20 #ifndef SPECTMORPH_MICRO_CONF_HH 21 #define SPECTMORPH_MICRO_CONF_HH 40 std::string current_line;
42 std::string current_file;
43 std::vector<std::string> tokens;
45 NumberFormat m_number_format;
47 bool convert (
const std::string& token,
int& arg);
48 bool convert (
const std::string& token,
double& arg);
49 bool convert (
const std::string& token, std::string& arg);
56 NumberFormat number_format();
57 void set_number_format (NumberFormat new_number_format);
62 void die_if_unknown();
65 bool command (
const std::string& cmd, T1& arg1)
67 if (tokenizer_error || tokens.size() != 2 || cmd != tokens[0])
69 return convert (tokens[1], arg1);
71 template<
class T1,
class T2>
72 bool command (
const std::string& cmd, T1& arg1, T2& arg2)
74 if (tokenizer_error || tokens.size() != 3 || cmd != tokens[0])
76 return convert (tokens[1], arg1) && convert (tokens[2], arg2);
78 template<
class T1,
class T2,
class T3>
79 bool command (
const std::string& cmd, T1& arg1, T2& arg2, T3& arg3)
81 if (tokenizer_error || tokens.size() != 4 || cmd != tokens[0])
83 return convert (tokens[1], arg1) && convert (tokens[2], arg2) && convert (tokens[3], arg3);
85 template<
class T1,
class T2,
class T3,
class T4>
86 bool command (
const std::string& cmd, T1& arg1, T2& arg2, T3& arg3, T4& arg4)
88 if (tokenizer_error || tokens.size() != 5 || cmd != tokens[0])
90 return convert (tokens[1], arg1) && convert (tokens[2], arg2) && convert (tokens[3], arg3)
91 && convert (tokens[4], arg4);
93 template<
class T1,
class T2,
class T3,
class T4,
class T5>
94 bool command (
const std::string& cmd, T1& arg1, T2& arg2, T3& arg3, T4& arg4, T5& arg5)
96 if (tokenizer_error || tokens.size() != 6 || cmd != tokens[0])
98 return convert (tokens[1], arg1) && convert (tokens[2], arg2) && convert (tokens[3], arg3)
99 && convert (tokens[4], arg4) && convert (tokens[5], arg5);
101 template<
class T1,
class T2,
class T3,
class T4,
class T5,
class T6>
102 bool command (
const std::string& cmd, T1& arg1, T2& arg2, T3& arg3, T4& arg4, T5& arg5, T6& arg6)
104 if (tokenizer_error || tokens.size() != 7 || cmd != tokens[0])
106 return convert (tokens[1], arg1) && convert (tokens[2], arg2) && convert (tokens[3], arg3)
107 && convert (tokens[4], arg4) && convert (tokens[5], arg5) && convert (tokens[6], arg6);
Definition: smmicroconf.hh:31
Definition: smalignedarray.cc:7