comparison gui/octave-gui/src/CommandLineParser.h @ 14240:a9992bc3c3f7 gui

GUI: Added qtermwidget snapshot as a subproject to build as a library that links with Octave GUI.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Sat, 21 Jan 2012 11:26:36 +0100
parents gui/src/CommandLineParser.h@c0e66d6e3dc8
children
comparison
equal deleted inserted replaced
14239:7ecaa8a66d5a 14240:a9992bc3c3f7
1 /* OctaveGUI - A graphical user interface for Octave
2 * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Affero General Public License as
6 * published by the Free Software Foundation, either version 3 of the
7 * License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU Affero General Public License for more details.
13 *
14 * You should have received a copy of the GNU Affero General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 #ifndef COMMANDLINEPARSER_H
19 #define COMMANDLINEPARSER_H
20
21 #include <QList>
22 #include <QString>
23
24 class CommandLineParser
25 {
26 public:
27 struct CommandLineOption
28 {
29 QString longOption;
30 QString shortOption;
31 QString description;
32 bool withArgument;
33
34 bool operator== (CommandLineOption other)
35 {
36 return longOption == other.longOption
37 || shortOption == other.shortOption;
38 }
39 };
40
41 CommandLineParser ();
42 void registerOption (CommandLineOption commandLineOption);
43 void registerOption (QString longOption, QString shortOption, QString description, bool withArgument);
44 void parse (int argc, char** argv);
45
46 private:
47 QList<CommandLineOption> m_registeredCommandLineOptions;
48 };
49
50 #endif // COMMANDLINEPARSER_H