5 static std::vector<std::string> m_list_key;
6 static std::map<std::string, int> m_map_key;
9 std::vector<std::string> m_list_val;
14 static int GetNumKey() {
return m_list_key.size(); }
15 static std::string
GetKey(
const int idx) {
return m_list_key[idx]; }
16 static void AddKey(
const std::string key);
17 static int FindKey(
const std::string key);
20 void SetLine(
const std::string line) { m_line = line; }
22 std::string
GetString(
const int idx) {
return m_list_val[idx]; }
23 int GetInt (
const int idx) {
return atoi(m_list_val[idx].c_str()); }
24 double GetDouble(
const int idx) {
return atof(m_list_val[idx].c_str()); }
30 void AddValue(
const std::string value) { m_list_val.push_back(value); }
34 std::vector<std::string> NMREvent::m_list_key;
35 std::map<std::string, int> NMREvent::m_map_key;
39 m_list_key.push_back(key);
40 m_map_key[key] = m_list_key.size() - 1;
45 if (m_map_key.find(key) == m_map_key.end()) {
46 cerr <<
"!!ERROR!! Cannot find '" << key <<
"' in the key list. Abort." << endl;
49 return m_map_key[key];
static std::string GetKey(const int idx)
std::string GetString(const int idx)
double GetDouble(const int idx)
int GetInt(const std::string key)
double GetDouble(const std::string key)
int GetInt(const int idx)
void SetLine(const std::string line)
std::string GetString(const std::string key)
static void AddKey(const std::string key)
static int FindKey(const std::string key)
void AddValue(const std::string value)