equal
deleted
inserted
replaced
153 /// Writes a quoted string to the given stream. |
153 /// Writes a quoted string to the given stream. |
154 void write(std::ostream& os, const std::string& value) const { |
154 void write(std::ostream& os, const std::string& value) const { |
155 os << "\""; |
155 os << "\""; |
156 if (escaped) { |
156 if (escaped) { |
157 std::ostringstream ls; |
157 std::ostringstream ls; |
158 for (int i = 0; i < (int)value.size(); ++i) { |
158 for (int i = 0; i < int(value.size()); ++i) { |
159 writeEscape(ls, value[i]); |
159 writeEscape(ls, value[i]); |
160 } |
160 } |
161 os << ls.str(); |
161 os << ls.str(); |
162 } else { |
162 } else { |
163 os << value; |
163 os << value; |
202 case '\v': |
202 case '\v': |
203 os << "\\v"; |
203 os << "\\v"; |
204 return; |
204 return; |
205 default: |
205 default: |
206 if (c < 0x20) { |
206 if (c < 0x20) { |
207 os << '\\' << std::oct << (int)c; |
207 os << '\\' << std::oct << static_cast<int>(c); |
208 } else { |
208 } else { |
209 os << c; |
209 os << c; |
210 } |
210 } |
211 return; |
211 return; |
212 } |
212 } |