ICF 3.0.5.47
Technical documentation of ICF Libraries
ifile::IFilePersistence Class Referenceabstract

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

#include <IFilePersistence.h>

Inheritance diagram for ifile::IFilePersistence:
Collaboration diagram for ifile::IFilePersistence:

Public Types

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=nullptr, int flags=-1, bool beQuiet=true) const =0
 Returns true if object dataObject can be loaded/saved.
 
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.
 
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.
 
- Public Member Functions inherited from ifile::IFileTypeInfo
virtual bool GetFileExtensions (QStringList &result, const istd::IChangeable *dataObjectPtr=nullptr, int flags=-1, bool doAppend=false) const =0
 Get file extensions supported by this loader.
 
virtual QString GetTypeDescription (const QString *extensionPtr=nullptr) const =0
 Get description of object type associated with single extension.
 

Detailed Description

Interface providing loading and saving of data objects.

Definition at line 32 of file IFilePersistence.h.

Member Enumeration Documentation

◆ ErrorType

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 38 of file IFilePersistence.h.

◆ MessageId

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 59 of file IFilePersistence.h.

Member Function Documentation

◆ IsOperationSupported()

virtual bool ifile::IFilePersistence::IsOperationSupported ( const istd::IChangeable * dataObjectPtr,
const QString * filePathPtr = nullptr,
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 nullptr if any object is meant.
filePathPtroptional pointer to file should be loaded/stored. It can be nullptr 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 icmpstr::CRegistrySerializerComp, idoc::CMultiPageDocumentFilePersistenceComp, idoc::CTextFilePersistenceComp, idocgui::CClipboardSerializerComp, ifile::CComposedFilePersistenceComp, ifile::CFileSerializerCompBase, ifile::CSettingsSerializerComp, ifilegui::CFileDialogPersistenceComp, iimg::CBitmapPersistenceComp, iipr::CRenderedObjectFileLoaderComp, imeas::CWavSamplesSaverComp, and ipackage::CRegistryCodeSaverComp.

◆ LoadFromFile()

◆ SaveToFile()


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

© Witold Gantzke and Kirill Lepskiy