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 getBoolean(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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 using JSONArrayBase::begin; | 324 using JSONArrayBase::begin; |
323 using JSONArrayBase::end; | 325 using JSONArrayBase::end; |
324 }; | 326 }; |
325 | 327 |
326 PLATFORM_EXPORT void escapeStringForJSON(const String&, StringBuilder*); | 328 PLATFORM_EXPORT void escapeStringForJSON(const String&, StringBuilder*); |
327 void doubleQuoteStringForJSON(const String&, StringBuilder*); | 329 void doubleQuoteStringForJSON(const String&, StringBuilder*); |
328 | 330 |
329 } // namespace blink | 331 } // namespace blink |
330 | 332 |
331 #endif // JSONValues_h | 333 #endif // JSONValues_h |
OLD | NEW |