mumsi/Configuration.hpp
Scott Hardin 75cafbfefe Add support for multiple caller pins
In config.ini, add the [pins] section, with key/value entries
for the expected pin and the channel regex to switch to when
the caller enters the pin. Here's an example:

[pins]
12345 = DevOps Team
23456 = Sales Team
2017-05-28 14:08:28 +02:00

41 lines
886 B
C++

#pragma once
#include <boost/noncopyable.hpp>
#include <vector>
#include <string>
#include <stdexcept>
#include <unordered_map>
namespace config {
class ConfigException : public std::runtime_error {
public:
ConfigException(const std::string &message)
: std::runtime_error(message) {
}
};
struct ConfigurationImpl;
class Configuration : boost::noncopyable {
public:
Configuration(const std::string fileName);
Configuration(const std::vector<std::string> fileNames);
~Configuration();
int getInt(const std::string &property);
bool getBool(const std::string &property);
std::string getString(const std::string &property);
std::unordered_map<std::string, std::string> getChildren(const std::string &property);
private:
ConfigurationImpl *impl;
};
}