Files
wc3re/util.hh
Matthias Blankertz ae51cd24c4 MmapFile helper; MveDecoder WIP
Added an MmapFile helper and changed iffexplore and treexplore to use it.
WIP: MveDecoder
Misc. changes/fixes
2015-04-24 22:13:32 +02:00

33 lines
556 B
C++

#ifndef WC3RE_UTIL_HH__
#define WC3RE_UTIL_HH__
#include <cstdint>
#include <string>
#include "common.hh"
class MmapFile {
public:
MmapFile(std::string fileName);
MmapFile(MmapFile const& copy) = delete;
MmapFile(MmapFile && move);
~MmapFile();
MmapFile& operator=(MmapFile const& copy) = delete;
MmapFile& operator=(MmapFile && move);
std::string const& name() const;
size_t size() const;
char const* data() const;
operator bool() const;
private:
std::string name_;
FILEUPtr fd_;
size_t size_;
void *base_;
};
#endif