40 #if CONFIG_ENABLE_BOOST
41 # include "boost/functional/hash.hpp"
86 :
path((const unsigned char*)p, (const unsigned char*)p+strlen(p))
94 :
path(p, p+wcslen(p))
100 :
path((const unsigned char*)s.c_str(), (const unsigned char*)s.c_str()+s.length())
153 if(idxSlash == String::npos)
155 return path.substr(0, idxSlash);
161 if(idxSlash == String::npos)
163 return path.substr(idxSlash+1);
169 const size_t idxDot = filename.
string().find_last_of(
'.');
170 if(idxDot == String::npos)
172 return filename.
string().substr(0, idxDot);
179 const size_t idxDot = filename.
string().find_last_of(
'.');
180 if(idxDot == String::npos)
182 return filename.
string().substr(idxDot);
198 if(rhs.
path.find((ret.
separator ==
'/')?
'\\' :
'/') != String::npos)
223 const size_t idx = ret.
path.rfind(other.
path);
224 if(idx == String::npos)
227 return path.substr(0, idx);
240 const size_t idxBackslash =
path.find(
'\\');
242 if(
path.find(
'/') != String::npos && idxBackslash != String::npos)
249 separator = (idxBackslash == String::npos)?
'/' :
'\\';
278 #if CONFIG_ENABLE_BOOST
283 struct hash<
Path> : std::unary_function<Path, std::size_t>
285 std::size_t operator()(
const Path& path)
const
293 #endif // #if CONFIG_ENABLE_BOOST
295 #endif // #ifndef INCLUDED_PATH
size_t hash_value(const CStrIntern &v)
const Status PATH_CHARACTER_ILLEGAL
void PrintToDebugOutput() const
Path BeforeCommon(Path other) const
Return the path before the common part of both paths.
const Status PATH_CHARACTER_UNSAFE
bool operator!=(const Path &rhs) const
const String & string() const
bool operator==(const Path &rhs) const
i64 Status
Error handling system.
Path operator/(Path rhs) const
const Status PATH_MIXED_SEPARATORS
Path(const std::wstring &s)
Path(const std::string &s)
#define DEBUG_WARN_ERR(status)
display the error dialog with text corresponding to the given error code.
bool path_is_subpath(const wchar_t *s1, const wchar_t *s2)
is s2 a subpath of s1, or vice versa? (equal counts as subpath)
static Status Validate(String::value_type c)
Path ChangeExtension(Path extension) const
static std::wistream & operator>>(std::wistream &s, Path &path)
const wchar_t * path_name_only(const wchar_t *path)
Get the path component of a path.
bool operator<(const Path &rhs) const
Path & operator=(const Path &rhs)
static std::wostream & operator<<(std::wostream &s, const Path &path)
void debug_printf(const wchar_t *fmt,...)
write a formatted string to the debug channel, subject to filtering (see below).
const Status PATH_NOT_FOUND