From b0e481a653b01e4329bccb1d101d56e3e878e960 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 3 Jun 2016 16:43:46 +0300 Subject: Port to MinGW --- build2/name | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'build2/name') diff --git a/build2/name b/build2/name index 68fe9c7..84e334a 100644 --- a/build2/name +++ b/build2/name @@ -106,19 +106,42 @@ namespace build2 inline bool operator< (const name& x, const name& y) {return x.compare (y) < 0;} + // Serialize the name to the stream. If requested, the name components + // containing special characters are quoted. The special characters are: + // + // {}[]$() \t\n#\"'% + // + // If the pair argument is not '\0', then it is added to the above special + // characters set. If the quote character is present in the component then + // it is double quoted rather than single quoted. In this case the following + // characters are escaped: + // + // \$(" + // ostream& - operator<< (ostream&, const name&); + to_stream (ostream&, const name&, bool quote, char pair); + + inline ostream& + operator<< (ostream& os, const name& n) { + return to_stream (os, n, false, '\0');} + // Vector of names. // using names = vector; using names_view = vector_view; + // The same semantics as to_stream(name). + // ostream& - operator<< (ostream&, const names_view&); + to_stream (ostream&, const names_view&, bool quote, char pair); + + inline ostream& + operator<< (ostream& os, const names_view& ns) { + return to_stream (os, ns, false, '\0');} inline ostream& - operator<< (ostream& os, const names& n) {return os << names_view (n);} + operator<< (ostream& os, const names& ns) {return os << names_view (ns);} } #include -- cgit v1.1