Пример #1
0
	void LibConfigProgram::computeDependencies(LibConfig::VersionInfo::Settings& version)
	{
		String::List deps;
		do
		{
			deps.clear();
			{
				const String::List::const_iterator end = pOptModules.end();
				for (String::List::const_iterator i = pOptModules.begin(); i != end; ++i)
				{
					const String::List& modDeps = version.moduleSettings[*i].dependencies;
					const String::List::const_iterator endJ = modDeps.end();
					for (String::List::const_iterator j = modDeps.begin(); j != endJ; ++j)
					{
						if (pOptModules.end() == std::find(pOptModules.begin(), pOptModules.end(), *j))
							deps.push_back(*j);
					}
				}
			}
			if (not deps.empty())
			{
				// Merge results
				const String::List::const_iterator end = deps.end();
				for (String::List::const_iterator i = deps.begin(); i != end; ++i)
				{
					if (pOptModules.end() == std::find(pOptModules.begin(), pOptModules.end(), *i))
						pOptModules.push_back(*i);
				}
			}
		}
		while (not deps.empty());
	}
Пример #2
0
 bool GlobDirs(String::List& out, const String& pattern, const bool emptyListBefore)
 {
     if (emptyListBefore)
         out.clear();
     gResourcesMutex.lock();
     for (ResourcesFoldersList::const_iterator i = pResourcesFolders.begin(); i != pResourcesFolders.end(); ++i)
         Paths::GlobDirs(out, *i + pattern, false);
     gResourcesMutex.unlock();
     return !out.empty();
 }
Пример #3
0
	bool Settings::configFile(String::List& options, bool displayError) const
	{
		if (compiler.empty())
		{
			if (displayError)
				std::cout << "Error: unknown compiler\n";
			return false;
		}
		String out;
		out << this->path << SEP;
		switch (mapping)
		{
			case mappingSVNSources:
				out << "src" << SEP << "yuni" << SEP;
				break;
			case mappingStandard:
				// Nothing to do
				break;
		}
		out << "yuni.config." << this->compiler;

		if (not IO::File::Exists(out))
		{
			if (displayError)
				std::cout << "Error: impossible to open the config file '" << out << "'\n";
			return false;
		}

		options.clear();
		IO::File::Stream file;
		if (file.open(out))
		{
			CString<8192> buffer;
			while (file.readline(buffer))
				options.push_back(buffer);
		}
		else
		{
			if (displayError)
				std::cout << "Error: Impossible to read '" << out << "'\n";
			return false;
		}
		return true;
	}