aboutsummaryrefslogtreecommitdiff
path: root/libbutl/path.ixx
diff options
context:
space:
mode:
Diffstat (limited to 'libbutl/path.ixx')
-rw-r--r--libbutl/path.ixx90
1 files changed, 66 insertions, 24 deletions
diff --git a/libbutl/path.ixx b/libbutl/path.ixx
index 165f06a..77bc9f7 100644
--- a/libbutl/path.ixx
+++ b/libbutl/path.ixx
@@ -702,6 +702,72 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason.
d.tsep_ = 1; // Canonical separator is always first.
}
+ template <typename C, typename K>
+ inline std::basic_ostream<C>&
+ to_stream (std::basic_ostream<C>& os,
+ const basic_path<C, K>& p,
+ bool representation)
+ {
+ os << p.string ();
+
+ if (representation)
+ {
+ C sep (p.separator ());
+
+#ifndef _WIN32
+ if (sep != 0 && !p.root ())
+ os << sep;
+#else
+ if (sep != 0)
+ os << sep;
+#endif
+ }
+
+ return os;
+ }
+
+ // basic_path_name
+ //
+ template <typename P>
+ inline basic_path_name<P>::
+ basic_path_name (basic_path_name&& p)
+ : basic_path_name (p.path, std::move (p.name))
+ {
+ }
+
+ template <typename P>
+ inline basic_path_name<P>::
+ basic_path_name (const basic_path_name& p)
+ : basic_path_name (p.path, p.name)
+ {
+ }
+
+ template <typename P>
+ inline basic_path_name<P>& basic_path_name<P>::
+ operator= (basic_path_name&& p)
+ {
+ if (this != &p)
+ {
+ this->path = p.path;
+ name = std::move (p.name);
+ }
+
+ return *this;
+ }
+
+ template <typename P>
+ inline basic_path_name<P>& basic_path_name<P>::
+ operator= (const basic_path_name& p)
+ {
+ if (this != &p)
+ {
+ this->path = p.path;
+ name = p.name;
+ }
+
+ return *this;
+ }
+
// basic_path_name_value
//
template <typename P>
@@ -743,28 +809,4 @@ LIBBUTL_MODEXPORT namespace butl //@@ MOD Clang needs this for some reason.
return *this;
}
-
- template <typename C, typename K>
- inline std::basic_ostream<C>&
- to_stream (std::basic_ostream<C>& os,
- const basic_path<C, K>& p,
- bool representation)
- {
- os << p.string ();
-
- if (representation)
- {
- C sep (p.separator ());
-
-#ifndef _WIN32
- if (sep != 0 && !p.root ())
- os << sep;
-#else
- if (sep != 0)
- os << sep;
-#endif
- }
-
- return os;
- }
}