|
1 | 1 | # wsjcpp-yaml |
2 | 2 |
|
3 | | -[](https://travis-ci.com/wsjcpp/wsjcpp-yaml) [](https://github.com/wsjcpp/wsjcpp-yaml) [](https://github.com/wsjcpp/wsjcpp-yaml) [](https://github.com/wsjcpp/wsjcpp-yaml/network/members) [](https://lgtm.com/projects/g/wsjcpp/wsjcpp-yaml/alerts/) [](https://lgtm.com/projects/g/wsjcpp/wsjcpp-yaml/context:cpp) |
4 | | - |
5 | | -C++ Write/Reader yaml files |
| 3 | +[](https://travis-ci.com/wsjcpp/wsjcpp-yaml) [](https://github.com/wsjcpp/wsjcpp-yaml) [](https://github.com/wsjcpp/wsjcpp-yaml) [](https://github.com/wsjcpp/wsjcpp-yaml/network/members) [](https://lgtm.com/projects/g/wsjcpp/wsjcpp-yaml/alerts/) [](https://lgtm.com/projects/g/wsjcpp/wsjcpp-yaml/context:cpp) [](https://www.deepcode.ai/app/gh/wsjcpp/wsjcpp-yaml/_/dashboard?utm_content=gh%2Fwsjcpp%2Fwsjcpp-yaml) |
6 | 4 |
|
| 5 | +C++ YAML parser/reader and writer of *.yaml/*.yml files with keeping user formatting |
7 | 6 |
|
8 | 7 | ## Integrate to your c++ project |
9 | 8 |
|
@@ -54,19 +53,19 @@ int main(int argc, char* argv[]) { |
54 | 53 | return -1; |
55 | 54 | } |
56 | 55 |
|
57 | | - std::cout << "yaml is " << yaml["yaml1"].getValue() << std::endl; |
58 | | - std::cout << "some-map is " << yaml["some-map"].getValue() << std::endl; |
59 | | - std::cout << "some-map2 is " << yaml["some-map2"].getValue() << std::endl; |
60 | | - std::cout << "some-array has " << std::to_string(yaml["some-array"].getLength()) << std::endl; |
61 | | - std::cout << "some-array element 0 is " << yaml["some-array"][0].getValue() << std::endl; |
62 | | - std::cout << "some-array element 1 is " << yaml["some-array"][1].getValue() << std::endl; |
63 | | - std::cout << "some-am has " << std::to_string(yaml["some-am"].getLength()) << std::endl; |
| 56 | + std::cout << "yaml is " << yaml["yaml1"].valStr() << std::endl; |
| 57 | + std::cout << "some-map is " << yaml["some-map"].valStr() << std::endl; |
| 58 | + std::cout << "some-map2 is " << yaml["some-map2"].valStr() << std::endl; |
| 59 | + std::cout << "some-array has " << std::to_string(yaml["some-array"].valStr()) << std::endl; |
| 60 | + std::cout << "some-array element 0 is " << yaml["some-array"][0].valStr() << std::endl; |
| 61 | + std::cout << "some-array element 1 is " << yaml["some-array"][1].valStr() << std::endl; |
| 62 | + std::cout << "some-am has " << std::to_string(yaml["some-am"].size()) << std::endl; |
64 | 63 | std::cout << "some-am is array: " << (yaml["some-am"].isArray() ? "yes" : "no") << std::endl; |
65 | | - std::cout << "some-am has comment " << yaml["some-am"].getComment() << std::endl; |
66 | | - std::cout << "some-am element 0 : p1 is " << yaml["some-am"][0]["p1"].getValue() << std::endl; |
67 | | - std::cout << "some-am element 0 : p2 is " << yaml["some-am"][0]["p2"].getValue() << std::endl; |
68 | | - std::cout << "some-am element 1 : p1 is " << yaml["some-am"][1]["p1"].getValue() << std::endl; |
69 | | - std::cout << "some-am element 1 : p2 is " << yaml["some-am"][1]["p2"].getValue() << std::endl; |
| 64 | + std::cout << "some-am has comment " << yaml["some-am"].comment() << std::endl; |
| 65 | + std::cout << "some-am element 0 : p1 is " << yaml["some-am"][0]["p1"].valStr() << std::endl; |
| 66 | + std::cout << "some-am element 0 : p2 is " << yaml["some-am"][0]["p2"].valStr() << std::endl; |
| 67 | + std::cout << "some-am element 1 : p1 is " << yaml["some-am"][1]["p1"].valStr() << std::endl; |
| 68 | + std::cout << "some-am element 1 : p2 is " << yaml["some-am"][1]["p2"].valStr() << std::endl; |
70 | 69 |
|
71 | 70 | return 0; |
72 | 71 | } |
|
0 commit comments