--- a/src/SerializeHandler.h Tue Apr 19 21:00:07 2022 +0200
+++ b/src/SerializeHandler.h Thu Apr 21 00:18:10 2022 +0200
@@ -32,6 +32,7 @@
#include <relpipe/cli/RelpipeCLIException.h>
#include "Configuration.h"
+#include "Hex.h"
namespace relpipe {
namespace tr {
@@ -57,13 +58,6 @@
size_t attributeIndex = 0;
} recordContext;
- relpipe::common::type::StringX toHex(const std::string& octets) {
- std::stringstream hex;
- hex << std::hex << std::setfill('0') << std::hex;
- for (size_t i = 0, size = octets.size(); i < size; i++) hex << std::setw(2) << (0xff & octets[i]);
- return convertor.from_bytes(hex.str());
- }
-
public:
SerializeHandler(shared_ptr<relpipe::writer::RelationalWriter> writer, Configuration configuration) : writer(writer), configuration(configuration) {
@@ -103,7 +97,7 @@
recordContext.attributeIndex++;
if (recordContext.attributeIndex % relationContext.readerMetadata.size() == 0) {
- writer->writeAttribute(toHex(recordContext.buffer.str()));
+ writer->writeAttribute(Hex::toHex(recordContext.buffer.str()));
recordContext.attributeIndex = 0;
}
}