// file : cutl/fs/path.ixx // author : Boris Kolpackov // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file #ifdef _WIN32 # include // std::tolower # include // std::towlower #endif namespace cutl { namespace fs { template inline bool basic_path:: absolute () const { #ifdef _WIN32 return path_.size () > 1 && path_[1] == ':'; #else return !path_.empty () && traits::is_separator (path_[0]); #endif } template inline bool basic_path:: root () const { #ifdef _WIN32 return path_.size () == 2 && path_[1] == ':'; #else return path_.size () == 1 && traits::is_separator (path_[0]); #endif } template inline basic_path& basic_path:: complete () { if (relative ()) *this = current () / *this; return *this; } #ifdef _WIN32 template <> inline char basic_path:: tolower (char c) { return std::tolower (c); } template <> inline wchar_t basic_path:: tolower (wchar_t c) { return std::towlower (c); } #endif } }