c++ - YAML-cpp null string parsing? -


how code parse "" string (or recognize not acceptable string)? using this yaml-cpp library verified treats nodetype::value() , not nodetype::null.

std::string getfilepath() {     yaml::node nodevalue = node["filepath"];     if(nodevalue.type() == yaml::nodetype::value()){         return nodevalue.as<std::string>(); //breaks here     }     return ""; } 

in .yaml file, entry listed filepath: ""

yaml::nodetypedoes not include more specific variable types value() , null.

here's specific error:

terminate called after throwing instance of 'yaml::typedbadconversion<std::string>' what():  bad conversion 

the work-around have figured out far try-catch block.


Comments

Popular posts from this blog

account - Script error login visual studio DefaultLogin_PCore.js -

xcode - CocoaPod Storyboard error: -