Project
Loading...
Searching...
No Matches
qconfig.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#include <cstdio>
16#include <cstdlib>
17#include <memory.h>
18#include <utility>
19#include <vector>
20#include <functional>
21#include <iostream>
22#include <tuple>
23#include "qconfig.h"
24#include "qconfig_helpers.h"
25
26// Create config instances
27#define QCONFIG_PARSER_CXX
28#define QCONFIG_INSTANCE
29#include "qconfig.h"
30#undef QCONFIG_INSTANCE
31
32namespace qConfig
33{
34#define QCONFIG_SETTING(name, type) \
35 struct qon_mxcat3(q, name, _t) \
36 { \
37 type v; \
38 constexpr qon_mxcat3(q, name, _t)(type s) : v(s) {} \
39 }; \
40 constexpr qon_mxcat3(q, name, _t) name(type v) { return (qon_mxcat3(q, name, _t)(v)); }
41
42#define QCONFIG_SETTING_TEMPLATE(name) \
43 template <typename T> \
44 struct qon_mxcat3(q, name, _t) \
45 { \
46 T v; \
47 constexpr qon_mxcat3(q, name, _t)(const T& s) : v(s) {} \
48 }; \
49 template <typename T> \
50 constexpr qon_mxcat3(q, name, _t)<T> name(T v) \
51 { \
52 return (qon_mxcat3(q, name, _t) < T > (v)); \
53 }
54
55QCONFIG_SETTING(message, const char*)
60
61static inline const char* getOptName(const char** argv, int32_t i)
62{
63 while (i > 1 && argv[i][0] != '-') {
64 i--;
65 }
66 return (argv[i]);
67}
68
69template <typename T>
71 qConfigSettings() : checkMin(false), checkMax(false), doSet(false), doDefault(false), min(), max(), set(), message(nullptr), allowEmpty(false){};
72 template <typename S>
76 T min, max;
77 T set;
78 const char* message;
80};
81
82template <typename T>
83static int32_t qAddOptionType(qConfigSettings<T>& settings, T& ref, int32_t& i, const char** argv, const int argc, T def);
84template <typename T>
85static void qAddOptionMessage(qConfigSettings<T>& settings, T& ref);
86template <typename T>
87static int32_t qAddOptionMinMax(qConfigSettings<T>& settings, T& ref, const char* arg);
88
89template <typename T>
91 typedef T settingsType;
92};
93template <typename... X>
94struct qSettingsType<std::tuple<X...>> {
95 typedef int32_t settingsType;
96};
97
98template <typename T>
100 static inline int32_t qAddOptionMain(qConfigSettings<T>& settings, T& ref, int32_t& i, const char** argv, const int argc, T def);
101};
102template <typename... X>
103struct qConfigTypeSpecialized<std::tuple<X...>> {
104 static inline int32_t qAddOptionMain(qConfigSettings<typename qSettingsType<std::tuple<X...>>::settingsType>& settings, std::tuple<X...>& ref, int32_t& i, const char** argv, const int argc, std::tuple<X...>& def);
105};
106
107// Main processing function for arguments
108template <class T>
109inline int32_t qConfigTypeSpecialized<T>::qAddOptionMain(qConfigSettings<T>& settings, T& ref, int32_t& i, const char** argv, const int argc, T def)
110{
111 int32_t retVal = 0;
112 int32_t iOrg = i;
113 if (settings.doSet) {
114 ref = settings.set;
115 } else if ((retVal = qAddOptionType<T>(settings, ref, i, argv, argc, def))) {
116 return (retVal);
117 }
118 if ((retVal = qAddOptionMinMax<T>(settings, ref, iOrg < argc ? argv[iOrg] : ""))) {
119 return (retVal);
120 }
121 qAddOptionMessage<T>(settings, ref);
122 return (0);
123}
124template <typename T>
125static inline int32_t qAddOptionMainTupleElem(qConfigSettings<typename qSettingsType<T>::settingsType> settingsTup, T& ref, int32_t& i, const char** argv, const int argc)
126{
127 T def = T();
128 qConfigSettings<T> settings = settingsTup;
129 return (qAddOptionType<T>(settings, ref, i, argv, argc, def));
130}
131template <typename T, int32_t index = 0, int32_t left = std::tuple_size<T>::value>
133 static inline int32_t qAddOptionMainTuple(qConfigSettings<typename qSettingsType<T>::settingsType> settings, T& tup, int32_t& i, const char** argv, const int argc)
134 {
135 auto& ref = std::get<index>(tup);
136 int32_t retVal = qAddOptionMainTupleElem(settings, ref, i, argv, argc);
137 if (retVal) {
138 if (retVal == qcrArgMissing && index != 0) {
139 printf("Invalid number of arguments for option %s\n", getOptName(argv, i));
141 }
142 return (retVal);
143 }
145 }
146};
147template <typename T, int32_t index>
149 static inline int32_t qAddOptionMainTuple(qConfigSettings<typename qSettingsType<T>::settingsType> /*settings*/, T& /*tup*/, int32_t& /*i*/, const char** /*argv*/, const int32_t /*argc*/) { return 0; }
150};
151template <typename... X>
152inline int32_t qConfigTypeSpecialized<std::tuple<X...>>::qAddOptionMain(qConfigSettings<typename qSettingsType<std::tuple<X...>>::settingsType>& settings, std::tuple<X...>& ref, int32_t& i, const char** argv, const int argc, std::tuple<X...>& /*def*/)
153{
154 return (qAddOptionMainTupleStruct<std::tuple<X...>>::qAddOptionMainTuple(settings, ref, i, argv, argc));
155}
156
157template <typename T>
159 // Recursive handling of additional settings
160 static inline void qProcessSetting(qConfigSettings<T>& settings, qmin_t<T> minval)
161 {
162 static_assert(!std::is_same<T, bool>::value, "min option not supported for boolean settings");
163 settings.checkMin = true;
164 settings.min = minval.v;
165 }
166 static inline void qProcessSetting(qConfigSettings<T>& settings, qmax_t<T> maxval)
167 {
168 static_assert(!std::is_same<T, bool>::value, "max option not supported for boolean settings");
169 settings.checkMax = true;
170 settings.max = maxval.v;
171 }
172 static inline void qProcessSetting(qConfigSettings<T>& settings, qmessage_t msg) { settings.message = msg.v; }
173 template <typename S>
174 static inline void qProcessSetting(qConfigSettings<T>& settings, qset_t<S> set)
175 {
176 settings.doSet = true;
177 settings.set = set.v;
178 }
179 template <typename S>
180 static inline void qProcessSetting(qConfigSettings<T>& settings, qdef_t<S> set)
181 {
182 settings.doDefault = true;
183 settings.set = set.v;
184 }
185
186 static inline void qAddOptionSettings(qConfigSettings<T>& /*settings*/) {}
187 template <typename Arg1, typename... Args>
188 static inline void qAddOptionSettings(qConfigSettings<T>& settings, Arg1&& arg1, Args&&... args)
189 {
190 qProcessSetting(settings, arg1);
191 qAddOptionSettings(settings, args...);
192 }
193
194 template <typename... Args>
195 static inline int32_t qAddOption(T& ref, int32_t& i, const char** argv, const int argc, T def, const char* /*help*/, Args&&... args)
196 {
197 auto settings = qConfigGetSettings(args...);
198 return qConfigTypeSpecialized<T>::qAddOptionMain(settings, ref, i, argv, argc, def);
199 }
200
201 template <typename... Args>
202 static inline int32_t qAddOptionVec(std::vector<T>& ref, int32_t& i, const char** argv, const int argc, const char* /*help*/, Args&&... args)
203 {
204 auto settings = qConfigGetSettings(args...);
205 int32_t iFirst = i, iLast;
206 do {
207 iLast = i;
208 T tmp = T(), def = T();
209 settings.allowEmpty = (i != iFirst);
210 int32_t retVal = qConfigTypeSpecialized<T>::qAddOptionMain(settings, tmp, i, argv, argc, def);
211 if (retVal) {
212 return (retVal != qcrArgMissing || i == iFirst ? retVal : 0);
213 }
214 if (i == iFirst || i != iLast) {
215 ref.push_back(tmp);
216 }
217 } while (i != iLast);
218 return (0);
219 }
220
221 template <typename... Args>
222 static inline int32_t qAddOptionArray(T* ref, int32_t count, int32_t& i, const char** argv, const int argc, const char* /*help*/, Args&&... args)
223 {
224 auto settings = qConfigGetSettings(args...);
225 int32_t iFirst = i, iLast;
226 do {
227 iLast = i;
228 T tmp = T(), def = T();
229 settings.allowEmpty = (i != iFirst);
230 int32_t retVal = qConfigTypeSpecialized<T>::qAddOptionMain(settings, tmp, i, argv, argc, def);
231 if (retVal) {
232 return (retVal != qcrArgMissing || i == iFirst ? retVal : 0);
233 }
234 if (i - iFirst >= count) {
235 printf("Too many values provided for option %s\n", getOptName(argv, i));
236 return (qcrArrayOverflow);
237 }
238 if (i == iFirst || i != iLast) {
239 ref[i - iFirst] = tmp;
240 }
241 } while (i != iLast);
242 return (0);
243 }
244
245 template <typename... Args>
246 static inline void qConfigHelpOption(const char* name, const char* type, const char* def, const char* optname, char optnameshort, const char* preopt, char preoptshort, int32_t optionType, const char* help, Args&&... args)
247 {
248 auto settings = qConfigGetSettings(args...);
249 const bool boolType = optionType != 1 && std::is_same<T, bool>::value;
250 const char* arguments = settings.doSet ? " (" : (settings.doDefault || optionType == 1 || boolType) ? " [arg] (" : optionType == 2 ? " [...] (" : " arg (";
251 char argBuffer[4] = {0};
252 uint32_t argBufferPos = 0;
253 if (optnameshort && preoptshort) {
254 argBuffer[argBufferPos++] = '-';
255 }
256 if (optnameshort) {
257 argBuffer[argBufferPos++] = preoptshort == 0 ? '-' : preoptshort;
258 argBuffer[argBufferPos++] = optnameshort;
259 }
260 std::cout << "\t" << name << ": " << argBuffer << (optnameshort == 0 ? "" : arguments) << "--";
261 if (optname[0] == 0) {
262 std::cout << preopt << name;
263 } else {
264 std::cout << optname;
265 }
266 std::cout << (optnameshort == 0 ? arguments : ", ") << "type: " << type;
267 if (optionType == 0) {
268 std::cout << ", default: " << def;
269 }
270 if (optionType == 1) {
271 std::cout << ", sets " << name << " to " << def;
272 }
273 if (settings.checkMin) {
274 std::cout << ", minimum: " << settings.min;
275 }
276 if (settings.checkMax) {
277 std::cout << ", maximum: " << settings.max;
278 }
279 std::cout << ")\n\t\t" << help << ".\n";
280 if (settings.doSet) {
281 std::cout << "\t\tSets " << name << " to " << settings.set << ".\n";
282 } else if (settings.doDefault) {
283 std::cout << "\t\tIf no argument is supplied, " << name << " is set to " << settings.set << ".\n";
284 } else if (boolType) {
285 std::cout << "\t\tIf no argument is supplied, " << name << " is set to true.\n";
286 }
287 if (optionType == 2) {
288 std::cout << "\t\tCan be set multiple times, accepts multiple arguments.\n";
289 }
290 std::cout << "\n";
291 }
292
293 template <typename... Args>
294 static inline auto qConfigGetSettings(Args&... args)
295 {
298 return (settings);
299 }
300};
301
302static inline const char* getArg(int32_t& i, const char** argv, const int argc, bool allowOption = false)
303{
304 if (i + 1 < argc && argv[i + 1][0] && ((allowOption && argv[i + 1][0] == '-' && argv[i + 1][1] != '-') || argv[i + 1][0] != '-')) {
305 return (argv[++i]);
306 }
307 return (nullptr);
308}
309
310template <class T>
311static inline int32_t qAddOptionGeneric(qConfigSettings<T>& settings, T& ref, int32_t& i, const char** argv, const int argc, T def, std::function<T(const char*)> func, bool allowDefault = false)
312{
313 const char* arg = getArg(i, argv, argc, !allowDefault);
314 if (arg) {
315 ref = func(arg);
316 return (0);
317 } else if (allowDefault) {
318 ref = def;
319 return (0);
320 }
321 if (!settings.allowEmpty) {
322 printf("Argument missing for option %s!\n", getOptName(argv, i));
323 }
324 return (qcrArgMissing);
325}
326
327// Handling of all supported types
328template <>
329inline int32_t qAddOptionType<bool>(qConfigSettings<bool>& settings, bool& ref, int32_t& i, const char** argv, const int argc, bool /*def*/)
330{
331 return qAddOptionGeneric<bool>(
332 settings, ref, i, argv, argc, settings.doDefault ? settings.set : true, [](const char* a) -> bool {
333 return atoi(a);
334 },
335 true);
336}
337template <>
338inline int32_t qAddOptionType<int8_t>(qConfigSettings<int8_t>& settings, int8_t& ref, int32_t& i, const char** argv, const int argc, int8_t /*def*/)
339{
340 return qAddOptionGeneric<int8_t>(
341 settings, ref, i, argv, argc, settings.set, [](const char* a) -> int8_t {
342 return atoi(a);
343 },
344 settings.doDefault);
345}
346template <>
347inline int32_t qAddOptionType<uint8_t>(qConfigSettings<uint8_t>& settings, uint8_t& ref, int32_t& i, const char** argv, const int argc, uint8_t /*def*/)
348{
349 return qAddOptionGeneric<uint8_t>(
350 settings, ref, i, argv, argc, settings.set, [](const char* a) -> uint8_t {
351 return atoi(a);
352 },
353 settings.doDefault);
354}
355template <>
356inline int32_t qAddOptionType<int32_t>(qConfigSettings<int32_t>& settings, int32_t& ref, int32_t& i, const char** argv, const int argc, int32_t /*def*/)
357{
358 return qAddOptionGeneric<int32_t>(
359 settings, ref, i, argv, argc, settings.set, [](const char* a) -> int32_t {
360 return atoi(a);
361 },
362 settings.doDefault);
363}
364template <>
365inline int32_t qAddOptionType<uint32_t>(qConfigSettings<uint32_t>& settings, uint32_t& ref, int32_t& i, const char** argv, const int argc, uint32_t /*def*/)
366{
367 return qAddOptionGeneric<uint32_t>(
368 settings, ref, i, argv, argc, settings.set, [](const char* a) -> uint32_t {
369 return strtoul(a, nullptr, 0);
370 },
371 settings.doDefault);
372}
373template <>
374inline int32_t qAddOptionType<int16_t>(qConfigSettings<int16_t>& settings, int16_t& ref, int32_t& i, const char** argv, const int argc, int16_t /*def*/)
375{
376 return qAddOptionGeneric<int16_t>(
377 settings, ref, i, argv, argc, settings.set, [](const char* a) -> int16_t {
378 return atoi(a);
379 },
380 settings.doDefault);
381}
382template <>
383inline int32_t qAddOptionType<uint16_t>(qConfigSettings<uint16_t>& settings, uint16_t& ref, int32_t& i, const char** argv, const int argc, uint16_t /*def*/)
384{
385 return qAddOptionGeneric<uint16_t>(
386 settings, ref, i, argv, argc, settings.set, [](const char* a) -> uint16_t {
387 return strtoul(a, nullptr, 0);
388 },
389 settings.doDefault);
390}
391template <>
392inline int32_t qAddOptionType<int64_t>(qConfigSettings<int64_t>& settings, int64_t& ref, int32_t& i, const char** argv, const int argc, int64_t /*def*/)
393{
394 return qAddOptionGeneric<int64_t>(
395 settings, ref, i, argv, argc, settings.set, [](const char* a) -> int64_t {
396 return strtoll(a, nullptr, 0);
397 },
398 settings.doDefault);
399}
400template <>
401inline int32_t qAddOptionType<uint64_t>(qConfigSettings<uint64_t>& settings, uint64_t& ref, int32_t& i, const char** argv, const int argc, uint64_t /*def*/)
402{
403 return qAddOptionGeneric<uint64_t>(
404 settings, ref, i, argv, argc, settings.set, [](const char* a) -> uint64_t {
405 return strtoull(a, nullptr, 0);
406 },
407 settings.doDefault);
408}
409template <>
410inline int32_t qAddOptionType<float>(qConfigSettings<float>& settings, float& ref, int32_t& i, const char** argv, const int argc, float /*def*/)
411{
412 return qAddOptionGeneric<float>(
413 settings, ref, i, argv, argc, settings.set, [](const char* a) -> float {
414 return (float)atof(a);
415 },
416 settings.doDefault);
417}
418template <>
419inline int32_t qAddOptionType<double>(qConfigSettings<double>& settings, double& ref, int32_t& i, const char** argv, const int argc, double /*def*/)
420{
421 return qAddOptionGeneric<double>(
422 settings, ref, i, argv, argc, settings.set, [](const char* a) -> double {
423 return atof(a);
424 },
425 settings.doDefault);
426}
427template <>
428inline int32_t qAddOptionType<const char*>(qConfigSettings<const char*>& settings, const char*& ref, int32_t& i, const char** argv, const int argc, const char* /*def*/)
429{
430 return qAddOptionGeneric<const char*>(
431 settings, ref, i, argv, argc, settings.set, [](const char* a) -> const char* {
432 return a;
433 },
434 settings.doDefault);
435}
436template <>
437inline int32_t qAddOptionType<std::string>(qConfigSettings<std::string>& settings, std::string& ref, int32_t& i, const char** argv, const int argc, std::string /*def*/)
438{
439 return qAddOptionGeneric<std::string>(
440 settings, ref, i, argv, argc, settings.set, [](const char* a) -> std::string {
441 return a;
442 },
443 settings.doDefault);
444}
445
446// Checks and messages for additional settings
447template <typename T>
448static inline int32_t qAddOptionMinMax(qConfigSettings<T>& settings, T& ref, const char* arg)
449{
450 if (settings.checkMin && ref < settings.min) {
451 std::cout << "Invalid setting for " << arg << ": minimum threshold exceeded (" << ref << " < " << settings.min << ")!\n";
452 return (qcrMinFailure);
453 }
454 if (settings.checkMax && ref > settings.max) {
455 std::cout << "Invalid setting for " << arg << ": maximum threshold exceeded (" << ref << " > " << settings.max << ")!\n";
456 return (qcrMaxFailure);
457 }
458 return (0);
459}
460template <>
461inline int32_t qAddOptionMinMax<bool>(qConfigSettings<bool>& /*settings*/, bool& /*ref*/, const char* /*arg*/)
462{
463 return (0);
464}
465
466template <typename T>
467inline void qAddOptionMessage(qConfigSettings<T>& settings, T& ref)
468{
469 if (settings.message) {
470 std::string tmp = print_type(ref);
471 std::string msg = std::string(settings.message) + "\n";
472 printf(msg.c_str(), tmp.c_str());
473 }
474}
475
476static inline void qConfigHelp(const char* subConfig = nullptr, int32_t followSub = 0)
477{
478 if (followSub < 2) {
479 printf("Usage Info:");
480 }
481#define QCONFIG_HELP
482#include "qconfig.h"
483#undef QCONFIG_HELP
484 if (followSub < 2) {
485 printf("\n");
486 }
487}
488
489// Create parser for configuration
490static inline int32_t qConfigParse(int argc, const char** argv, const char* /*filename*/)
491{
492 for (int32_t i = 1; i < argc; i++) {
493 const char* thisoption = argv[i];
494 repeat:
495 bool found = false;
496#define QCONFIG_PARSE
497#include "qconfig.h"
498#undef QCONFIG_PARSE
499 if (found == false) {
500 printf("Invalid argument: %s\n", argv[i]);
501 return (1);
502 goto repeat; // Suppress GCC warnings, this is never executed, label might be accessed from qconfig.h
503 }
504 }
505 return (0);
506}
507
508std::vector<std::function<void()>> qprint_global;
509#define QCONFIG_PRINT
510#include "qconfig.h"
511#undef QCONFIG_PRINT
512} // end namespace qConfig
513
514// Main parse function called from outside
515int32_t qConfigParse(int argc, const char** argv, const char* filename) { return (qConfig::qConfigParse(argc, argv, filename)); }
516
518{
519 for (auto& f : qConfig::qprint_global) {
520 f();
521 }
522}
int32_t i
int32_t retVal
GLenum func
Definition glcorearb.h:778
GLint GLsizei count
Definition glcorearb.h:399
const GLdouble * v
Definition glcorearb.h:832
GLuint index
Definition glcorearb.h:781
GLuint const GLchar * name
Definition glcorearb.h:781
GLdouble f
Definition glcorearb.h:310
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
GLuint GLsizei const GLchar * message
Definition glcorearb.h:2517
GLboolean GLboolean GLboolean GLboolean a
Definition glcorearb.h:1233
bpo::variables_map arguments
int32_t qAddOptionType< float >(qConfigSettings< float > &settings, float &ref, int32_t &i, const char **argv, const int argc, float)
Definition qconfig.cxx:410
int32_t qAddOptionType< int8_t >(qConfigSettings< int8_t > &settings, int8_t &ref, int32_t &i, const char **argv, const int argc, int8_t)
Definition qconfig.cxx:338
std::vector< std::function< void()> > qprint_global
Definition qconfig.cxx:508
int32_t qAddOptionType< uint32_t >(qConfigSettings< uint32_t > &settings, uint32_t &ref, int32_t &i, const char **argv, const int argc, uint32_t)
Definition qconfig.cxx:365
int32_t qAddOptionType< std::string >(qConfigSettings< std::string > &settings, std::string &ref, int32_t &i, const char **argv, const int argc, std::string)
Definition qconfig.cxx:437
int32_t qAddOptionType< int64_t >(qConfigSettings< int64_t > &settings, int64_t &ref, int32_t &i, const char **argv, const int argc, int64_t)
Definition qconfig.cxx:392
int32_t qAddOptionType< uint16_t >(qConfigSettings< uint16_t > &settings, uint16_t &ref, int32_t &i, const char **argv, const int argc, uint16_t)
Definition qconfig.cxx:383
std::string print_type(T val)
int32_t qAddOptionType< int16_t >(qConfigSettings< int16_t > &settings, int16_t &ref, int32_t &i, const char **argv, const int argc, int16_t)
Definition qconfig.cxx:374
int32_t qAddOptionType< uint8_t >(qConfigSettings< uint8_t > &settings, uint8_t &ref, int32_t &i, const char **argv, const int argc, uint8_t)
Definition qconfig.cxx:347
int32_t qAddOptionType< uint64_t >(qConfigSettings< uint64_t > &settings, uint64_t &ref, int32_t &i, const char **argv, const int argc, uint64_t)
Definition qconfig.cxx:401
int32_t qAddOptionType< bool >(qConfigSettings< bool > &settings, bool &ref, int32_t &i, const char **argv, const int argc, bool)
Definition qconfig.cxx:329
int32_t qAddOptionType< double >(qConfigSettings< double > &settings, double &ref, int32_t &i, const char **argv, const int argc, double)
Definition qconfig.cxx:419
int32_t qAddOptionType< const char * >(qConfigSettings< const char * > &settings, const char *&ref, int32_t &i, const char **argv, const int argc, const char *)
Definition qconfig.cxx:428
@ qcrArgMissing
Definition qconfig.h:31
@ qcrMinFailure
Definition qconfig.h:27
@ qcrArrayOverflow
Definition qconfig.h:33
@ qcrMaxFailure
Definition qconfig.h:28
@ qcrArgIncomplete
Definition qconfig.h:32
int32_t qAddOptionType< int32_t >(qConfigSettings< int32_t > &settings, int32_t &ref, int32_t &i, const char **argv, const int argc, int32_t)
Definition qconfig.cxx:356
int32_t qAddOptionMinMax< bool >(qConfigSettings< bool > &, bool &, const char *)
Definition qconfig.cxx:461
Defining DataPointCompositeObject explicitly as copiable.
std::string filename()
#define QCONFIG_SETTING(name, type)
Definition qconfig.cxx:34
void qConfigPrint()
Definition qconfig.cxx:517
#define QCONFIG_SETTING_TEMPLATE(name)
Definition qconfig.cxx:42
int32_t qConfigParse(int argc, const char **argv, const char *filename)
Definition qconfig.cxx:515
static int32_t qAddOptionMainTuple(qConfigSettings< typename qSettingsType< T >::settingsType >, T &, int32_t &, const char **, const int32_t)
Definition qconfig.cxx:149
static int32_t qAddOptionMainTuple(qConfigSettings< typename qSettingsType< T >::settingsType > settings, T &tup, int32_t &i, const char **argv, const int argc)
Definition qconfig.cxx:133
qConfigSettings(const qConfigSettings< S > v)
Definition qconfig.cxx:73
static int32_t qAddOptionMain(qConfigSettings< T > &settings, T &ref, int32_t &i, const char **argv, const int argc, T def)
Definition qconfig.cxx:109
static int32_t qAddOption(T &ref, int32_t &i, const char **argv, const int argc, T def, const char *, Args &&... args)
Definition qconfig.cxx:195
static int32_t qAddOptionArray(T *ref, int32_t count, int32_t &i, const char **argv, const int argc, const char *, Args &&... args)
Definition qconfig.cxx:222
static void qProcessSetting(qConfigSettings< T > &settings, qmin_t< T > minval)
Definition qconfig.cxx:160
static void qAddOptionSettings(qConfigSettings< T > &settings, Arg1 &&arg1, Args &&... args)
Definition qconfig.cxx:188
static int32_t qAddOptionVec(std::vector< T > &ref, int32_t &i, const char **argv, const int argc, const char *, Args &&... args)
Definition qconfig.cxx:202
static void qProcessSetting(qConfigSettings< T > &settings, qset_t< S > set)
Definition qconfig.cxx:174
static void qProcessSetting(qConfigSettings< T > &settings, qmessage_t msg)
Definition qconfig.cxx:172
static void qProcessSetting(qConfigSettings< T > &settings, qmax_t< T > maxval)
Definition qconfig.cxx:166
static void qConfigHelpOption(const char *name, const char *type, const char *def, const char *optname, char optnameshort, const char *preopt, char preoptshort, int32_t optionType, const char *help, Args &&... args)
Definition qconfig.cxx:246
static auto qConfigGetSettings(Args &... args)
Definition qconfig.cxx:294
static void qProcessSetting(qConfigSettings< T > &settings, qdef_t< S > set)
Definition qconfig.cxx:180
static void qAddOptionSettings(qConfigSettings< T > &)
Definition qconfig.cxx:186
constexpr size_t min
constexpr size_t max
uint64_t const void const *restrict const msg
Definition x9.h:153