Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Leitura de configuração em C++
//Leitura de uma chave
const std::string &log_dir = cfg.get("log.base_dir");
//Agora vamos pegar todas as configurações relativas a log
auto plugins = cfg.prefix("log.");
for(auto p : plugins)
std::cout << p.first << "=>" << p.second << std::endl;
//Lista de plugins na configuração
auto tok = cfg.next_token("plugin.", '.');
for(auto p : tok) {
std::cout << p << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment