PIIODevice::bytesAvailible()
fix pistringlist pibinarystream write pibinarystream::binaryStreamSize() PIByteArray pibinarystream read with more size fix pistring pibinarystream read optimization fix bug in PIIOBinaryStream read and write if failed workaround in PIIOString::readDevice PISPI readDevice bug Fixed
This commit is contained in:
@@ -56,9 +56,9 @@ bool PIIOString::open(const PIString & string) {
|
||||
PIString PIIOString::readLine() {
|
||||
if (!canRead() || !str) return PIString();
|
||||
int np = pos;
|
||||
while (++np < str->size_s())
|
||||
if ((*str)[np] == '\n')
|
||||
break;
|
||||
while (++np < str->size_s()) {
|
||||
if ((*str)[np] == '\n') break;
|
||||
}
|
||||
PIString ret = str->mid(pos, np - pos);
|
||||
pos = piMini(np + 1, str->size_s());
|
||||
return ret;
|
||||
@@ -66,7 +66,7 @@ PIString PIIOString::readLine() {
|
||||
|
||||
|
||||
int PIIOString::readDevice(void * read_to, int max_size) {
|
||||
if (!canRead() || !str) return -1;
|
||||
if (!canRead() || !str || max_size <= 0) return -1;
|
||||
PIString rs = str->mid(pos, max_size);
|
||||
pos += max_size;
|
||||
if (pos > str->size_s()) pos = str->size_s();
|
||||
|
||||
Reference in New Issue
Block a user