aboutsummaryrefslogtreecommitdiffstats
path: root/src/base/songloading/songloading_strategy_txt.hpp
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2010-01-15 05:10:30 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2013-01-05 17:17:44 +0100
commitf5d2afb357c7581536da91022986872cd41b68d3 (patch)
tree2422faa56d75827d265223248832df611974a45b /src/base/songloading/songloading_strategy_txt.hpp
parent750505e136531c44d0c6530562509eacfb1e3e56 (diff)
downloadusdx-f5d2afb357c7581536da91022986872cd41b68d3.tar.gz
usdx-f5d2afb357c7581536da91022986872cd41b68d3.tar.xz
usdx-f5d2afb357c7581536da91022986872cd41b68d3.zip
added txt header loading with test and some preparations for loading notes
Diffstat (limited to 'src/base/songloading/songloading_strategy_txt.hpp')
-rw-r--r--src/base/songloading/songloading_strategy_txt.hpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/base/songloading/songloading_strategy_txt.hpp b/src/base/songloading/songloading_strategy_txt.hpp
index 7a298e41..31a9815a 100644
--- a/src/base/songloading/songloading_strategy_txt.hpp
+++ b/src/base/songloading/songloading_strategy_txt.hpp
@@ -28,17 +28,42 @@
#define SONGLOADING_STRATEGY_TXT_HPP
#include <string>
+#include <log4cxx/logger.h>
#include "songloading_strategy.hpp"
namespace usdx
{
class SongloadingStrategyTxt : public SongloadingStrategy
{
+ private:
+ static log4cxx::LoggerPtr log;
+
+ /**
+ * Split the header field in name and value.
+ */
+ std::pair<std::string, std::string> split_header_field(std::string &line);
+
+ /**
+ * Removes whitespaces in front of the string.
+ */
+ std::string& ltrim(std::string& line);
+
+ /**
+ * Removes whitespaces in behind the string.
+ */
+ std::string& rtrim(std::string& line);
+
+ /**
+ * Removes whitespaces in front of the string and behind it.
+ */
+ std::string& trim(std::string& line);
+
public:
SongloadingStrategyTxt();
virtual ~SongloadingStrategyTxt();
- virtual Song* loadSong(std::string filename);
+ virtual Song* load_song(Song* song);
+ virtual Song* load_header(const std::string& filename);
};
};