UByteArray integrated

- another Qt class can be replaced for non-Qt builds
This commit is contained in:
Nikolaj Schlej 2016-07-05 17:22:03 +02:00
parent 804a55ba64
commit 71ba5fe582
10 changed files with 56 additions and 28 deletions

View file

@ -365,9 +365,9 @@ struct CBString : public tagbstring {
CBString toLocal8Bit() { return *this; }
bool isEmpty() const { return slen == 0; }
void clear() { *this = ""; }
CBString left(int len) { return midstr(0, len); }
CBString mid(int pos, int len) { return midstr(pos, len); }
static CBString fromUtf16(const ushort* str) { // Naive implementation assuming that only ASCII part of UCS2 is used
CBString left(int len) const { return midstr(0, len); }
CBString mid(int pos, int len) const { return midstr(pos, len); }
static CBString fromUtf16(const unsigned short* str) { // Naive implementation assuming that only ASCII part of UCS2 is used
CBString msg; while (*str) { msg += *(char*)str; str++; } return msg;
}
CBString leftJustified(int length) { if (length > slen) { return *this + CBString(' ', length - slen); } return *this; }