• R/O
  • HTTP
  • SSH
  • HTTPS

MUtilities: 提交

MUtilities development repository


Commit MetaInfo

修订版f903add3e120e0084767a8cf60ad4305c5aa5c4a (tree)
时间2016-12-26 10:36:50
作者LoRd_MuldeR <mulder2@gmx....>
CommiterLoRd_MuldeR

Log Message

Disable copy constructor.

更改概述

差异

--- a/include/MUtils/Hash.h
+++ b/include/MUtils/Hash.h
@@ -41,7 +41,6 @@ namespace MUtils
4141 class MUTILS_API Hash
4242 {
4343 public:
44- Hash(const char* key = NULL) {};
4544 virtual ~Hash(void) {};
4645
4746 bool update(const quint8 *const data, const quint32 len) { return process(data, len); }
@@ -51,10 +50,15 @@ namespace MUtils
5150 QByteArray digest(const bool bAsHex = true) { return bAsHex ? finalize().toHex() : finalize(); }
5251
5352 protected:
53+ Hash(const char* key = NULL) {/*nothing to do*/};
5454 virtual bool process(const quint8 *const data, const quint32 len) = 0;
5555 virtual QByteArray finalize(void) = 0;
56+
57+ private:
58+ Hash &operator=(const Hash&) { throw "Disabled"; }
59+ Hash(const Hash&) { throw "Disabled"; }
5660 };
5761
58- Hash *create(const quint16 &hashId, const char *const key = NULL);
62+ MUTILS_API Hash *create(const quint16 &hashId, const char *const key = NULL);
5963 }
6064 }
Show on old repository browser