05.11.2011 - stable version, 0.1.0, self-test program, work at GCC 2.95 - 4.5, VC 2010, MinGW, Linux, Windows, QNX

This commit is contained in:
peri4
2011-12-05 23:51:02 +03:00
parent e25553b97b
commit 74b4173c4c
43 changed files with 1495 additions and 694 deletions

View File

@@ -9,7 +9,7 @@ class PIStringList;
class PIString: public PIVector<PIChar>
{
public:
PIString() {;}
PIString() {piMonitor.strings++; piMonitor.containers--;}
//inline PIString & operator +=(const char c) {push_back(c); return *this;}
PIString & operator +=(const PIChar c) {push_back(c); return *this;}
@@ -21,16 +21,17 @@ public:
PIString & operator +=(const wstring & str);
//PIString(const char c) {*this += c;}
PIString(const PIChar c) {*this += c;}
PIString(const char * str) {*this += str;}
PIString(const wchar_t * str) {*this += str;}
PIString(const string & str) {*this += str;}
PIString(const wstring & str) {*this += str;}
PIString(const PIByteArray & ba) {*this += ba;}
PIString(const char * str, const int len) {*this += string(str, len);}
PIString(const int len, const char c) {for (int i = 0; i < len; ++i) push_back(c);}
PIString(const int len, const PIChar & c) {for (int i = 0; i < len; ++i) push_back(c);}
PIString(const PIString & str) {*this += str;}
PIString(const PIChar c) {piMonitor.strings++; piMonitor.containers--;*this += c;}
PIString(const char * str) {piMonitor.strings++; piMonitor.containers--;*this += str;}
PIString(const wchar_t * str) {piMonitor.strings++; piMonitor.containers--;*this += str;}
PIString(const string & str) {piMonitor.strings++; piMonitor.containers--;*this += str;}
PIString(const wstring & str) {piMonitor.strings++; piMonitor.containers--;*this += str;}
PIString(const PIByteArray & ba) {piMonitor.strings++; piMonitor.containers--;*this += ba;}
PIString(const char * str, const int len) {piMonitor.strings++; piMonitor.containers--;*this += string(str, len);}
PIString(const int len, const char c) {piMonitor.strings++; piMonitor.containers--;for (int i = 0; i < len; ++i) push_back(c);}
PIString(const int len, const PIChar & c) {piMonitor.strings++; piMonitor.containers--;for (int i = 0; i < len; ++i) push_back(c);}
PIString(const PIString & str) {piMonitor.strings++; piMonitor.containers--;*this += str;}
~PIString() {piMonitor.strings--; piMonitor.containers++;}
operator const char*() {return data();}
operator const string() {if (size() == 0) return string(); string s; for (int i = 0; i < length(); ++i) s.push_back(at(i).toAscii()); return s;}