本文整理汇总了C++中Version::null方法的典型用法代码示例。如果您正苦于以下问题:C++ Version::null方法的具体用法?C++ Version::null怎么用?C++ Version::null使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Version
的用法示例。
在下文中一共展示了Version::null方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadFromPath
void List::loadFromPath(const String& folder)
{
String path;
IO::Canonicalize(path, folder);
if (pOptDebug)
std::cout << "[yuni-config][debug] :: reading `" << path << "`" << std::endl;
VersionInfo::Settings info;
info.mapping = mappingStandard;
String s;
s << path << SEP << "yuni.version";
if (not IO::File::Exists(s))
{
s.clear() << path << SEP << "include" << SEP << "yuni" << SEP << "yuni.version";
if (not IO::File::Exists(s))
{
info.mapping = mappingSVNSources;
s.clear() << path << SEP << "src" << SEP << "yuni" << SEP << "yuni.version";
if (not IO::File::Exists(s))
{
if (pOptDebug)
std::cout << "[yuni-config][debug] :: " << s << " not found" << std::endl;
return;
}
}
}
IO::File::Stream file;
if (file.open(s))
{
String key;
String value;
Version version;
// A buffer. The given capacity will be the maximum length for a single line
Clob buffer;
buffer.reserve(8000);
while (file.readline(buffer))
{
buffer.extractKeyValue(key, value);
if (key.empty() || key == "[")
continue;
if (key == "version.hi")
version.hi = value.to<unsigned int>();
if (key == "version.lo")
version.lo = value.to<unsigned int>();
if (key == "version.rev")
version.revision = value.to<unsigned int>();
if (key == "version.target")
info.compilationMode = value;
if (key == "modules.available")
value.split(info.modules, ";\"', \t", false);
if (key == "support.opengl")
info.supportOpenGL = value.to<bool>();
if (key == "support.directx")
info.supportDirectX = value.to<bool>();
if (key == "redirect")
loadFromPath(value);
if (key == "path.include")
{
if (not value.empty())
info.includePath.push_back(value);
}
if (key == "path.lib")
{
if (not value.empty())
info.libPath.push_back(value);
}
}
if (not version.null() and not info.modules.empty())
{
info.path = path;
info.compiler = pCompiler;
pList[version] = info;
if (pOptDebug)
{
std::cout << "[yuni-config][debug] - found installation `" << path
<< "` (" << version << ")" << std::endl;
}
}
else
{
std::cerr << "error: " << s << ": invalid file";
if (version.null())
std::cerr << " (invalid version)" << std::endl;
else if (info.modules.empty())
std::cerr << " (no module)" << std::endl;
}
}
}