Bir yaml usign yaml-cpp'yi ayrıştırmaya çalışıyorum. Ben mesajı alıyorumyaml ile yaml cpp ile ayrıştırma
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;
yaptığınızda
---
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
: Bu benim yaml olan "düğüm yüksekliği yok". Bu alana nasıl erişebilirim (ve diğerleri?)
Çok teşekkürler!
Kafamı temizlemek için @Corbin teşekkür ederim! harika çalışıyor! Çok fazla doküman ve örnek bulamadım! – jmoren