Classe usada para transportar dados binários pelo sistema. Pode ser usada para conversão de texto em array de bytes e vice-versa. Usar esta classe ao invés do QByteArray por causa do uso de "unsigned char", e pela possibilidade de fazer "cópias profundas" dos dados.
More...
#include <ByteArray.h>
Classe usada para transportar dados binários pelo sistema. Pode ser usada para conversão de texto em array de bytes e vice-versa. Usar esta classe ao invés do QByteArray por causa do uso de "unsigned char", e pela possibilidade de fazer "cópias profundas" dos dados.
◆ ByteArray() [1/8]
◆ ByteArray() [2/8]
ByteArray::ByteArray |
( |
unsigned int |
length | ) |
|
◆ ByteArray() [3/8]
ByteArray::ByteArray |
( |
const unsigned char * |
data, |
|
|
unsigned int |
length |
|
) |
| |
ByteArray a partir do buffer desejado, copiando os dados.
- Parameters
-
data | Buffer de origem dos bytes. |
length | Tamanho do buffer. |
◆ ByteArray() [4/8]
ByteArray::ByteArray |
( |
std::ostringstream * |
buffer | ) |
|
ByteArray a partir de ostringstream copiando os dados.
- Parameters
-
buffer | ostream com os dados para colocar no ByteArray |
◆ ByteArray() [5/8]
ByteArray::ByteArray |
( |
std::string |
data | ) |
|
ByteArray a partir de dados legíveis.
- Parameters
-
data | dados que serão colocados no objeto |
◆ ByteArray() [6/8]
ByteArray::ByteArray |
( |
char * |
data | ) |
|
◆ ByteArray() [7/8]
ByteArray::ByteArray |
( |
int |
length | ) |
|
◆ ByteArray() [8/8]
ByteArray::ByteArray |
( |
const ByteArray & |
value | ) |
|
◆ ~ByteArray()
ByteArray::~ByteArray |
( |
| ) |
|
|
virtual |
◆ at()
char ByteArray::at |
( |
int |
pos | ) |
const |
throw | ( | out_of_range |
| ) | | |
Ler o byte da posição desejada.
- Parameters
-
◆ copyFrom() [1/2]
void ByteArray::copyFrom |
( |
unsigned char * |
data, |
|
|
unsigned int |
length |
|
) |
| |
Copy bytes from desired memory location.
- Parameters
-
data | Desired memory location. |
length | Amount to copy. |
◆ copyFrom() [2/2]
void ByteArray::copyFrom |
( |
int |
offset, |
|
|
int |
length, |
|
|
ByteArray & |
data, |
|
|
int |
offset2 |
|
) |
| |
Copy bytes from desired ByteArray, considering an offset.
- Parameters
-
offset | Offset to consider for copying. |
length | Amount to copy. |
data | Desired ByteArray. |
offset2 | Offset to consider for copy begin in data. |
◆ getDataPointer()
unsigned char * ByteArray::getDataPointer |
( |
| ) |
|
Returns the memory location of byte array content.
◆ operator=()
Fazer uma cópia profunda ao invés de copiar a referência
- Parameters
-
◆ operator[]()
unsigned char & ByteArray::operator[] |
( |
int |
pos | ) |
|
throw | ( | out_of_range |
| ) | | |
Ler o byte da posição desejada.
- Parameters
-
◆ setDataPointer()
void ByteArray::setDataPointer |
( |
unsigned char * |
data, |
|
|
unsigned int |
length |
|
) |
| |
Set the content of ByteArray to be an already allocated memory space.
- Parameters
-
data | Desired memory location. |
length | Length of allocated memory. |
◆ size()
unsigned int ByteArray::size |
( |
| ) |
const |
Returns the memory location of byte array content. Returns the byte array content encoded as base 64 characters. Returns the size of current byte array.
◆ toHex() [1/2]
std::string ByteArray::toHex |
( |
| ) |
|
|
virtual |
Converts the content of this bytearray to hexadecimal value.
◆ toHex() [2/2]
std::string ByteArray::toHex |
( |
char |
separator | ) |
|
|
virtual |
Converts the content of this bytearray to hexadecimal value separated using the char informed as argument.
◆ toStream()
std::istringstream * ByteArray::toStream |
( |
| ) |
|
Returns an istringstream representing current byte array.
◆ toString()
std::string ByteArray::toString |
( |
| ) |
|
|
virtual |
Consider that current byte array is a char array, and retuirns it as a QString.
◆ xOr()
Computes multiple xor of vector elements.
◆ operator xor
Fazer ou-exclusivo entre dois ByteArray's.
- Parameters
-
◆ operator!=
Permitir diferença booleana de ByteArray's
- Parameters
-
◆ operator==
Permitir comparação booleana de ByteArray's
- Parameters
-
The documentation for this class was generated from the following files: