#include <QtCrypto>
Inheritance diagram for QCA::MemoryRegion:
Public Member Functions | |
MemoryRegion (const char *str) | |
MemoryRegion (const QByteArray &from) | |
MemoryRegion (const MemoryRegion &from) | |
MemoryRegion & | operator= (const MemoryRegion &from) |
MemoryRegion & | operator= (const QByteArray &from) |
bool | isNull () const |
bool | isSecure () const |
QByteArray | toByteArray () const |
bool | isEmpty () const |
int | size () const |
const char * | data () const |
const char * | constData () const |
const char & | at (int index) const |
Protected Member Functions | |
MemoryRegion (bool secure) | |
MemoryRegion (int size, bool secure) | |
MemoryRegion (const QByteArray &from, bool secure) | |
char * | data () |
char & | at (int index) |
bool | resize (int size) |
void | set (const QByteArray &from, bool secure) |
void | setSecure (bool secure) |
This class is mostly unusable on its own. Either use it as a SecureArray subclass or call toByteArray() to convert to QByteArray.
Note that this class is implicitly shared (that is, copy on write).
|
Constructs a new Memory Region from a null terminated character array.
|
|
Constructs a new MemoryRegion from the data in a byte array.
|
|
Standard copy constructor.
|
|
Create a memory region, optionally using secure storage.
|
|
Create a memory region, optionally using secure storage.
|
|
Create a memory region, optionally using secure storage. This constructor variant allows you to initialize the memory region from an existing array.
|
|
Standard assignment operator.
|
|
Standard assignment operator.
Reimplemented in QCA::SecureArray. |
|
Test if the MemoryRegion is null (i.e. was created as a null array, and hasn't been resized). This is probably not what you are trying to do. If you are trying to determine whether there are any bytes in the array, use isEmpty() instead. |
|
Test if the MemoryRegion is using secure memory, or not. In this context, memory is secure if it will not be paged out to disk.
|
|
Convert this memory region to a byte array.
Reimplemented in QCA::SecureArray. |
|
Returns true if the size of the memory region is zero.
Reimplemented in QCA::SecureArray. |
|
Returns the number of bytes in the memory region.
Reimplemented in QCA::SecureArray. |
|
Convert the contents of the memory region to a C-compatible character array. This consists of size() bytes, followed by a null terminator.
Reimplemented in QCA::SecureArray. |
|
Convert the contents of the memory region to a C-compatible character array. This consists of size() bytes, followed by a null terminator.
Reimplemented in QCA::SecureArray. |
|
Obtain the value of the memory location at the specified position.
Reimplemented in QCA::SecureArray. |
|
Convert the contents of the memory region to a C-compatible character array. This consists of size() bytes, followed by a null terminator. Reimplemented in QCA::SecureArray. |
|
Obtain the value of the memory location at the specified position.
Reimplemented in QCA::SecureArray. |
|
Resize the memory region to the specified size.
Reimplemented in QCA::SecureArray. |
|
Modify the memory region to match a specified byte array. This resizes the memory region as required to match the byte array size.
|
|
Convert the memory region to use the specified memory type. This may involve copying data from secure to insecure storage, or from insecure to secure storage.
|