Quark  0.1
MemoryBlock.h++
Go to the documentation of this file.
1 #ifndef __libquark_util_MemoryBlock_hxx
2 #define __libquark_util_MemoryBlock_hxx
3 
4 #include <QtGlobal>
5 
6 #include <quark/Quark.h++>
7 
8 namespace quark {
9 namespace util {
10 
17 {
18  public:
19 
27  MemoryBlock(uchar *data, uint length);
28 
30  virtual ~MemoryBlock();
31 
33  uchar *data() const
34  { return _data; }
35 
37  void setData(uchar *data)
38  { _data = data; }
39 
41  uint length() const
42  { return(_length); }
43 
45  void setLength(uint length)
46  { _length = length; }
47 
56  int find(uchar *sequence, uint sequenceLength) const;
57 
66  int findLast(uchar *sequence, uint sequenceLength) const;
67 
68  private:
69 
70  uchar *_data;
71  uint _length;
72 };
73 
74 } // namespace util
75 } // namespace quark
76 
77 #endif // __libquark_util_MemoryBlock_hxx
void setData(uchar *data)
Sets the pointer to the data.
Definition: MemoryBlock.h++:37
A class representing a block of raw memory.
Definition: MemoryBlock.h++:16
Definition: BarChartView.h++:6
uchar * data() const
Returns a pointer to the data.
Definition: MemoryBlock.h++:33
void setLength(uint length)
Sets the length of the data.
Definition: MemoryBlock.h++:45
uint length() const
Returns the length of the data.
Definition: MemoryBlock.h++:41
#define LIBQUARK_API
Definition: Quark.h++:18