diff options
author | Marius Kintel <marius@kintel.net> | 2011-11-09 17:38:52 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-11-09 17:38:52 (GMT) |
commit | e65ea2d6515f205526c9cba77ad0831e3b4077d1 (patch) | |
tree | 18e40bf0a2933d7507dbe6f47a787d7808c7ff31 /src/value.cc | |
parent | 5c30bcb691729b52c8456f57b42d6514a9325cf8 (diff) |
Only quote strings when using the stream operator. Fixes #35
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/value.cc b/src/value.cc index e08b2d8..ab78c2a 100644 --- a/src/value.cc +++ b/src/value.cc @@ -343,7 +343,7 @@ std::string Value::toString() const switch (this->type) { case STRING: - stream << '"' << this->text << '"'; + stream << this->text; break; case VECTOR: stream << '['; @@ -411,7 +411,8 @@ void Value::append(Value *val) std::ostream &operator<<(std::ostream &stream, const Value &value) { - stream << value.toString(); + if (value.type == Value::STRING) stream << QuotedString(value.toString()); + else stream << value.toString(); return stream; } |