ICF 3.1.1.10
Technical documentation of ICF Libraries
IFilePersistence.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// Qt includes
10#include <QtCore/QString>
11
12// ICF includes
13#include <istd/IChangeable.h>
14#include <iproc/CTaskState.h>
15#include <ifile/IFileTypeInfo.h>
16
17
18namespace iproc
19{
20 class IProgressManager;
21}
22
23
24namespace ifile
25{
26
27
32class IFilePersistence: virtual public IFileTypeInfo
33{
34public:
55
60 {
65
70
75
80
85 /*
86 Version of file in no more supported.
87 */
89 };
90
102 const istd::IChangeable* dataObjectPtr,
103 const QString* filePathPtr = nullptr,
104 int flags = -1,
105 bool beQuiet = true) const = 0;
106
112 istd::IChangeable& data,
113 const QString& filePath = QString(),
114 iproc::IProgressManager* progressManagerPtr = nullptr) const = 0;
115
121 const istd::IChangeable& data,
122 const QString& filePath = QString(),
123 iproc::IProgressManager* progressManagerPtr = nullptr) const = 0;
124};
125
126
127} // namespace ifile
128
129
Interface providing loading and saving of data objects.
MessageId
List of possible message IDs used in context of this interface.
@ MI_CANNOT_SAVE
Data object could not be saved.
@ MI_BAD_EXTENSION
File path has an unsupported file exptension.
@ MI_CANNOT_LOAD
Data object could not be loaded.
@ MI_FILE_NOT_EXIST
File or directory not exists.
@ MI_BAD_OBJECT_TYPE
Data object is not supported.
virtual iproc::CTaskState SaveToFile(const istd::IChangeable &data, const QString &filePath=QString(), iproc::IProgressManager *progressManagerPtr=nullptr) const =0
This function saves data data to file filePath.
virtual bool IsOperationSupported(const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=nullptr, int flags=-1, bool beQuiet=true) const =0
Returns true if object dataObject can be loaded/saved.
ErrorType
Possible file I/O errors.
@ ET_FILE_NOT_EXIST
File doesn't exist.
@ ET_NO_READ_PERMISSIONS
File could not be read, no read access granted.
@ ET_NO_WRITE_PERMISSIONS
File could not be written, no write access granted.
virtual iproc::CTaskState LoadFromFile(istd::IChangeable &data, const QString &filePath=QString(), iproc::IProgressManager *progressManagerPtr=nullptr) const =0
This function loads data data from file filePath.
Provide loading and saving of objects.
Represent state of asynchronous operation.
Definition CTaskState.h:28
Consume information about progress of some process.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:32
Contains interfaces and implementations of file system related components.
This namespace containes interfaces and implementation of data processing concepts.

© Witold Gantzke and Kirill Lepskiy