version 2.39.0
PIString works with PIConstChars picodeinfo optimizations PIIODevice::availableClasses
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
#define PISTRING_H
|
||||
|
||||
#include "pibytearray.h"
|
||||
#include "piconstchars.h"
|
||||
|
||||
#define PIStringAscii PIString::fromAscii
|
||||
|
||||
@@ -71,6 +72,7 @@ public:
|
||||
PIString & operator +=(const wchar_t * str);
|
||||
PIString & operator +=(const PIByteArray & ba) {appendFromChars((const char * )ba.data(), ba.size_s(), __utf8name__); return *this;}
|
||||
PIString & operator +=(const PIString & str);
|
||||
PIString & operator +=(const PIConstChars & str);
|
||||
|
||||
//! \~english Contructs a copy of string.
|
||||
//! \~russian Создает копию строки.
|
||||
@@ -143,6 +145,8 @@ public:
|
||||
//! PIString s(5, "№"); // s = "№№№№№"
|
||||
//! \endcode
|
||||
PIString(const int len, const PIChar c) {for (int i = 0; i < len; ++i) d.push_back(c);}
|
||||
|
||||
PIString(const PIConstChars & c) {*this += c;}
|
||||
|
||||
~PIString();
|
||||
|
||||
@@ -154,6 +158,14 @@ public:
|
||||
//! \~russian Оператор перемещающего присваивания.
|
||||
PIString & operator =(PIString && o) {d.swap(o.d); piSwap(data_, o.data_); return *this;}
|
||||
|
||||
//! \~english Assign operator.
|
||||
//! \~russian Оператор присваивания.
|
||||
PIString & operator =(const PIConstChars & o) {d.clear(); *this += o; return *this;}
|
||||
|
||||
//! \~english Assign operator.
|
||||
//! \~russian Оператор присваивания.
|
||||
PIString & operator =(const char * o) {d.clear(); *this += o; return *this;}
|
||||
|
||||
//! \~english Compare operator.
|
||||
//! \~russian Оператор сравнения.
|
||||
bool operator ==(const PIString & str) const;
|
||||
@@ -271,6 +283,8 @@ public:
|
||||
//! \endcode
|
||||
PIString & operator <<(const wchar_t * str) {*this += str; return *this;}
|
||||
|
||||
PIString & operator <<(const PIConstChars & str) {*this += str; return *this;}
|
||||
|
||||
//! \~english Append string representation of "num" at the end of string.
|
||||
//! \~russian Добавляет в конец строковое представление "num".
|
||||
//! \~\details
|
||||
@@ -453,6 +467,8 @@ public:
|
||||
//! \~russian Вставляет "str" в конец строки.
|
||||
PIString & append(const PIString & str) {d.append(str.d); return *this;}
|
||||
|
||||
PIString & append(const PIConstChars & str) {*this += str; return *this;}
|
||||
|
||||
//! \~english Insert character `c` at the end of string.
|
||||
//! \~russian Вставляет символ `c` в конец строки.
|
||||
PIString & append(const PIChar c) {d.append(c); return *this;}
|
||||
@@ -469,6 +485,8 @@ public:
|
||||
//! \~russian Вставляет "str" в конец строки.
|
||||
PIString & push_back(const PIString & str) {d.push_back(str.d); return *this;}
|
||||
|
||||
PIString & push_back(const PIConstChars & str) {*this += str; return *this;}
|
||||
|
||||
//! \~english Insert character `c` at the end of string.
|
||||
//! \~russian Вставляет символ `c` в конец строки.
|
||||
PIString & push_back(const PIChar c) {d.push_back(c); return *this;}
|
||||
|
||||
Reference in New Issue
Block a user