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


 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Payload.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 PAYLOAD_H
8 #define PAYLOAD_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene {
13 
21 class LPPAPI Payload : public LuceneObject {
22 public:
24  Payload();
25 
29  Payload(ByteArray data);
30 
36  Payload(ByteArray data, int32_t offset, int32_t length);
37 
38  virtual ~Payload();
39 
41 
42 protected:
44  ByteArray data;
45 
47  int32_t offset;
48 
50  int32_t _length;
51 
52 public:
54  void setData(ByteArray data);
55 
57  void setData(ByteArray data, int32_t offset, int32_t length);
58 
60  ByteArray getData();
61 
63  int32_t getOffset();
64 
66  int32_t length();
67 
69  uint8_t byteAt(int32_t index);
70 
72  ByteArray toByteArray();
73 
77  void copyTo(ByteArray target, int32_t targetOffset);
78 
80  virtual LuceneObjectPtr clone(const LuceneObjectPtr& other = LuceneObjectPtr());
81 
82  virtual bool equals(const LuceneObjectPtr& other);
83  virtual int32_t hashCode();
84 };
85 
86 }
87 
88 #endif

clucene.sourceforge.net