aboutsummaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/qhexedit2/xbytearray.h
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
committerLibravatarUnit 193 <unit193@ubuntu.com>2014-12-06 17:33:25 -0500
commit7167ce41b61d2ba2cdb526777a4233eb84a3b66a (patch)
treea35c14143716e1f2c98f808c81f89426045a946f /SQLiteStudio3/guiSQLiteStudio/qhexedit2/xbytearray.h
Imported Upstream version 2.99.6upstream/2.99.6
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/qhexedit2/xbytearray.h')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/qhexedit2/xbytearray.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/qhexedit2/xbytearray.h b/SQLiteStudio3/guiSQLiteStudio/qhexedit2/xbytearray.h
new file mode 100644
index 0000000..a5cdc11
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/qhexedit2/xbytearray.h
@@ -0,0 +1,67 @@
+#ifndef XBYTEARRAY_H
+#define XBYTEARRAY_H
+
+/** \cond docNever */
+
+#include "guiSQLiteStudio_global.h"
+#include <QtCore>
+
+/*! XByteArray represents the content of QHexEcit.
+XByteArray comprehend the data itself and informations to store if it was
+changed. The QHexEdit component uses these informations to perform nice
+rendering of the data
+
+XByteArray also provides some functionality to insert, replace and remove
+single chars and QByteArras. Additionally some functions support rendering
+and converting to readable strings.
+*/
+class GUI_API_EXPORT XByteArray
+{
+public:
+ explicit XByteArray();
+
+ int addressOffset();
+ void setAddressOffset(int offset);
+
+ int addressWidth();
+ void setAddressWidth(int width);
+
+ QByteArray & data();
+ void setData(QByteArray data);
+
+ bool dataChanged(int i);
+ QByteArray dataChanged(int i, int len);
+ void setDataChanged(int i, bool state);
+ void setDataChanged(int i, const QByteArray & state);
+
+ int realAddressNumbers();
+ int size();
+
+ QByteArray & insert(int i, char ch);
+ QByteArray & insert(int i, const QByteArray & ba);
+
+ QByteArray & remove(int pos, int len);
+
+ QByteArray & replace(int index, char ch);
+ QByteArray & replace(int index, const QByteArray & ba);
+ QByteArray & replace(int index, int length, const QByteArray & ba);
+
+ QChar asciiChar(int index);
+ QString toRedableString(int start=0, int end=-1);
+
+signals:
+
+public slots:
+
+private:
+ QByteArray _data;
+ QByteArray _changedData;
+
+ int _addressNumbers; // wanted width of address area
+ int _addressOffset; // will be added to the real addres inside bytearray
+ int _realAddressNumbers; // real width of address area (can be greater then wanted width)
+ int _oldSize; // size of data
+};
+
+/** \endcond docNever */
+#endif // XBYTEARRAY_H