version 3.17.0
finally properly works PIIOString inside PIIOStream
This commit is contained in:
@@ -39,7 +39,7 @@ class PIP_EXPORT PIIOString: public PIIODevice {
|
||||
public:
|
||||
//! \~english Contructs %PIIOString with "string" content and "mode" open mode
|
||||
//! \~russian Создает %PIIOString с содержимым "string" и режимом открытия "mode"
|
||||
explicit PIIOString(PIString * string = 0, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite);
|
||||
explicit PIIOString(PIString * string = 0, PIIODevice::DeviceMode mode = PIIODevice::ReadOnly);
|
||||
|
||||
//! \~english Contructs %PIIOString with "string" content only for read
|
||||
//! \~russian Создает %PIIOString с содержимым "string" только для чтения
|
||||
@@ -51,10 +51,7 @@ public:
|
||||
|
||||
//! \~english Clear content string
|
||||
//! \~russian Очищает содержимое строки
|
||||
void clear() {
|
||||
if (str) str->clear();
|
||||
pos = 0;
|
||||
}
|
||||
void clear();
|
||||
|
||||
//! \~english Open "string" content with "mode" open mode
|
||||
//! \~russian Открывает содержимое "string" с режимом открытия "mode"
|
||||
@@ -66,10 +63,7 @@ public:
|
||||
|
||||
//! \~english Returns if position is at the end of content
|
||||
//! \~russian Возвращает в конце содержимого ли позиция
|
||||
bool isEnd() const {
|
||||
if (!str) return true;
|
||||
return pos >= str->size_s();
|
||||
}
|
||||
bool isEnd() const;
|
||||
|
||||
|
||||
//! \~english Move read/write position to "position"
|
||||
@@ -78,15 +72,11 @@ public:
|
||||
|
||||
//! \~english Move read/write position to the beginning of the string
|
||||
//! \~russian Перемещает позицию чтения/записи на начало строки
|
||||
void seekToBegin() {
|
||||
if (str) pos = 0;
|
||||
}
|
||||
void seekToBegin();
|
||||
|
||||
//! \~english Move read/write position to the end of the string
|
||||
//! \~russian Перемещает позицию чтения/записи на конец строки
|
||||
void seekToEnd() {
|
||||
if (str) pos = str->size_s();
|
||||
}
|
||||
void seekToEnd();
|
||||
|
||||
|
||||
//! \~english Read one text line and return it
|
||||
@@ -97,12 +87,7 @@ public:
|
||||
//! \~russian Вставляет строку "string" в содержимое буфера в текущую позицию
|
||||
int writeString(const PIString & string);
|
||||
|
||||
ssize_t bytesAvailable() const override {
|
||||
if (str)
|
||||
return str->size() - pos;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
ssize_t bytesAvailable() const override;
|
||||
|
||||
protected:
|
||||
bool openDevice() override;
|
||||
|
||||
Reference in New Issue
Block a user