chrono::ChYamlFileHandler Class Reference
Description
Utility class for handling data paths in YAML specification files.
#include <ChUtilsYAML.h>
Public Types | |
| enum | Type { ABS, REL } |
| Type of data path (absolute or relative). | |
Public Member Functions | |
| ChYamlFileHandler () | |
| Construct a default data path handler (with absolute path type). | |
| void | Read (const YAML::Node &a) |
| Read specification of the data path handler from the given YAML node. More... | |
| void | SetReferenceDirectory (const std::string &pathname) |
| Set the reference directory based on the location of the given path. More... | |
| Type | GetType () const |
| Return the data path type (absolute or relative). | |
| const std::string & | GetReferenceDirectory () const |
| Return the reference directory (for relative data path type). | |
| const std::string & | GetRelativePath () const |
| Return the relative path for data files (for relative data path type). | |
| std::string | GetFilename (const std::string &filename) const |
| Return the full path for the given filename, based on the data path type and reference directory. | |
| void | PrintInfo () const |
| Print information about the data path handler. | |
Member Function Documentation
◆ Read()
| void chrono::ChYamlFileHandler::Read | ( | const YAML::Node & | a | ) |
Read specification of the data path handler from the given YAML node.
If the YAML node does not contain a data path specification, the default absolute path type is used. Otherwise, the data path type and relative path (if applicable) are read from the YAML node.
◆ SetReferenceDirectory()
| void chrono::ChYamlFileHandler::SetReferenceDirectory | ( | const std::string & | pathname | ) |
Set the reference directory based on the location of the given path.
- if the given path is a file, the reference directory is set to its parent directory.
- if the given path is a directory, the reference directory is set to that directory.
The documentation for this class was generated from the following files:
- /builds/uwsbel/chrono/src/chrono/input_output/ChUtilsYAML.h
- /builds/uwsbel/chrono/src/chrono/input_output/ChUtilsYAML.cpp