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 <cstdint>
24#include <optional>
25#include <QCoreApplication>
26#include <QCommandLineParser>
27#include "ores.utility/log/logging_options.hpp"
28
29namespace ores::qt {
30
37class CommandLineParser final {
38public:
43
49 void process(const QCoreApplication& app);
50
58 [[nodiscard]] std::optional<utility::log::logging_options> loggingOptions() const;
59
63 [[nodiscard]] bool isLoggingEnabled() const;
64
68 [[nodiscard]] bool isCompressionEnabled() const;
69
80 [[nodiscard]] std::uint8_t supportedCompression() const;
81
82private:
83 void setupOptions();
84
85 QCommandLineParser parser_;
86};
87
88}
89
90#endif
Qt-based graphical user interface for ORE Studio.
Definition AboutDialog.hpp:35
Encapsulates Qt command line parsing for the application.
Definition CommandLineParser.hpp:37
bool isCompressionEnabled() const
Check if compression is enabled.
Definition CommandLineParser.cpp:127
void process(const QCoreApplication &app)
Process command line arguments.
Definition CommandLineParser.cpp:89
bool isLoggingEnabled() const
Check if logging is enabled.
Definition CommandLineParser.cpp:93
CommandLineParser()
Construct the parser and configure all options.
Definition CommandLineParser.cpp:28
std::optional< utility::log::logging_options > loggingOptions() const
Get logging configuration based on parsed options.
Definition CommandLineParser.cpp:97
std::uint8_t supportedCompression() const
Get the supported compression bitmask based on parsed options.
Definition CommandLineParser.cpp:131