ICF 3.0.5.47
Technical documentation of ICF Libraries
ifile::TFileSerializerComp< ReadArchive, WriteArchive > Class Template Reference

Template implementation of file serializer using loading and storing archive implementation. More...

#include <TFileSerializerComp.h>

Inheritance diagram for ifile::TFileSerializerComp< ReadArchive, WriteArchive >:
Collaboration diagram for ifile::TFileSerializerComp< ReadArchive, WriteArchive >:

Classes

class  ReadArchiveEx
 
class  WriteArchiveEx
 

Public Types

typedef CFileSerializerCompBase BaseClass
 
- Public Types inherited from ifile::CFileSerializerCompBase
typedef ilog::TLoggerCompWrap< CFileTypeInfoCompBaseClass
 
- Public Types inherited from ilog::TLoggerCompWrap< CFileTypeInfoComp >
enum  MessageId
 
typedef CFileTypeInfoComp BaseClass
 
typedef ilog::CLoggerBase BaseClass2
 
- Public Types inherited from ifile::IFilePersistence
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 iproc::CTaskState LoadFromFile (istd::IChangeable &data, const QString &filePath=QString(), iproc::IProgressManager *progressManagerPtr=nullptr) const override
 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 override
 This function saves data data to file filePath.
 
- Public Member Functions inherited from ifile::CFileSerializerCompBase
virtual bool IsOperationSupported (const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=nullptr, int flags=-1, bool beQuiet=true) const override
 Returns true if object dataObject can be loaded/saved.
 
- Public Member Functions inherited from ilog::CLoggerBase
 CLoggerBase ()
 
const QByteArray & GetVerboseSenderId () const
 Get sender ID for verbose messages.
 
void SetVerboseSenderId (const QByteArray &id)
 Set sender ID for verbose messages.
 
void SetLogPtr (ilog::IMessageConsumer *logPtr) override
 Install log.
 
ilog::IMessageConsumerGetLogPtr () const override
 Get log.
 
- Public Member Functions inherited from ilog::ILoggable
- Public Member Functions inherited from ifile::IFilePersistence
- 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.
 

Protected Member Functions

virtual void OnReadError (const ReadArchive &archive, const istd::IChangeable &data, const QString &filePath) const
 Called if read error is occurred.
 
- Protected Member Functions inherited from ifile::CFileSerializerCompBase
virtual const iser::IVersionInfoGetVersionInfo () const
 Get working version info.
 
bool CheckMinimalVersion (const iser::ISerializable &object, const iser::IVersionInfo &versionInfo) const
 Check if the minimal version of some serializable object is supported by version info.
 
bool CheckInputFile (const QString filePath, bool beQuiet=true) const
 Check if input file is OK.
 
bool CheckOutputFile (const QString filePath, bool beQuiet=true) const
 Check if output file is OK.
 
void OnComponentCreated () override
 
- Protected Member Functions inherited from ilog::TLoggerCompWrap< CFileTypeInfoComp >
virtual void DecorateMessage (istd::IInformationProvider::InformationCategory category, int id, int flags, QString &message, QString &messageSource) const override
 Decorate message parts before outputting.
 
void OnComponentCreated () override
 
void OnComponentDestroyed () override
 
- Protected Member Functions inherited from ilog::CLoggerBase
bool IsVerboseEnabled () const
 Check if verbose messages are enabled.
 
bool SendVerboseMessage (const QString &message, const QString &messageSource=QString()) const
 Send verbose message.
 
bool SendInfoMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send info message to log.
 
bool SendWarningMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send warning message to log.
 
bool SendErrorMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send error message to log.
 
bool SendCriticalMessage (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send critical message to log.
 
bool SendInfoMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once info message to log.
 
bool SendWarningMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once warning message to log.
 
bool SendErrorMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once error message to log.
 
bool SendCriticalMessageOnce (int id, const QString &message, const QString &messageSource=QString(), int flags=0) const
 Send once critical message to log.
 
bool SendUserMessage (const istd::IInformationProvider *messagePtr) const
 Send message with user object.
 
bool AllowMessageOnceAgain (int id)
 Reset message lock.
 
bool IsLogConsumed (const istd::IInformationProvider::InformationCategory *categoryPtr=nullptr, const int *flagsPtr=nullptr) const override
 Check if any log message is consumed.
 
bool SendLogMessage (istd::IInformationProvider::InformationCategory category, int id, const QString &message, const QString &messageSource, int flags=0) const override
 Send any message to log.
 
- Protected Member Functions inherited from istd::ILogger

Additional Inherited Members

- Protected Attributes inherited from ilog::CLoggerBase
QSet< int > m_onceMessageIds
 

Detailed Description

template<class ReadArchive, class WriteArchive>
class ifile::TFileSerializerComp< ReadArchive, WriteArchive >

Template implementation of file serializer using loading and storing archive implementation.

Definition at line 28 of file TFileSerializerComp.h.

Member Typedef Documentation

◆ BaseClass

template<class ReadArchive , class WriteArchive >
CFileSerializerCompBase ifile::TFileSerializerComp< ReadArchive, WriteArchive >::BaseClass

Definition at line 31 of file TFileSerializerComp.h.

Member Function Documentation

◆ LoadFromFile()

template<class ReadArchive , class WriteArchive >
iproc::CTaskState ifile::TFileSerializerComp< ReadArchive, WriteArchive >::LoadFromFile ( istd::IChangeable & data,
const QString & filePath = QString(),
iproc::IProgressManager * progressManagerPtr = nullptr ) const
overridevirtual

This function loads data data from file filePath.

Returns
File loading state.
See also
Status

Implements ifile::IFilePersistence.

Definition at line 155 of file TFileSerializerComp.h.

References CompCastPtr(), and iser::ISerializable::Serialize().

◆ OnReadError()

template<class ReadArchive , class WriteArchive >
void ifile::TFileSerializerComp< ReadArchive, WriteArchive >::OnReadError ( const ReadArchive & archive,
const istd::IChangeable & data,
const QString & filePath ) const
protectedvirtual

Called if read error is occurred.

Definition at line 233 of file TFileSerializerComp.h.

◆ SaveToFile()

template<class ReadArchive , class WriteArchive >
iproc::CTaskState ifile::TFileSerializerComp< ReadArchive, WriteArchive >::SaveToFile ( const istd::IChangeable & data,
const QString & filePath = QString(),
iproc::IProgressManager * progressManagerPtr = nullptr ) const
overridevirtual

This function saves data data to file filePath.

Returns
File saving state.
See also
Status

Implements ifile::IFilePersistence.

Definition at line 188 of file TFileSerializerComp.h.

References CompCastPtr(), and istd::CSystem::EnsurePathExists().


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

© Witold Gantzke and Kirill Lepskiy