Skip to content

Commit

Permalink
added doxygen comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fktn-k committed Jan 6, 2025
1 parent 5c3d5c0 commit 84bdf33
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/fkYAML/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ class basic_node {
using yaml_version_t = detail::yaml_version_t;

/// @brief A type for mapping range objects for the map_items() function.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_range/
using map_range = fkyaml::detail::map_range_proxy<basic_node>;

/// @brief A type for constant mapping range objects for the map_items() function.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_range/
using const_map_range = fkyaml::detail::map_range_proxy<const basic_node>;

private:
Expand Down Expand Up @@ -1601,13 +1603,21 @@ class basic_node {
return rend();
}

/// @brief Returns a range of mapping entries.
/// @throw `type_error` if this basic_node is not a mapping.
/// @return A range of mapping entries.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_items/
map_range map_items() {
if FK_YAML_UNLIKELY (!is_mapping()) {
throw type_error("map_items() cannot be called on a non-mapping node.", get_type());
}
return {*this};
}

/// @brief Returns a const range of mapping entries.
/// @throw `type_error` if this basic_node is not a mapping.
/// @return A const range of mapping entries.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_items/
const_map_range map_items() const {
if FK_YAML_UNLIKELY (!is_mapping()) {
throw type_error("map_items() cannot be called on a non-mapping node.", get_type());
Expand Down
10 changes: 10 additions & 0 deletions single_include/fkYAML/node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12559,9 +12559,11 @@ class basic_node {
using yaml_version_t = detail::yaml_version_t;

/// @brief A type for mapping range objects for the map_items() function.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_range/
using map_range = fkyaml::detail::map_range_proxy<basic_node>;

/// @brief A type for constant mapping range objects for the map_items() function.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_range/
using const_map_range = fkyaml::detail::map_range_proxy<const basic_node>;

private:
Expand Down Expand Up @@ -14024,13 +14026,21 @@ class basic_node {
return rend();
}

/// @brief Returns a range of mapping entries.
/// @throw `type_error` if this basic_node is not a mapping.
/// @return A range of mapping entries.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_items/
map_range map_items() {
if FK_YAML_UNLIKELY (!is_mapping()) {
throw type_error("map_items() cannot be called on a non-mapping node.", get_type());
}
return {*this};
}

/// @brief Returns a const range of mapping entries.
/// @throw `type_error` if this basic_node is not a mapping.
/// @return A const range of mapping entries.
/// @sa https://fktn-k.github.io/fkYAML/api/basic_node/map_items/
const_map_range map_items() const {
if FK_YAML_UNLIKELY (!is_mapping()) {
throw type_error("map_items() cannot be called on a non-mapping node.", get_type());
Expand Down

0 comments on commit 84bdf33

Please sign in to comment.