PageRenderTime 25ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/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
 1#ifndef		___PROPERTIES___HEADER___
 2#define		___PROPERTIES___HEADER___
 3
 4#include "Entry/TExportUtil.h"
 5
 6namespace woe
 7{
 8	//
 9	//	a simple properties file parser
10	//
11	class TUTIL_API Properties
12	{
13	public:
14		Properties(const string& file_name = "");
15		bool init(const string& file_name);
16
17		//
18		//	
19		//
20		bool parse(const string& key, short& value);
21		bool parse(const string& key, int& value);
22		bool parse(const string& key, bool& value);
23		bool parse(const string& key, string& value);
24	protected:
25		bool add_line(const string& line);
26
27		typedef std::map<string, string>	Key2Value;
28
29		Key2Value	pairs_;
30	};
31}
32
33
34#endif
35