Lucene++ - a full-featured, c++ search engine
API Documentation


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ChecksumIndexOutput.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2011 Alan Wright. All rights reserved.
3 // Distributable under the terms of either the Apache License (Version 2.0)
4 // or the GNU Lesser General Public License.
6 
7 #ifndef CHECKSUMINDEXOUTPUT_H
8 #define CHECKSUMINDEXOUTPUT_H
9 
10 #include <boost/crc.hpp>
11 #include "IndexOutput.h"
12 
13 namespace Lucene
14 {
17  class LPPAPI ChecksumIndexOutput : public IndexOutput
18  {
19  public:
21  virtual ~ChecksumIndexOutput();
22 
24 
25  protected:
26  IndexOutputPtr main;
27  boost::crc_32_type checksum;
28 
29  public:
32  virtual void writeByte(uint8_t b);
33 
38  virtual void writeBytes(const uint8_t* b, int32_t offset, int32_t length);
39 
41  int64_t getChecksum();
42 
44  virtual void flush();
45 
47  virtual void close();
48 
51  virtual int64_t getFilePointer();
52 
55  virtual void seek(int64_t pos);
56 
60  void prepareCommit();
61 
63  void finishCommit();
64 
66  virtual int64_t length();
67  };
68 }
69 
70 #endif

clucene.sourceforge.net