From c09cd7512491cee1e82c1ad8128ce9fd4bc3f79b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Sep 2017 23:32:28 +0200 Subject: Initial modularization with both Clang and VC hacks Note: gave up on VC about half way though. --- libbutl/path-io.mxx | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 libbutl/path-io.mxx (limited to 'libbutl/path-io.mxx') diff --git a/libbutl/path-io.mxx b/libbutl/path-io.mxx new file mode 100644 index 0000000..ae1ee84 --- /dev/null +++ b/libbutl/path-io.mxx @@ -0,0 +1,45 @@ +// file : libbutl/path-io.mxx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef __cpp_modules +#pragma once +#endif + +// C includes. + +#ifndef __cpp_lib_modules +#include +#endif + +// Other includes. + +#ifdef __cpp_modules +export module butl.path_io; +#ifdef __cpp_lib_modules +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. The reason it is + // separate is because one often wants a custom implementation. + // 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, basic_path const& p) + { + return os << p.string (); + } +} -- cgit v1.1