From e37cf91f24fc409fa0aa84500245f57c685fc8ea Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 30 Jul 2016 16:36:53 +0200 Subject: Implement support for Windows path actualization --- butl/path.ixx | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'butl/path.ixx') diff --git a/butl/path.ixx b/butl/path.ixx index 3d1f20c..a90922a 100644 --- a/butl/path.ixx +++ b/butl/path.ixx @@ -3,8 +3,8 @@ // license : MIT; see accompanying LICENSE file #ifdef _WIN32 -# include // std::tolower -# include // std::towlower +# include // tolower(), toupper() +# include // towlower(), towupper() #endif namespace butl @@ -23,6 +23,20 @@ namespace butl { return std::towlower (c); } + + template <> + inline char path_traits:: + toupper (char c) + { + return std::toupper (c); + } + + template <> + inline wchar_t path_traits:: + toupper (wchar_t c) + { + return std::towupper (c); + } #endif template @@ -223,10 +237,14 @@ namespace butl realize () { #ifdef _WIN32 + // This is not exactly the semantics of realpath(3). In particular, we + // don't fail if the path does not exist. But we could have seeing that + // we actualize it. + // complete (); - normalize (); + normalize (true); #else - traits::realize (this->path_); // Note: we retail trailing slash. + traits::realize (this->path_); // Note: we retain the trailing slash. #endif return *this; } -- cgit v1.1