git-svn-id: svn://db.shs.com.ru/pip@927 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2020-03-08 13:11:01 +00:00
parent 0831beaeec
commit 222a58d207
4 changed files with 132 additions and 55 deletions

View File

@@ -236,8 +236,7 @@ void PIString::appendFromChars(const char * c, int s, const char * codepage) {
delete[] buffer;
return;
//printf("request %d\n", sz);
# endif
#endif
# else
wchar_t wc;
mbtowc(0,0,0); // reset mbtowc
//qDebug() << "FromChars ...";
@@ -251,6 +250,8 @@ void PIString::appendFromChars(const char * c, int s, const char * codepage) {
//qDebug() << "2" << c;
}
//qDebug() << "FromChars done" << size();
# endif
#endif
}
@@ -360,8 +361,7 @@ void PIString::buildData(const char * cp) const {
WideCharToMultiByte((uint)(uintptr_t)cp, 0, (LPCWCH)PIDeque<PIChar>::data(), PIDeque<PIChar>::size_s(), (LPSTR)data_.data(), data_.size_s(), NULL, NULL);
data_.push_back(uchar('\0'));
return;
# endif
#endif
# else
wchar_t wc;
char tc[8];
wctomb(0, 0);
@@ -376,6 +376,8 @@ void PIString::buildData(const char * cp) const {
data_.push_back(uchar(tc[b]));
}
data_.push_back(uchar('\0'));
# endif
#endif
}
@@ -475,7 +477,7 @@ PIString & PIString::operator +=(const wchar_t * str) {
delete[] c;*/
int i = -1;
while (str[++i])
push_back(PIChar(int(str[i])));
push_back(PIChar(ushort(str[i])));
return *this;
}
@@ -511,8 +513,8 @@ bool PIString::operator <(const PIString & str) const {
if (size() < l) return true;
if (size() > l) return false;
for (uint i = 0; i < l; ++i) {
if (str[i] == at(i)) continue;
if (str[i] < at(i)) return true;
if (at(i) == str[i]) continue;
if (at(i) < str[i]) return true;
else return false;
}
return false;
@@ -524,8 +526,8 @@ bool PIString::operator >(const PIString & str) const {
if (size() < l) return false;
if (size() > l) return true;
for (uint i = 0; i < l; ++i) {
if (str[i] == at(i)) continue;
if (str[i] < at(i)) return false;
if (at(i) == str[i]) continue;
if (at(i) < str[i]) return false;
else return true;
}
return false;