5
yaml usign yaml-cppを解析しようとしています。私はメッセージを取得していますyamlをyaml cppで解析する
YAML::Node basenode = YAML::LoadFile("./path/to/file.yaml");
int height;
if(basenode["configuration"])
if(basenode["configuration"]["height"]
height = basenode["configuration"]["height"].as<int>();
else
cout << "The node height doesn't exist" << endl;
else
cout << "The node configuration doesn't exist" << endl;
を行うと
---
configuration:
- height: 600
- widht: 800
- velocity: 1
- scroll: 30
types:
- image: resources/images/grass.png
name: grass
- image: resources/images/water.png
name: water
version: 1.0
:これは私のYAMLである "ノードの高さが存在しません"。どうすればそのフィールド(と他のフィールド)にアクセスできますか?
ありがとうございます!
ありがとうございます@Corbinは私の頭をクリア!それは素晴らしい作品です!私は非常に多くのドキュメンテーションとサンプルを見つけられませんでした! – jmoren