// file : libbutl/path-io.mxx -*- C++ -*- // copyright : Copyright (c) 2014-2019 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file #ifndef __cpp_modules_ts #pragma once #endif // C includes. #include #ifndef __cpp_lib_modules_ts #include #endif // Other includes. #ifdef __cpp_modules_ts export module butl.path_io; #ifdef __cpp_lib_modules_ts import std.core; //@@ MOD TMP (should not be needed). import std.io; #endif import butl.path; #else #include #endif #include LIBBUTL_MODEXPORT namespace butl { // This is the default path IO implementation. It is separate to allo custom // implementations. For example, we may want to print paths as relative to // the working directory. Or we may want to print '~' for the home directory // prefix. Or we may want to print dir_path with a trailing '/'. // template inline std::basic_ostream& operator<< (std::basic_ostream& os, const basic_path& p) { return os << p.string (); } template inline std::basic_ostream& operator<< (std::basic_ostream& os, const basic_path_name

& pn) { assert (!pn.empty ()); return os << (pn.name ? *pn.name : pn.path->string ()); } }