You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
438 B

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. #include <iostream>
  2. #include <string>
  3. #include <string_view>
  4. #include <toml++/toml.hpp>
  5. // g++ tomldemo.cpp -I ../libs/tomlplusplus -std=c++17
  6. using namespace std::literals;
  7. int main(int argc, char** argv) {
  8. toml::table tbl;
  9. try {
  10. tbl = toml::parse_file("config.ini");
  11. std::cout << tbl << "\n";
  12. } catch (const toml::parse_error& err) {
  13. std::cerr << "Parsing failed:\n" << err << "\n";
  14. return 1;
  15. }
  16. return 0;
  17. }