diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-22 16:45:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-06-25 10:16:37 +0200 |
commit | 01e37e3e5626551b6e8d261e357afcea1ba7c758 (patch) | |
tree | bbd1bd5402b07c44747d7962a9db48f9c04c1de0 /include/tools | |
parent | e318d5d8146d18e2c76e23f2e3c39527f2af9f36 (diff) |
use tools::JsonWriter for dumping property tree
Change-Id: I8f55af19ba10b71bd621e69b27000ab7cb565309
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96677
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools')
-rw-r--r-- | include/tools/json_writer.hxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/tools/json_writer.hxx b/include/tools/json_writer.hxx index c15c4b7401da..3b27a18833f3 100644 --- a/include/tools/json_writer.hxx +++ b/include/tools/json_writer.hxx @@ -52,7 +52,18 @@ public: void put(const char* pPropName, const OUString& rPropValue); void put(const char* pPropName, const OString& rPropValue); void put(const char* pPropName, const char* pPropVal); - void put(const char*, int); + void put(const char* pPropName, const std::string& rPropValue) + { + put(pPropName, rPropValue.data()); + } + + void put(const char* pPropName, sal_uInt16 nPropVal) { put(pPropName, sal_Int64(nPropVal)); } + void put(const char* pPropName, sal_Int16 nPropVal) { put(pPropName, sal_Int64(nPropVal)); } + void put(const char* pPropName, sal_Int32 nPropVal) { put(pPropName, sal_Int64(nPropVal)); } + void put(const char* pPropName, sal_uInt32 nPropVal) { put(pPropName, sal_Int64(nPropVal)); } + void put(const char* pPropName, sal_Int64); + void put(const char* pPropName, bool); + void put(const char* pPropName, double); /// This assumes that this data belongs at this point in the stream, and is valid, and properly encoded void putRaw(const rtl::OStringBuffer&); @@ -61,6 +72,10 @@ public: * after this no more document modifications may be written. */ char* extractData(); OString extractAsOString(); + std::string extractAsStdString(); + + /** returns true if the current JSON data matches the string */ + bool isDataEquals(const std::string&); private: void endNode(); |