yaml_utils.h
Go to the documentation of this file.
1 
26 #ifndef TESSERACT_COMMON_YAML_UTILS_H
27 #define TESSERACT_COMMON_YAML_UTILS_H
28 
29 #include <string>
30 #include <set>
31 
32 #include <filesystem>
33 
34 namespace YAML
35 {
36 class Node;
37 }
38 
39 namespace tesseract_common
40 {
41 class ResourceLocator;
42 
57 YAML::Node processYamlIncludeDirective(const YAML::Node& node, const ResourceLocator& locator);
58 
73 YAML::Node loadYamlFile(const std::string& file_path, const ResourceLocator& locator);
74 YAML::Node loadYamlString(const std::string& yaml_string, const ResourceLocator& locator);
75 
84 void writeYamlToFile(const YAML::Node& node, const std::string& file_path);
85 
91 void checkForUnknownKeys(const YAML::Node& node, const std::set<std::string>& expected_keys);
92 
98 std::string toYAMLString(const YAML::Node& node);
99 
105 YAML::Node fromYAMLString(const std::string& string);
106 
113 bool compareYAML(const YAML::Node& node1, const YAML::Node& node2);
114 } // namespace tesseract_common
115 
116 #endif // TESSERACT_COMMON_YAML_UTILS_H
tesseract_common::processYamlIncludeDirective
YAML::Node processYamlIncludeDirective(const YAML::Node &node, const ResourceLocator &locator)
Recursively processes a YAML node to resolve !include directives.
Definition: yaml_utils.cpp:52
tesseract_common::writeYamlToFile
void writeYamlToFile(const YAML::Node &node, const std::string &file_path)
Writes a YAML::Node to a file.
Definition: yaml_utils.cpp:106
tesseract_common
Definition: allowed_collision_matrix.h:19
tesseract_common::compareYAML
bool compareYAML(const YAML::Node &node1, const YAML::Node &node2)
Checks if the YAML::Nodes are identical.
Definition: yaml_utils.cpp:144
YAML
Definition: yaml_extenstions.h:39
tesseract_common::checkForUnknownKeys
void checkForUnknownKeys(const YAML::Node &node, const std::set< std::string > &expected_keys)
Check node map for unknown keys.
Definition: yaml_utils.cpp:122
tesseract_common::loadYamlString
YAML::Node loadYamlString(const std::string &yaml_string, const ResourceLocator &locator)
Definition: yaml_utils.cpp:100
tesseract_common::loadYamlFile
YAML::Node loadYamlFile(const std::string &file_path, const ResourceLocator &locator)
Loads a YAML file and processes !include directives recursively.
Definition: yaml_utils.cpp:93
tesseract_common::fromYAMLString
YAML::Node fromYAMLString(const std::string &string)
Converts yaml string to a YAML::Node.
Definition: yaml_utils.cpp:142
tesseract_common::toYAMLString
std::string toYAMLString(const YAML::Node &node)
Converts a YAML::Node to a yaml string.
Definition: yaml_utils.cpp:135


tesseract_common
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:01:40