git-svn-id: svn://db.shs.com.ru/pip@804 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#define PISTRING_H
|
||||
|
||||
#include "pibytearray.h"
|
||||
|
||||
#define PIStringAscii PIString::fromAscii
|
||||
|
||||
|
||||
@@ -36,7 +37,7 @@ class PIP_EXPORT PIString: public PIDeque<PIChar>
|
||||
friend PIByteArray & operator >>(PIByteArray & s, PIString & v);
|
||||
public:
|
||||
//! Contructs an empty string
|
||||
PIString(): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--;}
|
||||
PIString(): PIDeque<PIChar>() {}
|
||||
|
||||
//inline PIString & operator +=(const char c) {push_back(c); return *this;}
|
||||
PIString & operator +=(const PIChar & c) {push_back(c); return *this;}
|
||||
@@ -46,55 +47,55 @@ public:
|
||||
PIString & operator +=(const PIString & str);
|
||||
|
||||
//PIString(const char c) {*this += c;}
|
||||
PIString(const PIString & o): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += o;}
|
||||
PIString(const PIString & o): PIDeque<PIChar>() {*this += o;}
|
||||
|
||||
|
||||
//! Contructs string with single symbol "c"
|
||||
PIString(const PIChar & c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += c;}
|
||||
PIString(const char c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += PIChar(c);}
|
||||
PIString(const PIChar & c): PIDeque<PIChar>() {*this += c;}
|
||||
PIString(const char c): PIDeque<PIChar>() {*this += PIChar(c);}
|
||||
|
||||
/*! \brief Contructs string from c-string "str"
|
||||
* \details "str" should be null-terminated\n
|
||||
* Example: \snippet pistring.cpp PIString(char * ) */
|
||||
PIString(const char * str): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += str;}
|
||||
PIString(const char * str): PIDeque<PIChar>() {*this += str;}
|
||||
|
||||
/*! \brief Contructs string from \c wchar_t c-string "str"
|
||||
* \details "str" should be null-terminated\n
|
||||
* Example: \snippet pistring.cpp PIString(wchar_t * ) */
|
||||
PIString(const wchar_t * str): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += str;}
|
||||
PIString(const wchar_t * str): PIDeque<PIChar>() {*this += str;}
|
||||
|
||||
//! Contructs string from byte array "ba"
|
||||
PIString(const PIByteArray & ba): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this += ba;}
|
||||
PIString(const PIByteArray & ba): PIDeque<PIChar>() {*this += ba;}
|
||||
|
||||
//! \brief Contructs string from "len" characters of buffer "str"
|
||||
PIString(const PIChar * str, const int len): PIDeque<PIChar>(str, size_t(len)) {/*reserve(4); */piMonitor.strings++; piMonitor.containers--;}
|
||||
PIString(const PIChar * str, const int len): PIDeque<PIChar>(str, size_t(len)) {}
|
||||
|
||||
/*! \brief Contructs string from "len" characters of buffer "str"
|
||||
* \details Example: \snippet pistring.cpp PIString(char * , int) */
|
||||
PIString(const char * str, const int len): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; appendFromChars(str, len);}
|
||||
PIString(const char * str, const int len): PIDeque<PIChar>() {appendFromChars(str, len);}
|
||||
|
||||
/*! \brief Contructs string as sequence of characters "c" of buffer with length "len"
|
||||
* \details Example: \snippet pistring.cpp PIString(int, char) */
|
||||
PIString(const int len, const char c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; 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) push_back(c);}
|
||||
|
||||
/*! \brief Contructs string as sequence of symbols "c" of buffer with length "len"
|
||||
* \details Example: \snippet pistring.cpp PIString(int, PIChar) */
|
||||
PIString(const int len, const PIChar & c): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; 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) push_back(c);}
|
||||
|
||||
|
||||
// PIString(const short & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const ushort & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const int & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const uint & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const long & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const ulong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const llong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const ullong & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const float & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const double & value): PIDeque<PIChar>() {/*reserve(4); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);}
|
||||
// PIString(const short & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const ushort & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const int & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const uint & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const long & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const ulong & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const llong & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const ullong & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const float & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
// PIString(const double & value): PIDeque<PIChar>() {*this = fromNumber(value);}
|
||||
|
||||
|
||||
~PIString() {piMonitor.strings--; piMonitor.containers++;}
|
||||
~PIString() {}
|
||||
|
||||
|
||||
PIString & operator =(const PIString & o) {if (this == &o) return *this; clear(); *this += o; return *this;}
|
||||
|
||||
Reference in New Issue
Block a user