IFilePersistence.h
Go to the documentation of this file.
1 #ifndef ifile_IFilePersistence_included
2 #define ifile_IFilePersistence_included
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 
13 namespace ibase
14 {
15  class IProgressManager;
16 }
17 
18 
19 namespace ifile
20 {
21 
22 
28 class IFilePersistence: virtual public IFileTypeInfo
29 {
30 public:
35  {
40 
45 
50  };
51 
55  enum ErrorType
56  {
61 
66 
71  };
72 
76  enum MessageId
77  {
82 
87 
92 
97 
102  /*
103  Version of file in no more supported.
104  */
106  };
107 
118  virtual bool IsOperationSupported(
119  const istd::IChangeable* dataObjectPtr,
120  const QString* filePathPtr = NULL,
121  int flags = -1,
122  bool beQuiet = true) const = 0;
123 
128  virtual int LoadFromFile(
129  istd::IChangeable& data,
130  const QString& filePath = QString(),
131  ibase::IProgressManager* progressManagerPtr = NULL) const = 0;
132 
137  virtual int SaveToFile(
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 
147 #endif // !ifile_IFilePersistence_included
148 
149 
Provide loading and saving of objects.
Definition: IFileTypeInfo.h:22
File path has an unsupported file exptension.
File could not be read, no read access granted.
Data object could not be saved.
File could not be written, no write access granted.
virtual int LoadFromFile(istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const =0
This function loads data data from file filePath.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
virtual int SaveToFile(const istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const =0
This function saves data data to file filePath.
OperationState
Result of operation.
Data object could not be loaded.
ErrorType
Possible file I/O errors.
#define NULL
Definition: istd.h:64
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.
MessageId
List of possible message IDs used in context of this interface.
Interface providing loading and saving of data objects.
Operation was aborted by user.
Operation was successful.
Consume information about progress of some process.

© 2007-2017 Witold Gantzke and Kirill Lepskiy