Public Types | Public Member Functions | List of all members
ifile::IFilePersistence Class Referenceabstract

Interface providing loading and saving of data objects. More...

#include <IFilePersistence.h>

Inheritance diagram for ifile::IFilePersistence:
ifile::IFileTypeInfo istd::IPolymorphic idoc::CMultiPageDocumentFilePersistenceComp idoc::CTextFileLoaderComp ifile::CComposedFilePersistenceComp ifile::CFileSerializerCompBase ifile::CTextFileLogStreamerComp ifilegui::CFileDialogLoaderComp iimg::CBitmapLoaderComp ipackage::CRegistryCodeSaverComp iqt::CClipboardSerializerComp iqt::CSettingsSerializerComp

Public Types

enum  OperationState { OS_OK, OS_CANCELED, OS_FAILED }
 Result of operation. More...
 
enum  ErrorType { ET_NO_WRITE_PERMISSIONS, ET_NO_READ_PERMISSIONS, ET_FILE_NOT_EXIST }
 Possible file I/O errors. More...
 
enum  MessageId {
  MI_BAD_OBJECT_TYPE = 0xabf0, MI_CANNOT_LOAD, MI_CANNOT_SAVE, MI_BAD_EXTENSION,
  MI_FILE_NOT_EXIST, MI_UNSUPPORTED_VERSION
}
 List of possible message IDs used in context of this interface. More...
 
- Public Types inherited from ifile::IFileTypeInfo
enum  QueryFlags {
  QF_LOAD = 1 << 0, QF_SAVE = 1 << 1, QF_FILE = 1 << 2, QF_DIRECTORY = 1 << 3,
  QF_ANONYMOUS = 1 << 4
}
 Describe detailed options of query. More...
 

Public Member Functions

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. More...
 
virtual int LoadFromFile (istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const =0
 This function loads data data from file filePath. More...
 
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. More...
 
- Public Member Functions inherited from ifile::IFileTypeInfo
virtual bool GetFileExtensions (QStringList &result, const istd::IChangeable *dataObjectPtr=NULL, int flags=-1, bool doAppend=false) const =0
 Get file extensions supported by this loader. More...
 
virtual QString GetTypeDescription (const QString *extensionPtr=NULL) const =0
 Get description of object type associated with single extension. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 

Detailed Description

Interface providing loading and saving of data objects.

Definition at line 28 of file IFilePersistence.h.

Member Enumeration Documentation

Possible file I/O errors.

Enumerator
ET_NO_WRITE_PERMISSIONS 

File could not be written, no write access granted.

ET_NO_READ_PERMISSIONS 

File could not be read, no read access granted.

ET_FILE_NOT_EXIST 

File doesn't exist.

Definition at line 55 of file IFilePersistence.h.

List of possible message IDs used in context of this interface.

Enumerator
MI_BAD_OBJECT_TYPE 

Data object is not supported.

MI_CANNOT_LOAD 

Data object could not be loaded.

MI_CANNOT_SAVE 

Data object could not be saved.

MI_BAD_EXTENSION 

File path has an unsupported file exptension.

MI_FILE_NOT_EXIST 

File or directory not exists.

MI_UNSUPPORTED_VERSION 

Definition at line 76 of file IFilePersistence.h.

Result of operation.

Enumerator
OS_OK 

Operation was successful.

OS_CANCELED 

Operation was aborted by user.

OS_FAILED 

Operation failed.

Definition at line 34 of file IFilePersistence.h.

Member Function Documentation

virtual bool ifile::IFilePersistence::IsOperationSupported ( const istd::IChangeable dataObjectPtr,
const QString *  filePathPtr = NULL,
int  flags = -1,
bool  beQuiet = true 
) const
pure virtual

Returns true if object dataObject can be loaded/saved.

Parameters
dataObjectPtroptional pointer to data object should be loaded/stored. It can be NULL if any object is meant.
filePathPtroptional pointer to file should be loaded/stored. It can be NULL if any file is meant. If it points at empty string, anonymous loading is mean.
flagscombination of flags defined in QueryFlags and ifile::IFileTypeInfo::QueryFlags.
beQuietif true, no user message output is allowed.

Implemented in ipackage::CRegistryCodeSaverComp, ifilegui::CFileDialogLoaderComp, idoc::CMultiPageDocumentFilePersistenceComp, iimg::CBitmapLoaderComp, ifile::CFileSerializerCompBase, ifile::CComposedFilePersistenceComp, iqt::CSettingsSerializerComp, ifile::CTextFileLogStreamerComp, iqt::CClipboardSerializerComp, and idoc::CTextFileLoaderComp.

virtual int ifile::IFilePersistence::LoadFromFile ( istd::IChangeable data,
const QString &  filePath = QString(),
ibase::IProgressManager progressManagerPtr = NULL 
) const
pure virtual
virtual int ifile::IFilePersistence::SaveToFile ( const istd::IChangeable data,
const QString &  filePath = QString(),
ibase::IProgressManager progressManagerPtr = NULL 
) const
pure virtual

The documentation for this class was generated from the following file:

© 2007-2017 Witold Gantzke and Kirill Lepskiy