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 // 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 PAYLOAD_H
8 #define PAYLOAD_H
9 
10 #include "LuceneObject.h"
11 
12 namespace Lucene
13 {
21  class LPPAPI Payload : public LuceneObject
22  {
23  public:
25  Payload();
26 
30  Payload(ByteArray data);
31 
37  Payload(ByteArray data, int32_t offset, int32_t length);
38 
39  virtual ~Payload();
40 
42 
43  protected:
45  ByteArray data;
46 
48  int32_t offset;
49 
51  int32_t _length;
52 
53  public:
55  void setData(ByteArray data);
56 
58  void setData(ByteArray data, int32_t offset, int32_t length);
59 
61  ByteArray getData();
62 
64  int32_t getOffset();
65 
67  int32_t length();
68 
70  uint8_t byteAt(int32_t index);
71 
73  ByteArray toByteArray();
74 
78  void copyTo(ByteArray target, int32_t targetOffset);
79 
81  virtual LuceneObjectPtr clone(LuceneObjectPtr other = LuceneObjectPtr());
82 
83  virtual bool equals(LuceneObjectPtr other);
84  virtual int32_t hashCode();
85  };
86 }
87 
88 #endif

clucene.sourceforge.net