PIDeque doc, fixes in PIVector and PIString

This commit is contained in:
Andrey
2022-04-21 18:25:44 +03:00
parent 8beaac5193
commit 93b881da1b
4 changed files with 2384 additions and 401 deletions

View File

@@ -53,8 +53,8 @@ public:
//! \~russian Значение для пропуска справа
static const float ElideRight ;
PIString & operator +=(const PIChar c) {push_back(c); return *this;}
PIString & operator +=(const char c) {push_back(PIChar(c)); return *this;}
PIString & operator +=(const PIChar & c) {PIDeque<PIChar>::push_back(c); return *this;}
PIString & operator +=(const char c) {PIDeque<PIChar>::push_back(PIChar(c)); return *this;}
PIString & operator +=(const char * str);
PIString & operator +=(const wchar_t * str);
PIString & operator +=(const PIByteArray & ba) {appendFromChars((const char * )ba.data(), ba.size_s(), __utf8name__); return *this;}
@@ -121,7 +121,7 @@ public:
//! \~\code
//! PIString s(5, 'p'); // s = "ppppp"
//! \endcode
PIString(const int len, const char c): PIDeque<PIChar>() {for (int i = 0; i < len; ++i) push_back(c);}
PIString(const int len, const char c): PIDeque<PIChar>() {for (int i = 0; i < len; ++i) PIDeque<PIChar>::push_back(PIChar(c));}
//! \~english Contructs string as sequence of symbols "c" of buffer with length "len"
//! \~russian Создает строку как последовательность длиной "len" символа "c"
@@ -129,7 +129,7 @@ public:
//! \~\code
//! PIString s(5, "№"); // s = "№№№№№"
//! \endcode
PIString(const int len, const PIChar c): PIDeque<PIChar>() {for (int i = 0; i < len; ++i) push_back(c);}
PIString(const int len, const PIChar c): PIDeque<PIChar>() {for (int i = 0; i < len; ++i) PIDeque<PIChar>::push_back(c);}
~PIString() {}
@@ -230,8 +230,8 @@ public:
//! \endcode
PIString & operator <<(const PIChar c) {*this += c; return *this;}
//! \~english Append symbol "c" at the end of string
//! \~russian Добавляет в конец символ "c"
//! \~english Append symbol `c` at the end of string
//! \~russian Добавляет в конец символ `c`
//! \~\details
//! \~\code
//! PIString s("stri");
@@ -298,15 +298,71 @@ public:
//! \endcode
PIString & operator <<(const double & num) {*this += PIString::fromNumber(num); return *this;}
//! \~english Insert string "str" at the begin of string
//! \~russian Вставляет "str" в начало строки
PIString & prepend(const char * str) {insert(0, str); return *this;}
//! \~english Insert string "str" at the begin of string
//! \~russian Вставляет "str" в начало строки
PIString & prepend(const PIString & str) {insert(0, str); return *this;}
//! \~english Insert symbol `c` at the begin of string
//! \~russian Вставляет символ `c` в начало строки
PIString & prepend(const PIChar c) {PIDeque<PIChar>::prepend(c); return *this;}
//! \~english Insert symbol `c` at the begin of string
//! \~russian Вставляет символ `c` в начало строки
PIString & prepend(const char c) {PIDeque<PIChar>::prepend(PIChar(c)); return *this;}
//! \~english Insert string "str" at the begin of string
//! \~russian Вставляет "str" в начало строки
PIString & push_front(const char * str) {insert(0, str); return *this;}
//! \~english Insert string "str" at the begin of string
//! \~russian Вставляет "str" в начало строки
PIString & push_front(const PIString & str) {insert(0, str); return *this;}
//! \~english Insert symbol `c` at the begin of string
//! \~russian Вставляет символ `c` в начало строки
PIString & push_front(const PIChar c) {PIDeque<PIChar>::push_front(c); return *this;}
//! \~english Insert symbol `c` at the begin of string
//! \~russian Вставляет символ `c` в начало строки
PIString & push_front(const char c) {PIDeque<PIChar>::push_front(PIChar(c)); return *this;}
//! \~english Insert string "str" at the end of string
//! \~russian Вставляет "str" в конец строки
PIString & append(const char * str) {*this += str; return *this;}
//! \~english Insert string "str" at the end of string
//! \~russian Вставляет "str" в конец строки
PIString & append(const PIString & str) {*this += str; return *this;}
//! \~english Insert symbol `c` at the end of string
//! \~russian Вставляет символ `c` в конец строки
PIString & append(const PIChar c) {PIDeque<PIChar>::append(c); return *this;}
//! \~english Insert symbol `c` at the end of string
//! \~russian Вставляет символ `c` в конец строки
PIString & append(const char c) {PIDeque<PIChar>::append(PIChar(c)); return *this;}
//! \~english Insert string "str" at the end of string
//! \~russian Вставляет "str" в конец строки
PIString & push_back(const char * str) {*this += str; return *this;}
//! \~english Insert string "str" at the end of string
//! \~russian Вставляет "str" в конец строки
PIString & push_back(const PIString & str) {*this += str; return *this;}
//! \~english Insert symbol `c` at the end of string
//! \~russian Вставляет символ `c` в конец строки
PIString & push_back(const PIChar c) {PIDeque<PIChar>::push_back(c); return *this;}
//! \~english Insert symbol `c` at the end of string
//! \~russian Вставляет символ `c` в конец строки
PIString & push_back(const char c) {PIDeque<PIChar>::push_back(PIChar(c)); return *this;}
//! \~english Returns part of string from symbol at index "start" and maximum length "len"
//! \~russian Возвращает подстроку от символа "start" и максимальной длиной "len"
@@ -600,7 +656,7 @@ public:
//! piCout << s; // s = "9876543210"
//! \endcode
//! \~\sa \a reversed()
PIString & reverse() {PIString str(*this); clear(); piForeachCR (PIChar c, str) push_back(c); return *this;}
PIString & reverse() {PIDeque<PIChar>::reverse(); return *this;}
//! \~english Reverse copy of this string
//! \~russian Разворачивает копию этой строки
@@ -611,7 +667,7 @@ public:
//! piCout << s; // s = "0123456789"
//! \endcode
//! \~\sa \a reverse()
PIString reversed() const {PIString str(*this); str.reverse(); return str;}
PIString reversed() const {PIString ret(*this); return ret.reverse();}
//! \~english Fit string to maximum size "size" by inserting ".." at position "pos" and return this string
//! \~russian Уменьшает строку до размера "size", вставляя ".." в положение "pos" и возвращает эту строку