libassetmap  1.0.0
Hash-table based archive format containing compressed data
IMemMapper.h
1 #ifndef LIBASSETMAP_IMEMMAPPER_H
2 #define LIBASSETMAP_IMEMMAPPER_H
3 
4 #include <cstdint>
5 #include <cstdlib>
6 
7 namespace AssetMap {
8  class IMemMapper {
9  public:
20  virtual IMemMapper& Resize(size_t size) = 0;
21 
24  [[nodiscard]] virtual size_t Size() const noexcept = 0;
25 
29  [[nodiscard]] virtual const uint8_t* Get() const noexcept = 0;
30 
36  [[nodiscard]] virtual uint8_t* Get() noexcept = 0;
37 
38  virtual ~IMemMapper() noexcept = default;
39  };
40 } // namespace AssetMap
41 
42 #endif // LIBASSETMAP_IMEMMAPPER_H
AssetMap::IMemMapper
Definition: IMemMapper.h:8
AssetMap::IMemMapper::Get
virtual const uint8_t * Get() const noexcept=0
Obtain a read-only pointer to the mapped data.
AssetMap::IMemMapper::Resize
virtual IMemMapper & Resize(size_t size)=0
Resize a mapped file.
AssetMap
Definition: DirectoryMetadata.h:65
AssetMap::IMemMapper::Size
virtual size_t Size() const noexcept=0
Get the size of this mapping.