CCopyFilesTreeComp.h
Go to the documentation of this file.
1 #ifndef ifileproc_CCopyFilesTreeComp_included
2 #define ifileproc_CCopyFilesTreeComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QString>
7 #include <QtCore/QDir>
8 
9 // ACF includes
11 #include "ilog/TLoggerCompWrap.h"
12 
13 
14 namespace ifileproc
15 {
16 
17 
23  public QObject,
25  virtual public ifileproc::IFileConvertCopy
26 {
27 public:
29 
30  enum MessageId
31  {
32  MI_END_STATUS = 0xa830,
35  };
36 
37  I_BEGIN_COMPONENT(CCopyFilesTreeComp);
38  I_REGISTER_INTERFACE(ifileproc::IFileConvertCopy);
39  I_ASSIGN(m_fileCopyCompPtr, "FileCopy", "Provide copy of single file", true, "FileCopy");
40  I_ASSIGN_MULTI_1(m_filtersAttrPtr, "Filters", "List of file filters will be copied", true, "*");
41  I_ASSIGN_MULTI_0(m_excludeFiltersAttrPtr, "ExcludeFilters", "List of file filters will be exclude from copy", false);
42  I_ASSIGN(m_recursionDepthAttrPtr, "RecursionDepth", "Depth of recursion. Negative value means no depth limitation", true, 0);
43  I_ASSIGN(m_inputSubdirAttrPtr, "InputSubDir", "Input sub-directory", true, ".");
44  I_ASSIGN(m_outputSubdirAttrPtr, "OutputSubDir", "Output sub-directory", true, ".");
45  I_END_COMPONENT;
46 
47  // reimplemented (ifileproc::IFileConvertCopy)
48  virtual bool ConvertFiles(
49  const QString& inputPath,
50  const QString& outputPath,
51  const iprm::IParamsSet* paramsPtr = NULL) const;
52 
53 protected:
60  bool CheckFileExistTree(
61  const QDir& inputDir,
62  const QStringList& filters,
63  const QStringList& excludeFilters,
64  int recursionDepth) const;
73  bool CopyFileTree(
74  const QDir& inputDir,
75  const QDir& outputDir,
76  const iprm::IParamsSet* paramsPtr,
77  const QStringList& filters,
78  const QStringList& excludeFilters,
79  int recursionDepth,
80  int& counter) const;
81 
85  bool CheckIfExcluded(const QString& fileName, const QStringList& excludeFilters) const;
86 
87 private:
88  I_REF(ifileproc::IFileConvertCopy, m_fileCopyCompPtr);
89  I_MULTIATTR(QString, m_filtersAttrPtr);
90  I_MULTIATTR(QString, m_excludeFiltersAttrPtr);
91  I_ATTR(int, m_recursionDepthAttrPtr);
92  I_ATTR(QString, m_inputSubdirAttrPtr);
93  I_ATTR(QString, m_outputSubdirAttrPtr);
94 };
95 
96 
97 } // namespace ifileproc
98 
99 
100 #endif // !ifileproc_CCopyFilesTreeComp_included
101 
102 
virtual bool ConvertFiles(const QString &inputPath, const QString &outputPath, const iprm::IParamsSet *paramsPtr=NULL) const
Copy a file or files from inputPath to destination outputPath.
Common interface for file copying.
Copy files from one directory to another one.
bool CheckIfExcluded(const QString &fileName, const QStringList &excludeFilters) const
Check if some file should be excluded from processing.
ilog::CLoggerComponentBase BaseClass
bool CheckFileExistTree(const QDir &inputDir, const QStringList &filters, const QStringList &excludeFilters, int recursionDepth) const
Check if in tree specified files exists.
bool CopyFileTree(const QDir &inputDir, const QDir &outputDir, const iprm::IParamsSet *paramsPtr, const QStringList &filters, const QStringList &excludeFilters, int recursionDepth, int &counter) const
Copy complete files tree for specified filter.

© 2007-2011 Witold Gantzke and Kirill Lepskiy