aboutsummaryrefslogtreecommitdiff
path: root/src/index.h
diff options
context:
space:
mode:
authorAdrian Kummerlaender2017-10-07 15:45:37 +0200
committerAdrian Kummerlaender2017-10-07 15:45:37 +0200
commit51a422f161e7e7cc5b1093a12e004165754ec1b9 (patch)
tree5c23a69b197e614424aba3e14f59be87de6a4fac /src/index.h
parent574e79243648debf57a0d92653bd0df83398e772 (diff)
downloadDictzipQuery-51a422f161e7e7cc5b1093a12e004165754ec1b9.tar
DictzipQuery-51a422f161e7e7cc5b1093a12e004165754ec1b9.tar.gz
DictzipQuery-51a422f161e7e7cc5b1093a12e004165754ec1b9.tar.bz2
DictzipQuery-51a422f161e7e7cc5b1093a12e004165754ec1b9.tar.lz
DictzipQuery-51a422f161e7e7cc5b1093a12e004165754ec1b9.tar.xz
DictzipQuery-51a422f161e7e7cc5b1093a12e004165754ec1b9.tar.zst
DictzipQuery-51a422f161e7e7cc5b1093a12e004165754ec1b9.zip
Introduce IndexFile class
Diffstat (limited to 'src/index.h')
-rw-r--r--src/index.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/index.h b/src/index.h
new file mode 100644
index 0000000..50acb2e
--- /dev/null
+++ b/src/index.h
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <string>
+#include <vector>
+#include <cstdint>
+
+namespace dictzip {
+
+class IndexFile {
+public:
+ struct Entry {
+ Entry(const std::string& line);
+ Entry(const std::string& word, std::size_t offset, std::size_t length);
+
+ const std::string word;
+ const std::size_t offset;
+ const std::size_t length;
+ };
+
+ IndexFile(const std::string& path);
+
+ std::vector<Entry> get(const std::string& word);
+
+private:
+ const std::string path_;
+
+};
+
+}