summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbpp/testCore.cpp6
-rw-r--r--libdbpp/types.cpp7
-rw-r--r--libdbpp/types.h2
3 files changed, 9 insertions, 6 deletions
diff --git a/libdbpp/testCore.cpp b/libdbpp/testCore.cpp
index 3c71daa..890cb18 100644
--- a/libdbpp/testCore.cpp
+++ b/libdbpp/testCore.cpp
@@ -63,12 +63,6 @@ TestCore::assertColumnValueHelper(DB::SelectCommand & sel, unsigned int col, con
sel[col].apply(a);
}
-bool
-operator==(const DB::Blob a, const DB::Blob b)
-{
- return a.len == b.len && memcmp(a.data, b.data, a.len) == 0;
-}
-
AdHocFormatter(BlobDbg, "Blob[length=%?, addr=%?]");
std::ostream &
operator<<(std::ostream & s, const DB::Blob b)
diff --git a/libdbpp/types.cpp b/libdbpp/types.cpp
index 65e8598..325a24c 100644
--- a/libdbpp/types.cpp
+++ b/libdbpp/types.cpp
@@ -1,4 +1,5 @@
#include "types.h"
+#include <memory.h>
DB::Blob::Blob() :
data(nullptr),
@@ -12,3 +13,9 @@ DB::Blob::Blob(const void * d, size_t l) :
{
}
+bool
+DB::Blob::operator==(const DB::Blob b) const
+{
+ return this->len == b.len && memcmp(this->data, b.data, this->len) == 0;
+}
+
diff --git a/libdbpp/types.h b/libdbpp/types.h
index d42d0c0..a75f0d3 100644
--- a/libdbpp/types.h
+++ b/libdbpp/types.h
@@ -28,6 +28,8 @@ namespace DB {
{
}
+ bool operator==(const DB::Blob b) const;
+
/// The beginning of the binary data.
const void * data;
/// The length of the binary data.