xentara-utils v2.0.4
The Xentara Utility Library
|
A class used for writing a JSON string value progressively. More...
#include <xentara/utils/json/encoder/String.hpp>
Public Member Functions | |
String ()=delete | |
This type is not user-constructible. | |
~String () noexcept(false) | |
Destructor. | |
template<std::convertible_to< std::string_view > String> | |
auto | append (const String &text) -> void |
Appends text to the string. | |
auto | close () -> void |
Writes the termination of the object, if it has not already been written. | |
A class used for writing a JSON string value progressively.
This class can be used to compose JSON string on the fly by concatenating string fragments.
Objects of this class can be moved, but not copied.
|
delete |
This type is not user-constructible.
xentara::utils::json::encoder::String::~String | ( | ) |
Destructor.
This destructor writes the closing quotes, if they have not already been written.
This destructor will throw an exception if the closing quotes cannot be written. To prevent termination of the program, no exceptions are thrown during stack windup, though. You can prevent the destructor from throwing any exceptions by closing the string manually beforehand using close().
std::runtime_error | An error occured writing to the stream |
auto xentara::utils::json::encoder::String::append | ( | const String & | text | ) | -> void |
Appends text to the string.
text | The text to append |
std::runtime_error | An error occured writing to the stream |
auto xentara::utils::json::encoder::String::close | ( | ) | -> void |
Writes the termination of the object, if it has not already been written.
std::runtime_error | An error occured writing to the stream |