QElectroTech  0.8-dev
qetarguments.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2020 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef QET_ARGUMENTS_H
19 #define QET_ARGUMENTS_H
20 #include <QtCore>
26 class QETArguments : public QObject {
27  Q_OBJECT
28 
29  // constructors, destructor
30  public:
31  QETArguments(QObject * = nullptr);
32  QETArguments(const QList<QString> &, QObject * = nullptr);
33  QETArguments(const QETArguments &);
35  ~QETArguments() override;
36 
37  // methods
38  public:
39  virtual void setArguments(const QList<QString> &);
40  virtual QList<QString> arguments() const;
41  virtual QList<QString> files() const;
42  virtual QList<QString> projectFiles() const;
43  virtual QList<QString> elementFiles() const;
44  virtual QList<QString> titleBlockTemplateFiles() const;
45 #ifdef QET_ALLOW_OVERRIDE_CED_OPTION
46  virtual bool commonElementsDirSpecified() const;
47  virtual QString commonElementsDir() const;
48 #endif
49 #ifdef QET_ALLOW_OVERRIDE_CTBTD_OPTION
50  virtual bool commonTitleBlockTemplatesDirSpecified() const;
51  virtual QString commonTitleBlockTemplatesDir() const;
52 #endif
53 #ifdef QET_ALLOW_OVERRIDE_CD_OPTION
54  virtual bool configDirSpecified() const;
55  virtual QString configDir() const;
56 #endif
57  virtual bool langDirSpecified() const;
58  virtual QString langDir() const;
59  virtual bool printHelpRequested() const;
60  virtual bool printLicenseRequested() const;
61  virtual bool printVersionRequested() const;
62  virtual QList<QString> options() const;
63  virtual QList<QString> unknownOptions() const;
64 
65  private:
66  void clear();
67  void parseArguments(const QList<QString> &);
68  void handleFileArgument(const QString &);
69  void handleOptionArgument(const QString &);
70 
71  // attributes
72  private:
73  QList<QString> project_files_;
74  QList<QString> element_files_;
75  QList<QString> tbt_files_;
76  QList<QString> options_;
77  QList<QString> unknown_options_;
78 #ifdef QET_ALLOW_OVERRIDE_CED_OPTION
79  QString common_elements_dir_;
80 #endif
81 #ifdef QET_ALLOW_OVERRIDE_CTBTD_OPTION
82  QString common_tbt_dir_;
83 #endif
84 #ifdef QET_ALLOW_OVERRIDE_CD_OPTION
85  QString config_dir_;
86 #endif
87  QString lang_dir_;
91 };
92 #endif
QETArguments::project_files_
QList< QString > project_files_
Definition: qetarguments.h:73
QETArguments::printVersionRequested
virtual bool printVersionRequested() const
Definition: qetarguments.cpp:376
QETArguments::titleBlockTemplateFiles
virtual QList< QString > titleBlockTemplateFiles() const
Definition: qetarguments.cpp:149
QETArguments::unknown_options_
QList< QString > unknown_options_
Definition: qetarguments.h:77
QETArguments::unknownOptions
virtual QList< QString > unknownOptions() const
Definition: qetarguments.cpp:163
QETArguments::langDir
virtual QString langDir() const
Definition: qetarguments.cpp:352
QETArguments::lang_dir_
QString lang_dir_
Definition: qetarguments.h:87
QETArguments::print_help_
bool print_help_
Definition: qetarguments.h:88
QETArguments::langDirSpecified
virtual bool langDirSpecified() const
Definition: qetarguments.cpp:344
QETArguments::print_version_
bool print_version_
Definition: qetarguments.h:90
QETArguments::printLicenseRequested
virtual bool printLicenseRequested() const
Definition: qetarguments.cpp:368
QETArguments::arguments
virtual QList< QString > arguments() const
Definition: qetarguments.cpp:120
QETArguments::handleOptionArgument
void handleOptionArgument(const QString &)
Definition: qetarguments.cpp:239
QETArguments
Definition: qetarguments.h:26
QETArguments::setArguments
virtual void setArguments(const QList< QString > &)
Definition: qetarguments.cpp:111
QETArguments::projectFiles
virtual QList< QString > projectFiles() const
Definition: qetarguments.cpp:135
QETArguments::print_license_
bool print_license_
Definition: qetarguments.h:89
templatescollection.h
QETArguments::printHelpRequested
virtual bool printHelpRequested() const
Definition: qetarguments.cpp:360
QETArguments::clear
void clear()
Definition: qetarguments.cpp:170
QETArguments::element_files_
QList< QString > element_files_
Definition: qetarguments.h:74
QETArguments::handleFileArgument
void handleFileArgument(const QString &)
Definition: qetarguments.cpp:211
QETArguments::~QETArguments
~QETArguments() override
Definition: qetarguments.cpp:103
QETArguments::parseArguments
void parseArguments(const QList< QString > &)
Definition: qetarguments.cpp:191
QETArguments::options_
QList< QString > options_
Definition: qetarguments.h:76
QETArguments::options
virtual QList< QString > options() const
Definition: qetarguments.cpp:156
QETArguments::tbt_files_
QList< QString > tbt_files_
Definition: qetarguments.h:75
qetarguments.h
QETArguments::QETArguments
QETArguments(QObject *=nullptr)
Definition: qetarguments.cpp:25
TITLEBLOCKS_FILE_EXTENSION
#define TITLEBLOCKS_FILE_EXTENSION
Definition: templatescollection.h:20
QETArguments::operator=
QETArguments & operator=(const QETArguments &)
Definition: qetarguments.cpp:78
QETArguments::files
virtual QList< QString > files() const
Definition: qetarguments.cpp:128
QETArguments::elementFiles
virtual QList< QString > elementFiles() const
Definition: qetarguments.cpp:142