36 return (suffix1.compare(suffix2, Qt::CaseInsensitive) == 0 || suffix1.compare(suffix2, Qt::CaseInsensitive) == 0);
41 mCanReadDataType(canReadDataType),
42 mCanWriteDataType(canWriteDataType),
43 mFileSuffix(fileSuffix),
44 mPatientModelService(patientModelService)
46 this->setObjectName(mName);
61 QString fileType = QFileInfo(filename).suffix();
62 bool rightFileType =
sameSuffix(fileType, mFileSuffix);
63 bool rightDataType = (type == mCanReadDataType);
69 QString fileType = QFileInfo(filename).suffix();
70 bool rightFileType =
sameSuffix(fileType, mFileSuffix);
71 bool rightDataType = (type == mCanWriteDataType);
77 QFileInfo fileInfo(filename);
79 QString unique = QUuid::createUuid().toString();
81 QString uid = strippedFilename +
"_" + unique +
"_" +QDateTime::currentDateTime().toString(
timestampSecondsFormat());
83 name = strippedFilename;
85 DataPtr data = mPatientModelService->createData(type, uid, name);
virtual QString canWriteDataType() const =0
static FileReaderWriterServicePtr getNullObject()
DataPtr createData(QString type, QString filename, QString name="") const
bool sameSuffix(QString suffix1, QString suffix2)
FileReaderWriterImplService(QString name, QString canReadDataType, QString canWriteDataType, QString fileSuffix, PatientModelServicePtr patientModelService)
bool canReadInternal(const QString &type, const QString &filename) const
QString timestampSecondsFormat()
boost::shared_ptr< class Data > DataPtr
virtual QString getFileSuffix() const
boost::shared_ptr< class FileReaderWriterService > FileReaderWriterServicePtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
virtual QString getName() const
QString changeExtension(QString name, QString ext)
virtual QString canReadDataType() const =0
bool canWriteInternal(const QString &type, const QString &filename) const
Namespace for all CustusX production code.