diff options
Diffstat (limited to 'include/sax/tools/converter.hxx')
-rw-r--r-- | include/sax/tools/converter.hxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index b15288e51062..6cbeffd2f770 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -20,6 +20,10 @@ #ifndef INCLUDED_SAX_TOOLS_CONVERTER_HXX #define INCLUDED_SAX_TOOLS_CONVERTER_HXX +#include <sal/config.h> + +#include <type_traits> + #include <sax/saxdllapi.h> #include <sal/types.h> @@ -213,6 +217,16 @@ public: OUStringBuffer& rsType , const css::uno::Any& rValue); + /** convert specified byte sequence to xsd:hexBinary string **/ + static void convertBytesToHexBinary(OUStringBuffer& rBuffer, const void* pBytes, + sal_Int32 nBytes); + + template <typename T, std::enable_if_t<std::is_arithmetic_v<T>, int> = 0> + static void convertNumberToHexBinary(OUStringBuffer& rBuffer, T n) + { + convertBytesToHexBinary(rBuffer, &n, sizeof(n)); + } + }; } |