20 namespace experimental = std::tr2::sys;
32 Path (
const std::wstring& path );
34 template<
class Source >
35 Path (
const Source& source );
47 std::string
String ()
const;
76 template<
class Source >
78 : m_path( experimental::path( source ) )
87 : m_path( path.m_path )
92 : m_path( std::move( path.m_path ) )
98 typedef std::codecvt_utf8< wchar_t > ConvertType;
99 std::wstring_convert< ConvertType, wchar_t > converter;
100 auto pathStr = converter.to_bytes( path );
102 m_path = experimental::path( pathStr );
115 m_path = std::move( other.m_path );
129 return experimental::equivalent(
m_path, other.
m_path );
135 return experimental::equivalent( path1.
m_path, path2.
m_path );
147 return m_path.filename().string();
153 return m_path.extension().string();
159 return m_path.parent_path();
165 if(
m_path.has_filename() )
168 return Path( *
this );
181 return m_path.has_root_directory();
187 return m_path.has_filename();
205 return m_path.has_root_name() &&
m_path.has_root_directory();
211 return experimental::exists(
m_path );
218 return experimental::current_path();
224 Path newPath = path1;
Path GetParent() const
Definition: Path.h:157
bool HasFileName() const
Definition: Path.h:185
experimental::path m_path
Definition: Path.h:25
bool IsAbsolut() const
Definition: Path.h:203
Path()
Definition: Path.h:82
std::string GetExtension() const
Definition: Path.h:151
static Path WorkingDirectory()
Definition: Path.h:216
const experimental::path & GetStdPath() const
Returns standard library path. Use only if you must.
Definition: Path.h:231
bool HasExtension() const
Definition: Path.h:191
bool HasRoot() const
Definition: Path.h:179
Path & operator/=(const Path &other)
Definition: Path.h:120
bool Compare(const Path &path1, const Path &path2)
Porównuje ścieżki. Przed porównaniem ścieżki są normalizowane.
Definition: Path.h:133
std::string String() const
Definition: Path.h:139
Path & operator=(const Path &other)
Definition: Path.h:106
bool Exists() const
Checks if file or directory exists on filesystem.
Definition: Path.h:209
void Normalize()
Normalizuje ścieżkę.
Definition: Path.h:173
Path operator/(const Path &path1, const Path &path2)
Definition: Path.h:222
bool operator==(const Path &other) const
Definition: Path.h:127
Path GetDirectory() const
Definition: Path.h:163
bool IsRelative() const
Definition: Path.h:197
std::string GetFileName() const
Definition: Path.h:145
friend Path operator/(const Path &path1, const Path &path2)
Definition: Path.h:222