14 #include "Filesystem/filesystem/path.h"
18 #include "swCommonLib/Common/Converters.h"
36 Path (
const std::wstring& path );
38 template<
class Source >
39 Path (
const Source& source );
42 Path& operator= (
const Path& other );
45 Path& operator/= (
const Path& other );
46 bool operator== (
const Path& other )
const;
47 bool operator!= (
const Path& other )
const;
48 bool operator< (
const Path& other )
const;
49 bool operator<= (
const Path& other )
const;
50 bool operator> (
const Path& other )
const;
51 bool operator>= (
const Path& other )
const;
54 friend Path operator/ (
const Path& path1,
const Path& path2 );
56 std::string
String ()
const;
57 std::wstring WString ()
const;
60 std::string GetFileName ()
const;
61 std::string GetExtension ()
const;
62 Path GetParent ()
const;
63 Path GetDirectory ()
const;
69 bool HasFileName ()
const;
70 bool HasExtension ()
const;
72 bool IsRelative ()
const;
73 bool IsAbsolut ()
const;
78 static Path WorkingDirectory();
87 template<
class Source >
88 inline Path::Path (
const Source& source )
99 inline Path::Path (
const std::wstring& path )
110 inline Path& Path::operator= (
const Path& other )
112 m_path = other.m_path;
118 inline Path& Path::operator= ( Path&& other )
120 m_path = std::move( other.m_path );
126 inline Path& Path::operator/= (
const Path& other )
128 m_path = m_path / other.m_path;
134 inline bool Path::operator== (
const Path& other )
const
136 return m_path == other.m_path;
141 inline bool Path::operator!= (
const Path& other )
const
143 return m_path != other.m_path;
148 inline bool Path::operator< (
const Path& other )
const
150 return m_path.str() < other.m_path.str();
155 inline bool Path::operator<= (
const Path& other )
const
157 return m_path.str() <= other.m_path.str();
162 inline bool Path::operator> (
const Path& other )
const
164 return m_path.str() > other.m_path.str();
169 inline bool Path::operator>= (
const Path& other )
const
171 return m_path.str() >= other.m_path.str();
188 inline std::wstring Path::WString()
const
190 return m_path.wstr();
194 inline std::string Path::GetFileName()
const
196 return m_path.filename();
200 inline std::string Path::GetExtension()
const
202 return m_path.extension();
206 inline Path Path::GetParent()
const
208 return m_path.parent_path();
212 inline Path Path::GetDirectory()
const
217 return Path( *
this );
234 inline bool Path::HasFileName()
const
236 return !m_path.str().empty();
240 inline bool Path::HasExtension()
const
242 return !GetExtension().empty();
246 inline bool Path::IsRelative()
const
252 inline bool Path::IsAbsolut()
const
254 return m_path.is_absolute();
260 return m_path.exists();
265 inline Path Path::WorkingDirectory()
267 return path_impl::getcwd();
271 inline Path operator/(
const Path& path1,
const Path& path2 )
273 Path newPath = path1;
std::string String() const
Porównuje ścieżki. Przed porównaniem ścieżki są normalizowane. Paths must exist on file system...
Definition: Path.h:182
bool Exists() const
Checks if file or directory exists on filesystem.
Definition: Path.h:258
void Normalize()
Normalizuje ścieżkę.
Definition: Path.h:222
Simple class for manipulating paths on Linux/Windows/Mac OS.
Definition: path.h:33