wavelength 1.0.0
Loading...
Searching...
No Matches
OptionProcessor.h
Go to the documentation of this file.
1#pragma once
2
3#include <list>
4
5#include "utl/Option.h"
6#include "utl/Str.h"
7
14class OptionProcessor {
15public:
22
31 void AddBoolOption(const char *name, bool *value, bool setValue);
32
40 void AddStringOption(const char *name, String *value);
41
53 void Process(int argc, char **argv);
54
66 static char **ParseCommandLine(const char *commandLine, int *argc);
67
68private:
69 std::list<Option *> mOptions;
70 int mCurArg;
71 char **mArgv;
72 int mArgc;
73};
Parser of the command line that main() receives.
Definition optionprocessor.h:14
static char ** ParseCommandLine(const char *commandLine, int *argc)
Split a command line into arguments at spaces outside double quotes.
void AddStringOption(const char *name, String *value)
Add an option that stores the argument after it.
void Process(int argc, char **argv)
Apply the options to the arguments that start with a dash, stopping at the first that does not.
~OptionProcessor()
Delete every option.
void AddBoolOption(const char *name, bool *value, bool setValue)
Add an option that stores a fixed value in a flag.
Growable text buffer that is also a PrnStream.
Definition string.h:19