3 #ifndef INCLUDE_NN_NLIB_MSGPACK_JSONREADER_H_
4 #define INCLUDE_NN_NLIB_MSGPACK_JSONREADER_H_
9 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
10 #undef NLIB_VIS_PUBLIC
11 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
28 : maxArraySize(max_array_size_),
29 maxMapSize(max_map_size_),
30 maxStrLen(max_str_len_),
31 maxDepth(max_depth_) {}
41 OPTION_DEFAULT = 0x00000000,
42 OPTION_RELAXED = 0x00000001
50 return this->Init(stream, settings);
64 return ReadEx(obj, jsontext, option,
RSIZE_MAX) == 0;
71 if (m_ErrorValue == 0) m_ErrorValue = e;
79 size_t m_MaxArraySize;
92 #if defined(_MSC_VER) && defined(nx_msgpack_EXPORTS)
93 #undef NLIB_VIS_PUBLIC
94 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT
97 #endif // INCLUDE_NN_NLIB_MSGPACK_JSONREADER_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
int GetLine() const noexcept
Gets the line number (near where the error occurred).
Option
Defines the option value that may be passed to Read.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
#define NLIB_SAFE_BOOL(class_name, exp)
Defines a safe operator bool function in the class. Uses the C++11 explicit bool if it is available f...
bool Close() noexcept
Closes JsonReader.
Data structure used to store the JsonReader settings parameters.
constexpr JsonReaderSettings() noexcept
Instantiates the object with default parameters (default constructor). Sets each data member to the d...
size_t maxArraySize
Specifies the maximum size of the JSON array being read. The default is 8192.
constexpr JsonReaderSettings(size_t max_array_size_, size_t max_map_size_, size_t max_str_len_, size_t max_depth_) noexcept
Instantiates the object. Sets the individual data members.
Defines that class that is corresponding to std::unique_ptr.
Object created when MessagePack or JSON is read.
#define NLIB_CEXPR
Defines constexpr if it is available for use. If not, holds an empty string.
size_t maxMapSize
Specifies the maximum size of the JSON associative array being read. The default is 256...
Defines the class for reading text from streams.
int GetColumn() const noexcept
Gets the digit number (near where the error occurred).
JSON parser. Reads and parses the JSON string from the stream.
The class for reading text from streams.
size_t maxStrLen
Specifies the maximum size (in bytes) of the string being read. The default is 2047.
bool Read(BinaryReader *r, T *x)
You can read to user-defined class objects by specializing this function template.
size_t maxDepth
Specifies the maximum depth of JSON (recursive structure). The default is 7.
InputStream * GetStream() noexcept
Gets the base stream specified in Init.
errno_t GetErrorValue() const noexcept
Gets the error that occurred.