mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-15 15:16:47 +02:00
use SwapPayload() to retain comments
All tests pass, but we might be missing coverage. issue #47
This commit is contained in:
@@ -235,23 +235,26 @@ Json::Value obj_value(Json::objectValue); // {}
|
||||
Value(const CppTL::ConstString& value);
|
||||
#endif
|
||||
Value(bool value);
|
||||
/// Deep copy.
|
||||
Value(const Value& other);
|
||||
~Value();
|
||||
|
||||
// Deep copy, then swap(other).
|
||||
Value& operator=(Value other);
|
||||
/// Swap values.
|
||||
/// Swap everything.
|
||||
void swap(Value& other);
|
||||
/// Swap values but leave comments and source offsets in place.
|
||||
void swapPayload(Value& other);
|
||||
|
||||
ValueType type() const;
|
||||
|
||||
/// Compare payload only, not comments etc.
|
||||
bool operator<(const Value& other) const;
|
||||
bool operator<=(const Value& other) const;
|
||||
bool operator>=(const Value& other) const;
|
||||
bool operator>(const Value& other) const;
|
||||
|
||||
bool operator==(const Value& other) const;
|
||||
bool operator!=(const Value& other) const;
|
||||
|
||||
int compare(const Value& other) const;
|
||||
|
||||
const char* asCString() const;
|
||||
@@ -442,9 +445,6 @@ private:
|
||||
|
||||
Value& resolveReference(const char* key, bool isStatic);
|
||||
|
||||
/// Swap values but leave comments and source offsets in place.
|
||||
void swapPayload(Value& other);
|
||||
|
||||
#ifdef JSON_VALUE_USE_INTERNAL_MAP
|
||||
inline bool isItemAvailable() const { return itemIsUsed_ == 0; }
|
||||
|
||||
|
Reference in New Issue
Block a user