Skip to content

Instantly share code, notes, and snippets.

@thiagomg thiagomg/config.h
Created Feb 4, 2016

Embed
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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.