| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/ostreams.h" | 5 #include "src/ostreams.h" |
| 6 | 6 |
| 7 #if V8_OS_WIN | 7 #if V8_OS_WIN |
| 8 #define snprintf sprintf_s | 8 #define snprintf sprintf_s |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 std::ostream& operator<<(std::ostream& os, const AsReversiblyEscapedUC16& c) { | 64 std::ostream& operator<<(std::ostream& os, const AsReversiblyEscapedUC16& c) { |
| 65 return PrintUC16(os, c.value, IsOK); | 65 return PrintUC16(os, c.value, IsOK); |
| 66 } | 66 } |
| 67 | 67 |
| 68 | 68 |
| 69 std::ostream& operator<<(std::ostream& os, const AsEscapedUC16ForJSON& c) { | 69 std::ostream& operator<<(std::ostream& os, const AsEscapedUC16ForJSON& c) { |
| 70 if (c.value == '\n') return os << "\\n"; | 70 if (c.value == '\n') return os << "\\n"; |
| 71 if (c.value == '\r') return os << "\\r"; | 71 if (c.value == '\r') return os << "\\r"; |
| 72 if (c.value == '\"') return os << "\\\""; | 72 if (c.value == '\"') return os << "\\\""; |
| 73 if (c.value == '\'') return os << "\\\'"; | |
| 74 return PrintUC16(os, c.value, IsOK); | 73 return PrintUC16(os, c.value, IsOK); |
| 75 } | 74 } |
| 76 | 75 |
| 77 | 76 |
| 78 std::ostream& operator<<(std::ostream& os, const AsUC16& c) { | 77 std::ostream& operator<<(std::ostream& os, const AsUC16& c) { |
| 79 return PrintUC16(os, c.value, IsPrint); | 78 return PrintUC16(os, c.value, IsPrint); |
| 80 } | 79 } |
| 81 | 80 |
| 82 } // namespace internal | 81 } // namespace internal |
| 83 } // namespace v8 | 82 } // namespace v8 |
| OLD | NEW |