PLCnext API Documentation 25.0.2.69
|
Class to write a Json file More...
#include <JsonWriter.hpp>
Public Member Functions | |
JsonWriter (void) | |
Default constructor. | |
JsonWriter (const JsonWriter &arg)=delete | |
JsonWriter (JsonWriter &&arg) noexcept | |
Default move constructor. | |
JsonWriter & | operator= (const JsonWriter &arg)=delete |
JsonWriter & | operator= (JsonWriter &&arg) noexcept |
Default move-assignment operator. | |
~JsonWriter (void) | |
Default destructor. | |
void | SetPrettyPrint (bool state) |
Write json data pretty print More... | |
void | SaveDocument (void) const |
Save the json data to a file system More... | |
bool | TrySaveDocument (void) const |
Save the json data to a file system More... | |
String | SaveToText (void) const |
Save the json data to string More... | |
bool | TrySaveToText (String &text) const |
Save the json data to string More... | |
void | WriteRootObject (void) |
Create a Json root object More... | |
bool | TryWriteRootObject (void) |
Create a Json root object More... | |
void | WriteStartObject (const char *objectName) |
Create a Json object More... | |
bool | TryWriteStartObject (const char *objectName) |
Create a Json object More... | |
void | WriteEndObject (void) |
End of creating Json object More... | |
bool | TryWriteEndObject (void) |
End of creating Json object More... | |
void | WriteRootComplexArray (void) |
Creating a Json root array of objects More... | |
bool | TryWriteRootComplexArray (void) |
Creating a Json root array of objects More... | |
void | WriteStartComplexArray (const char *arrayName) |
Creating a Json array of objects More... | |
bool | TryWriteStartComplexArray (const char *arrayName) |
Creating a Json array of objects More... | |
void | WriteEndComplexArray (void) |
End of Creating a Json array of objects More... | |
bool | TryWriteEndComplexArray (void) |
End of creating a Json array of objects More... | |
void | WriteStartComplexArrayItem (void) |
Creating of an object array element More... | |
bool | TryWriteStartComplexArrayItem (void) |
Creating of an object array element More... | |
void | WriteEndComplexArrayItem (void) |
End of creating of an object array element More... | |
bool | TryWriteEndComplexArrayItem (void) |
End of creating of an object array element More... | |
void | WriteValue (const char *valueName, const bool &value) |
Writes a bool value More... | |
void | WriteValue (const char *valueName, const uint8 &value) |
Writes a uint8 value More... | |
void | WriteValue (const char *valueName, const int8 &value) |
Writes a int8 value More... | |
void | WriteValue (const char *valueName, const uint16 &value) |
Writes a uint16 value More... | |
void | WriteValue (const char *valueName, const int16 &value) |
Writes a int16 value More... | |
void | WriteValue (const char *valueName, const uint32 &value) |
Writes a uint32 value More... | |
void | WriteValue (const char *valueName, const int32 &value) |
Writes a int32 value More... | |
void | WriteValue (const char *valueName, const uint64 &value) |
Writes a uint64 value More... | |
void | WriteValue (const char *valueName, const int64 &value) |
Writes a int64 value More... | |
void | WriteValue (const char *valueName, const float32 &value) |
Writes a float32 value More... | |
void | WriteValue (const char *valueName, const float64 &value) |
Writes a float64 value More... | |
void | WriteValue (const char *valueName, std::nullptr_t value) |
Writes a null value More... | |
void | WriteValue (const char *valueName, const String &value) |
Writes a String value More... | |
void | WriteValue (const char *valueName, const char *value) |
Writes from a const char* value, this will be maped to write String More... | |
void | WriteValue (const char *valueName, const char *pBuffer, size_t bufferSize) |
Writes from a const char* value More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< bool > &values) |
Writes a simple array of bool More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< String > &values) |
Writes a simple array of String More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< uint8 > &values) |
Writes a simple array of uint8 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< int8 > &values) |
Writes a simple array of int8 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< uint16 > &values) |
Writes a simple array of uint16 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< int16 > &values) |
Writes a simple array of int16 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< uint32 > &values) |
Writes a simple array of uint32 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< int32 > &values) |
Writes a simple array of int32 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< uint64 > &values) |
Writes a simple array of uint64 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< int64 > &values) |
Writes a simple array of int64 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< float32 > &values) |
Writes a simple array of float32 More... | |
void | WriteSimpleArray (const char *arrayName, const std::vector< float64 > &values) |
Writes a simple array of float64 More... | |
Impl & | GetImpl (void) |
For internal use only. | |
const Impl & | GetImpl (void) const |
Static Public Member Functions | |
static JsonWriter | Create (const String &filename) |
Creates a new Instance of the JsonWriter More... | |
static bool | TryCreate (const String &filename, JsonWriter &writer) |
Tries to creates a new Instance of the JsonWriter More... | |
Class to write a Json file
|
static |
Creates a new Instance of the JsonWriter
filename | The Filename the writer uses to write the Json data |
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::SaveDocument | ( | void | ) | const |
Save the json data to a file system
JsonException | An exception is thrown if the function cannot be executed |
String Arp::System::Commons::Json::JsonWriter::SaveToText | ( | void | ) | const |
Save the json data to string
void Arp::System::Commons::Json::JsonWriter::SetPrettyPrint | ( | bool | state | ) |
Write json data pretty print
state | If true, the json data print within pretty print |
|
static |
Tries to creates a new Instance of the JsonWriter
filename | The Filename the writer uses to write the Json data |
writer | Json writer object |
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TrySaveDocument | ( | void | ) | const |
Save the json data to a file system
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TrySaveToText | ( | String & | text | ) | const |
Save the json data to string
text | string result |
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteEndComplexArray | ( | void | ) |
End of creating a Json array of objects
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteEndComplexArrayItem | ( | void | ) |
End of creating of an object array element
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteEndObject | ( | void | ) |
End of creating Json object
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteRootComplexArray | ( | void | ) |
Creating a Json root array of objects
arrayName | Name of the array |
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteRootObject | ( | void | ) |
Create a Json root object
objectName | Json Object name |
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteStartComplexArray | ( | const char * | arrayName | ) |
Creating a Json array of objects
arrayName | Name of the array |
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteStartComplexArrayItem | ( | void | ) |
Creating of an object array element
true
on success, otherwise false
bool Arp::System::Commons::Json::JsonWriter::TryWriteStartObject | ( | const char * | objectName | ) |
Create a Json object
objectName | Json Object name |
true
on success, otherwise false
void Arp::System::Commons::Json::JsonWriter::WriteEndComplexArray | ( | void | ) |
End of Creating a Json array of objects
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteEndComplexArrayItem | ( | void | ) |
End of creating of an object array element
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteEndObject | ( | void | ) |
End of creating Json object
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteRootComplexArray | ( | void | ) |
Creating a Json root array of objects
arrayName | Name of the array |
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteRootObject | ( | void | ) |
Create a Json root object
objectName | Json object name |
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< bool > & | values | ||
) |
Writes a simple array of bool
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< float32 > & | values | ||
) |
Writes a simple array of float32
name | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< float64 > & | values | ||
) |
Writes a simple array of float64
name | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< int16 > & | values | ||
) |
Writes a simple array of int16
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< int32 > & | values | ||
) |
Writes a simple array of int32
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< int64 > & | values | ||
) |
Writes a simple array of int64
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< int8 > & | values | ||
) |
Writes a simple array of int8
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< String > & | values | ||
) |
Writes a simple array of String
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< uint16 > & | values | ||
) |
Writes a simple array of uint16
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< uint32 > & | values | ||
) |
Writes a simple array of uint32
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< uint64 > & | values | ||
) |
Writes a simple array of uint64
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteSimpleArray | ( | const char * | arrayName, |
const std::vector< uint8 > & | values | ||
) |
Writes a simple array of uint8
arrayName | Name of the value |
values | Array value to write |
void Arp::System::Commons::Json::JsonWriter::WriteStartComplexArray | ( | const char * | arrayName | ) |
Creating a Json array of objects
arrayName | Name of the array |
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteStartComplexArrayItem | ( | void | ) |
Creating of an object array element
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteStartObject | ( | const char * | objectName | ) |
Create a Json object
objectName | Json object name |
JsonException | An exception is thrown if the function cannot be executed |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const bool & | value | ||
) |
Writes a bool value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const char * | pBuffer, | ||
size_t | bufferSize | ||
) |
Writes from a const char* value
valueName | Name of the value |
pBuffer | Value to write |
bufferSize | Writing size |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const char * | value | ||
) |
Writes from a const char* value, this will be maped to write String
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const float32 & | value | ||
) |
Writes a float32 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const float64 & | value | ||
) |
Writes a float64 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const int16 & | value | ||
) |
Writes a int16 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const int32 & | value | ||
) |
Writes a int32 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const int64 & | value | ||
) |
Writes a int64 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const int8 & | value | ||
) |
Writes a int8 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const String & | value | ||
) |
Writes a String value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const uint16 & | value | ||
) |
Writes a uint16 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const uint32 & | value | ||
) |
Writes a uint32 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const uint64 & | value | ||
) |
Writes a uint64 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
const uint8 & | value | ||
) |
Writes a uint8 value
valueName | Name of the value |
value | Value to write |
void Arp::System::Commons::Json::JsonWriter::WriteValue | ( | const char * | valueName, |
std::nullptr_t | value | ||
) |
Writes a null value
valueName | Name of the value |
value | Value to write |