示例#1
0
  void Scan(const boost::filesystem::path & path) {
    
    if(args.verbose)
      printf("scanning %s\n", path.c_str());
    
    if(!boost::filesystem::exists(path))
	throw OpenDirException();
      
    if(!boost::filesystem::is_directory(path))
      throw OpenDirException();
    
    // dont parse SVN
    if(path.has_extension() && (strcasecmp(path.extension().c_str(), ".svn")==0))
      return;
    
    boost::filesystem::directory_iterator end;
    for( boost::filesystem::directory_iterator itor = boost::filesystem::directory_iterator( path ); itor != end; itor++)
      if(boost::filesystem::is_regular_file( itor->status() ))
	if( !itor->path().has_extension() || ((strcasecmp(itor->path().extension().c_str(), ".h")==0) || (strcasecmp(itor->path().extension().c_str(), ".hpp")==0)) )
	  Add( itor->path().string() );
    
    if( boost::filesystem::is_symlink(path) )
      return; // FIXME: better way to deal with gphoto's recursive symlinks?
      
    for( boost::filesystem::directory_iterator itor = boost::filesystem::directory_iterator( path ); itor != end; itor++)  
      if(boost::filesystem::is_directory( itor->status() ))
	  Scan( itor->path() );
  }
示例#2
0
	AssetManager::AssetLoader AssetManager::FindLoader(const boost::filesystem::path& path)
	{
		if(path.has_extension() == false)
		{
			return AssetLoader();
		}
		AssetLoaderMap::iterator it = m_loaders.find(path.extension().string());

		if(it != m_loaders.end())
		{
			return it->second;
		}
		return AssetLoader();
	}