Module implementing the storage backend for the hex editor.
None |
HexEditChunk | Class implementing a container for the data chunks. |
HexEditChunks | Class implementing the storage backend for the hex editor. |
None |
Class implementing a container for the data chunks.
None |
None |
HexEditChunk | Constructor |
None |
Constructor
Class implementing the storage backend for the hex editor.
When HexEditWidget loads data, HexEditChunks access them using a QIODevice interface. When the app uses a QByteArray or Python bytearray interface, QBuffer is used to provide again a QIODevice like interface. No data will be changed, therefore HexEditChunks opens the QIODevice in QIODevice.ReadOnly mode. After every access HexEditChunks closes the QIODevice. That's why external applications can overwrite files while HexEditWidget shows them.
When the the user starts to edit the data, HexEditChunks creates a local copy of a chunk of data (4 kilobytes) and notes all changes there. Parallel to that chunk, there is a second chunk, which keeps track of which bytes are changed and which are not.
BUFFER_SIZE |
CHUNK_SIZE |
READ_CHUNK_MASK |
None |
HexEditChunks | Constructor |
__getChunkIndex | Private method to get the chunk index for a position. |
__getitem__ | Special method to get a byte at a position. |
data | Public method to get data out of the chunks. |
dataChanged | Public method to test, if some data was changed. |
indexOf | Public method to search the first occurrence of some data. |
insert | Public method to insert a byte. |
lastIndexOf | Public method to search the last occurrence of some data. |
overwrite | Public method to overwrite a byte. |
pos | Public method to get the current position. |
removeAt | Public method to remove a byte. |
setDataChanged | Public method to set highlighting info. |
setIODevice | Public method to set an io device to read the binary data from. |
size | Public method to get the current data size. |
write | Public method to write data to an io device. |
None |
Constructor
Private method to get the chunk index for a position.
This method checks, if there is already a copied chunk available. If there is one, it returns its index. If there is no copied chunk available, original data will be copied into a new chunk.
Special method to get a byte at a position.
Note: This realizes the [] get operator.
Public method to get data out of the chunks.
Public method to test, if some data was changed.
Public method to search the first occurrence of some data.
Public method to insert a byte.
Public method to search the last occurrence of some data.
Public method to overwrite a byte.
Public method to get the current position.
Public method to remove a byte.
Public method to set highlighting info.
Public method to set an io device to read the binary data from.
Public method to get the current data size.
Public method to write data to an io device.