|
OpenTTD Source 20251117-master-g7398d2e290
|
Data storage for parsing command line options. More...
#include <getoptdata.h>
Public Types | |
| using | OptionSpan = std::span< const OptionData > |
| using | ArgumentSpan = std::span< std::string_view > |
Public Member Functions | |
| GetOptData (ArgumentSpan arguments, OptionSpan options) | |
| Constructor of the data store. | |
| int | GetOpt () |
| Find the next option. | |
| int | GetOpt (const OptionData &option) |
Data Fields | |
| ArgumentSpan | arguments |
| Remaining command line arguments. | |
| const OptionSpan | options |
| Command line option descriptions. | |
| std::string_view | opt |
| Option value, if available (else empty). | |
| std::string_view | cont |
| 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.
| using GetOptData::ArgumentSpan = std::span<std::string_view> |
Definition at line 31 of file getoptdata.h.
| using GetOptData::OptionSpan = std::span<const OptionData> |
Definition at line 30 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, GetOpt(), and options.
Referenced by GetOpt(), main(), and openttd_main().
| int GetOptData::GetOpt | ( | const OptionData & | option | ) |
Definition at line 55 of file getoptdata.cpp.
| ArgumentSpan GetOptData::arguments |
Remaining command line arguments.
Definition at line 33 of file getoptdata.h.
Referenced by GetOpt(), main(), and openttd_main().
| std::string_view GetOptData::cont |
Next call to GetOpt should start here (in the middle of an argument).
Definition at line 36 of file getoptdata.h.
Referenced by GetOpt().
| std::string_view GetOptData::opt |
Option value, if available (else empty).
Definition at line 35 of file getoptdata.h.
Referenced by main(), and openttd_main().
| const OptionSpan GetOptData::options |
Command line option descriptions.
Definition at line 34 of file getoptdata.h.
Referenced by GetOpt().