Defined in header <fkYAML/node.hpp>
fkyaml::basic_node::get_yaml_version¶
Deprecation
The function yaml_version_type get_yaml_version_type() replaces the function basic_node::yaml_version_t get_yaml_version() which has been deprecated in version 0.3.12. It will be removed in a future version. Please replace calls like
Returns the YAML specification version applied for a basic_node.
Return Value¶
The YAML specification version applied to a basic_node.
| YAML version | Return Value |
|---|---|
| 1.1 | yaml_version_t::VER_1_1 |
| 1.2 | yaml_version_t::VER_1_2 |
Examples¶
Example
#include <iomanip>
#include <iostream>
#include <fkYAML/node.hpp>
int main() {
// A `fkyaml::node` object has `yaml_version_t::VER_1_2` by default.
fkyaml::node n;
std::cout << std::boolalpha << (n.get_yaml_version() == fkyaml::node::yaml_version_t::VER_1_2) << std::endl;
return 0;
}
output: