| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 RefPtr<JSONValue> value = get(name); | 203 RefPtr<JSONValue> value = get(name); |
| 204 if (!value) | 204 if (!value) |
| 205 return false; | 205 return false; |
| 206 return value->asNumber(output); | 206 return value->asNumber(output); |
| 207 } | 207 } |
| 208 bool getString(const String& name, String* output) const; | 208 bool getString(const String& name, String* output) const; |
| 209 PassRefPtr<JSONObject> getObject(const String& name) const; | 209 PassRefPtr<JSONObject> getObject(const String& name) const; |
| 210 PassRefPtr<JSONArray> getArray(const String& name) const; | 210 PassRefPtr<JSONArray> getArray(const String& name) const; |
| 211 PassRefPtr<JSONValue> get(const String& name) const; | 211 PassRefPtr<JSONValue> get(const String& name) const; |
| 212 | 212 |
| 213 bool booleanProperty(const String& name, bool defaultValue) const; |
| 214 |
| 213 void remove(const String& name); | 215 void remove(const String& name); |
| 214 | 216 |
| 215 void prettyWriteJSONInternal(StringBuilder* output, int depth) const overrid
e; | 217 void prettyWriteJSONInternal(StringBuilder* output, int depth) const overrid
e; |
| 216 | 218 |
| 217 iterator begin() { return m_data.begin(); } | 219 iterator begin() { return m_data.begin(); } |
| 218 iterator end() { return m_data.end(); } | 220 iterator end() { return m_data.end(); } |
| 219 const_iterator begin() const { return m_data.begin(); } | 221 const_iterator begin() const { return m_data.begin(); } |
| 220 const_iterator end() const { return m_data.end(); } | 222 const_iterator end() const { return m_data.end(); } |
| 221 | 223 |
| 222 protected: | 224 protected: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 244 using JSONObjectBase::setArray; | 246 using JSONObjectBase::setArray; |
| 245 | 247 |
| 246 using JSONObjectBase::find; | 248 using JSONObjectBase::find; |
| 247 using JSONObjectBase::getBoolean; | 249 using JSONObjectBase::getBoolean; |
| 248 using JSONObjectBase::getNumber; | 250 using JSONObjectBase::getNumber; |
| 249 using JSONObjectBase::getString; | 251 using JSONObjectBase::getString; |
| 250 using JSONObjectBase::getObject; | 252 using JSONObjectBase::getObject; |
| 251 using JSONObjectBase::getArray; | 253 using JSONObjectBase::getArray; |
| 252 using JSONObjectBase::get; | 254 using JSONObjectBase::get; |
| 253 | 255 |
| 256 using JSONObjectBase::booleanProperty; |
| 257 |
| 254 using JSONObjectBase::remove; | 258 using JSONObjectBase::remove; |
| 255 | 259 |
| 256 using JSONObjectBase::begin; | 260 using JSONObjectBase::begin; |
| 257 using JSONObjectBase::end; | 261 using JSONObjectBase::end; |
| 258 | 262 |
| 259 using JSONObjectBase::size; | 263 using JSONObjectBase::size; |
| 260 }; | 264 }; |
| 261 | 265 |
| 262 | 266 |
| 263 class PLATFORM_EXPORT JSONArrayBase : public JSONValue { | 267 class PLATFORM_EXPORT JSONArrayBase : public JSONValue { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 using JSONArrayBase::begin; | 326 using JSONArrayBase::begin; |
| 323 using JSONArrayBase::end; | 327 using JSONArrayBase::end; |
| 324 }; | 328 }; |
| 325 | 329 |
| 326 PLATFORM_EXPORT void escapeStringForJSON(const String&, StringBuilder*); | 330 PLATFORM_EXPORT void escapeStringForJSON(const String&, StringBuilder*); |
| 327 void doubleQuoteStringForJSON(const String&, StringBuilder*); | 331 void doubleQuoteStringForJSON(const String&, StringBuilder*); |
| 328 | 332 |
| 329 } // namespace blink | 333 } // namespace blink |
| 330 | 334 |
| 331 #endif // JSONValues_h | 335 #endif // JSONValues_h |
| OLD | NEW |