CFileInfoCopyComp.h
Go to the documentation of this file.
1 #ifndef ifileproc_CFileInfoCopyComp_included
2 #define ifileproc_CFileInfoCopyComp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QString>
7 #include <QtCore/QDir>
8 
9 // ACF includes
10 #include <ibase/IApplicationInfo.h>
11 #include <ilog/TLoggerCompWrap.h>
12 
13 // ACF-Solutions includes
15 
16 
17 namespace ifileproc
18 {
19 
20 
38  public QObject,
40  virtual public ifileproc::IFileConversion
41 {
42 public:
44 
45  enum MessageId
46  {
47  MI_FILE_INFO = 0xa810,
52  };
53 
54  I_BEGIN_COMPONENT(CFileInfoCopyComp);
55  I_REGISTER_INTERFACE(ifileproc::IFileConversion);
56  I_ASSIGN(m_applicationInfoCompPtr, "ApplicationInfo", "Provide information about versions for substitution", false, "VersionInfo");
57  I_ASSIGN(m_licensePathAttrPtr, "LicensePath", "Path of license file will be included at begin of copied file", false, "License.txt");
58  I_ASSIGN(m_substitutionTagExprAttrPtr, "SubstitutionTagExpr", "Define tag used for substitution as QT regular expression", false, "\\$(\\S+)\\$");
59  I_ASSIGN(m_replaceEnvironmentVariablesAttrPtr, "ReplaceEnvironmentVariables", "If enabled, environment variables will be replaced", true, false);
60  I_ASSIGN(m_replaceEmbeddedVariablesAttrPtr, "ReplaceEmbeddedVariables", "If enabled, embedded variables will be replaced e.g.:\n\tCompileMode for current compile mode (Debug or Release)\n\tCompilerName for current compiler name (VC9)\n\tConfigurationDir for e.g. VC9_64", true, false);
61  I_ASSIGN_MULTI_0(m_userSubstitutionTagsAttrPtr, "UserSubstitutionTags", "List of user defined substitution tags will be replaced with specified values", false);
62  I_ASSIGN_MULTI_0(m_userSubstitutionValuesAttrPtr, "UserSubstitutionValues", "List of user substitution values according to specified user tags, it can contains special values:\n\t$RelativeToInputFile:<base file name>\n\t$RelativeToOutputFile:<base file name>\n\t$AbsoluteToInputFile:<base file name>\n\t$AbsoluteToInputFile:<base file name>", false);
63  I_ASSIGN(m_ignoreUnknownTagsAttrPtr, "IgnoreUnknownTags", "When enabled the unknown tags will not produce warning messages", true, false);
64  I_END_COMPONENT;
65 
66  // reimplemented (ifileproc::IFileConversion)
67  virtual int ConvertFiles(
68  const QString& inputPath,
69  QString& outputPath,
70  const iprm::IParamsSet* paramsPtr = NULL,
71  ibase::IProgressManager* progressManagerPtr = NULL) const;
72 
73 protected:
75  const QDir& inputDir,
76  const QDir& outputDir,
77  const QString& tag,
78  QString& result) const;
79 
80 private:
81  I_REF(ibase::IApplicationInfo, m_applicationInfoCompPtr);
82 
83  I_ATTR(QString, m_licensePathAttrPtr);
84  I_ATTR(QString, m_substitutionTagExprAttrPtr);
85  I_ATTR(bool, m_replaceEnvironmentVariablesAttrPtr);
86  I_ATTR(bool, m_replaceEmbeddedVariablesAttrPtr);
87  I_MULTIATTR(QString, m_userSubstitutionTagsAttrPtr);
88  I_MULTIATTR(QString, m_userSubstitutionValuesAttrPtr);
89  I_ATTR(bool, m_ignoreUnknownTagsAttrPtr);
90 };
91 
92 
93 } // namespace ifileproc
94 
95 
96 #endif // !ifileproc_CFileInfoCopyComp_included
97 
98 
Copy of text files with some tags substitution and optional license attachment.
ilog::CLoggerComponentBase BaseClass
bool ProcessSubstitutionTag(const QDir &inputDir, const QDir &outputDir, const QString &tag, QString &result) const
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.
General interface for conversion of files.

© 2007-2017 Witold Gantzke and Kirill Lepskiy