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
10 #include <ilog/TLoggerCompWrap.h>
11 
12 // ACF-Solutions includes
14 
15 
16 namespace ifileproc
17 {
18 
19 
26  virtual public ifileproc::IFileConversion
27 {
28 public:
30 
31  enum MessageId
32  {
33  MI_END_STATUS = 0xa830,
36  };
37 
38  I_BEGIN_COMPONENT(CCopyFilesTreeComp);
39  I_REGISTER_INTERFACE(ifileproc::IFileConversion);
40  I_ASSIGN(m_fileCopyCompPtr, "FileCopy", "Provide copy of single file", true, "FileCopy");
41  I_ASSIGN_MULTI_1(m_filtersAttrPtr, "Filters", "List of file filters will be copied", true, "*");
42  I_ASSIGN_MULTI_0(m_excludeFiltersAttrPtr, "ExcludeFilters", "List of file filters will be exclude from copy", false);
43  I_ASSIGN(m_recursionDepthAttrPtr, "RecursionDepth", "Depth of recursion. Negative value means no depth limitation", true, 0);
44  I_ASSIGN(m_inputSubdirAttrPtr, "InputSubDir", "Input sub-directory", true, ".");
45  I_ASSIGN(m_outputSubdirAttrPtr, "OutputSubDir", "Output sub-directory", true, ".");
46  I_END_COMPONENT;
47 
48  // reimplemented (ifileproc::IFileConversion)
49  virtual int ConvertFiles(
50  const QString& inputPath,
51  QString& outputPath,
52  const iprm::IParamsSet* paramsPtr = NULL,
53  ibase::IProgressManager* progressManagerPtr = NULL) const;
54 
55 protected:
62  bool CheckFileExistTree(
63  const QDir& inputDir,
64  const QStringList& filters,
65  const QStringList& excludeFilters,
66  int recursionDepth) const;
75  bool CopyFileTree(
76  const QDir& inputDir,
77  const QDir& outputDir,
78  const iprm::IParamsSet* paramsPtr,
79  const QStringList& filters,
80  const QStringList& excludeFilters,
81  int recursionDepth,
82  int& counter) const;
83 
87  bool CheckIfExcluded(const QString& fileName, const QStringList& excludeFilters) const;
88 
89 private:
90  I_REF(ifileproc::IFileConversion, m_fileCopyCompPtr);
91  I_MULTIATTR(QString, m_filtersAttrPtr);
92  I_MULTIATTR(QString, m_excludeFiltersAttrPtr);
93  I_ATTR(int, m_recursionDepthAttrPtr);
94  I_ATTR(QString, m_inputSubdirAttrPtr);
95  I_ATTR(QString, m_outputSubdirAttrPtr);
96 };
97 
98 
99 } // namespace ifileproc
100 
101 
102 #endif // !ifileproc_CCopyFilesTreeComp_included
103 
104 
virtual int ConvertFiles(const QString &inputPath, QString &outputPath, const iprm::IParamsSet *paramsPtr=NULL, ibase::IProgressManager *progressManagerPtr=NULL) const
Copy a file or files from inputPath to destination outputPath.
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.
General interface for conversion of files.
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-2017 Witold Gantzke and Kirill Lepskiy