14#include <rtl/string.hxx>
15#include <rtl/ustring.hxx>
30class ScopedJsonWriterNode;
31class ScopedJsonWriterArray;
32class ScopedJsonWriterStruct;
55 void put(std::u16string_view pPropName,
const OUString& rPropValue);
57 void put(std::string_view pPropName,
const OUString& rPropValue);
59 void put(std::string_view pPropName, std::string_view rPropValue);
60 void put(std::string_view pPropName,
const char* pPropVal)
62 put(pPropName, std::string_view(pPropVal));
64 template <
size_t N>
void put(std::string_view pPropName,
const char (&pPropVal)[N])
66 put(pPropName, std::string_view(pPropVal,
N));
69 template <
typename N, std::enable_if_t<std::is_arithmetic_v<N>,
int> = 0>
70 void put(std::string_view pPropName, N n)
72 putLiteral(pPropName, OString::number(
n));
74 void put(std::string_view pPropName,
bool);
76 void putSimpleValue(
const OUString& rPropValue);
79 void putRaw(std::string_view);
83 OString finishAndGetAsOString();
86 bool isDataEquals(std::string_view)
const;
92 void addCommaBeforeField();
93 void writeEscapedOUString(
const OUString& rPropVal);
95 void ensureSpace(
int noMoreBytesRequired);
96 void ensureSpaceAndWriteNameColon(std::string_view name,
int valSize);
97 void putLiteral(std::string_view propName, std::string_view propValue);
100 static constexpr unsigned char JSON_WRITER_DEBUG_MARKER = 0xde;
105 *(mpBuffer + mSpaceAllocated - 1) = JSON_WRITER_DEBUG_MARKER;
112 unsigned char c = *(mpBuffer + mSpaceAllocated - 1);
113 assert(c == JSON_WRITER_DEBUG_MARKER);