Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: third_party/WebKit/Source/platform/JSONValues.h

Issue 1746283002: Rename enums/functions that collide in chromium style in platform/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get-names-13-platform: . Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 typedef enum { 66 typedef enum {
67 TypeNull = 0, 67 TypeNull = 0,
68 TypeBoolean, 68 TypeBoolean,
69 TypeNumber, 69 TypeNumber,
70 TypeString, 70 TypeString,
71 TypeObject, 71 TypeObject,
72 TypeArray 72 TypeArray
73 } Type; 73 } Type;
74 74
75 Type type() const { return m_type; } 75 Type getType() const { return m_type; }
76 76
77 bool isNull() const { return m_type == TypeNull; } 77 bool isNull() const { return m_type == TypeNull; }
78 78
79 virtual bool asBoolean(bool* output) const; 79 virtual bool asBoolean(bool* output) const;
80 virtual bool asNumber(double* output) const; 80 virtual bool asNumber(double* output) const;
81 virtual bool asNumber(long* output) const; 81 virtual bool asNumber(long* output) const;
82 virtual bool asNumber(int* output) const; 82 virtual bool asNumber(int* output) const;
83 virtual bool asNumber(unsigned long* output) const; 83 virtual bool asNumber(unsigned long* output) const;
84 virtual bool asNumber(unsigned* output) const; 84 virtual bool asNumber(unsigned* output) const;
85 virtual bool asString(String* output) const; 85 virtual bool asString(String* output) const;
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 typedef Dictionary::iterator iterator; 172 typedef Dictionary::iterator iterator;
173 typedef Dictionary::const_iterator const_iterator; 173 typedef Dictionary::const_iterator const_iterator;
174 174
175 static PassRefPtr<JSONObject> create() 175 static PassRefPtr<JSONObject> create()
176 { 176 {
177 return adoptRef(new JSONObject()); 177 return adoptRef(new JSONObject());
178 } 178 }
179 179
180 static PassRefPtr<JSONObject> cast(PassRefPtr<JSONValue> value) 180 static PassRefPtr<JSONObject> cast(PassRefPtr<JSONValue> value)
181 { 181 {
182 if (!value || value->type() != TypeObject) 182 if (!value || value->getType() != TypeObject)
183 return nullptr; 183 return nullptr;
184 return adoptRef(static_cast<JSONObject*>(value.leakRef())); 184 return adoptRef(static_cast<JSONObject*>(value.leakRef()));
185 } 185 }
186 186
187 void writeJSON(StringBuilder* output) const override; 187 void writeJSON(StringBuilder* output) const override;
188 188
189 int size() const { return m_data.size(); } 189 int size() const { return m_data.size(); }
190 190
191 void setBoolean(const String& name, bool); 191 void setBoolean(const String& name, bool);
192 void setNumber(const String& name, double); 192 void setNumber(const String& name, double);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 typedef Vector<RefPtr<JSONValue>>::iterator iterator; 235 typedef Vector<RefPtr<JSONValue>>::iterator iterator;
236 typedef Vector<RefPtr<JSONValue>>::const_iterator const_iterator; 236 typedef Vector<RefPtr<JSONValue>>::const_iterator const_iterator;
237 237
238 static PassRefPtr<JSONArray> create() 238 static PassRefPtr<JSONArray> create()
239 { 239 {
240 return adoptRef(new JSONArray()); 240 return adoptRef(new JSONArray());
241 } 241 }
242 242
243 static PassRefPtr<JSONArray> cast(PassRefPtr<JSONValue> value) 243 static PassRefPtr<JSONArray> cast(PassRefPtr<JSONValue> value)
244 { 244 {
245 if (!value || value->type() != TypeArray) 245 if (!value || value->getType() != TypeArray)
246 return nullptr; 246 return nullptr;
247 return adoptRef(static_cast<JSONArray*>(value.leakRef())); 247 return adoptRef(static_cast<JSONArray*>(value.leakRef()));
248 } 248 }
249 249
250 ~JSONArray() override; 250 ~JSONArray() override;
251 251
252 void writeJSON(StringBuilder* output) const override; 252 void writeJSON(StringBuilder* output) const override;
253 253
254 void pushBoolean(bool); 254 void pushBoolean(bool);
255 void pushInt(int); 255 void pushInt(int);
(...skipping 18 matching lines...) Expand all
274 JSONArray(); 274 JSONArray();
275 Vector<RefPtr<JSONValue>> m_data; 275 Vector<RefPtr<JSONValue>> m_data;
276 }; 276 };
277 277
278 PLATFORM_EXPORT void escapeStringForJSON(const String&, StringBuilder*); 278 PLATFORM_EXPORT void escapeStringForJSON(const String&, StringBuilder*);
279 void doubleQuoteStringForJSON(const String&, StringBuilder*); 279 void doubleQuoteStringForJSON(const String&, StringBuilder*);
280 280
281 } // namespace blink 281 } // namespace blink
282 282
283 #endif // JSONValues_h 283 #endif // JSONValues_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/DecimalTest.cpp ('k') | third_party/WebKit/Source/platform/JSONValues.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698