|
PLCnext API Documentation 25.9.0.13
|
Class to read a json file or stream More...
#include <JsonReader.hpp>
Public Member Functions | |
| JsonReader (void) | |
| Default constructor. | |
| JsonReader (const JsonReader &arg)=delete | |
| JsonReader (JsonReader &&arg) noexcept | |
| Default move constructor. | |
| JsonReader & | operator= (const JsonReader &arg)=delete |
| JsonReader & | operator= (JsonReader &&arg) noexcept |
| Default move-assignment operator. | |
| ~JsonReader (void) | |
| Default destructor. | |
| const String & | GetDocumentFileName () |
| Gets the current document filename of this Json reader More... | |
| bool | HasRootObject (void) |
| Returns the root value information More... | |
| bool | HasRootSimpleArray (void) |
| Returns the root value information More... | |
| bool | HasRootComplexArray (void) |
| Returns the root value information More... | |
| void | ReadRootObject (void) |
| Go straight into the root object or root complex array More... | |
| bool | TryReadRootObject (void) |
| Go straight into the root object or root complex array More... | |
| void | ReadStartObject (const char *objectName) |
| Reads a Json object or complex array More... | |
| bool | TryReadStartObject (const char *objectName) |
| Reads a Json object or complex array. More... | |
| void | ReadEndObject (void) |
| End of reading a Json object More... | |
| bool | TryReadEndObject (void) |
| End of reading a Json object More... | |
| bool | TryReadStartAny (String &name) |
| Reads in a loop a Json object or complex array More... | |
| void | ReadEndAny (void) |
| End of reading a loop Json object More... | |
| bool | TryReadEndAny (void) |
| End of reading a loop Json object More... | |
| void | ReadStartComplexArrayItem (void) |
| Reads a Json complex array item More... | |
| bool | TryReadStartComplexArrayItem (void) |
| Reads a complex array item More... | |
| void | ReadEndComplexArrayItem (void) |
| End of reading a complex array item More... | |
| bool | TryReadEndComplexArrayItem (void) |
| End of reading a complex array item More... | |
| bool | TryReadValue (const char *valueName, bool &result) |
| Reads a bool value More... | |
| bool | TryReadValue (const char *valueName, String &result) |
| Reads a String value More... | |
| bool | TryReadValue (const char *valueName, uint8 &result) |
| Reads a uint8 value More... | |
| bool | TryReadValue (const char *valueName, int8 &result) |
| Reads a int8 value More... | |
| bool | TryReadValue (const char *valueName, uint16 &result) |
| Reads a uint16 value More... | |
| bool | TryReadValue (const char *valueName, int16 &result) |
| Reads a int16 value More... | |
| bool | TryReadValue (const char *valueName, uint32 &result) |
| Reads a uint32 value More... | |
| bool | TryReadValue (const char *valueName, int32 &result) |
| Reads a int32 value More... | |
| bool | TryReadValue (const char *valueName, uint64 &result) |
| Reads a uint64 value More... | |
| bool | TryReadValue (const char *valueName, int64 &result) |
| Reads a int64 value More... | |
| bool | TryReadValue (const char *valueName, float32 &result) |
| Reads a float32 value More... | |
| bool | TryReadValue (const char *valueName, float64 &result) |
| Reads a float64 value More... | |
| void | ReadValue (const char *valueName, char *pBuffer, size_t bufferSize) |
| Reads a char* value More... | |
| bool | TryReadValue (const char *valueName, char *pBuffer, size_t bufferSize) |
| Reads a char* value More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< bool > &result) |
| Reads a simple array of bool More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< String > &result) |
| Reads a simple array of String More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< uint8 > &result) |
| Reads a simple array of uint8 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< int8 > &result) |
| Reads a simple array of int8 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< uint16 > &result) |
| Reads a simple array of uint16 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< int16 > &result) |
| Reads a simple array of int16 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< uint32 > &result) |
| Reads a simple array of uint32 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< int32 > &result) |
| Reads a simple array of int32 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< uint64 > &result) |
| Reads a simple array of uint64 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< int64 > &result) |
| Reads a simple array of int64 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< float32 > &result) |
| Reads a simple array of float64 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< float64 > &result) |
| Reads a simple array of float64 More... | |
| bool | TryReadSimpleArray (const char *arrayName, std::vector< Arp::byte > &result) |
| Reads a simple array of std::byte More... | |
| JsonValue | GetRootValue (void) |
| Reads a root JsonValue More... | |
| bool | TryGetRootValue (JsonValue &jsonValueResult) |
| Reads a root JsonValue More... | |
| JsonValue | GetValue (const char *valueName) |
| Reads a JsonValue More... | |
| bool | TryGetValue (const char *valueName, JsonValue &jsonValueResult) |
| Reads a JsonValue More... | |
| IEnumerator< constJsonValue & >::Ptr | GetValueEnumerator (void) |
| List a level in the form of an enumerator More... | |
| template<class T > | |
| bool | TryReadStartComplexArrayItem (T &arrayObjectResult, JsonSerializationContext &context) |
| Convenience function to reade a complex array element More... | |
| template<class T > | |
| T | ReadValue (const char *valueName) |
| Reads a value More... | |
| template<class T > | |
| std::vector< T > | ReadSimpleArray (const char *arrayName) |
| Reads a simple array More... | |
| template<typename... Args> | |
| JsonException | CreateException (const char *message, const Args &... args) const |
| JsonException | CreateException (const String &message) const |
| Impl & | GetImpl (void) |
| For internal use only. | |
| const Impl & | GetImpl (void) const |
Static Public Member Functions | |
| static JsonReader | Create (const String &filename) |
| Creates a new Instance of the JsonReader More... | |
| static JsonReader | CreateFromText (const String &text) |
| Creates a new Instance of the JsonReader More... | |
| static bool | TryCreate (const String &filename, JsonReader &reader) |
| Tries to creates a new Instance of the JsonReader More... | |
| static bool | TryCreateFromText (const String &text, JsonReader &reader) |
| Creates a new Instance of the JsonReader reading from a buffer More... | |
Class to read a json file or stream
|
static |
Creates a new Instance of the JsonReader
| filename | The Filename the writer uses to write the Json data |
| JsonException | An exception is thrown if the function cannot be executed |
|
static |
Creates a new Instance of the JsonReader
| buffer | Reference to the buffer to read from |
| JsonException | An exception is thrown if the function cannot be executed |
| const String & Arp::System::Commons::Json::JsonReader::GetDocumentFileName | ( | ) |
Gets the current document filename of this Json reader
true on success, otherwise false| JsonValue Arp::System::Commons::Json::JsonReader::GetRootValue | ( | void | ) |
Reads a root JsonValue
| valueName | Name of the value. An empty value name reads the root |
| JsonException | An exception is thrown if the function cannot be executed |
| JsonValue Arp::System::Commons::Json::JsonReader::GetValue | ( | const char * | valueName | ) |
Reads a JsonValue
| valueName | Name of the value. An empty value name reads the root |
| JsonException | An exception is thrown if the function cannot be executed |
| IEnumerator< constJsonValue & >::Ptr Arp::System::Commons::Json::JsonReader::GetValueEnumerator | ( | void | ) |
List a level in the form of an enumerator
| bool Arp::System::Commons::Json::JsonReader::HasRootComplexArray | ( | void | ) |
Returns the root value information
| bool Arp::System::Commons::Json::JsonReader::HasRootObject | ( | void | ) |
Returns the root value information
| bool Arp::System::Commons::Json::JsonReader::HasRootSimpleArray | ( | void | ) |
Returns the root value information
| void Arp::System::Commons::Json::JsonReader::ReadEndAny | ( | void | ) |
End of reading a loop Json object
| name | Json object or complex array name |
| JsonException | An exception is thrown if the function cannot be executed</ |
| void Arp::System::Commons::Json::JsonReader::ReadEndComplexArrayItem | ( | void | ) |
End of reading a complex array item
| JsonException | An exception is thrown if the function cannot be executed |
| void Arp::System::Commons::Json::JsonReader::ReadEndObject | ( | void | ) |
End of reading a Json object
| JsonException | An exception is thrown if the function cannot be executed |
| void Arp::System::Commons::Json::JsonReader::ReadRootObject | ( | void | ) |
Go straight into the root object or root complex array
| JsonException | An exception is thrown if the function cannot be executed |
|
inline |
Reads a simple array
| arrayName | Name of the array |
| JsonException | An exception is thrown if the function cannot be executed |
| void Arp::System::Commons::Json::JsonReader::ReadStartComplexArrayItem | ( | void | ) |
Reads a Json complex array item
| JsonException | An exception is thrown if the function cannot be executed |
| void Arp::System::Commons::Json::JsonReader::ReadStartObject | ( | const char * | objectName | ) |
Reads a Json object or complex array
| objectName | Json Object name. An empty object name reads the root object or complex array |
| JsonException | An exception is thrown if the function cannot be executed |
|
inline |
Reads a value
| valueName | Name of the value |
| JsonException | An exception is thrown if the function cannot be executed |
| void Arp::System::Commons::Json::JsonReader::ReadValue | ( | const char * | valueName, |
| char * | pBuffer, | ||
| size_t | bufferSize | ||
| ) |
Reads a char* value
| valueName | Name of the value |
| pBuffer | Pointer to the memory |
| bufferSize | Max buffer size from the pBuffer |
| JsonException | An exception is thrown if the function cannot be executed |
|
static |
Tries to creates a new Instance of the JsonReader
| filename | The Filename the writer uses to write the Json data |
true on success, otherwise false
|
static |
Creates a new Instance of the JsonReader reading from a buffer
| buffer | Reference to the buffer to read from |
| JsonException | An exception is thrown if the function cannot be executed |
| bool Arp::System::Commons::Json::JsonReader::TryGetRootValue | ( | JsonValue & | jsonValueResult | ) |
Reads a root JsonValue
| valueName | Name of the value. An empty value name reads the root |
| result | Result of a JsonValue |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryGetValue | ( | const char * | valueName, |
| JsonValue & | jsonValueResult | ||
| ) |
Reads a JsonValue
| valueName | Name of the value. An empty value name reads the root |
| result | Result of a JsonValue |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadEndAny | ( | void | ) |
End of reading a loop Json object
| name | Json object or complex array name |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadEndComplexArrayItem | ( | void | ) |
End of reading a complex array item
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadEndObject | ( | void | ) |
End of reading a Json object
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadRootObject | ( | void | ) |
Go straight into the root object or root complex array
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< Arp::byte > & | result | ||
| ) |
Reads a simple array of std::byte
| arrayName | Name of the value |
| result | Array value |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< bool > & | result | ||
| ) |
Reads a simple array of bool
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< float32 > & | result | ||
| ) |
Reads a simple array of float64
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< float64 > & | result | ||
| ) |
Reads a simple array of float64
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< int16 > & | result | ||
| ) |
Reads a simple array of int16
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< int32 > & | result | ||
| ) |
Reads a simple array of int32
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< int64 > & | result | ||
| ) |
Reads a simple array of int64
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< int8 > & | result | ||
| ) |
Reads a simple array of int8
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< String > & | result | ||
| ) |
Reads a simple array of String
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< uint16 > & | result | ||
| ) |
Reads a simple array of uint16
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< uint32 > & | result | ||
| ) |
Reads a simple array of uint32
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< uint64 > & | result | ||
| ) |
Reads a simple array of uint64
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadSimpleArray | ( | const char * | arrayName, |
| std::vector< uint8 > & | result | ||
| ) |
Reads a simple array of uint8
| arrayName | Name of the value |
| result | Array value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadStartAny | ( | String & | name | ) |
Reads in a loop a Json object or complex array
| name | Return of a Json object or complex array name |
true on success, otherwise false
|
inline |
Convenience function to reade a complex array element
| arryObjectResult | Complex array element |
| context | Context of the Json Serialization |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadStartComplexArrayItem | ( | void | ) |
Reads a complex array item
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadStartObject | ( | const char * | objectName | ) |
Reads a Json object or complex array.
| objectName | Json Object name. An empty object name reads the root object or complex array |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| bool & | result | ||
| ) |
Reads a bool value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| char * | pBuffer, | ||
| size_t | bufferSize | ||
| ) |
Reads a char* value
| valueName | Name of the value |
| pBuffer | Pointer to the memory |
| bufferSize | Max buffer size from the pBuffer |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| float32 & | result | ||
| ) |
Reads a float32 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| float64 & | result | ||
| ) |
Reads a float64 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| int16 & | result | ||
| ) |
Reads a int16 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| int32 & | result | ||
| ) |
Reads a int32 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| int64 & | result | ||
| ) |
Reads a int64 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| int8 & | result | ||
| ) |
Reads a int8 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| String & | result | ||
| ) |
Reads a String value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| uint16 & | result | ||
| ) |
Reads a uint16 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| uint32 & | result | ||
| ) |
Reads a uint32 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| uint64 & | result | ||
| ) |
Reads a uint64 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false| bool Arp::System::Commons::Json::JsonReader::TryReadValue | ( | const char * | valueName, |
| uint8 & | result | ||
| ) |
Reads a uint8 value
| valueName | Name of the value |
| result | Value to read |
true on success, otherwise false