aboutsummaryrefslogtreecommitdiff
path: root/butl/path-io
blob: 6b68f30b8f26434110079715073ed392672f99d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// file      : butl/path-io -*- C++ -*-
// copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef BUTL_PATH_IO
#define BUTL_PATH_IO

#include <ostream>

#include <butl/path>

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 <typename C, typename K>
  inline std::basic_ostream<C>&
  operator<< (std::basic_ostream<C>& os, basic_path<C, K> const& p)
  {
    return os << p.string ();
  }
}

#endif // BUTL_PATH_IO