12 :
public std::vector<std::string>
14 using Super = std::vector<std::string>;
15 using iterator = Super::iterator;
16 using const_iterator = Super::const_iterator;
20 static constexpr char preferred_separator =
'\\';
22 static constexpr char preferred_separator =
'/';
29 template <
class String>
36 template <
class InputIt>
37 path(InputIt it, InputIt end_it)
43 template <
class String>
44 path(std::initializer_list<String>
const& list)
45 :
path(list.begin(), list.end())
58 return empty() ?
path() :
path(begin(), --end());
64 return empty() ?
path() :
path(back());
74 std::string
string()
const;
80 static bool is_absolute(std::string p);
82 bool is_absolute()
const {
return is_absolute(original); }
84 bool is_relative()
const {
return !is_absolute(); }
102 template <
class CharT,
class Traits>
103 friend std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& out,
path const& p)
105 out <<
'"' << p.
string() <<
'"';
113 void split(std::string p);
116 std::string original =
"";
120 bool exists(path
const&);
123 bool create_directories(path
const&);
Definition: Filesystem.hpp:13
bool is_file() const
Check whether path is a regular file.
Definition: Filesystem.cpp:115
path filename() const
Returns filename path component.
Definition: Filesystem.hpp:62
friend std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &out, path const &p)
output of the path
Definition: Filesystem.hpp:103
path & operator/=(path const &p)
Appends elements to the path.
Definition: Filesystem.cpp:107
bool is_directory() const
Check whether path is a regular file.
Definition: Filesystem.cpp:123
path parent_path() const
Returns the path of the parent path.
Definition: Filesystem.hpp:56
bool operator==(path const &p)
Lexicographically compares two paths.
Definition: Filesystem.hpp:93
path extension() const
Returns the file extension path component.
Definition: Filesystem.cpp:83
path & remove_filename()
Removes filename path component.
Definition: Filesystem.hpp:49
std::string string() const
Return the path as string.
Definition: Filesystem.cpp:33
path stem() const
Returns the stem path component.
Definition: Filesystem.cpp:72