83 #ifndef AWS_JSON_AMALGATED_H_INCLUDED 84 # define AWS_JSON_AMALGATED_H_INCLUDED 85 #define AWS_JSON_IS_AMALGAMATION 96 #ifndef AWS_JSON_VERSION_H_INCLUDED 97 # define AWS_JSON_VERSION_H_INCLUDED 99 # define AWS_JSONCPP_VERSION_STRING "1.4.0" 100 # define AWS_JSONCPP_VERSION_MAJOR 1 101 # define AWS_JSONCPP_VERSION_MINOR 4 102 # define AWS_JSONCPP_VERSION_PATCH 0 103 # define AWS_JSONCPP_VERSION_QUALIFIER 104 # define AWS_JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8)) 106 #endif // AWS_JSON_VERSION_H_INCLUDED 126 #ifndef AWS_JSON_CONFIG_H_INCLUDED 127 #define AWS_JSON_CONFIG_H_INCLUDED 152 #ifndef JSON_USE_EXCEPTION 153 #define JSON_USE_EXCEPTION 1 161 #ifdef AWS_JSON_IN_CPPTL 162 #include <cpptl/config.h> 163 #ifndef AWS_JSON_USE_CPPTL 164 #define AWS_JSON_USE_CPPTL 1 168 #ifdef AWS_JSON_IN_CPPTL 169 #define AWS_JSON_API CPPTL_API 170 #elif defined(USE_IMPORT_EXPORT) 172 #ifdef AWS_CORE_EXPORTS 173 #define AWS_JSON_API __declspec(dllexport) 174 #define AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING 176 #define AWS_JSON_API __declspec(dllimport) 177 #define AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING 178 #endif // AWS_CORE_EXPORTS 179 #endif // if defined(_MSC_VER) 180 #endif // ifdef AWS_JSON_IN_CPPTL 181 #if !defined(AWS_JSON_API) 190 #if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6 193 #define AWS_JSON_USE_INT64_DOUBLE_CONVERSION 1 198 #pragma warning(disable : 4786) 199 #endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6 201 #if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008 202 #define AWS_JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) 204 #pragma warning(disable : 4267) 205 #pragma warning(disable : 4512) 208 #if !defined(AWS_JSONCPP_DEPRECATED) 209 #define AWS_JSONCPP_DEPRECATED(message) 210 #endif // if !defined(AWS_JSONCPP_DEPRECATED) 217 #if defined(AWS_JSON_NO_INT64) 220 #undef AWS_JSON_HAS_INT64 221 #else // if defined(AWS_JSON_NO_INT64) 223 #if defined(_MSC_VER) // Microsoft Visual Studio 224 typedef __int64
Int64;
225 typedef unsigned __int64
UInt64;
226 #else // if defined(_MSC_VER) // Other platforms, use long long 229 #endif // if defined(_MSC_VER) 232 #define AWS_JSON_HAS_INT64 233 #endif // if defined(AWS_JSON_NO_INT64) 238 #endif // AWS_JSON_CONFIG_H_INCLUDED 258 #ifndef AWS_JSON_FORWARDS_H_INCLUDED 259 #define AWS_JSON_FORWARDS_H_INCLUDED 261 #if !defined(AWS_JSON_IS_AMALGAMATION) 263 #endif // if !defined(AWS_JSON_IS_AMALGAMATION) 288 #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 289 class ValueMapAllocator;
290 class ValueInternalLink;
291 class ValueInternalArray;
292 class ValueInternalMap;
293 #endif // #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 299 #endif // AWS_JSON_FORWARDS_H_INCLUDED 319 #ifndef AWS_CPPTL_JSON_FEATURES_H_INCLUDED 320 #define AWS_CPPTL_JSON_FEATURES_H_INCLUDED 322 #if !defined(AWS_JSON_IS_AMALGAMATION) 323 #include <forwards.h> 324 #endif // if !defined(AWS_JSON_IS_AMALGAMATION) 374 #endif // AWS_CPPTL_JSON_FEATURES_H_INCLUDED 394 #ifndef AWS_CPPTL_JSON_H_INCLUDED 395 #define AWS_CPPTL_JSON_H_INCLUDED 397 #if !defined(AWS_JSON_IS_AMALGAMATION) 398 #include <forwards.h> 399 #endif // if !defined(AWS_JSON_IS_AMALGAMATION) 408 #ifndef AWS_JSON_USE_CPPTL_SMALLMAP 411 #include <cpptl/smallmap.h> 413 #ifdef AWS_JSON_USE_CPPTL 414 #include <cpptl/forwards.h> 419 #if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 420 #pragma warning(push) 421 #pragma warning(disable : 4251) 422 #endif // if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 474 operator const char*()
const {
return str_; }
476 const char*
c_str()
const {
return str_; }
513 #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 514 friend class ValueInternalLink;
515 friend class ValueInternalMap;
523 #if defined(AWS_JSON_HAS_INT64) 526 #endif // defined(AWS_JSON_HAS_INT64) 546 #if defined(AWS_JSON_HAS_INT64) 547 static const Int64 minInt64;
553 #endif // defined(AWS_JSON_HAS_INT64) 556 #ifndef AWS_JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 557 #ifndef AWS_JSON_VALUE_USE_INTERNAL_MAP 560 enum DuplicationPolicy {
565 CZString(ArrayIndex index);
566 CZString(
const char* cstr, DuplicationPolicy allocate);
567 CZString(
const CZString& other);
569 CZString& operator=(CZString other);
570 bool operator<(
const CZString& other)
const;
571 bool operator==(
const CZString& other)
const;
572 ArrayIndex index()
const;
573 const char* c_str()
const;
574 bool isStaticString()
const;
577 void swap(CZString& other);
583 #ifndef AWS_JSON_USE_CPPTL_SMALLMAP 586 typedef CppTL::SmallMap<CZString, Value> ObjectValues;
587 #endif // ifndef AWS_JSON_USE_CPPTL_SMALLMAP 588 #endif // ifndef AWS_JSON_VALUE_USE_INTERNAL_MAP 589 #endif // ifndef AWS_JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 610 #if defined(AWS_JSON_HAS_INT64) 613 #endif // if defined(AWS_JSON_HAS_INT64) 615 Value(
const char* value);
616 Value(
const char* beginValue,
const char* endValue);
629 #ifdef AWS_JSON_USE_CPPTL 630 Value(
const CppTL::ConstString& value);
640 void swap(
Value& other);
642 void swapPayload(
Value& other);
647 bool operator<(
const Value& other)
const;
648 bool operator<=(
const Value& other)
const;
649 bool operator>=(
const Value& other)
const;
650 bool operator>(
const Value& other)
const;
651 bool operator==(
const Value& other)
const;
652 bool operator!=(
const Value& other)
const;
653 int compare(
const Value& other)
const;
655 const char* asCString()
const;
657 #ifdef AWS_JSON_USE_CPPTL 658 CppTL::ConstString asConstString()
const;
662 #if defined(AWS_JSON_HAS_INT64) 663 Int64 asInt64()
const;
664 UInt64 asUInt64()
const;
665 #endif // if defined(AWS_JSON_HAS_INT64) 666 LargestInt asLargestInt()
const;
667 LargestUInt asLargestUInt()
const;
668 float asFloat()
const;
669 double asDouble()
const;
675 bool isInt64()
const;
677 bool isUInt64()
const;
678 bool isIntegral()
const;
679 bool isDouble()
const;
680 bool isNumeric()
const;
681 bool isString()
const;
682 bool isArray()
const;
683 bool isObject()
const;
685 bool isConvertibleTo(
ValueType other)
const;
688 ArrayIndex size()
const;
695 bool operator!()
const;
707 void resize(ArrayIndex size);
715 Value& operator[](ArrayIndex index);
723 Value& operator[](
int index);
728 const Value& operator[](ArrayIndex index)
const;
733 const Value& operator[](
int index)
const;
738 Value get(ArrayIndex index,
const Value& defaultValue)
const;
740 bool isValidIndex(ArrayIndex index)
const;
747 Value& operator[](
const char* key);
750 const Value& operator[](
const char* key)
const;
769 #ifdef AWS_JSON_USE_CPPTL 770 Value& operator[](
const CppTL::ConstString& key);
774 const Value& operator[](
const CppTL::ConstString& key)
const;
776 Value get(
const char* key,
const Value& defaultValue)
const;
780 #ifdef AWS_JSON_USE_CPPTL 781 Value get(
const CppTL::ConstString& key,
const Value& defaultValue)
const;
784 Value removeMember(
const char* key);
800 bool removeMember(
const char* key,
Value* removed);
807 bool removeIndex(ArrayIndex i,
Value* removed);
810 bool isMember(
const char* key)
const;
813 #ifdef AWS_JSON_USE_CPPTL 814 bool isMember(
const CppTL::ConstString& key)
const;
823 Members getMemberNames()
const;
833 void setComment(
const char* comment,
size_t len,
CommentPlacement placement);
842 const_iterator begin()
const;
843 const_iterator end()
const;
850 void setOffsetStart(
size_t start);
851 void setOffsetLimit(
size_t limit);
852 size_t getOffsetStart()
const;
853 size_t getOffsetLimit()
const;
856 void initBasic(
ValueType type,
bool allocated =
false);
858 Value& resolveReference(
const char* key,
bool isStatic);
860 #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 861 inline bool isItemAvailable()
const {
return itemIsUsed_ == 0; }
863 inline void setItemUsed(
bool isUsed =
true) { itemIsUsed_ = isUsed ? 1 : 0; }
865 inline bool isMemberNameStatic()
const {
return memberNameIsStatic_ == 0; }
867 inline void setMemberNameIsStatic(
bool isStatic) {
868 memberNameIsStatic_ = isStatic ? 1 : 0;
870 #endif // # ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 877 void setComment(
const char* text,
size_t len);
897 #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 898 ValueInternalArray* array_;
899 ValueInternalMap* map_;
905 unsigned int allocated_ : 1;
906 #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 907 unsigned int itemIsUsed_ : 1;
908 unsigned int memberNameIsStatic_ : 1;
910 CommentInfo* comments_;
961 const Value& resolve(
const Value& root)
const;
971 void makePath(
const Aws::String& path,
const InArgs& in);
974 InArgs::const_iterator& itInArg,
975 PathArgument::Kind kind);
976 void invalidPath(
const Aws::String& path,
int location);
981 #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 1029 virtual ~ValueMapAllocator();
1030 virtual ValueInternalMap* newMap() = 0;
1031 virtual ValueInternalMap* newMapCopy(
const ValueInternalMap& other) = 0;
1032 virtual void destructMap(ValueInternalMap* map) = 0;
1033 virtual ValueInternalLink* allocateMapBuckets(
unsigned int size) = 0;
1034 virtual void releaseMapBuckets(ValueInternalLink* links) = 0;
1035 virtual ValueInternalLink* allocateMapLink() = 0;
1036 virtual void releaseMapLink(ValueInternalLink* link) = 0;
1047 enum InternalFlags {
1052 ValueInternalLink();
1054 ~ValueInternalLink();
1056 Value items_[itemPerLink];
1057 char* keys_[itemPerLink];
1058 ValueInternalLink* previous_;
1059 ValueInternalLink* next_;
1084 typedef unsigned int HashKey;
1085 typedef unsigned int BucketIndex;
1087 #ifndef AWS_JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 1088 struct IteratorState {
1089 IteratorState() : map_(0), link_(0), itemIndex_(0), bucketIndex_(0) {}
1090 ValueInternalMap* map_;
1091 ValueInternalLink* link_;
1092 BucketIndex itemIndex_;
1093 BucketIndex bucketIndex_;
1095 #endif // ifndef AWS_JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 1098 ValueInternalMap(
const ValueInternalMap& other);
1099 ValueInternalMap& operator=(ValueInternalMap other);
1100 ~ValueInternalMap();
1102 void swap(ValueInternalMap& other);
1104 BucketIndex size()
const;
1108 bool reserveDelta(BucketIndex growth);
1110 bool reserve(BucketIndex newItemCount);
1112 const Value* find(
const char* key)
const;
1114 Value* find(
const char* key);
1116 Value& resolveReference(
const char* key,
bool isStatic);
1118 void remove(
const char* key);
1120 void doActualRemove(ValueInternalLink* link,
1122 BucketIndex bucketIndex);
1124 ValueInternalLink*& getLastLinkInBucket(BucketIndex bucketIndex);
1126 Value& setNewItem(
const char* key,
1128 ValueInternalLink* link,
1131 Value& unsafeAdd(
const char* key,
bool isStatic, HashKey hashedKey);
1133 HashKey hash(
const char* key)
const;
1135 int compare(
const ValueInternalMap& other)
const;
1138 void makeBeginIterator(IteratorState& it)
const;
1139 void makeEndIterator(IteratorState& it)
const;
1140 static bool equals(
const IteratorState& x,
const IteratorState& other);
1141 static void increment(IteratorState& iterator);
1142 static void incrementBucket(IteratorState& iterator);
1143 static void decrement(IteratorState& iterator);
1144 static const char* key(
const IteratorState& iterator);
1145 static const char* key(
const IteratorState& iterator,
bool& isStatic);
1146 static Value& value(
const IteratorState& iterator);
1147 static int distance(
const IteratorState& x,
const IteratorState& y);
1150 ValueInternalLink* buckets_;
1151 ValueInternalLink* tailLink_;
1152 BucketIndex bucketsSize_;
1153 BucketIndex itemCount_;
1179 typedef unsigned int PageIndex;
1181 #ifndef AWS_JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 1182 struct IteratorState
1184 IteratorState() : array_(0), currentPageIndex_(0), currentItemIndex_(0) {}
1185 ValueInternalArray* array_;
1186 Value** currentPageIndex_;
1187 unsigned int currentItemIndex_;
1189 #endif // ifndef AWS_JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 1191 ValueInternalArray();
1192 ValueInternalArray(
const ValueInternalArray& other);
1193 ValueInternalArray& operator=(ValueInternalArray other);
1194 ~ValueInternalArray();
1195 void swap(ValueInternalArray& other);
1198 void resize(ArrayIndex newSize);
1200 Value& resolveReference(ArrayIndex index);
1202 Value* find(ArrayIndex index)
const;
1204 ArrayIndex size()
const;
1206 int compare(
const ValueInternalArray& other)
const;
1209 static bool equals(
const IteratorState& x,
const IteratorState& other);
1210 static void increment(IteratorState& iterator);
1211 static void decrement(IteratorState& iterator);
1212 static Value& dereference(
const IteratorState& iterator);
1213 static Value& unsafeDereference(
const IteratorState& iterator);
1214 static int distance(
const IteratorState& x,
const IteratorState& y);
1215 static ArrayIndex indexOf(
const IteratorState& iterator);
1216 void makeBeginIterator(IteratorState& it)
const;
1217 void makeEndIterator(IteratorState& it)
const;
1218 void makeIterator(IteratorState& it, ArrayIndex index)
const;
1220 void makeIndexValid(ArrayIndex index);
1224 PageIndex pageCount_;
1292 virtual ~ValueArrayAllocator();
1293 virtual ValueInternalArray* newArray() = 0;
1294 virtual ValueInternalArray* newArrayCopy(
const ValueInternalArray& other) = 0;
1295 virtual void destructArray(ValueInternalArray* array) = 0;
1309 reallocateArrayPageIndex(
Value**& indexes,
1310 ValueInternalArray::PageIndex& indexCount,
1311 ValueInternalArray::PageIndex minNewIndexCount) = 0;
1313 releaseArrayPageIndex(
Value** indexes,
1314 ValueInternalArray::PageIndex indexCount) = 0;
1315 virtual Value* allocateArrayPage() = 0;
1316 virtual void releaseArrayPage(
Value* value) = 0;
1318 #endif // #ifdef AWS_JSON_VALUE_USE_INTERNAL_MAP 1331 #ifndef AWS_JSON_VALUE_USE_INTERNAL_MAP 1338 bool operator==(
const SelfType& other)
const {
return isEqual(other); }
1340 bool operator!=(
const SelfType& other)
const {
return !isEqual(other); }
1343 return computeDistance(other);
1355 const char* memberName()
const;
1358 Value& deref()
const;
1364 difference_type computeDistance(
const SelfType& other)
const;
1366 bool isEqual(
const SelfType& other)
const;
1368 void copy(
const SelfType& other);
1371 #ifndef AWS_JSON_VALUE_USE_INTERNAL_MAP 1372 Value::ObjectValues::iterator current_;
1377 ValueInternalArray::IteratorState array_;
1378 ValueInternalMap::IteratorState map_;
1403 #ifndef AWS_JSON_VALUE_USE_INTERNAL_MAP 1413 SelfType temp(*
this);
1419 SelfType temp(*
this);
1459 #ifndef AWS_JSON_VALUE_USE_INTERNAL_MAP 1460 explicit ValueIterator(
const Value::ObjectValues::iterator& current);
1462 ValueIterator(
const ValueInternalArray::IteratorState& state);
1463 ValueIterator(
const ValueInternalMap::IteratorState& state);
1466 SelfType& operator=(
const SelfType& other);
1469 SelfType temp(*
this);
1475 SelfType temp(*
this);
1506 #if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1507 #pragma warning(pop) 1508 #endif // if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1510 #endif // AWS_CPPTL_JSON_H_INCLUDED 1530 #ifndef AWS_CPPTL_JSON_READER_H_INCLUDED 1531 #define AWS_CPPTL_JSON_READER_H_INCLUDED 1533 #if !defined(AWS_JSON_IS_AMALGAMATION) 1534 #include <features.h> 1536 #endif // if !defined(AWS_JSON_IS_AMALGAMATION) 1540 #if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1541 #pragma warning(push) 1542 #pragma warning(disable : 4251) 1543 #endif // if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1546 namespace External {
1595 parse(
const Aws::String& document,
Value& root,
bool collectComments =
true);
1615 bool parse(
const char* beginDoc,
1618 bool collectComments =
true);
1634 Aws::
String getFormatedErrorMessages() const;
1644 Aws::
String getFormattedErrorMessages() const;
1680 tokenEndOfStream = 0,
1690 tokenArraySeparator,
1691 tokenMemberSeparator,
1712 bool readToken(Token& token);
1714 bool match(Location pattern,
int patternLength);
1716 bool readCStyleComment();
1717 bool readCppStyleComment();
1721 bool readObject(Token& token);
1722 bool readArray(Token& token);
1723 bool decodeNumber(Token& token);
1724 bool decodeNumber(Token& token,
Value& decoded);
1725 bool decodeString(Token& token);
1726 bool decodeString(Token& token,
Aws::String& decoded);
1727 bool decodeDouble(Token& token);
1728 bool decodeDouble(Token& token,
Value& decoded);
1729 bool decodeUnicodeCodePoint(Token& token,
1732 unsigned int& unicode);
1733 bool decodeUnicodeEscapeSequence(Token& token,
1736 unsigned int& unicode);
1737 bool addError(
const Aws::String& message, Token& token, Location extra = 0);
1738 bool recoverFromError(TokenType skipUntilToken);
1739 bool addErrorAndRecover(
const Aws::String& message,
1741 TokenType skipUntilToken);
1742 void skipUntilSpace();
1743 Value& currentValue();
1746 getLocationLineAndColumn(Location location,
int& line,
int& column)
const;
1747 Aws::String getLocationLineAndColumn(Location location)
const;
1749 void skipCommentTokens(Token& token);
1758 Location lastValueEnd_;
1762 bool collectComments_;
1795 #if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1796 #pragma warning(pop) 1797 #endif // if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1799 #endif // AWS_CPPTL_JSON_READER_H_INCLUDED 1819 #ifndef AWS_JSON_WRITER_H_INCLUDED 1820 #define AWS_JSON_WRITER_H_INCLUDED 1822 #if !defined(AWS_JSON_IS_AMALGAMATION) 1824 #endif // if !defined(AWS_JSON_IS_AMALGAMATION) 1828 #if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1829 #pragma warning(push) 1830 #pragma warning(disable : 4251) 1831 #endif // if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 1834 namespace External {
1869 virtual int write(
Value const& root) = 0;
1961 : dropNullPlaceholders_(false)
1962 , omitEndingLineFeed_(false)
1963 , enableYAMLCompatibility_(false)
1992 void enableYAMLCompatibility();
1999 void dropNullPlaceholders();
2001 void omitEndingLineFeed();
2007 void writeValue(
const Value& value);
2010 bool yamlCompatiblityEnabled_;
2011 bool dropNullPlaceholders_;
2012 bool omitEndingLineFeed_;
2052 void writeValue(
const Value& value);
2053 void writeArrayValue(
const Value& value);
2054 bool isMultineArray(
const Value& value);
2060 void writeCommentBeforeValue(
const Value& root);
2061 void writeCommentAfterValueOnSameLine(
const Value& root);
2062 bool hasCommentForValue(
const Value& value);
2067 ChildValues childValues_;
2072 bool addChildValues_;
2116 void writeValue(
const Value& value);
2117 void writeArrayValue(
const Value& value);
2118 bool isMultineArray(
const Value& value);
2124 void writeCommentBeforeValue(
const Value& root);
2125 void writeCommentAfterValueOnSameLine(
const Value& root);
2126 bool hasCommentForValue(
const Value& value);
2131 ChildValues childValues_;
2136 bool addChildValues_ : 1;
2140 #if defined(AWS_JSON_HAS_INT64) 2143 #endif // if defined(AWS_JSON_HAS_INT64) 2158 #if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 2159 #pragma warning(pop) 2160 #endif // if defined(AWS_JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 2162 #endif // AWS_JSON_WRITER_H_INCLUDED 2182 #ifndef AWS_CPPTL_JSON_ASSERTIONS_H_INCLUDED 2183 #define AWS_CPPTL_JSON_ASSERTIONS_H_INCLUDED 2188 #if !defined(AWS_JSON_IS_AMALGAMATION) 2190 #endif // if !defined(AWS_JSON_IS_AMALGAMATION) 2192 #if JSON_USE_EXCEPTION 2193 #include <stdexcept> 2194 #define AWS_JSON_ASSERT(condition) \ 2195 assert(condition); // @todo <= change this into an exception throw 2196 #define AWS_JSON_FAIL_MESSAGE(message) do{Aws::OStringStream oss; oss << message; throw std::runtime_error(oss.str());}while(0) 2198 #else // JSON_USE_EXCEPTION 2199 #define AWS_JSON_ASSERT(condition) assert(condition); 2203 #define AWS_JSON_FAIL_MESSAGE(message) \ 2205 Aws::OStringStream oss; \ 2207 assert(false && oss.str().c_str()); \ 2214 #define AWS_JSON_ASSERT_MESSAGE(condition, message) \ 2215 if (!(condition)) { \ 2216 AWS_JSON_FAIL_MESSAGE(message); \ 2219 #endif // AWS_CPPTL_JSON_ASSERTIONS_H_INCLUDED 2229 #endif //ifndef AWS_JSON_AMALGATED_H_INCLUDED Aws::String AWS_JSON_API valueToQuotedString(const char *value)
CommentStyle
Decide whether to write comments.
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
const char * c_str() const
Experimental and untested: represents an element of the "path" to access a node.
void swap(Aws::External::Json::Value &a, Aws::External::Json::Value &b)
Specialize std::swap() for Json::Value.
Configuration passed to reader and writer. This configuration object can be used to force the Reader ...
difference_type operator-(const SelfType &other) const
ValueConstIterator const_iterator
Writes a Value in JSON format in a human friendly way.
#define AWS_JSONCPP_DEPRECATED(message)
bool omitEndingLineFeed_
Do not add at end of document. Normally, we add an extra newline, just because. ...
bool dropNullPlaceholders_
Drop the "null" string from the writer's output for nullValues. Strictly speaking, this is not valid JSON. But when the output is being fed to a browser's Javascript, it makes for smaller output and the browser can handle the output just fine.
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string...
a comment placed on the line before a value
bool enableYAMLCompatibility_
Add a space after ':'. If indentation is non-empty, we surround colon with whitespace, e.g. " : " This will add back the trailing space when there is no indentation. This seems dubious when the entire document is on a single line, but we leave this here to repduce the behavior of the old FastWriter.
bool operator!=(const SelfType &other) const
std::vector< T, Aws::Allocator< T > > Vector
std::bidirectional_iterator_tag iterator_category
unsigned long long int UInt64
std::map< K, V, std::less< K >, Aws::Allocator< std::pair< const K, V > > > Map
ValueConstIterator SelfType
Iterator for object and array value.
std::basic_istream< char, std::char_traits< char > > IStream
Json::ArrayIndex ArrayIndex
Outputs a Value in JSON format without formatting (not human friendly).
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
bool allowComments_
true if comments are allowed. Default: true.
a comment just after a value on the same line
Aws::Vector< Aws::String > Members
array value (ordered list)
const iterator for object and array value.
Json::LargestUInt LargestUInt
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
A simple abstract factory.
pointer operator->() const
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
Aws::String writeString(Value const &root, StreamWriter::Factory const &factory)
Write into stringstream, then return string, for convenience.
Lightweight wrapper to tag static string.
base class for Value iterators.
Aws::String AWS_JSON_API valueToString(Int value)
std::basic_ostream< char, std::char_traits< char > > OStream
OldCompressingStreamWriterBuilder()
An error tagged with where in the JSON text it was encountered.
AWS_JSON_API Aws::OStream & operator<<(Aws::OStream &, const Value &root)
Output using the StyledStreamWriter.
Aws::String indentation_
Write in human-friendly style.
std::deque< T, Aws::Allocator< T > > Deque
Aws::Map< CZString, Value > ObjectValues
static const LargestInt minLargestInt
Minimum signed integer value that can be stored in a Json::Value.
AWS_JSON_API Aws::IStream & operator>>(Aws::IStream &, Value &)
Read from 'sin' into 'root'.
reference operator*() const
Experimental and untested: represents a "path" to access a node.
std::stack< T, Deque< T > > Stack
reference operator*() const
Json::LargestInt LargestInt
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
static const Value & null
bool operator==(const SelfType &other) const
StreamWriter::CommentStyle cs_
How to write comments. Default: All.
Build a StreamWriter implementation. Comments are not written, and most whitespace is omitted...
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
object value (collection of name/value pairs).
bool allowNumericKeys_
true if numeric object key are allowed. Default: false.
bool allowDroppedNullPlaceholders_
true if dropped null placeholders are allowed. Default: false.
ValueIteratorBase SelfType
pointer operator->() const
StaticString(const char *czstring)
ValueType
Type of the value held by a Value object.
Abstract class for writers.
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
Build a StreamWriter implementation.
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
JSON (JavaScript Object Notation).
void swap(Value &other)
Swap everything.
Unserialize a JSON document into a Value.