01.03.2011 - as a initial commit

This commit is contained in:
peri4
2011-03-01 06:07:16 +03:00
parent 3610ea9212
commit b21a0496cd
20 changed files with 1589 additions and 522 deletions

View File

@@ -22,6 +22,13 @@ PIString & PIString::operator +=(const PIString & str) {
}
PIString & PIString::operator +=(const PIByteArray & ba) {
uint l = ba.size();
for (uint i = 0; i < l; ++i) push_back(ba[i]);
return *this;
}
bool PIString::operator ==(const PIString & str) const {
uint l = str.size();
if (size() != l) return false;
@@ -106,6 +113,20 @@ PIString & PIString::trim() {
}
PIStringList PIString::split(const PIString & delim) {
PIString ts(*this);
PIStringList sl;
int ci = ts.find(delim);
while (ci >= 0) {
sl << ts.left(ci);
ts.cutLeft(ci + delim.length());
ci = ts.find(delim);
}
if (ts.length() > 0) sl << ts;
return sl;
}
int PIString::find(const char str, const int start) {
for (int i = start; i < length(); ++i)
if (at(i) == str)