1#ifndef CALCULATOROPTIONS_P_H
2#define CALCULATOROPTIONS_P_H
9#include <qx/io/qx-textstreamreader.h>
12#include "star/calculator.h"
18class QX_ERROR_TYPE(CalcOptionsError,
"Star::CalcOptionsError", 1151)
20 friend class CalcOptionsReader;
33 static inline const QString MAIN_ERR_MSG = u
"Error reading the options list."_s;
34 static inline const QHash<Type, QString> ERR_STRINGS{
37 {DoesNotExist, u
"The specified file does not exist."_s},
38 {InvalidOption, u
"The file contains an invalid option (Line: %1)."_s}
48 CalcOptionsError(Type t = NoError);
50 template<
typename... Strings>
51 requires (std::same_as<Strings, QString> && ...)
52 CalcOptionsError(Type t, Strings... args) :
55 mString = mString.arg(args...);
58 template<
typename... Ints>
59 requires (std::integral<Ints> && ...)
60 CalcOptionsError(Type t, Ints... args) :
63 auto sub = [
this](
auto integer) { mString = mString.arg(integer); };
71 QString string()
const;
74 Qx::Severity deriveSeverity()
const override;
75 quint32 deriveValue()
const override;
76 QString derivePrimary()
const override;
77 QString deriveSecondary()
const override;
80class CalcOptionsReader
85 Qx::TextStreamReader mOptionsReader;
93 CalcOptionsError readInto();
QFlags< Option > Options
Definition calculator.h:34
The Star namespace is the main namespace through which all functionality of the STAR++ library is acc...
Definition calculator.cpp:21