Go to the documentation of this file.
75 #ifndef JSON_AMALGATED_H_INCLUDED
76 # define JSON_AMALGATED_H_INCLUDED
77 #define JSON_IS_AMALGAMATION
87 #ifndef JSON_VERSION_H_INCLUDED
88 # define JSON_VERSION_H_INCLUDED
90 # define JSONCPP_VERSION_STRING "1.6.5"
91 # define JSONCPP_VERSION_MAJOR 1
92 # define JSONCPP_VERSION_MINOR 6
93 # define JSONCPP_VERSION_PATCH 5
94 # define JSONCPP_VERSION_QUALIFIER
95 # define JSONCPP_VERSION_HEXA ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | (JSONCPP_VERSION_PATCH << 8))
97 #endif // JSON_VERSION_H_INCLUDED
117 #ifndef JSON_CONFIG_H_INCLUDED
118 #define JSON_CONFIG_H_INCLUDED
132 #ifndef JSON_USE_EXCEPTION
133 #define JSON_USE_EXCEPTION 1
142 #include <cpptl/config.h>
143 #ifndef JSON_USE_CPPTL
144 #define JSON_USE_CPPTL 1
149 #define JSON_API CPPTL_API
150 #elif defined(JSON_DLL_BUILD)
151 #if defined(_MSC_VER)
152 #define JSON_API __declspec(dllexport)
153 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
154 #endif // if defined(_MSC_VER)
155 #elif defined(JSON_DLL)
156 #if defined(_MSC_VER)
157 #define JSON_API __declspec(dllimport)
158 #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING
159 #endif // if defined(_MSC_VER)
160 #endif // ifdef JSON_IN_CPPTL
161 #if !defined(JSON_API)
170 #if defined(_MSC_VER) // MSVC
171 # if _MSC_VER <= 1200 // MSVC 6
174 # define JSON_USE_INT64_DOUBLE_CONVERSION 1
179 # pragma warning(disable : 4786)
182 # if _MSC_VER >= 1500 // MSVC 2008
183 # define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
187 #endif // defined(_MSC_VER)
190 #ifndef JSON_HAS_RVALUE_REFERENCES
192 #if defined(_MSC_VER) && _MSC_VER >= 1600 // MSVC >= 2010
193 #define JSON_HAS_RVALUE_REFERENCES 1
194 #endif // MSVC >= 2010
197 #if __has_feature(cxx_rvalue_references)
198 #define JSON_HAS_RVALUE_REFERENCES 1
199 #endif // has_feature
201 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
202 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L)
203 #define JSON_HAS_RVALUE_REFERENCES 1
204 #endif // GXX_EXPERIMENTAL
206 #endif // __clang__ || __GNUC__
208 #endif // not defined JSON_HAS_RVALUE_REFERENCES
210 #ifndef JSON_HAS_RVALUE_REFERENCES
211 #define JSON_HAS_RVALUE_REFERENCES 0
215 #elif defined __GNUC__ // not clang (gcc comes later since clang emulates gcc)
216 # if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
217 # define JSONCPP_DEPRECATED(message) __attribute__ ((deprecated(message)))
218 # elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
219 # define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__))
220 # endif // GNUC version
221 #endif // __clang__ || __GNUC__
223 #if !defined(JSONCPP_DEPRECATED)
224 #define JSONCPP_DEPRECATED(message)
225 #endif // if !defined(JSONCPP_DEPRECATED)
230 #if defined(JSON_NO_INT64)
233 #undef JSON_HAS_INT64
234 #else // if defined(JSON_NO_INT64)
236 #if defined(_MSC_VER) // Microsoft Visual Studio
237 typedef __int64
Int64;
238 typedef unsigned __int64
UInt64;
239 #else // if defined(_MSC_VER) // Other platforms, use long long
242 #endif // if defined(_MSC_VER)
245 #define JSON_HAS_INT64
246 #endif // if defined(JSON_NO_INT64)
249 #endif // JSON_CONFIG_H_INCLUDED
269 #ifndef JSON_FORWARDS_H_INCLUDED
270 #define JSON_FORWARDS_H_INCLUDED
272 #if !defined(JSON_IS_AMALGAMATION)
274 #endif // if !defined(JSON_IS_AMALGAMATION)
300 #endif // JSON_FORWARDS_H_INCLUDED
320 #ifndef CPPTL_JSON_FEATURES_H_INCLUDED
321 #define CPPTL_JSON_FEATURES_H_INCLUDED
323 #if !defined(JSON_IS_AMALGAMATION)
325 #endif // if !defined(JSON_IS_AMALGAMATION)
371 #endif // CPPTL_JSON_FEATURES_H_INCLUDED
391 #ifndef CPPTL_JSON_H_INCLUDED
392 #define CPPTL_JSON_H_INCLUDED
394 #if !defined(JSON_IS_AMALGAMATION)
396 #endif // if !defined(JSON_IS_AMALGAMATION)
401 #ifndef JSON_USE_CPPTL_SMALLMAP
404 #include <cpptl/smallmap.h>
406 #ifdef JSON_USE_CPPTL
407 #include <cpptl/forwards.h>
412 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
413 #pragma warning(push)
414 #pragma warning(disable : 4251)
415 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
429 char const* what()
const throw()
override;
505 operator const char*()
const {
return c_str_; }
507 const char*
c_str()
const {
return c_str_; }
555 #if defined(JSON_HAS_INT64)
558 #endif // defined(JSON_HAS_INT64)
579 #if defined(JSON_HAS_INT64)
580 static const Int64 minInt64;
586 #endif // defined(JSON_HAS_INT64)
589 #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
600 #if JSON_HAS_RVALUE_REFERENCES
609 char const*
data()
const;
611 bool isStaticString()
const;
629 #ifndef JSON_USE_CPPTL_SMALLMAP
633 #endif // ifndef JSON_USE_CPPTL_SMALLMAP
634 #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION
655 #if defined(JSON_HAS_INT64)
658 #endif // if defined(JSON_HAS_INT64)
679 #ifdef JSON_USE_CPPTL
685 #if JSON_HAS_RVALUE_REFERENCES
697 void swapPayload(
Value& other);
708 int compare(
const Value& other)
const;
710 const char* asCString()
const;
716 char const**
begin,
char const**
end)
const;
717 #ifdef JSON_USE_CPPTL
718 CppTL::ConstString asConstString()
const;
722 #if defined(JSON_HAS_INT64)
723 Int64 asInt64()
const;
725 #endif // if defined(JSON_HAS_INT64)
728 float asFloat()
const;
729 double asDouble()
const;
735 bool isInt64()
const;
737 bool isUInt64()
const;
738 bool isIntegral()
const;
739 bool isDouble()
const;
740 bool isNumeric()
const;
741 bool isString()
const;
742 bool isArray()
const;
743 bool isObject()
const;
745 bool isConvertibleTo(
ValueType other)
const;
812 const Value& operator[](
const char*
key)
const;
833 #ifdef JSON_USE_CPPTL
834 Value& operator[](
const CppTL::ConstString&
key);
838 const Value& operator[](
const CppTL::ConstString&
key)
const;
851 #ifdef JSON_USE_CPPTL
871 Value removeMember(
const char*
key);
878 bool removeMember(
const char*
key,
Value* removed);
887 bool removeMember(
const char*
begin,
const char*
end,
Value* removed);
898 bool isMember(
const char*
key)
const;
903 bool isMember(
const char*
begin,
const char*
end)
const;
904 #ifdef JSON_USE_CPPTL
905 bool isMember(
const CppTL::ConstString&
key)
const;
914 Members getMemberNames()
const;
942 void setOffsetStart(
size_t start);
943 void setOffsetLimit(
size_t limit);
944 size_t getOffsetStart()
const;
945 size_t getOffsetLimit()
const;
957 void setComment(
const char* text,
size_t len);
1040 typedef std::vector<const PathArgument*>
InArgs;
1041 typedef std::vector<PathArgument>
Args;
1046 InArgs::const_iterator& itInArg,
1100 difference_type computeDistance(
const SelfType& other)
const;
1104 void copy(
const SelfType& other);
1189 explicit ValueIterator(
const Value::ObjectValues::iterator& current);
1230 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1231 #pragma warning(pop)
1232 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1234 #endif // CPPTL_JSON_H_INCLUDED
1254 #ifndef CPPTL_JSON_READER_H_INCLUDED
1255 #define CPPTL_JSON_READER_H_INCLUDED
1257 #if !defined(JSON_IS_AMALGAMATION)
1258 #include "features.h"
1260 #endif // if !defined(JSON_IS_AMALGAMATION)
1269 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1270 #pragma warning(push)
1271 #pragma warning(disable : 4251)
1272 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1343 bool parse(
const char* beginDoc,
1346 bool collectComments =
true);
1350 bool parse(std::istream& is,
Value&
root,
bool collectComments =
true);
1362 std::
string getFormatedErrorMessages()
const;
1372 std::
string getFormattedErrorMessages()
const;
1408 tokenEndOfStream = 0,
1440 bool readToken(
Token& token);
1442 bool match(Location pattern,
int patternLength);
1444 bool readCStyleComment();
1445 bool readCppStyleComment();
1449 bool readObject(
Token& token);
1450 bool readArray(
Token& token);
1451 bool decodeNumber(
Token& token);
1452 bool decodeNumber(
Token& token,
Value& decoded);
1453 bool decodeString(
Token& token);
1455 bool decodeDouble(
Token& token);
1456 bool decodeDouble(
Token& token,
Value& decoded);
1457 bool decodeUnicodeCodePoint(
Token& token,
1460 unsigned int& unicode);
1461 bool decodeUnicodeEscapeSequence(
Token& token,
1464 unsigned int& unicode);
1466 bool recoverFromError(
TokenType skipUntilToken);
1470 void skipUntilSpace();
1471 Value& currentValue();
1474 getLocationLineAndColumn(Location
location,
int& line,
int& column)
const;
1477 void skipCommentTokens(
Token& token);
1516 char const* beginDoc,
char const* endDoc,
1525 virtual CharReader* newCharReader()
const = 0;
1648 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1649 #pragma warning(pop)
1650 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1652 #endif // CPPTL_JSON_READER_H_INCLUDED
1672 #ifndef JSON_WRITER_H_INCLUDED
1673 #define JSON_WRITER_H_INCLUDED
1675 #if !defined(JSON_IS_AMALGAMATION)
1677 #endif // if !defined(JSON_IS_AMALGAMATION)
1684 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1685 #pragma warning(push)
1686 #pragma warning(disable : 4251)
1687 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1718 virtual int write(
Value const&
root, std::ostream* sout) = 0;
1829 void enableYAMLCompatibility();
1836 void dropNullPlaceholders();
1838 void omitEndingLineFeed();
1897 void writeCommentBeforeValue(
const Value&
root);
1898 void writeCommentAfterValueOnSameLine(
const Value&
root);
1950 void write(std::ostream& out,
const Value&
root);
1961 void writeCommentBeforeValue(
const Value&
root);
1962 void writeCommentAfterValueOnSameLine(
const Value&
root);
1977 #if defined(JSON_HAS_INT64)
1980 #endif // if defined(JSON_HAS_INT64)
1993 #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1994 #pragma warning(pop)
1995 #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING)
1997 #endif // JSON_WRITER_H_INCLUDED
2017 #ifndef CPPTL_JSON_ASSERTIONS_H_INCLUDED
2018 #define CPPTL_JSON_ASSERTIONS_H_INCLUDED
2023 #if !defined(JSON_IS_AMALGAMATION)
2025 #endif // if !defined(JSON_IS_AMALGAMATION)
2031 #if JSON_USE_EXCEPTION
2034 # define JSON_ASSERT(condition) \
2035 {if (!(condition)) {Json::throwLogicError( "assert json failed" );}}
2037 # define JSON_FAIL_MESSAGE(message) \
2039 std::ostringstream oss; oss << message; \
2040 Json::throwLogicError(oss.str()); \
2044 #else // JSON_USE_EXCEPTION
2046 # define JSON_ASSERT(condition) assert(condition)
2050 # define JSON_FAIL_MESSAGE(message) \
2052 std::ostringstream oss; oss << message; \
2053 assert(false && oss.str().c_str()); \
2060 #define JSON_ASSERT_MESSAGE(condition, message) \
2061 if (!(condition)) { \
2062 JSON_FAIL_MESSAGE(message); \
2065 #endif // CPPTL_JSON_ASSERTIONS_H_INCLUDED
2075 #endif //ifndef JSON_AMALGATED_H_INCLUDED
Build a CharReader implementation.
unsigned long long int UInt64
Build a StreamWriter implementation.
Json::LargestUInt LargestUInt
GLuint const GLchar * name
Iterator for object and array value.
pointer operator->() const
std::string JSON_API writeString(StreamWriter::Factory const &factory, Value const &root)
Write into stringstream, then return string, for convenience. A StreamWriter will be created from the...
size_t parse(void *closure, const void *hd, const char *buf, size_t size, const upb_bufhandle *handle)
bool allowDroppedNullPlaceholders_
true if dropped null placeholders are allowed. Default: false.
static int indent(upb_textprinter *p)
GLenum GLuint GLenum GLsizei length
ROSCPP_DECL bool get(const std::string &key, bool &b)
@ arrayValue
array value (ordered list)
std::map< CZString, Value > ObjectValues
StaticString(const char *czstring)
Experimental and untested: represents a "path" to access a node.
ValueConstIterator const_iterator
Configuration passed to reader and writer. This configuration object can be used to force the Reader ...
bool dropNullPlaceholders_
@ numberOfCommentPlacement
root value)
bool operator>(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
bool operator==(const SelfType &other) const
GLsizei const GLchar *const * string
bool operator<(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
bool operator>=(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
bool allowComments_
true if comments are allowed. Default: true.
static const Int maxInt
Maximum signed int value that can be stored in a Json::Value.
static const UInt maxUInt
Maximum unsigned int value that can be stored in a Json::Value.
Unserialize a JSON document into a Value.
static const Int64 maxInt64
Maximum signed 64 bits int value that can be stored in a Json::Value.
std::string indentString_
ROSCPP_DECL bool validate(const std::string &name, std::string &error)
GLboolean GLboolean GLboolean b
std::vector< std::string > ChildValues
static const Value & nullRef
ROSCPP_DECL std::string resolve(const std::string &name, bool remap=true)
JSON_API std::ostream & operator<<(std::ostream &, const Value &root)
Output using the StyledStreamWriter.
static size_t begin(const upb_table *t)
@ uintValue
unsigned integer value
const char * c_str() const
JSON (JavaScript Object Notation).
def root(location=None, arch=None, version=None, threading=None, exceptions=None, revision=None, log=EmptyLogger())
GLsizei const GLchar ** path
std::stack< Value * > Nodes
bool allowNumericKeys_
true if numeric object key are allowed. Default: false.
@ objectValue
object value (collection of name/value pairs).
static const LargestUInt maxLargestUInt
Maximum unsigned integer value that can be stored in a Json::Value.
reference operator*() const
bool operator==(const in6_addr a, const in6_addr b)
An error tagged with where in the JSON text it was encountered.
bool operator!=(const SelfType &other) const
Writes a Value in JSON format in a human friendly way.
const iterator for object and array value.
std::string commentsBefore_
void swap(Json::Value &a, Json::Value &b)
Specialize std::swap() for Json::Value.
base class for Value iterators.
std::string JSON_API valueToString(Int value)
Writes a Value in JSON format in a human friendly way, to a stream rather than to a string.
@ commentBefore
a comment placed on the line before a value
bool JSON_API parseFromStream(CharReader::Factory const &, std::istream &, Value *root, std::string *errs)
std::vector< const PathArgument * > InArgs
const typedef Value value_type
@ stringValue
UTF-8 string value.
ValueType
Type of the value held by a Value object.
const SETUP_TEARDOWN_TESTCONTEXT char * key
reference operator*() const
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
static const Int minInt
Minimum signed int value that can be stored in a Json::Value.
const typedef Char * Location
difference_type operator-(const SelfType &other) const
static const LargestInt maxLargestInt
Maximum signed integer value that can be stored in a Json::Value.
difference_type computeDistance(const SelfType &other) const
#define JSONCPP_DEPRECATED(message)
std::vector< std::string > ChildValues
pointer operator->() const
Experimental and untested: represents an element of the "path" to access a node.
ROSCPP_DECL std::string append(const std::string &left, const std::string &right)
JSON_API std::istream & operator>>(std::istream &, Value &)
Read from 'sin' into 'root'.
A simple abstract factory.
static const UInt64 maxUInt64
Maximum unsigned 64 bits int value that can be stored in a Json::Value.
Lightweight wrapper to tag static string.
bool operator!=(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
@ intValue
signed integer value
const typedef Value * pointer
Json::ArrayIndex ArrayIndex
Outputs a Value in JSON format without formatting (not human friendly).
std::string JSON_API valueToQuotedString(const char *value)
std::vector< std::string > Members
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
const typedef Value & reference
bool operator!(const uint128 &val)
GLsizei const GLfloat * value
ValueConstIterator SelfType
void throwRuntimeError(std::string const &msg)
used internally
std::bidirectional_iterator_tag iterator_category
static std::string normalizeEOL(Reader::Location begin, Reader::Location end)
Abstract class for writers.
GLboolean GLboolean GLboolean GLboolean a
std::string indentString_
ValueIteratorBase SelfType
@ commentAfterOnSameLine
a comment just after a value on the same line
Json::LargestInt LargestInt
GLenum GLuint GLenum GLsizei const GLchar * message
std::vector< PathArgument > Args
bool yamlCompatiblityEnabled_
Value & operator=(const Value &from)
void throwLogicError(std::string const &msg)
used internally
std::deque< ErrorInfo > Errors
bool operator<=(const detail::socket_base &a, const detail::socket_base &b) ZMQ_NOTHROW
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:55