Exemple #1
0
static void loadExcludes(std::set<std::string> & x, const bf::path & ePath)
{
	using namespace bf;
	if (!exists(ePath))
		throw std::logic_error(fmt::format("exclude file list path doesn't exists '{}'", ePath.string()));

	std::ifstream f( ePath.c_str() );
	if (!f.is_open())
		throw std::logic_error(fmt::format("error while opening exclude list file '{}'", ePath.string()));
	
	std::string line;
	while(getline(f, line)) {
		line = boost::trim_copy(line);
		if (line.empty()) continue;
		x.insert(line);
	}
	if (f.bad())
		throw std::logic_error(fmt::format("error while reading exclude list file '{}'", ePath.string()));
}
Exemple #2
0
bool FileSystemTree::addNode( const bf::path &path, const EntityType &type )
{
    std::string pathStr = path.string();

    if( checkAndhandlePath(pathStr) )
    {
        mTree.put(bpt::ptree::path_type{ pathStr, SEPARATOR }, Node( path, type) );
        return true;
    }

    return false;
}