QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
qetarguments.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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>
26class QETArguments : public QObject {
27 Q_OBJECT
28
29 // constructors, destructor
30 public:
31 QETArguments(QObject * = nullptr);
32 QETArguments(const QList<QString> &, QObject * = nullptr);
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
Definition qetarguments.h:26
virtual bool printLicenseRequested() const
Definition qetarguments.cpp:386
void clear()
Definition qetarguments.cpp:178
bool print_license_
Definition qetarguments.h:89
bool print_help_
Definition qetarguments.h:88
QString lang_dir_
Definition qetarguments.h:87
QList< QString > element_files_
Definition qetarguments.h:74
virtual QList< QString > titleBlockTemplateFiles() const
Definition qetarguments.cpp:154
QList< QString > unknown_options_
Definition qetarguments.h:77
virtual QList< QString > options() const
Definition qetarguments.cpp:162
virtual QList< QString > files() const
Definition qetarguments.cpp:130
~QETArguments() override
Definition qetarguments.cpp:103
void handleFileArgument(const QString &)
Definition qetarguments.cpp:220
bool print_version_
Definition qetarguments.h:90
QList< QString > options_
Definition qetarguments.h:76
virtual QList< QString > arguments() const
Definition qetarguments.cpp:121
QList< QString > tbt_files_
Definition qetarguments.h:75
void parseArguments(const QList< QString > &)
Definition qetarguments.cpp:200
virtual QList< QString > unknownOptions() const
Definition qetarguments.cpp:170
virtual bool printHelpRequested() const
Definition qetarguments.cpp:377
virtual bool langDirSpecified() const
Definition qetarguments.cpp:359
virtual QString langDir() const
Definition qetarguments.cpp:368
void handleOptionArgument(const QString &)
Definition qetarguments.cpp:248
virtual QList< QString > elementFiles() const
Definition qetarguments.cpp:146
virtual QList< QString > projectFiles() const
Definition qetarguments.cpp:138
virtual bool printVersionRequested() const
Definition qetarguments.cpp:395
QETArguments & operator=(const QETArguments &)
Definition qetarguments.cpp:78
virtual void setArguments(const QList< QString > &)
Definition qetarguments.cpp:112
QList< QString > project_files_
Definition qetarguments.h:73