QHexEdit
 All Classes Functions Properties
xbytearray.h
1 #ifndef XBYTEARRAY_H
2 #define XBYTEARRAY_H
3 
6 #include <QtCore>
7 
17 class XByteArray
18 {
19 public:
20  explicit XByteArray();
21 
22  int addressOffset();
23  void setAddressOffset(int offset);
24 
25  int addressWidth();
26  void setAddressWidth(int width);
27 
28  QByteArray & data();
29  void setData(QByteArray data);
30 
31  bool dataChanged(int i);
32  QByteArray dataChanged(int i, int len);
33  void setDataChanged(int i, bool state);
34  void setDataChanged(int i, const QByteArray & state);
35 
36  int realAddressNumbers();
37  int size();
38 
39  QByteArray & insert(int i, char ch);
40  QByteArray & insert(int i, const QByteArray & ba);
41 
42  QByteArray & remove(int pos, int len);
43 
44  QByteArray & replace(int index, char ch);
45  QByteArray & replace(int index, const QByteArray & ba);
46  QByteArray & replace(int index, int length, const QByteArray & ba);
47 
48  QChar asciiChar(int index);
49  QString toRedableString(int start=0, int end=-1);
50 
51 signals:
52 
53 public slots:
54 
55 private:
56  QByteArray _data;
57  QByteArray _changedData;
58 
59  int _addressNumbers; // wanted width of address area
60  int _addressOffset; // will be added to the real addres inside bytearray
61  int _realAddressNumbers; // real width of address area (can be greater then wanted width)
62  int _oldSize; // size of data
63 };
64 
66 #endif // XBYTEARRAY_H