#ifndef WC3RE_UTIL_HH__ #define WC3RE_UTIL_HH__ #include #include #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