diff options
author | John Hodge <tpg@ucc.asn.au> | 2017-04-16 11:40:20 +0800 |
---|---|---|
committer | John Hodge <tpg@ucc.asn.au> | 2017-04-16 11:40:20 +0800 |
commit | 2acb5a8ac29ddc6f6894802d255d686fdb18329d (patch) | |
tree | a52c35427e7416f3c43be83c21e7caa85aba96ae /src/common.hpp | |
parent | 8a12037b9f8c3a18c860e6f392ba9cebb3ed5aa6 (diff) | |
download | mrust-2acb5a8ac29ddc6f6894802d255d686fdb18329d.tar.gz |
common - Expand FmtEscaped
Diffstat (limited to 'src/common.hpp')
-rw-r--r-- | src/common.hpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/common.hpp b/src/common.hpp index 63125b0e..d3aca257 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -328,19 +328,8 @@ struct FmtEscaped { FmtEscaped(const ::std::string& s): s(s.c_str()) {} - friend ::std::ostream& operator<<(::std::ostream& os, const FmtEscaped& x) { - for(auto s = x.s; *s != '\0'; s ++) - { - switch(*s) - { - case '\n': os << "\\n"; break; - case '\\': os << "\\\\"; break; - case '"': os << "\\\""; break; - default: os << *s; break; - } - } - return os; - } + // See main.cpp + friend ::std::ostream& operator<<(::std::ostream& os, const FmtEscaped& x); }; // ------------------------------------------------------------------- |