Interface for JSON serialization and parsing.
More...
#include <IJsonSerializer.hpp>
|
| virtual | ~IJsonSerializer ()=default |
| virtual Result< nlohmann::json, JsonError > | loadFromFile (const std::filesystem::path &filePath) const =0 |
| | Load JSON from file.
|
| virtual Result< void, JsonError > | saveToFile (const std::filesystem::path &filePath, const nlohmann::json &jsonData, int indent=2) const =0 |
| | Save JSON to file.
|
| virtual Result< nlohmann::json, JsonError > | parse (const std::string &jsonString) const =0 |
| | Parse JSON from string.
|
| virtual Result< std::string, JsonError > | toString (const nlohmann::json &jsonData, int indent=2) const =0 |
| | Convert JSON to string.
|
Interface for JSON serialization and parsing.
Provides safe JSON operations with Result<T,E> error handling.
◆ ~IJsonSerializer()
| virtual dotnamecpp::utils::IJsonSerializer::~IJsonSerializer |
( |
| ) |
|
|
virtualdefault |
◆ loadFromFile()
| virtual Result< nlohmann::json, JsonError > dotnamecpp::utils::IJsonSerializer::loadFromFile |
( |
const std::filesystem::path & | filePath | ) |
const |
|
nodiscardpure virtual |
◆ parse()
| virtual Result< nlohmann::json, JsonError > dotnamecpp::utils::IJsonSerializer::parse |
( |
const std::string & | jsonString | ) |
const |
|
nodiscardpure virtual |
◆ saveToFile()
| virtual Result< void, JsonError > dotnamecpp::utils::IJsonSerializer::saveToFile |
( |
const std::filesystem::path & | filePath, |
|
|
const nlohmann::json & | jsonData, |
|
|
int | indent = 2 ) const |
|
nodiscardpure virtual |
◆ toString()
| virtual Result< std::string, JsonError > dotnamecpp::utils::IJsonSerializer::toString |
( |
const nlohmann::json & | jsonData, |
|
|
int | indent = 2 ) const |
|
nodiscardpure virtual |
The documentation for this class was generated from the following file: