/TGame/TUtil/Config/Properties.h
http://awoe.googlecode.com/ · C Header · 35 lines · 21 code · 8 blank · 6 comment · 0 complexity · ee5fb695d9fc0375d8458f6e42ec91da MD5 · raw file
- #ifndef ___PROPERTIES___HEADER___
- #define ___PROPERTIES___HEADER___
-
- #include "Entry/TExportUtil.h"
-
- namespace woe
- {
- //
- // a simple properties file parser
- //
- class TUTIL_API Properties
- {
- public:
- Properties(const string& file_name = "");
- bool init(const string& file_name);
-
- //
- //
- //
- bool parse(const string& key, short& value);
- bool parse(const string& key, int& value);
- bool parse(const string& key, bool& value);
- bool parse(const string& key, string& value);
- protected:
- bool add_line(const string& line);
-
- typedef std::map<string, string> Key2Value;
-
- Key2Value pairs_;
- };
- }
-
-
- #endif