I know little about yaml then I use word yaml section to describe something like this below:
---
- section 1:
subsection: 1
subsection: 2
- section 2:
subsection: 1
subsection: 2
my code is not complete but this what I wrote:
class YParser{
public:
YAML::Node conf;
const YAML::Node& section1;
const YAML::Node& section2;
void init(std::string address) {
conf = YAML::LoadFile(address);
section1 = conf["section1"];
section2 = conf["section2"];
}
void show(std::string something){
if(!conf[something])
return ;
std::cout << something <<" : " << conf[something].as<std::string>() << std::endl;
}
};
What I want is to have access to read data from a section and it's subsections.