First commit
This commit is contained in:
55
include/Nazara/Core/HashDigest.hpp
Normal file
55
include/Nazara/Core/HashDigest.hpp
Normal file
@@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2012 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine".
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_HASHDIGEST_HPP
|
||||
#define NAZARA_HASHDIGEST_HPP
|
||||
|
||||
#define NAZARA_HASHDIGEST
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <ostream>
|
||||
|
||||
class NAZARA_API NzHashDigest
|
||||
{
|
||||
public:
|
||||
NzHashDigest();
|
||||
NzHashDigest(NzString hashName, const nzUInt8* digest, unsigned int length);
|
||||
NzHashDigest(const NzHashDigest& rhs);
|
||||
NzHashDigest(NzHashDigest&& rhs);
|
||||
~NzHashDigest();
|
||||
|
||||
bool IsValid() const;
|
||||
|
||||
const nzUInt8* GetDigest() const;
|
||||
unsigned int GetDigestLength() const;
|
||||
NzString GetHashName() const;
|
||||
|
||||
NzString ToHex() const;
|
||||
|
||||
nzUInt8 operator[](unsigned short pos) const;
|
||||
|
||||
NzHashDigest& operator=(const NzHashDigest& rhs);
|
||||
NzHashDigest& operator=(NzHashDigest&& rhs);
|
||||
|
||||
bool operator==(const NzHashDigest& rhs) const;
|
||||
bool operator!=(const NzHashDigest& rhs) const;
|
||||
bool operator<(const NzHashDigest& rhs) const;
|
||||
bool operator<=(const NzHashDigest& rhs) const;
|
||||
bool operator>(const NzHashDigest& rhs) const;
|
||||
bool operator>=(const NzHashDigest& rhs) const;
|
||||
|
||||
NAZARA_API friend std::ostream& operator<<(std::ostream& out, const NzHashDigest& string);
|
||||
|
||||
private:
|
||||
NzString m_hashName;
|
||||
nzUInt8* m_digest;
|
||||
unsigned short m_digestLength;
|
||||
};
|
||||
|
||||
#undef NAZARA_HASHDIGEST
|
||||
|
||||
#endif // NAZARA_HASHDIGEST_HPP
|
||||
Reference in New Issue
Block a user