0

How can I read this YAML file with yaml-cpp:

sensors:
  - id: 5
    hardwareId: 28-000005a32133
    type: 1
  - id: 6
    hardwareId: 28-000005a32132
    type: 4

How can one get/print details of id = 5 (i.e. type and hardwareID) in a long list of such items efficiently?

Aykhan Hagverdili
  • 28,141
  • 6
  • 41
  • 93
neo
  • 1
  • Did you try the tutorial? https://github.com/jbeder/yaml-cpp/blob/master/docs/Tutorial.md The first example shows a file being opened and parameters being read. – SamBob Dec 20 '21 at 18:18
  • Does this answer your question? [Parse YAML Files in C++](https://stackoverflow.com/questions/365155/parse-yaml-files-in-c) – SamBob Dec 20 '21 at 18:20

0 Answers0