Defined in header <fkYAML/node.hpp>
fkyaml::basic_node::set_yaml_version¶
Deprecation
The function void set_yaml_version_type(const yaml_version_type)
replaces the function void set_yaml_version(const basic_node::yaml_version_t)
which has been deprecated in version 0.3.12. It will be removed in version 0.4.0. Please replace calls like
with
Sets a target YAML version to the basic_node
object.
Parameters¶
- version [in]
- A target YAML version.
Example
#include <iomanip>
#include <iostream>
#include <fkYAML/node.hpp>
int main() {
fkyaml::node n;
n.set_yaml_version(fkyaml::node::yaml_version_t::VER_1_1);
fkyaml::node n2;
n2.set_yaml_version(fkyaml::node::yaml_version_t::VER_1_2);
std::cout << std::boolalpha;
std::cout << (n.get_yaml_version() == fkyaml::node::yaml_version_t::VER_1_1) << std::endl;
std::cout << (n2.get_yaml_version() == fkyaml::node::yaml_version_t::VER_1_2) << std::endl;
return 0;
}
output: