Skip to content

Commit b441568

Browse files
committed
std::string -> String
1 parent 9c89807 commit b441568

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

include/json/thing.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Then we will move the Exceptions, Iterators, and Paths here too.
66
* For now, we are working on the API we *want*.
77
*/
8-
#include <string>
98
#include <vector>
109

1110
// Disable warning C4251: <data member>: <type> needs to have dll-interface to
@@ -53,9 +52,10 @@ namespace Json {
5352
* but the Value API does *not* check bounds. That is the responsibility
5453
* of the caller.
5554
*/
55+
template <String>
5656
class JSON_API Thing {
5757
public:
58-
typedef std::vector<std::string> Members;
58+
typedef std::vector<String> Members;
5959
//typedef ThingIterator iterator;
6060
//typedef ThingConstIterator const_iterator;
6161

@@ -129,7 +129,7 @@ Json::Thing obj_value(Json::objectThing); // {}
129129
* \endcode
130130
*/
131131
Thing(const StaticString& value);
132-
Thing(const std::string& value); ///< Copy data() til size(). Embedded zeroes too.
132+
Thing(const String& value); ///< Copy data() til size(). Embedded zeroes too.
133133
Thing(bool value);
134134
/// Deep copy.
135135
Thing(const Thing& other);
@@ -159,7 +159,7 @@ Json::Thing obj_value(Json::objectThing); // {}
159159
int compare(const Thing& other) const;
160160

161161
const char* asCString() const; ///< Embedded zeroes could cause you trouble!
162-
std::string asString() const; ///< Embedded zeroes are possible.
162+
String asString() const; ///< Embedded zeroes are possible.
163163
/** Get raw char* of string-value.
164164
* \return false if !string. (Seg-fault if str or end are NULL.)
165165
*/
@@ -260,11 +260,11 @@ Json::Thing obj_value(Json::objectThing); // {}
260260
const Thing& operator[](const char* key) const;
261261
/// Access an object value by name, create a null member if it does not exist.
262262
/// \param key may contain embedded nulls.
263-
Thing& operator[](const std::string& key);
263+
Thing& operator[](const String& key);
264264
/// Access an object value by name, returns null if there is no member with
265265
/// that name.
266266
/// \param key may contain embedded nulls.
267-
const Thing& operator[](const std::string& key) const;
267+
const Thing& operator[](const String& key) const;
268268
/** \brief Access an object value by name, create a null member if it does not
269269
exist.
270270
@@ -288,7 +288,7 @@ Json::Thing obj_value(Json::objectThing); // {}
288288
/// Return the member named key if it exist, defaultThing otherwise.
289289
/// \note deep copy
290290
/// \param key may contain embedded nulls.
291-
Thing get(const std::string& key, const Thing& defaultThing) const;
291+
Thing get(const String& key, const Thing& defaultThing) const;
292292
/// Most general and efficient version of isMember()const, get()const,
293293
/// and operator[]const
294294
/// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30
@@ -308,7 +308,7 @@ Json::Thing obj_value(Json::objectThing); // {}
308308
/// Same as removeMember(const char*)
309309
/// \param key may contain embedded nulls.
310310
/// \deprecated
311-
Thing removeMember(const std::string& key);
311+
Thing removeMember(const String& key);
312312
/// Same as removeMember(const char* begin, const char* end, Thing* removed),
313313
/// but 'key' is null-terminated.
314314
bool removeMember(const char* key, Thing* removed);
@@ -318,8 +318,8 @@ Json::Thing obj_value(Json::objectThing); // {}
318318
\param key may contain embedded nulls.
319319
\return true iff removed (no exceptions)
320320
*/
321-
bool removeMember(std::string const& key, Thing* removed);
322-
/// Same as removeMember(std::string const& key, Thing* removed)
321+
bool removeMember(String const& key, Thing* removed);
322+
/// Same as removeMember(String const& key, Thing* removed)
323323
bool removeMember(const char* begin, const char* end, Thing* removed);
324324
/** \brief Remove the indexed array element.
325325
@@ -334,8 +334,8 @@ Json::Thing obj_value(Json::objectThing); // {}
334334
bool isMember(const char* key) const;
335335
/// Return true if the object has a member named key.
336336
/// \param key may contain embedded nulls.
337-
bool isMember(const std::string& key) const;
338-
/// Same as isMember(std::string const& key)const
337+
bool isMember(const String& key) const;
338+
/// Same as isMember(String const& key)const
339339
bool isMember(const char* begin, const char* end) const;
340340

341341
/// \brief Return a list of the member names.
@@ -346,17 +346,17 @@ Json::Thing obj_value(Json::objectThing); // {}
346346
Members getMemberNames() const;
347347

348348
/// \deprecated Always pass len.
349-
JSONCPP_DEPRECATED("Use setComment(std::string const&) instead.")
349+
JSONCPP_DEPRECATED("Use setComment(String const&) instead.")
350350
void setComment(const char* comment, CommentPlacement placement);
351351
/// Comments must be //... or /* ... */
352352
void setComment(const char* comment, size_t len, CommentPlacement placement);
353353
/// Comments must be //... or /* ... */
354-
void setComment(const std::string& comment, CommentPlacement placement);
354+
void setComment(const String& comment, CommentPlacement placement);
355355
bool hasComment(CommentPlacement placement) const;
356356
/// Include delimiters and embedded newlines.
357-
std::string getComment(CommentPlacement placement) const;
357+
String getComment(CommentPlacement placement) const;
358358

359-
std::string toStyledString() const;
359+
String toStyledString() const;
360360

361361
const_iterator begin() const;
362362
const_iterator end() const;

0 commit comments

Comments
 (0)