| 1234567891011121314151617181920212223242526 |
- #include "cpptoml.h"
- #include <iostream>
- #include <cassert>
- int main(int argc, char** argv)
- {
- if (argc < 2)
- {
- std::cout << "Usage: " << argv[0] << " filename" << std::endl;
- return 1;
- }
- try
- {
- std::shared_ptr<cpptoml::table> g = cpptoml::parse_file(argv[1]);
- std::cout << (*g) << std::endl;
- }
- catch (const cpptoml::parse_exception& e)
- {
- std::cerr << "Failed to parse " << argv[1] << ": " << e.what() << std::endl;
- return 1;
- }
- return 0;
- }
|