CFileSerializerCompBase.h
Go to the documentation of this file.
1 #ifndef ifile_CFileSerializerCompBase_included
2 #define ifile_CFileSerializerCompBase_included
3 
4 
5 // Qt includes
6 #include <QtCore/QObject>
7 #include <QtCore/QStringList>
8 #include <QtCore/QFileInfo>
9 
10 
11 // ACF includes
12 #include <ilog/TLoggerCompWrap.h>
13 #include <ifile/IFilePersistence.h>
15 
16 
17 namespace ifile
18 {
19 
20 
28  public ilog::TLoggerCompWrap<CFileTypeInfoComp>,
29  virtual public ifile::IFilePersistence
30 {
31 public:
33 
34  I_BEGIN_BASE_COMPONENT(CFileSerializerCompBase);
35  I_REGISTER_INTERFACE(ifile::IFileTypeInfo);
36  I_REGISTER_INTERFACE(ifile::IFilePersistence);
37  I_ASSIGN(m_versionInfoCompPtr, "VersionInfo", "Provide information about archive versions", false, "VersionInfo");
38  I_END_COMPONENT;
39 
40  // reimplemented (ifile::IFilePersistence)
41  virtual bool IsOperationSupported(
42  const istd::IChangeable* dataObjectPtr,
43  const QString* filePathPtr = NULL,
44  int flags = -1,
45  bool beQuiet = true) const;
46 
47 protected:
51  virtual const iser::IVersionInfo* GetVersionInfo() const;
52 
56  bool CheckMinimalVersion(const iser::ISerializable& object, const iser::IVersionInfo& versionInfo) const;
57 
61  bool CheckInputFile(const QString filePath, bool beQuiet = true) const;
62 
66  bool CheckOutputFile(const QString filePath, bool beQuiet = true) const;
67 
68 private:
69  I_REF(iser::IVersionInfo, m_versionInfoCompPtr);
70 };
71 
72 
73 } // namespace ifile
74 
75 
76 #endif // !ifile_CFileSerializerCompBase_included
77 
78 
Provide loading and saving of objects.
Definition: IFileTypeInfo.h:22
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.
Provides access to version information.
Definition: IVersionInfo.h:22
virtual const iser::IVersionInfo * GetVersionInfo() const
Get working version info.
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.
Base implementation of file serializer.
Common class for all classes which objects can be archived or restored from archive.
Definition: ISerializable.h:23
Wrapper provider of log-functionality for component based implementations.
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.
Common interface for data model objects, which can be changed.
Definition: IChangeable.h:24
ilog::TLoggerCompWrap< CFileTypeInfoComp > BaseClass
#define NULL
Definition: istd.h:64
Interface providing loading and saving of data objects.

© 2007-2017 Witold Gantzke and Kirill Lepskiy