include/tools/json_writer.hxx | 1 + tools/source/misc/json_writer.cxx | 8 ++++++++ 2 files changed, 9 insertions(+)
New commits: commit cf6388b6a5f3e3baa54ed8b02020e9a25487b32b Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Aug 1 08:40:10 2020 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Mon Aug 10 09:35:19 2020 +0200 add extractAsOString to JsonWriter Change-Id: I761fcf885a4965f88107f84b839108960805a1b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99909 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/include/tools/json_writer.hxx b/include/tools/json_writer.hxx index 34930584730d..588577d41303 100644 --- a/include/tools/json_writer.hxx +++ b/include/tools/json_writer.hxx @@ -47,6 +47,7 @@ public: /** Hands ownership of the the underlying storage buffer to the caller, * after this no more document modifications may be written. */ char* extractData(); + OString extractAsOString(); private: void endNode(); diff --git a/tools/source/misc/json_writer.cxx b/tools/source/misc/json_writer.cxx index 3040fda8a080..ab109dae669c 100644 --- a/tools/source/misc/json_writer.cxx +++ b/tools/source/misc/json_writer.cxx @@ -255,5 +255,13 @@ char* JsonWriter::extractData() return pRet; } +OString JsonWriter::extractAsOString() +{ + char* pChar = extractData(); + OString ret(pChar); + free(pChar); + return ret; +} + } // namespace tools /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits