|
10 | 10 | #include "4C_utils_string.hpp" |
11 | 11 |
|
12 | 12 | #include <format> |
13 | | -#include <iostream> |
14 | 13 | #include <numeric> |
15 | 14 | #include <set> |
16 | 15 | #include <unordered_map> |
@@ -751,25 +750,25 @@ void Core::IO::Internal::GroupSpec::print(std::ostream& stream, std::size_t inde |
751 | 750 | } |
752 | 751 | } |
753 | 752 |
|
754 | | -void Core::IO::Internal::GroupSpec::emit_metadata(ryml::NodeRef node) const |
| 753 | +void Core::IO::Internal::GroupSpec::emit_metadata(YamlNodeRef node) const |
755 | 754 | { |
756 | | - node |= ryml::MAP; |
757 | | - node["name"] << name; |
| 755 | + node.node |= ryml::MAP; |
| 756 | + node.node["name"] << name; |
758 | 757 |
|
759 | | - node["type"] = "group"; |
| 758 | + node.node["type"] = "group"; |
760 | 759 | if (!data.description.empty()) |
761 | 760 | { |
762 | | - node["description"] << data.description; |
| 761 | + node.node["description"] << data.description; |
763 | 762 | } |
764 | | - emit_value_as_yaml(node["required"], data.required.value()); |
765 | | - emit_value_as_yaml(node["defaultable"], data.defaultable); |
766 | | - node["specs"] |= ryml::SEQ; |
| 763 | + emit_value_as_yaml(node.wrap(node.node["required"]), data.required.value()); |
| 764 | + emit_value_as_yaml(node.wrap(node.node["defaultable"]), data.defaultable); |
| 765 | + node.node["specs"] |= ryml::SEQ; |
767 | 766 | { |
768 | 767 | for (const auto& spec : specs) |
769 | 768 | { |
770 | | - auto child = node["specs"].append_child(); |
| 769 | + auto child = node.node["specs"].append_child(); |
771 | 770 | child |= ryml::MAP; |
772 | | - spec.impl().emit_metadata(child); |
| 771 | + spec.impl().emit_metadata(node.wrap(child)); |
773 | 772 | }; |
774 | 773 | } |
775 | 774 | } |
@@ -864,23 +863,23 @@ void Core::IO::Internal::AllOfSpec::print(std::ostream& stream, std::size_t inde |
864 | 863 | } |
865 | 864 | } |
866 | 865 |
|
867 | | -void Core::IO::Internal::AllOfSpec::emit_metadata(ryml::NodeRef node) const |
| 866 | +void Core::IO::Internal::AllOfSpec::emit_metadata(YamlNodeRef node) const |
868 | 867 | { |
869 | | - node |= ryml::MAP; |
| 868 | + node.node |= ryml::MAP; |
870 | 869 |
|
871 | | - node["type"] = "all_of"; |
| 870 | + node.node["type"] = "all_of"; |
872 | 871 | if (!data.description.empty()) |
873 | 872 | { |
874 | | - node["description"] << data.description; |
| 873 | + node.node["description"] << data.description; |
875 | 874 | } |
876 | | - emit_value_as_yaml(node["required"], data.required.value()); |
877 | | - node["specs"] |= ryml::SEQ; |
| 875 | + emit_value_as_yaml(node.wrap(node.node["required"]), data.required.value()); |
| 876 | + node.node["specs"] |= ryml::SEQ; |
878 | 877 | { |
879 | 878 | for (const auto& spec : specs) |
880 | 879 | { |
881 | | - auto child = node["specs"].append_child(); |
| 880 | + auto child = node.node["specs"].append_child(); |
882 | 881 | child |= ryml::MAP; |
883 | | - spec.impl().emit_metadata(child); |
| 882 | + spec.impl().emit_metadata(node.wrap(child)); |
884 | 883 | } |
885 | 884 | } |
886 | 885 | } |
@@ -1021,20 +1020,20 @@ void Core::IO::Internal::OneOfSpec::print(std::ostream& stream, std::size_t inde |
1021 | 1020 | } |
1022 | 1021 | } |
1023 | 1022 |
|
1024 | | -void Core::IO::Internal::OneOfSpec::emit_metadata(ryml::NodeRef node) const |
| 1023 | +void Core::IO::Internal::OneOfSpec::emit_metadata(YamlNodeRef node) const |
1025 | 1024 | { |
1026 | | - node |= ryml::MAP; |
| 1025 | + node.node |= ryml::MAP; |
1027 | 1026 |
|
1028 | | - node["type"] << "one_of"; |
| 1027 | + node.node["type"] << "one_of"; |
1029 | 1028 | if (!data.description.empty()) |
1030 | 1029 | { |
1031 | | - node["description"] << data.description; |
| 1030 | + node.node["description"] << data.description; |
1032 | 1031 | } |
1033 | | - node["specs"] |= ryml::SEQ; |
| 1032 | + node.node["specs"] |= ryml::SEQ; |
1034 | 1033 | for (const auto& spec : specs) |
1035 | 1034 | { |
1036 | | - auto child = node["specs"].append_child(); |
1037 | | - spec.impl().emit_metadata(child); |
| 1035 | + auto child = node.node["specs"].append_child(); |
| 1036 | + spec.impl().emit_metadata(node.wrap(child)); |
1038 | 1037 | } |
1039 | 1038 | } |
1040 | 1039 |
|
@@ -1153,21 +1152,21 @@ void Core::IO::Internal::ListSpec::print(std::ostream& stream, std::size_t inden |
1153 | 1152 | spec.impl().print(stream, indent + 2); |
1154 | 1153 | } |
1155 | 1154 |
|
1156 | | -void Core::IO::Internal::ListSpec::emit_metadata(ryml::NodeRef node) const |
| 1155 | +void Core::IO::Internal::ListSpec::emit_metadata(YamlNodeRef node) const |
1157 | 1156 | { |
1158 | | - node |= ryml::MAP; |
| 1157 | + node.node |= ryml::MAP; |
1159 | 1158 |
|
1160 | | - node["name"] << name; |
| 1159 | + node.node["name"] << name; |
1161 | 1160 |
|
1162 | | - node["type"] << "list"; |
| 1161 | + node.node["type"] << "list"; |
1163 | 1162 | if (!data.description.empty()) |
1164 | 1163 | { |
1165 | | - node["description"] << Core::Utils::trim(data.description); |
| 1164 | + node.node["description"] << Core::Utils::trim(data.description); |
1166 | 1165 | } |
1167 | | - emit_value_as_yaml(node["required"], data.required); |
1168 | | - if (data.size > 0) node["size"] << data.size; |
1169 | | - node["spec"] |= ryml::MAP; |
1170 | | - spec.impl().emit_metadata(node["spec"]); |
| 1166 | + emit_value_as_yaml(node.wrap(node.node["required"]), data.required); |
| 1167 | + if (data.size > 0) node.node["size"] << data.size; |
| 1168 | + node.node["spec"] |= ryml::MAP; |
| 1169 | + spec.impl().emit_metadata(node.wrap(node.node["spec"])); |
1171 | 1170 | } |
1172 | 1171 |
|
1173 | 1172 |
|
|
0 commit comments