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

This commit is contained in:
2019-01-09 14:08:57 +00:00
parent dc790b44c8
commit e902f26d9b
6 changed files with 23 additions and 5 deletions

View File

@@ -313,6 +313,20 @@ void PIFile::configureFromFullPathDevice(const PIString & full_path) {
}
PIPropertyStorage PIFile::constructVariantDevice() const {
PIPropertyStorage ret;
PIVariantTypes::File f;
f.file = path();
ret.addProperty("path", f);
return ret;
}
void PIFile::configureFromVariantDevice(const PIPropertyStorage & d) {
setPath(d.propertyValueByName("path").toString());
}
PIString PIFile::strType(const PIIODevice::DeviceMode type) {
switch (type) {
case PIIODevice::ReadOnly: return "rb";

View File

@@ -24,6 +24,7 @@
#define PIFILE_H
#include "piiodevice.h"
#include "pipropertystorage.h"
class PIP_EXPORT PIFile: public PIIODevice
@@ -289,6 +290,8 @@ protected:
PIString fullPathPrefix() const {return PIStringAscii("file");}
PIString constructFullPathDevice() const;
void configureFromFullPathDevice(const PIString & full_path);
PIPropertyStorage constructVariantDevice() const;
void configureFromVariantDevice(const PIPropertyStorage & d);
int readDevice(void * read_to, int max_size);
int writeDevice(const void * data, int max_size);
bool openDevice();

View File

@@ -459,3 +459,4 @@ PIPropertyStorage PIIODevice::constructVariantDevice() const {
void PIIODevice::configureFromVariantDevice(const PIPropertyStorage & d) {
setPath(d.propertyValueByName("path").toString());
}

View File

@@ -418,5 +418,4 @@ private:
};
#endif // PIIODEVICE_H