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


Loading...
Searching...
No Matches
ChecksumIndexInput.h
Go to the documentation of this file.
1
2// Copyright (c) 2009-2014 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 CHECKSUMINDEXINPUT_H
8#define CHECKSUMINDEXINPUT_H
9
10#include <boost/crc.hpp>
11#include "IndexInput.h"
12
13namespace Lucene {
14
17class LPPAPI ChecksumIndexInput : public IndexInput {
18public:
21
23
24protected:
26 boost::crc_32_type checksum;
27
28public:
31 virtual uint8_t readByte();
32
38 virtual void readBytes(uint8_t* b, int32_t offset, int32_t length);
39
41 int64_t getChecksum();
42
44 virtual void close();
45
48 virtual int64_t getFilePointer();
49
52 virtual void seek(int64_t pos);
53
55 virtual int64_t length();
56
59};
60
61}
62
63#endif
#define LUCENE_CLASS(Name)
Definition LuceneObject.h:24
Writes bytes through to a primary IndexInput, computing checksum as it goes. Note that you cannot use...
Definition ChecksumIndexInput.h:17
ChecksumIndexInput(const IndexInputPtr &main)
virtual LuceneObjectPtr clone(const LuceneObjectPtr &other=LuceneObjectPtr())
Returns a clone of this stream.
virtual void readBytes(uint8_t *b, int32_t offset, int32_t length)
Reads a specified number of bytes into an array at the specified offset.
int64_t getChecksum()
Return calculated checksum.
virtual void seek(int64_t pos)
Sets current position in this file, where the next read will occur.
virtual uint8_t readByte()
Reads and returns a single byte.
virtual void close()
Closes the stream to further operations.
virtual int64_t getFilePointer()
Returns the current position in this file, where the next read will occur.
boost::crc_32_type checksum
Definition ChecksumIndexInput.h:26
IndexInputPtr main
Definition ChecksumIndexInput.h:25
virtual int64_t length()
The number of bytes in the file.
Abstract base class for input from a file in a Directory. A random-access input stream....
Definition IndexInput.h:17
Definition AbstractAllTermDocs.h:12
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition LuceneTypes.h:539
boost::shared_ptr< IndexInput > IndexInputPtr
Definition LuceneTypes.h:493

clucene.sourceforge.net