ACF $AcfVersion:0$
IFilePersistence.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QString>
7
8// ACF includes
9#include <istd/IChangeable.h>
10#include <ifile/IFileTypeInfo.h>
11
12
13namespace ibase
14{
15 class IProgressManager;
16}
17
18
19namespace ifile
20{
21
22
28class IFilePersistence: virtual public IFileTypeInfo
29{
30public:
51
72
77 {
82
87
92
97
102 /*
103 Version of file in no more supported.
104 */
106 };
107
119 const istd::IChangeable* dataObjectPtr,
120 const QString* filePathPtr = NULL,
121 int flags = -1,
122 bool beQuiet = true) const = 0;
123
129 istd::IChangeable& data,
130 const QString& filePath = QString(),
131 ibase::IProgressManager* progressManagerPtr = NULL) const = 0;
132
138 const istd::IChangeable& data,
139 const QString& filePath = QString(),
140 ibase::IProgressManager* progressManagerPtr = NULL) const = 0;
141};
142
143
144} // namespace ifile
145
146
Consume information about progress of some process.
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 bool IsOperationSupported(const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=NULL, int flags=-1, bool beQuiet=true) const =0
Returns true if object dataObject can be loaded/saved.
OperationState
Result of operation.
@ OS_FAILED
Operation failed.
@ OS_CANCELED
Operation was aborted by user.
@ OS_OK
Operation was successful.
virtual OperationState LoadFromFile(istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const =0
This function loads data data from file filePath.
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 OperationState SaveToFile(const istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const =0
This function saves data data to file filePath.
Provide loading and saving of objects.
Common interface for data model objects, which can be changed.
Definition IChangeable.h:28
#define NULL
Definition istd.h:74
This namespace contains basic implementations of standard primitives on the component level.
Contains interfaces and implementations of file system related components.