Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
AbstractHash.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Core module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_ABSTRACTHASH_HPP
8 #define NAZARA_ABSTRACTHASH_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Core/Enums.hpp>
12 #include <memory>
13 
14 namespace Nz
15 {
16  class ByteArray;
17 
18  class NAZARA_CORE_API AbstractHash
19  {
20  public:
21  AbstractHash() = default;
22  AbstractHash(const AbstractHash&) = delete;
23  AbstractHash(AbstractHash&&) = default;
24  virtual ~AbstractHash();
25 
26  virtual void Append(const UInt8* data, std::size_t len) = 0;
27  virtual void Begin() = 0;
28  virtual ByteArray End() = 0;
29 
30  virtual std::size_t GetDigestLength() const = 0;
31  virtual const char* GetHashName() const = 0;
32 
33  AbstractHash& operator=(const AbstractHash&) = delete;
34  AbstractHash& operator=(AbstractHash&&) = default;
35 
36  static std::unique_ptr<AbstractHash> Get(HashType hash);
37  };
38 }
39 
40 #endif // NAZARA_ABSTRACTHASH_HPP
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Core class that represents the behaviour of the hash classes.
Definition: AbstractHash.hpp:18
Core class that represents an array of bytes.
Definition: ByteArray.hpp:18