qTox
Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
|
Helper to convert safely between strings in the c-toxcore representation and QString. More...
#include <toxstring.h>
Public Member Functions | |
ToxString (const QString &text) | |
Creates a ToxString from a QString. More... | |
ToxString (const QByteArray &text) | |
Creates a ToxString from bytes in a QByteArray. More... | |
ToxString (const uint8_t *text, size_t length) | |
Creates a ToxString from the representation used by c-toxcore. More... | |
const uint8_t * | data () const |
Returns a pointer to the beginning of the string data. More... | |
size_t | size () const |
Get the number of bytes in the string. More... | |
QString | getQString () const |
Gets the string as QString. More... | |
QByteArray | getBytes () const |
getBytes Gets the bytes of the string. More... | |
Private Attributes | |
QByteArray | string |
Helper to convert safely between strings in the c-toxcore representation and QString.
Definition at line 27 of file toxstring.h.
|
explicit |
Creates a ToxString from a QString.
string | Input text. |
Definition at line 37 of file toxstring.cpp.
|
explicit |
Creates a ToxString from bytes in a QByteArray.
text | Input text. |
Definition at line 46 of file toxstring.cpp.
ToxString::ToxString | ( | const uint8_t * | text, |
size_t | length | ||
) |
Creates a ToxString from the representation used by c-toxcore.
text | Pointer to the beginning of the text. |
length | Number of bytes to read from the beginning. |
Definition at line 56 of file toxstring.cpp.
const uint8_t * ToxString::data | ( | ) | const |
Returns a pointer to the beginning of the string data.
Definition at line 66 of file toxstring.cpp.
QByteArray ToxString::getBytes | ( | ) | const |
getBytes Gets the bytes of the string.
Definition at line 93 of file toxstring.cpp.
QString ToxString::getQString | ( | ) | const |
Gets the string as QString.
Definition at line 84 of file toxstring.cpp.
size_t ToxString::size | ( | ) | const |
Get the number of bytes in the string.
Definition at line 75 of file toxstring.cpp.
|
private |
Definition at line 40 of file toxstring.h.