From 1ec548442d833469d76ef83d83e1051211526b94 Mon Sep 17 00:00:00 2001 From: Jason Felds Date: Thu, 9 Jun 2011 21:34:04 -0400 Subject: [PATCH] [notesloader] Take advantage of const members. --- src/NotesLoaderSM.h | 13 +++++++++++++ src/NotesLoaderSMA.h | 1 + src/NotesLoaderSSC.h | 2 ++ 3 files changed, 16 insertions(+) diff --git a/src/NotesLoaderSM.h b/src/NotesLoaderSM.h index f2c964a43a..168b7e411f 100644 --- a/src/NotesLoaderSM.h +++ b/src/NotesLoaderSM.h @@ -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 diff --git a/src/NotesLoaderSMA.h b/src/NotesLoaderSMA.h index 71d307642b..dad853fa19 100644 --- a/src/NotesLoaderSMA.h +++ b/src/NotesLoaderSMA.h @@ -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 ); diff --git a/src/NotesLoaderSSC.h b/src/NotesLoaderSSC.h index e535f8ac48..e400b94bb7 100644 --- a/src/NotesLoaderSSC.h +++ b/src/NotesLoaderSSC.h @@ -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.