Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <deathbaba@gmail.com>2011-07-28 09:11:50 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:21:08 +0300
commit03498d612549e1bfe7b4a7b22663a1e5f5e8c66a (patch)
tree0ae31b8fec49dccbc362d336a576bfd059bf9059 /coding/mmap_reader.hpp
parent8e0260818d938ffa9f3c7bb75307689d22b1659a (diff)
Added (but not activated) coding/mmap_reader.
@TODO Add Windows support
Diffstat (limited to 'coding/mmap_reader.hpp')
-rw-r--r--coding/mmap_reader.hpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/coding/mmap_reader.hpp b/coding/mmap_reader.hpp
new file mode 100644
index 0000000000..480cd0eefa
--- /dev/null
+++ b/coding/mmap_reader.hpp
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "reader.hpp"
+
+#include "../std/shared_ptr.hpp"
+
+/// @TODO Add Windows support
+class MmapReader : public ModelReader
+{
+ typedef ModelReader base_type;
+
+ class MmapData;
+ shared_ptr<MmapData> m_data;
+ uint64_t m_offset;
+ uint64_t m_size;
+
+ MmapReader(MmapReader const & reader, uint64_t offset, uint64_t size);
+
+public:
+ explicit MmapReader(string const & fileName);
+
+ virtual uint64_t Size() const;
+ virtual void Read(uint64_t pos, void * p, size_t size) const;
+ virtual MmapReader * CreateSubReader(uint64_t pos, uint64_t size) const;
+};