From 7514b57ebf883e4e99a83411f11448343f409f22 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 20 Jul 2010 23:14:48 +0000 Subject: [PATCH] Added Data() getter and an assignment operator getting a raw buffer. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37637 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tests/system/kernel/file_corruption/CheckSum.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/tests/system/kernel/file_corruption/CheckSum.h b/src/tests/system/kernel/file_corruption/CheckSum.h index 7c1000d3e0..8fefe7769d 100644 --- a/src/tests/system/kernel/file_corruption/CheckSum.h +++ b/src/tests/system/kernel/file_corruption/CheckSum.h @@ -12,6 +12,10 @@ struct CheckSum { + const uint8* Data() const + { + return fData; + } bool IsZero() const { @@ -29,6 +33,12 @@ struct CheckSum { return *this; } + CheckSum& operator=(const void* buffer) + { + memcpy(fData, buffer, sizeof(fData)); + return *this; + } + bool operator==(const void* buffer) const { return memcmp(fData, buffer, sizeof(fData)) == 0;