Add FixedSizeData::Null()
This commit is contained in:
parent
d9410488a7
commit
63fe94ffe6
@ -21,6 +21,8 @@ public:
|
||||
|
||||
static FixedSizeData<SIZE> CreatePseudoRandom();
|
||||
static FixedSizeData<SIZE> CreateOSRandom();
|
||||
//TODO Test Null()
|
||||
static FixedSizeData<SIZE> Null();
|
||||
|
||||
static FixedSizeData<SIZE> FromString(const std::string &data);
|
||||
std::string ToString() const;
|
||||
@ -66,6 +68,13 @@ FixedSizeData<SIZE> FixedSizeData<SIZE>::CreateOSRandom() {
|
||||
return result;
|
||||
}
|
||||
|
||||
template<unsigned int SIZE>
|
||||
FixedSizeData<SIZE> FixedSizeData<SIZE>::Null() {
|
||||
FixedSizeData<SIZE> result;
|
||||
std::memset(result._data, 0, BINARY_LENGTH);
|
||||
return result;
|
||||
}
|
||||
|
||||
template<unsigned int SIZE>
|
||||
FixedSizeData<SIZE> FixedSizeData<SIZE>::FromString(const std::string &data) {
|
||||
ASSERT(data.size() == STRING_LENGTH, "Wrong string size for parsing FixedSizeData");
|
||||
|
Loading…
x
Reference in New Issue
Block a user