|
dot-xx
A personal collection of small C++ modules
|
Public Types | |
| using | Data = TData |
Public Member Functions | |
| PathNode (std::string_view c_name) | |
| Construct a node without data. | |
|
template<typename... Args> requires std::constructible_from<Data, Args...> | |
| PathNode (std::string_view c_name, Args &&... args) | |
| Construct a node and initialize it with some data. | |
| const std::string & | get_name () const |
| Get the node name. | |
| auto & | get_data (this auto &self) |
| Get the node data. | |
| auto * | find (this auto &self, std::filesystem::path::const_iterator cur, std::filesystem::path::const_iterator end, std::vector< std::string > *substs=nullptr) |
| Find a pointer to the node that is located at the relative path from the current one. | |
| auto * | find (this auto &self, const std::filesystem::path &p, std::vector< std::string > *substs=nullptr) |
| Equivalent to find(p.begin(), p.end(), substs). | |
|
template<typename... Args> requires (sizeof...(Args) > 0) | |
| PathNode * | emplace (const std::filesystem::path &path, Args &&... args) |
| Create a node at the path, or emplace data into an existing node. Creates intermediate nodes too. | |
|
inlinenodiscard |
Find a pointer to the node that is located at the relative path from the current one.
| cur | current position in the path being searched |
| end | the past-the-end iterator to the path |
| substs | a list of substitutions that were made in place of # and ## (leave nullptr if not needed) |