diff options
Diffstat (limited to 'cutl/fs/path.txx')
-rw-r--r-- | cutl/fs/path.txx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cutl/fs/path.txx b/cutl/fs/path.txx index f7cdcc4..e95c890 100644 --- a/cutl/fs/path.txx +++ b/cutl/fs/path.txx @@ -64,6 +64,26 @@ namespace cutl return *this; } +#ifdef _WIN32 + template <typename C> + typename basic_path<C>::string_type basic_path<C>:: + posix_string () const + { + if (absolute ()) + throw invalid_basic_path<C> (path_); + + string_type r (path_); + + // Translate Windows-style separators to the POSIX ones. + // + for (size_type i (0), n (r.size ()); i != n; ++i) + if (r[i] == '\\') + r[i] = '/'; + + return r; + } +#endif + template <typename C> basic_path<C>& basic_path<C>:: operator/= (basic_path<C> const& r) |