Replies: 2 comments 1 reply
-
@ghmchen
|
Beta Was this translation helpful? Give feedback.
0 replies
-
@fktn-k |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When my yaml file have three level nodes, and the third level node is unfortunately missed in the yaml file. is_float_number() function will throw exception.
Here are my codes:
std::ifstream ifs(YamlPath);
fkyaml::node Root = fkyaml::node::deserialize(ifs);
if (Root["first_level_nodes"]["second_level_nodes"]["third_level_nodes"].is_float_number()) //exception thrown here
m_Threshold = Root["first_level_nodes"]["second_level_nodes"]["third_level_nodes"].get_value_ref<double&>();
here is a good yaml file example:
first_level_nodes:
--second_level_nodes:
----third_level_nodes: 12.3a
here is a yaml file example throwing exception
first_level_nodes:
--second_level_nodes:
Is there any way to avoid throwing an exception here?
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions