Initial import into git.
[galago.git] / cpp / galago / include / DocumentNameReader.hpp
blob81fcffb1b0adb07a33f57907a7464d7817b81bb3
2 //
3 // DocumentNameReader
4 //
5 // 5 January 2007 -- tds
6 //
8 #ifndef GALAGO_DOCUMENTNAMEREADER_HPP
9 #define GALAGO_DOCUMENTNAMEREADER_HPP
11 #include <string>
12 #include <vector>
13 #include "indri/indri-platform.h"
14 #include "lemur/RVLCompress.hpp"
15 #include "indri/RVLDecompressStream.hpp"
16 #include "indri/File.hpp"
17 #include "UncompressedRead.hpp"
19 class DocumentNameReader {
20 private:
21 struct NameSlot {
22 std::string prefix;
23 int offset;
24 int footerWidth;
25 std::vector<int> footers;
26 };
28 std::vector<NameSlot> _slots;
29 int _documentCount;
31 public:
32 void getInSlot( std::string& result, const NameSlot& slot, int footerIndex ) const;
33 std::string operator[] ( int index ) const;
34 std::string get( int index ) const;
35 void read( const std::string& filename );
36 };
38 #endif // GALAGO_DOCUMENTNAMEREADER_HPP