Stellarium 0.13.2
CLIProcessor.hpp
1 /*
2  * Stellarium
3  * Copyright (C) 2009 Fabien Chereau
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program 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 this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef CLIPROCESSOR_HPP
21 #define CLIPROCESSOR_HPP
22 
23 #include "config.h"
24 
25 #include <QStringList>
26 
27 class QSettings;
28 
30 {
31 public:
37  static bool argsGetOption(const QStringList& argList, QString shortOpt, QString longOpt);
38 
66  static QVariant argsGetOptionWithArg(const QStringList& argList, QString shortOpt, QString longOpt, QVariant defaultValue);
67 
88  static int argsGetYesNoOption(const QStringList& argList, QString shortOpt, QString longOpt, int defaultValue);
89 
94  static void parseCLIArgsPreConfig(const QStringList& argList);
95 
99  static void parseCLIArgsPostConfig(const QStringList& argList, QSettings* conf);
100 };
101 
102 #endif // CLIPROCESSOR_HPP
static bool argsGetOption(const QStringList &argList, QString shortOpt, QString longOpt)
Check if a QStringList has a CLI-style option in it (before the first –).
static void parseCLIArgsPreConfig(const QStringList &argList)
Processing of command line options which is to be done before config file is read.
static QVariant argsGetOptionWithArg(const QStringList &argList, QString shortOpt, QString longOpt, QVariant defaultValue)
Retrieve the argument to an option from a QStringList.
static int argsGetYesNoOption(const QStringList &argList, QString shortOpt, QString longOpt, int defaultValue)
Check if a QStringList has a yes/no CLI-style option in it, and find out the argument to that paramet...
static void parseCLIArgsPostConfig(const QStringList &argList, QSettings *conf)
Processing of command line options which is to be done after the config file is read.