Go to the documentation of this file.
81 for (
int i = 0; i <
argc; ++i)
88 int idx = current.
index + 1;
89 if (idx <
argc && (
avail[idx >> 3] & (1 << (idx & 0x7)))) {
99 for (
int index = 1; index <
argc; ++index)
100 if (
avail[index >> 3] & (1 << (index & 0x7)))
101 if (strcmp(str,
argv[index]) == 0) {
111 if (arg.
index != 0) {
119 for (
int i = 1; i <
argc; ++i)
120 if (
avail[i >> 3] & (1 << (i & 0x7)))
135 int idx = arg.
index + 1;
136 while (idx <
argc && (
avail[idx >> 3] & (1 << (idx & 0x7))) == 0)
164 val = (
ui32)strtoul(t2.
arg, NULL, 10);
177 val = strtof(t2.
arg, NULL);
190 if (strcmp(t2.
arg,
"false") == 0) {
195 else if (strcmp(t2.
arg,
"true") == 0) {
210 if (strcmp(t2.
arg,
"false") == 0) {
215 else if (strcmp(t2.
arg,
"true") == 0) {
261 #endif // !OJPH_ARG_H
char * arg
Definition: ojph_arg.h:57
int index
Definition: ojph_arg.h:60
ui8 * avail
Definition: ojph_arg.h:257
uint8_t ui8
Definition: ojph_defs.h:50
argument()
Definition: ojph_arg.h:56
argument get_next_avail_argument(const argument &arg)
Definition: ojph_arg.h:133
void reinterpret(const char *str, int &val)
Definition: ojph_arg.h:146
bool is_valid()
Definition: ojph_arg.h:58
void reinterpret(const char *str, bool &val)
Definition: ojph_arg.h:185
argument get_argument_zero()
Definition: ojph_arg.h:126
argument find_argument(const char *str)
Definition: ojph_arg.h:97
Definition: ojph_arg.h:53
void reinterpret_to_bool(const char *str, int &val)
Definition: ojph_arg.h:205
void reinterpret(const char *str, char *&val)
Definition: ojph_arg.h:225
uint32_t ui32
Definition: ojph_defs.h:54
void release_argument(const argument &arg)
Definition: ojph_arg.h:110
virtual void operate(const char *)=0
void init(int argc, char *argv[])
Definition: ojph_arg.h:73
ui8 avail_store[16]
Definition: ojph_arg.h:256
int argc
Definition: ojph_arg.h:255
#define ojph_max(a, b)
Definition: ojph_defs.h:73
bool is_exhausted()
Definition: ojph_arg.h:118
Definition: ojph_arg.h:238
Definition: ojph_block_decoder.cpp:49
cli_interpreter()
Definition: ojph_arg.h:68
argument get_next_value(const argument ¤t)
Definition: ojph_arg.h:86
char ** argv
Definition: ojph_arg.h:254
~cli_interpreter()
Definition: ojph_arg.h:69
Definition: ojph_arg.h:66
void reinterpret(const char *str, arg_inter_base *fun)
Definition: ojph_arg.h:241
void reinterpret(const char *str, ui32 &val)
Definition: ojph_arg.h:159
void reinterpret(const char *str, float &val)
Definition: ojph_arg.h:172