| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 virtual bool asObject(RefPtr<JSONObject>* output); | 110 virtual bool asObject(RefPtr<JSONObject>* output); |
| 111 virtual bool asArray(RefPtr<JSONArray>* output); | 111 virtual bool asArray(RefPtr<JSONArray>* output); |
| 112 virtual PassRefPtr<JSONObject> asObject(); | 112 virtual PassRefPtr<JSONObject> asObject(); |
| 113 virtual PassRefPtr<JSONArray> asArray(); | 113 virtual PassRefPtr<JSONArray> asArray(); |
| 114 | 114 |
| 115 String toJSONString() const; | 115 String toJSONString() const; |
| 116 String toPrettyJSONString() const; | 116 String toPrettyJSONString() const; |
| 117 virtual void writeJSON(StringBuilder* output) const; | 117 virtual void writeJSON(StringBuilder* output) const; |
| 118 virtual void prettyWriteJSON(StringBuilder* output) const; | 118 virtual void prettyWriteJSON(StringBuilder* output) const; |
| 119 | 119 |
| 120 static String quoteString(const String&); |
| 121 |
| 120 protected: | 122 protected: |
| 121 explicit JSONValue(Type type) : m_type(type) { } | 123 explicit JSONValue(Type type) : m_type(type) { } |
| 122 virtual void prettyWriteJSONInternal(StringBuilder* output, int depth) const
; | 124 virtual void prettyWriteJSONInternal(StringBuilder* output, int depth) const
; |
| 123 | 125 |
| 124 private: | 126 private: |
| 125 friend class JSONObjectBase; | 127 friend class JSONObjectBase; |
| 126 friend class JSONArrayBase; | 128 friend class JSONArrayBase; |
| 127 | 129 |
| 128 Type m_type; | 130 Type m_type; |
| 129 }; | 131 }; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 342 |
| 341 using JSONArrayBase::get; | 343 using JSONArrayBase::get; |
| 342 | 344 |
| 343 using JSONArrayBase::begin; | 345 using JSONArrayBase::begin; |
| 344 using JSONArrayBase::end; | 346 using JSONArrayBase::end; |
| 345 }; | 347 }; |
| 346 | 348 |
| 347 } // namespace blink | 349 } // namespace blink |
| 348 | 350 |
| 349 #endif // JSONValues_h | 351 #endif // JSONValues_h |
| OLD | NEW |