move to PIIOTextStream

This commit is contained in:
2022-05-13 13:24:09 +03:00
parent 1028233553
commit f67e3030b9
6 changed files with 217 additions and 188 deletions

View File

@@ -41,6 +41,8 @@ public:
//! \~russian Создает %PIIOBinaryStream для устройства "device"
PIIOBinaryStream(PIIODevice * device): dev(device) {}
void setDevice(PIIODevice * device) {dev = device;}
bool binaryStreamAppendImp(const void * d, size_t s) {
if (!dev) return false;
return dev->write(d, s);
@@ -68,6 +70,11 @@ public:
//! \~russian Создает %PIIOTextStream для устройства "device"
PIIOTextStream(PIIODevice * device): PITextStream<PIIOBinaryStream>(&bin_stream), bin_stream(device){}
void setDevice(PIIODevice * device) {
bin_stream = PIIOBinaryStream(device);
setStream(&bin_stream);
}
private:
PIIOBinaryStream bin_stream;