annotate gui/src/CommandLineParser.cpp @ 13544:81eef7babeb5

Tagged unused variables with Q_UNUSED, so that no warnings remain.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Tue, 26 Jul 2011 23:20:05 +0200
parents a4b5cad8f7c6
children c0e66d6e3dc8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13539
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
1 /* OctaveGUI - A graphical user interface for Octave
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
2 * Copyright (C) 2011 Jacob Dawid
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
3 * jacob.dawid@googlemail.com
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
4 *
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
8 * (at your option) any later version.
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
9 *
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
14 *
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
17 */
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
18
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
19 #include "CommandLineParser.h"
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
20
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
21 CommandLineParser::CommandLineParser ()
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22 {
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23 }
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25 void
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26 CommandLineParser::registerOption (CommandLineOption commandLineOption)
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
27 {
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
28 if (m_registeredCommandLineOptions.contains(commandLineOption))
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
29 m_registeredCommandLineOptions.append(commandLineOption);
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
30 }
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
31
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
32 void
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
33 CommandLineParser::registerOption (QString longOption, QString shortOption, QString description, bool withArgument)
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 {
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
35 CommandLineOption commandLineOption;
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
36 commandLineOption.longOption = longOption;
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
37 commandLineOption.shortOption = shortOption;
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
38 commandLineOption.description = description;
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39 commandLineOption.withArgument = withArgument;
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40 registerOption (commandLineOption);
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
41 }
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
42
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
43 void
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
44 CommandLineParser::parse (int argc, char** argv)
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
45 {
13544
81eef7babeb5 Tagged unused variables with Q_UNUSED, so that no warnings remain.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13539
diff changeset
46 Q_UNUSED(argc);
81eef7babeb5 Tagged unused variables with Q_UNUSED, so that no warnings remain.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13539
diff changeset
47 Q_UNUSED(argv);
13539
a4b5cad8f7c6 Added command line parser class.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
48 }