void addType(const char* moduleName, filetype_t type) { if(extension_equal(m_pattern, type.pattern)) { m_moduleName = moduleName; } }
void visit(const char* name) { const char* subname = path_make_relative(name, m_directory); if(subname != name) { if(subname[0] == '/') ++subname; if(m_extension[0] == '*' || extension_equal(path_get_extension(subname), m_extension)) pathlist_prepend_unique(m_matches, g_strdup (subname)); } }
void forEachFile(const char* basedir, const char* extension, const FileNameCallback& callback, std::size_t depth) { GSList* list = GetFileList(basedir, extension, depth); for(GSList* i = list; i != 0; i = g_slist_next(i)) { const char* name = reinterpret_cast<const char*>((*i).data); if(extension_equal(path_get_extension(name), extension)) { callback(name); } } ClearFileDirList(&list); }
void operator()( const char* name ) const { if ( !extension_equal( path_get_extension( name ), "game" ) ) { return; } StringOutputStream strPath( 256 ); strPath << mPath << name; globalOutputStream() << strPath.c_str() << '\n'; xmlDocPtr pDoc = xmlParseFile( strPath.c_str() ); if ( pDoc ) { mGames.push_front( new CGameDescription( pDoc, name ) ); xmlFreeDoc( pDoc ); } else { globalErrorStream() << "XML parser failed on '" << strPath.c_str() << "'\n"; } }