当前位置: 首页>>代码示例>>C++>>正文


C++ Version::null方法代码示例

本文整理汇总了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;
			}
		}
	}
开发者ID:MAPJe71,项目名称:libyuni,代码行数:95,代码来源:versions.cpp


注:本文中的Version::null方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。