Example #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());
	}
Example #2
0
		BOOTIL_EXPORT int GetFilesInFolder( const BString & strFolder, String::List & OutputFiles, bool Recursive )
		{
			String::List files;
			String::List folders;
			File::Find( &files, &folders, strFolder + "/*", false );
			BOOTIL_FOREACH_CONST( f, files, String::List )
			{
				OutputFiles.push_back( *f );
			}
Example #3
0
			BOOTIL_EXPORT void Split( const BString& str, const BString& seperator, String::List& outbits )
			{
				BString strBit;
				int iOffset = 0;
				int iLength = str.length();
				int iSepLen = seperator.length();

				int i = str.find( seperator, 0 );
				while ( i != std::string::npos )
				{
					outbits.push_back( str.substr( iOffset, i-iOffset ) );
					iOffset = i + iSepLen;

					i = str.find( seperator, iOffset );
				}

				outbits.push_back( str.substr( iOffset, iLength-iOffset ) );
			}
Example #4
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;
	}