diff options
Diffstat (limited to 'include/sax/tools/converter.hxx')
-rw-r--r-- | include/sax/tools/converter.hxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index a01ee6e68170..6f330fa58400 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -23,6 +23,7 @@ #include <sal/config.h> #include <optional> +#include <type_traits> #include <sax/saxdllapi.h> @@ -284,6 +285,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)); + } + }; } |