Utils.hpp

This File On Github
Ask A Question

API: latest
module: oatpp
#include "oatpp/parser/json/Utils.hpp"

Utils

Utility class for json serializer/deserializer. Used by oatpp::parser::json::mapping::Serializer, oatpp::parser::json::mapping::Deserializer.

namespace oatpp { namespace parser { namespace json { 
  class Utils {}
}}}

Fields

Type Name Summary
v_int32 ERROR_CODE_INVALID_ESCAPED_CHAR ERROR_CODE_INVALID_ESCAPED_CHAR
v_int32 ERROR_CODE_INVALID_SURROGATE_PAIR ERROR_CODE_INVALID_SURROGATE_PAIR
v_int32 ERROR_CODE_PARSER_QUOTE_EXPECTED '\' - EXPECTED" ERROR_CODE_PARSER_QUOTE_EXPECTED

Methods

Return Type Name Summary
String escapeString Escape string as for json standard.
String unescapeString Unescape string as for json standard.
std::string unescapeStringToStdString Same as Utils::unescapeString() but return std::string.
String parseString Parse string enclosed in "<string>".
std::string parseStringToStdString Parse string enclosed in "<string>".

Utils::ERROR_CODE_INVALID_ESCAPED_CHAR

ERROR_CODE_INVALID_ESCAPED_CHAR

static constexpr v_int32 ERROR_CODE_INVALID_ESCAPED_CHAR = 1

Utils::ERROR_CODE_INVALID_SURROGATE_PAIR

ERROR_CODE_INVALID_SURROGATE_PAIR

static constexpr v_int32 ERROR_CODE_INVALID_SURROGATE_PAIR = 2

Utils::ERROR_CODE_PARSER_QUOTE_EXPECTED

'\' - EXPECTED" ERROR_CODE_PARSER_QUOTE_EXPECTED

static constexpr v_int32 ERROR_CODE_PARSER_QUOTE_EXPECTED = 3

Utils::escapeString

Escape string as for json standard.
Note: if(copyAsOwnData == false escapedString == initialString) then result string will point to initial data.

static String escapeString(p_char8 data, v_int32 size, bool copyAsOwnData = true)

Utils::unescapeString

Unescape string as for json standard.

static String unescapeString(p_char8 data, v_int32 size, v_int32& errorCode, v_int32& errorPosition)

Utils::unescapeStringToStdString

Same as Utils::unescapeString() but return std::string.

static std::string unescapeStringToStdString(p_char8 data, v_int32 size, v_int32& errorCode, v_int32& errorPosition)

Utils::parseString

Parse string enclosed in "<string>".

static String parseString(ParsingCaret& caret)

Utils::parseStringToStdString

Parse string enclosed in "<string>".

static std::string parseStringToStdString(ParsingCaret& caret)