diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-09-12 08:05:50 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-09-19 09:35:08 +0200 |
| commit | f2cc10c24014a41c9b92ae1f1aed04445fcf608e (patch) | |
| tree | 594595307dcddbd0387dd344c8a28afa66841f53 /sources/shiboken6/ApiExtractor/optionsparser.cpp | |
| parent | 766f4de0d00c598ab647f88f50ae5423edd2690b (diff) | |
shiboken6: Move OptionsParser out of the generator
Move the interface out to a separate class in ApiExtractor so that it
can be used for options handling of ApiExtractor and type database as
well.
Add a class OptionsParserList that aggregates option parser
instances.
Replace it by static functions creating OptionsParser instances.
Pick-to: 6.6
Change-Id: Ic1b3a2020af6d18f682f7026a7e9c2c7ba704d6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/optionsparser.cpp')
| -rw-r--r-- | sources/shiboken6/ApiExtractor/optionsparser.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sources/shiboken6/ApiExtractor/optionsparser.cpp b/sources/shiboken6/ApiExtractor/optionsparser.cpp index 21f19612c..b41d13e7d 100644 --- a/sources/shiboken6/ApiExtractor/optionsparser.cpp +++ b/sources/shiboken6/ApiExtractor/optionsparser.cpp @@ -53,3 +53,21 @@ bool OptionsParser::handleOption(const QString &, const QString &, OptionSource) { return false; } + +bool OptionsParserList::handleBoolOption(const QString &key, OptionSource source) +{ + for (const auto &p : std::as_const(m_parsers)) { + if (p->handleBoolOption(key, source)) + return true; + } + return false; +} + +bool OptionsParserList::handleOption(const QString &key, const QString &value, OptionSource source) +{ + for (const auto &p : std::as_const(m_parsers)) { + if (p->handleOption(key, value, source)) + return true; + } + return false; +} |
