ORE Studio 0.0.4
Loading...
Searching...
No Matches
CommandLineParser.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 *
3 * Copyright (C) 2025 Marco Craveiro <marco.craveiro@gmail.com>
4 *
5 * This program is free software; you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 3 of the License, or (at your option) any later
8 * version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 *
19 */
20#ifndef ORES_QT_COMMAND_LINE_PARSER_HPP
21#define ORES_QT_COMMAND_LINE_PARSER_HPP
22
23#include <optional>
24#include <string>
25#include <QCoreApplication>
26#include <QCommandLineParser>
27#include <QString>
28#include <QColor>
29#include "ores.logging/logging_options.hpp"
30
31namespace ores::qt {
32
39class CommandLineParser final {
40public:
45
51 void process(const QCoreApplication& app);
52
60 [[nodiscard]] std::optional<logging::logging_options> loggingOptions() const;
61
65 [[nodiscard]] bool isLoggingEnabled() const;
66
75 [[nodiscard]] QString instanceName() const;
76
85 [[nodiscard]] QColor instanceColor() const;
86
92 [[nodiscard]] std::string httpBaseUrl() const;
93
94
95private:
96 void setupOptions();
97 void saveToSettings();
98
99 QCommandLineParser parser_;
100};
101
102}
103
104#endif
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:29
Encapsulates Qt command line parsing for the application.
Definition CommandLineParser.hpp:39
void process(const QCoreApplication &app)
Process command line arguments.
Definition CommandLineParser.cpp:97
bool isLoggingEnabled() const
Check if logging is enabled.
Definition CommandLineParser.cpp:121
CommandLineParser()
Construct the parser and configure all options.
Definition CommandLineParser.cpp:28
std::string httpBaseUrl() const
Get the HTTP base URL for the compute service.
Definition CommandLineParser.cpp:163
QColor instanceColor() const
Get the instance color for the title bar.
Definition CommandLineParser.cpp:167
std::optional< logging::logging_options > loggingOptions() const
Get logging configuration based on parsed options.
Definition CommandLineParser.cpp:125
QString instanceName() const
Get the instance name for identifying this application instance.
Definition CommandLineParser.cpp:158