SimpCfg: Rename to get_vector, add some test code
This commit is contained in:
parent
1e1f54ec1d
commit
86e776c857
1 changed files with 8 additions and 3 deletions
|
@ -208,7 +208,7 @@ public:
|
|||
|
||||
|
||||
template<typename SupportedDataType>
|
||||
std::vector<SupportedDataType> get_array(const std::string &group, const std::string &key, const std::vector<SupportedDataType> &defaultValue, const std::string &callerName="") {
|
||||
std::vector<SupportedDataType> get_vector(const std::string &group, const std::string &key, const std::vector<SupportedDataType> &defaultValue, const std::string &callerName="") {
|
||||
auto gm = mapV[group];
|
||||
std::vector<SupportedDataType> array;
|
||||
int i = 0;
|
||||
|
@ -330,11 +330,16 @@ int main(int argc, char **argv) {
|
|||
sc.get_string("mistral", "system-prefix", "Not found");
|
||||
sc.get_string("\"mistral\"", "\"system-prefix\"", "Not found");
|
||||
|
||||
sc.get_array<int64_t>("testme", "keyA100", {1, 2, 3});
|
||||
sc.get_vector<int64_t>("testme", "keyA100", {1, 2, 3});
|
||||
sc.get_vector<std::string>("testme", "keyA100", { "A", "അ", "अ", "ಅ" });
|
||||
sc.set_int64("testme", "keyA300-0", 330);
|
||||
sc.set_int64("testme", "keyA300-1", 331);
|
||||
sc.set_int64("testme", "keyA300-2", 332);
|
||||
sc.get_array<int64_t>("testme", "keyA300", {1, 2, 3});
|
||||
sc.set_string("testme", "keyA301-0", "India");
|
||||
sc.set_value<std::string>("testme", "keyA301-1", "World");
|
||||
sc.set_string("testme", "keyA301-2", "AkashaGanga");
|
||||
sc.get_vector<int64_t>("testme", "keyA300", {1, 2, 3});
|
||||
sc.get_vector<std::string>("testme", "keyA301", { "yes 1", "No 2", "very well 3" });
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue