dot-xx
A personal collection of small C++ modules
Loading...
Searching...
No Matches
dxx::http::PathNode< TData > Class Template Referenceexport
module dxx.http

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)
PathNodeemplace (const std::filesystem::path &path, Args &&... args)
 Create a node at the path, or emplace data into an existing node. Creates intermediate nodes too.

Member Function Documentation

◆ find()

template<typename TData>
auto * dxx::http::PathNode< TData >::find ( this auto & self,
std::filesystem::path::const_iterator cur,
std::filesystem::path::const_iterator end,
std::vector< std::string > * substs = nullptr )
inlinenodiscard

Find a pointer to the node that is located at the relative path from the current one.

Parameters
curcurrent position in the path being searched
endthe past-the-end iterator to the path
substsa list of substitutions that were made in place of # and ## (leave nullptr if not needed)

The documentation for this class was generated from the following file:
  • /build-llvm-libcpp/_deps/dot-xx-http-src/src/path.xx