Created
February 4, 2016 22:25
-
-
Save thiagomg/bcf70a5b9d67148d2da5 to your computer and use it in GitHub Desktop.
Leitura de configuração em C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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