bool SMLoader::LoadFromDir( CString sPath, Song &out ) { CStringArray aFileNames; GetApplicableFiles( sPath, aFileNames ); if( aFileNames.size() > 1 ) RageException::Throw( "There is more than one SM file in '%s'. There should be only one!", sPath.c_str() ); /* We should have exactly one; if we had none, we shouldn't have been * called to begin with. */ ASSERT( aFileNames.size() == 1 ); return LoadFromSMFile( sPath + aFileNames[0], out ); }
bool SMLoader::LoadFromDir( const RString &sPath, Song &out ) { vector<RString> aFileNames; GetApplicableFiles( sPath, aFileNames ); if( aFileNames.size() > 1 ) { // Need to break this up first. RString tmp = "Song " + sPath + " has more than one"; LOG->UserLog(tmp, this->GetFileExtension(), "file. There can only be one!"); return false; } ASSERT( aFileNames.size() == 1 ); return LoadFromSimfile( sPath + aFileNames[0], out ); }
bool SMLoader::LoadFromDir( const RString &sPath, Song &out, bool load_autosave ) { vector<RString> aFileNames; GetApplicableFiles( sPath, aFileNames, load_autosave ); return LoadFromSimfile( sPath + aFileNames[0], out ); }
bool NotesLoader::Loadable( CString sPath ) { CStringArray list; GetApplicableFiles( sPath, list ); return !list.empty(); }