Implemented sugar Parse() functions

This commit is contained in:
Jesse Beder
2011-09-09 23:40:19 -05:00
parent 6e03bebeb0
commit 09beb5c47a
8 changed files with 67 additions and 20 deletions

View File

@@ -3,22 +3,7 @@
int main()
{
YAML::Value value;
value["seq"] = YAML::Value(YAML::ValueType::Sequence);
for(int i=0;i<5;i++)
value["seq"].append(i);
value["map"]["one"] = "I";
value["map"]["two"] = "II";
value["map"]["three"] = "III";
value["map"]["four"] = "IV";
for(YAML::const_iterator it=value["seq"].begin();it!=value["seq"].end();++it) {
std::cout << it->as<int>() << "\n";
}
for(YAML::const_iterator it=value["map"].begin();it!=value["map"].end();++it) {
std::cout << it->first.as<std::string>() << " -> " << it->second.as<std::string>() << "\n";
}
YAML::Value value = YAML::Parse("foo: bar");
return 0;
}