Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Created February 4, 2016 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagomg/bcf70a5b9d67148d2da5 to your computer and use it in GitHub Desktop.
Save thiagomg/bcf70a5b9d67148d2da5 to your computer and use it in GitHub Desktop.
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