OpenTTD Source
20241108-master-g80f628063a
|
Data storage for parsing command line options. More...
#include <getoptdata.h>
Public Types | |
using | OptionSpan = std::span< const OptionData > |
using | ArgumentSpan = std::span< char *const > |
Public Member Functions | |
GetOptData (ArgumentSpan arguments, OptionSpan options) | |
Constructor of the data store. More... | |
int | GetOpt () |
Find the next option. More... | |
int | GetOpt (const OptionData &option) |
Data Fields | |
ArgumentSpan | arguments |
Remaining command line arguments. | |
const OptionSpan | options |
Command line option descriptions. | |
const char * | opt = nullptr |
Option value, if available (else nullptr ). | |
const char * | cont = nullptr |
Next call to GetOpt should start here (in the middle of an argument). | |
Data storage for parsing command line options.
Definition at line 29 of file getoptdata.h.
|
inline |
Constructor of the data store.
argument | The command line arguments, excluding the program name. |
options | Command line option descriptions. |
Definition at line 43 of file getoptdata.h.
int GetOptData::GetOpt | ( | ) |
Find the next option.
Definition at line 22 of file getoptdata.cpp.
References arguments, cont, and options.
Referenced by main().