Skip to content

Defined in header <fkYAML/node.hpp>

fkyaml::basic_node::set_yaml_version_type

void set_yaml_version_type(const yaml_version_type version) noexcept;

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_type(fkyaml::yaml_version_type::VERSION_1_1);
    fkyaml::node n2;
    n2.set_yaml_version_type(fkyaml::yaml_version_type::VERSION_1_2);

    std::cout << std::boolalpha;
    std::cout << (n.get_yaml_version_type() == fkyaml::yaml_version_type::VERSION_1_1) << std::endl;
    std::cout << (n2.get_yaml_version_type() == fkyaml::yaml_version_type::VERSION_1_2) << std::endl;

    return 0;
}

output:

true
true

See Also