Settings.h
Go to the documentation of this file.
1/*!
2 * \file Settings.h
3 * \brief Settings class to store the settings information
4 *
5 * Changelog:
6 * - 1. 2010-06-30 - lj - Change LoadSettingsFromFile to SetSettingTagStrings, Value to GetValue.
7 * Decoupling with the file IO handling
8 *
9 * \author Junzhi Liu, LiangJun Zhu
10 * \version 2.0
11 * \date June 2010
12 */
13#ifndef SEIMS_SETTING_H
14#define SEIMS_SETTING_H
15
16#include <vector>
17
18#include "basic.h"
19
20using namespace ccgl;
21using std::vector;
22
23/*!
24 * \ingroup data
25 * \class Settings
26 * \brief Base class for input or output Settings
27 */
29public:
30 //! Constructor
32
33 //! Constructor via 2D string vector
34 explicit Settings(vector<vector<string> >& str2dvec) : m_Settings(str2dvec) {};
35
36 //! Constructor via 1D string vector
37 explicit Settings(vector<string>& str1dvec);
38
39 //! Set Settings vector directly
40 virtual void SetSettingTagStrings(vector<vector<string> >& string2dvector) {
41 m_Settings = string2dvector;
42 }
43
44 //! Parse and Set Settings vector by splitting strings
45 virtual void SetSettingTagStrings(vector<string>& stringvector);
46
47 //! Return the value for the entry with the given tag, "" if not found
48 string GetValue(const string& tag);
49
50 //! Output information to plain text file
51 virtual void Dump(const string& filename) {};
52
53public:
54 //! Store setting key and values
55 vector<vector<string> > m_Settings;
56};
57
58#endif /* SEIMS_SETTING_H */
Basic definitions.
Base type of all interfaces.
Definition: basic.h:407
string GetValue(const string &tag)
Return the value for the entry with the given tag, "" if not found.
virtual void SetSettingTagStrings(vector< vector< string > > &string2dvector)
Set Settings vector directly.
Definition: Settings.h:40
virtual void Dump(const string &filename)
Output information to plain text file.
Definition: Settings.h:51
Settings(vector< string > &str1dvec)
Constructor via 1D string vector.
virtual void SetSettingTagStrings(vector< string > &stringvector)
Parse and Set Settings vector by splitting strings.
Settings()
Constructor.
Definition: Settings.h:31
vector< vector< string > > m_Settings
Store setting key and values.
Definition: Settings.h:51
Settings(vector< vector< string > > &str2dvec)
Constructor via 2D string vector.
Definition: Settings.h:34
Base class for input or output Settings.
Definition: Settings.h:28
Common Cross-platform Geographic Library (CCGL)