PICloud small patches
This commit is contained in:
@@ -389,6 +389,12 @@ bool PIIODevice::close() {
|
||||
return !opened_;
|
||||
}
|
||||
|
||||
int PIIODevice::write(PIByteArray data) {
|
||||
if (isOpened())
|
||||
return writeDevice(data.data(), data.size_s());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
bool PIIODevice::configure(const PIString & config_file, const PIString & section, bool parent_section) {
|
||||
PIConfig conf(config_file, PIIODevice::ReadOnly);
|
||||
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
bool open(DeviceMode _mode);
|
||||
EVENT_HANDLER2(bool, open, const PIString &, _path, DeviceMode, _mode);
|
||||
EVENT_HANDLER(bool, close);
|
||||
EVENT_HANDLER1(int, write, PIByteArray, data) {return writeDevice(data.data(), data.size_s());}
|
||||
EVENT_HANDLER1(int, write, PIByteArray, data);
|
||||
|
||||
EVENT_VHANDLER(void, flush) {;}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user