[notesloader] Take advantage of const members.

This commit is contained in:
Jason Felds
2011-06-09 21:34:04 -04:00
parent 1e296ed0bf
commit 1ec548442d
3 changed files with 16 additions and 0 deletions
+13
View File
@@ -18,6 +18,10 @@ const float FAST_BPM_WARP = 9999999.f;
/** @brief Reads a Song from an .SM file. */
struct SMLoader
{
SMLoader() : fileExt(".sm") {}
SMLoader(RString ext) : fileExt(ext) {}
virtual ~SMLoader() {}
bool LoadFromDir( const RString &sPath, Song &out );
@@ -143,6 +147,15 @@ protected:
RString sRadarValues,
RString sNoteData,
Steps &out);
/**
* @brief Retrieve the file extension associated with this loader.
* @return the file extension. */
RString GetFileExtension() const { return fileExt; }
private:
/** @brief The file extension in use. */
const RString fileExt;
};
#endif
+1
View File
@@ -23,6 +23,7 @@ enum SMALoadingStates
/** @brief Reads a Song from a .SMA file. */
struct SMALoader : public SMLoader
{
SMALoader() : SMLoader(".sma") {}
bool LoadFromDir( const RString &sPath, Song &out );
virtual bool LoadFromSimfile( const RString &sPath, Song &out, bool bFromCache = false );
+2
View File
@@ -32,6 +32,8 @@ const float VERSION_SPLIT_TIMING = 0.7f;
*/
struct SSCLoader : public SMLoader
{
SSCLoader() : SMLoader(".ssc") {}
/**
* @brief Attempt to load a song from a specified path.
* @param sPath a const reference to the path on the hard drive to check.