Classes | Public Types | Public Member Functions | Protected Member Functions | List of all members
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 >:
ifile::CFileSerializerCompBase ilog::TLoggerCompWrap< CFileTypeInfoComp > ifile::IFilePersistence ilog::CLoggerBase ifile::IFileTypeInfo ilog::ILoggable istd::ILogger istd::IPolymorphic istd::IPolymorphic istd::IPolymorphic

Classes

class  ReadArchiveEx
 
class  WriteArchiveEx
 

Public Types

typedef CFileSerializerCompBase BaseClass
 
- Public Types inherited from ifile::CFileSerializerCompBase
typedef ilog::TLoggerCompWrap
< CFileTypeInfoComp
BaseClass
 
- Public Types inherited from ilog::TLoggerCompWrap< CFileTypeInfoComp >
typedef CFileTypeInfoComp BaseClass
 
typedef ilog::CLoggerBase BaseClass2
 
- Public Types inherited from ifile::IFilePersistence
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 int LoadFromFile (istd::IChangeable &data, const QString &filePath=QString(), ibase::IProgressManager *progressManagerPtr=NULL) const
 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
 This function saves data data to file filePath. More...
 
- Public Member Functions inherited from ifile::CFileSerializerCompBase
virtual bool IsOperationSupported (const istd::IChangeable *dataObjectPtr, const QString *filePathPtr=NULL, int flags=-1, bool beQuiet=true) const
 Returns true if object dataObject can be loaded/saved. More...
 
- Public Member Functions inherited from ilog::CLoggerBase
 CLoggerBase ()
 
virtual void SetLogPtr (ilog::IMessageConsumer *logPtr)
 Install log. More...
 
virtual ilog::IMessageConsumerGetLogPtr () const
 Get log. More...
 
virtual void SetTracingEnabled (bool trace)
 Enable/disable tracing. More...
 
virtual bool IsTracingEnabled () const
 Returns true if tracing enabled. More...
 
- Public Member Functions inherited from istd::IPolymorphic
virtual ~IPolymorphic ()
 
- 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...
 

Protected Member Functions

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

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 26 of file TFileSerializerComp.h.

Member Typedef Documentation

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

Definition at line 29 of file TFileSerializerComp.h.

Member Function Documentation

template<class ReadArchive , class WriteArchive >
int ifile::TFileSerializerComp< ReadArchive, WriteArchive >::LoadFromFile ( istd::IChangeable data,
const QString &  filePath = QString(),
ibase::IProgressManager progressManagerPtr = NULL 
) const
virtual

This function loads data data from file filePath.

Returns
File loading state.
See Also
OperationState
Todo:
Change CompCastPtr to be sure that firstly the data will be casted to the interface, but NOT the first ISerializable in the composition.

Implements ifile::IFilePersistence.

Definition at line 141 of file TFileSerializerComp.h.

References NULL.

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 219 of file TFileSerializerComp.h.

template<class ReadArchive , class WriteArchive >
int ifile::TFileSerializerComp< ReadArchive, WriteArchive >::SaveToFile ( const istd::IChangeable data,
const QString &  filePath = QString(),
ibase::IProgressManager progressManagerPtr = NULL 
) const
virtual

This function saves data data to file filePath.

Returns
File saving state.
See Also
OperationState
Todo:
Change CompCastPtr to be sure that firstly the data will be casted to the interface, but NOT the first ISerializable in the composition.

Implements ifile::IFilePersistence.

Definition at line 174 of file TFileSerializerComp.h.

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


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy