Skip to content

Defined in header <fkYAML/node.hpp>

fkyaml::basic_node::get_yaml_version

yaml_version_t get_yaml_version() const noexcept;

Returns the version of the YAML format applied for the basic_node object.

Return Value

The version of the YAML format applied to the basic_node object.

YAML version Return Value
1.1 yaml_version_t::VER_1_1
1.2 yaml_version_t::VER_1_2
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:

true

See Also