Lines Matching full:path

29 #include "utils/fs/path.hpp"
41 /// Normalizes an input string to a valid path.
43 /// A normalized path cannot have empty components; i.e. there can be at most
48 /// \return The normalized string, representing a path.
50 /// \throw utils::fs::invalid_path_error If the path is empty.
84 /// Creates a new path object from a textual representation of a path.
86 /// \param text A valid representation of a path in textual form.
89 /// valid path.
90 fs::path::path(const std::string& text) : in path() function in fs::path
96 /// Gets a view of the path as an array of characters.
100 fs::path::c_str(void) const in c_str()
106 /// Gets a view of the path as a std::string.
110 fs::path::str(void) const in str()
116 /// Gets the branch path (directory name) of the path.
118 /// The branch path of a path with just one component (no separators) is ".".
120 /// \return A new path representing the branch path.
121 fs::path
122 fs::path::branch_path(void) const in branch_path()
126 return fs::path("."); in branch_path()
128 return fs::path("/"); in branch_path()
130 return fs::path(_repr.substr(0, end_pos)); in branch_path()
134 /// Gets the leaf name (base name) of the path.
138 fs::path::leaf_name(void) const in leaf_name()
149 /// Converts a relative path in the current directory to an absolute path.
151 /// \pre The path is relative.
153 /// \return The absolute representation of the relative path.
154 fs::path
155 fs::path::to_absolute(void) const in to_absolute()
162 /// \return True if the representation of the path is absolute.
164 fs::path::is_absolute(void) const in is_absolute()
170 /// Checks whether the path is a parent of another path.
172 /// A path is considered to be a parent of itself.
174 /// \return True if this path is a parent of p.
176 fs::path::is_parent_of(path p) const in is_parent_of()
182 } while (p != fs::path(".") && p != fs::path("/")); in is_parent_of()
187 /// Counts the number of components in the path.
191 fs::path::ncomponents(void) const in ncomponents()
211 /// \param p The path to compare to.
216 fs::path::operator<(const fs::path& p) const in operator <()
229 /// \param p The path to compare to.
233 fs::path::operator==(const fs::path& p) const in operator ==()
244 /// \param p The path to compare to.
248 fs::path::operator!=(const fs::path& p) const in operator !=()
254 /// Concatenates this path with one or more components.
256 /// \param components The new components to concatenate to the path. These are
258 /// components cannot represent an absolute path.
260 /// \return A new path containing the concatenation of this path and the
264 /// valid path.
267 fs::path
268 fs::path::operator/(const std::string& components) const in operator /()
270 return (*this) / fs::path(components); in operator /()
274 /// Concatenates this path with another path.
276 /// \param rest The path to concatenate to this one. Cannot be absolute.
278 /// \return A new path containing the concatenation of this path and the other
279 /// path.
283 fs::path
284 fs::path::operator/(const fs::path& rest) const in operator /()
288 "Cannot concatenate a path to an absolute path"); in operator /()
289 return fs::path(_repr + '/' + rest._repr); in operator /()
293 /// Formats a path for insertion on a stream.
296 /// \param p The path to inject to the stream.
300 fs::operator<<(std::ostream& os, const fs::path& p) in operator <<()