151         return ((ch == 
'-') || (ch == 
'+'));
 
  157         return ((ch >= 
'0') && (ch <= 
'9'));
 
  169         return ((ch == 
'0') || (ch == 
'1'));
 
  175         return ((ch >= 
'0') && (ch <= 
'7'));
 
  181         return (((ch >= 
'0') && (ch <= 
'9')) || ((ch >= 
'a') && (ch <= 
'f')) || ((ch >= 
'A') && (ch <= 
'F')));
 
  193         return ((ch == 
'b') || (ch == 
'B'));
 
  199         return ((ch == 
'o') || (ch == 
'O'));
 
  205         return ((ch == 
'x') || (ch == 
'X'));
 
  211         return ((ch == 
'e') || (ch == 
'E'));
 
  236         out_str.assign(
Cp, count);
 
  264         out_str.assign(
Cp, count);
 
  372         if (*c_ptr == 
'\0') {
 
  377         while ((*c_ptr != 
'\0') && (count < maxlen)) {
 
  383         if (count == maxlen) {
 
  388         strncpy(out_str, 
Cp, count);
 
  409         if (*c_ptr == 
'\0') {
 
  414         while ((*c_ptr != 
'\0') && (count < out_str.max_size())) {
 
  420         if (count == out_str.max_size()) {
 
  425         out_str.assign(
Cp, count);
 
  461         char *str_found = NULL;
 
  465         if (strncmp(pstr, 
Cp, strlen(pstr)) == 0) {
 
  469         if (str_found != NULL) {
 
  472                         dc_printf(
"<debug> Found required string [%s]\n", str_found);
 
  475                 Cp += strlen(str_found);
 
  486         char *str_found = NULL;
 
  491         if (strncmp(str1, 
Cp, strlen(str1)) == 0) {
 
  494         } 
else if (strncmp(str2, 
Cp, strlen(str2)) == 0) {
 
  502                         dc_printf(
"<debug> Found required string [%s]\n", str_found);
 
  505                 Cp += strlen(str_found);
 
  520         const char *str_found = NULL;
 
  527         for (i = 0; i < 
n; ++
i) {
 
  528                 strings.push_back(va_arg(vl, 
char *));
 
  533         for (i = 0; i < 
n; ++
i) {
 
  534                 if (strcmp(
Cp, strings[i].c_str()) == 0)
 
  536                         str_found = strings[
i].c_str();
 
  541         if (str_found != NULL) {
 
  544                         dc_printf(
"<debug> Found required string [%s}\n", str_found);
 
  547                 Cp += strlen(str_found);
 
  562         if (strncmp(pstr, 
Cp, strlen(pstr)) != 0) {
 
  567                 dc_printf(
"<debug> Found optional string [%s]\n", pstr);
 
  576         const char *str_found = NULL;
 
  580         if (strncmp(str1, 
Cp, strlen(str1)) == 0) {
 
  582         } 
else if (strncmp(str2, 
Cp, strlen(str2)) == 0) {
 
  589                 dc_printf(
"<debug> Found optional string [%s]\n",str_found);
 
  592         Cp += strlen(str_found);
 
  603         const char *ch_ptr = ch;
 
  613         if (*ch_ptr == 
'\0') {
 
  615                         dc_printf(
"<debug> [parse_double] no argument found\n");
 
  625                                 if (*ch_ptr == 
'-') {
 
  626                                         buffer_str.push_back(*ch_ptr);
 
  632                                 buffer_str.push_back(*ch_ptr);
 
  637                                 buffer_str.push_back(*ch_ptr);
 
  642                                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_start\n", *ch_ptr);
 
  649                         if (buffer_str == 
"") {
 
  686         } 
while (state != 
sf_end);
 
  688         ret = strtod(buffer_str.c_str(), &end_ptr);
 
  699                 buffer_str.push_back(*ch_ptr);
 
  704                 buffer_str.push_back(*ch_ptr);
 
  710                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_sign\n", *ch_ptr);
 
  723                 buffer_str.push_back(*ch_ptr);
 
  728                 buffer_str.push_back(*ch_ptr);
 
  733                 buffer_str.push_back(*ch_ptr);
 
  742                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_whole\n", *ch_ptr);
 
  755                 buffer_str.push_back(*ch_ptr);
 
  760                 buffer_str.push_back(*ch_ptr);
 
  769                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_decimal\n", *ch_ptr);
 
  782                 buffer_str.push_back(*ch_ptr);
 
  787                 buffer_str.push_back(*ch_ptr);
 
  796                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_faction\n", *ch_ptr);
 
  809                 buffer_str.push_back(*ch_ptr);
 
  814                 buffer_str.push_back(*ch_ptr);
 
  820                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_expprefix\n", *ch_ptr);
 
  833                 buffer_str.push_back(*ch_ptr);
 
  839                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_expsign\n", *ch_ptr);
 
  852                 buffer_str.push_back(*ch_ptr);
 
  861                         dc_printf(
"<debug> [parse_double] Invalid character '%c' found in sf_exponent\n", *ch_ptr);
 
  869         const char *ch_ptr = ch;
 
  870         char *end_ptr = NULL;
 
  880         if (*ch_ptr == 
'\0') {
 
  882                         dc_printf(
"<debug> [parse_long] no argument found\n");
 
  892                                 if (*ch_ptr == 
'-') {
 
  893                                         buffer_str.push_back(*ch_ptr);
 
  904                                 buffer_str.push_back(*ch_ptr);
 
  909                                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_start\n", *ch_ptr);
 
  916                         if (buffer_str == 
"") {
 
  951         } 
while (state != 
si_end);
 
  953         ret = strtol(buffer_str.c_str(), &end_ptr, base);
 
  956         if (*end_ptr != 
'\0') {
 
  957                 dc_printf(
"Error: Could not convert all of the buffer '%s'.\n", buffer_str.c_str());
 
  959                         dc_printf(
"<debug> Buffer value: %s\n", buffer_str.c_str());
 
  960                         dc_printf(
"<debug> Return value: %i", ret);
 
  969         const char *ch_ptr = ch;
 
  980         if (*ch_ptr == 
'\0') {
 
  982                         dc_printf(
"<debug> [parse_long] no argument found\n");
 
  997                                 buffer_str.push_back(*ch_ptr);
 
 1002                                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_start\n", *ch_ptr);
 
 1009                         if (buffer_str == 
"")
 
 1040         } 
while (state != 
si_end);
 
 1042         ret = strtoul(buffer_str.c_str(), &end_ptr, base);
 
 1045         if (end_ptr != ch_ptr) {
 
 1046                 dc_printf(
"Error: Could not convert all of the buffer '%s'.\n", buffer_str.c_str());
 
 1048                         dc_printf(
"<debug> Buffer value: %s\n", buffer_str.c_str());
 
 1049                         dc_printf(
"<debug> Return value: %i", ret);
 
 1068         if ((std::abs(value_d) < FLT_MAX) && (std::abs(value_d) > FLT_MIN)) {
 
 1069                 *f = 
static_cast<float>(value_d);
 
 1085         if ((value_l < INT_MAX) && (value_l > INT_MIN)) {
 
 1103         if (value_l < UINT_MAX) {
 
 1122         if (value_ul <= 255) {
 
 1123                 *i = 
static_cast<ubyte>(value_ul);
 
 1136         if ((token == 
"yes")
 
 1137                 || (token == 
"true")
 
 1142                 || (token == 
"HIja") || (token == 
"HISLaH")     
 
 1147         } 
else if ((token == 
"no")
 
 1148                 || (token == 
"false")
 
 1149                 || (token == 
"nein")    
 
 1153                 || (token == 
"ghobe'")  
 
 1169         value_b ? *i = 1 : *i = 0;
 
 1190         while ((*c_ptr != 
'\0') && (count < maxlen)) {
 
 1196         if (count == maxlen) {
 
 1197                 token.assign(
Cp, maxlen);
 
 1202         strncpy(out_str, 
Cp, count);
 
 1224         while ((*c_ptr != 
'\0') && (count < out_str.max_size())) {
 
 1230         if ((count == out_str.max_size()) && (*c_ptr != 
'\0')) {
 
 1235         out_str.assign(
Cp, count);
 
 1258         while (!
is_gray_space(*c_ptr) && (*c_ptr != 
'\0') && (count < maxlen)) {
 
 1264         if (count == maxlen) {
 
 1269         strncpy(out_str, 
Cp, count);
 
 1291         while (!
is_gray_space(*c_ptr) && (*c_ptr != 
'\0') && (count < out_str.max_size())) {
 
 1297         if (count == out_str.max_size()) {
 
 1302         out_str.assign(
Cp, count);
 
 1335                 buffer_str.push_back(
'0');
 
 1340                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_prefix\n", *ch_ptr);
 
 1353                 buffer_str.push_back(*ch_ptr);
 
 1366                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_sign\n", *ch_ptr);
 
 1379                 buffer_str.push_back(*ch_ptr);
 
 1388                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_numeral\n", *ch_ptr);
 
 1401                 buffer_str.push_back(*ch_ptr);
 
 1409                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_numeral_bin\n", *ch_ptr);
 
 1422                 buffer_str.push_back(*ch_ptr);
 
 1430                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_numeral_hex\n", *ch_ptr);
 
 1442                 buffer_str.push_back(*ch_ptr);
 
 1451                         dc_printf(
"<debug> [parse_long] Invalid character '%c' found in si_numeral_octal\n", *ch_ptr);
 
char * Cp
Pointer to the commant string. 
 
char Command_string[MAX_CLI_LEN]
Command string buffer. 
 
state_float dc_parse_double_expsign(const char *&ch_ptr, SCP_string &buffer_str)
 
prefix character sequence, 0b, 0o, or 0x 
 
state_float dc_parse_double_exponent(const char *&ch_ptr, SCP_string &buffer_str)
 
state_int dc_parse_long_numeral(const char *&ch_ptr, SCP_string &buffer_str)
 
bool dc_maybe_stuff_int(int *i)
Tries to stuff an int from the Command_string. 
 
bool ch_is_decimal(char ch)
 
state_int dc_parse_long_prefix(const char *&ch_ptr, SCP_string &buffer_str, int &base)
 
state_int dc_parse_long_numeral_octal(const char *&ch_ptr, SCP_string &buffer_str)
 
Class thrown when the parsed string or token could not be stuffed into the smaller destination contai...
 
state_float dc_parse_double_decimal(const char *&ch_ptr, SCP_string &buffer_str)
 
state_float dc_parse_double_expprefix(const char *&ch_ptr, SCP_string &buffer_str)
 
Integral or string evaluated as a boolean. 
 
Class thrown when a required token is not found. 
 
Exponent prefix, 'e', 'E'. 
 
std::basic_string< char, std::char_traits< char >, std::allocator< char > > SCP_string
 
state_int dc_parse_long_numeral_hex(const char *&ch_ptr, SCP_string &buffer_str)
 
state_float dc_parse_double_fraction(const char *&ch_ptr, SCP_string &buffer_str)
 
state_float dc_parse_double_whole(const char *&ch_ptr, SCP_string &buffer_str)
 
uint dc_required_string_any(const uint n,...)
Searches for specified required strings. 
 
void dc_stuff_string(char *out_str, size_t maxlen=MAX_TOKEN_LENGTH)
Stuffs a string to out_str from the command line, stopping at the end of the command line...
 
void dc_stuff_uint(uint *i)
Stuffs an unsigned int to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats. 
 
state_int dc_parse_long_numeral_bin(const char *&ch_ptr, SCP_string &buffer_str)
 
bool ch_is_octal(char ch)
 
bool ch_is_binary(char ch)
 
long dc_parse_long(const char *ch, dc_token type)
Parses a long integral type. Supports decimal, binary, octal, and hexidecimal strings. 
 
void dc_get_token_no_advance(SCP_string &out_str)
Returns a single token, but does not advances Cp. 
 
state_float dc_parse_double_sign(const char *&ch_ptr, SCP_string &buffer_str)
 
ulong dc_parse_ulong(const char *ch, dc_token type)
Parses an unsigned long integral type. Supports decimal, binary, octal, and hexidecimal strings...
 
bool dc_maybe_stuff_boolean(bool *b)
Tries to stuff a bool from the Command_string. 
 
bool dc_optional_string_either(const char *str1, const char *str2)
Searches for an optional string and it's alias. 
 
int dc_required_string_either(char *str1, char *str2)
Searchs for either of the specified required strings, throwing an errParse if neither are found...
 
bool dc_maybe_stuff_ubyte(ubyte *i)
Tries to stuff an ubyte from the Command_string. 
 
bool dc_maybe_stuff_string(char *out_str, size_t maxlen)
Tries to stuff a string to out_str from the command line, stopping at the end of the command line...
 
void dc_ignore_white_space(void)
Advances the parser past whitespace characters. 
 
bool ch_is_octal_prefix(char ch)
 
void dc_stuff_ubyte(ubyte *i)
Stuffs an unsigned byte to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats. 
 
Integral with values between 0 and 255. 
 
Class thrown when an expected string was not found. Can/should contain all of the expected strings...
 
void dc_stuff_float(float *f)
Stuffs a float to the given variable. 
 
void dc_stuff_int(int *i)
Stuffs an int to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats...
 
Numeral altstate, 0 - 9 and 'a' - 'f'. 
 
void dc_stuff_string_white(char *out_str, size_t maxlen)
Stuffs a whitespace delimited string to out_str from the command line, stopping at the end of the com...
 
GLboolean GLboolean GLboolean b
 
void dc_stuff_boolean(bool *b)
stuffs a boolean evaluated integer or string into the given variable. 
 
state_int dc_parse_long_sign(const char *&ch_ptr, SCP_string &buffer_str)
 
void dc_parse_init(SCP_string &str)
Initializes the DC command line parser. 
 
Fractional value numeral. 
 
int is_gray_space(char ch)
 
bool ch_is_prefix(char ch)
 
bool Dc_debug_on
Flag used to print console and command debugging strings. 
 
bool ch_is_binary_prefix(char ch)
 
bool dc_maybe_stuff_uint(uint *i)
Tries to stuff an uint from the Command_string. 
 
void dc_ignore_gray_space(void)
Advances the parser past grayspace characters. 
 
bool dc_optional_string(const char *pstr)
Searches for an optional string. 
 
void dc_printf(const char *format,...)
Prints the given char string to the debug console. 
 
GLsizei const GLchar ** strings
 
double dc_parse_double(const char *ch, dc_token type)
Parses a double-precision floating point type. Supports, Whole, Fractional, and Mixed numbers...
 
int is_white_space(char ch)
 
Parsing functions for the command line. Previously known as the command line scanner. 
 
bool ch_is_hex_prefix(char ch)
 
bool ch_is_numeral(char ch)
 
bool dc_maybe_stuff_float(float *f)
Tries to stuff a float from the Command_string. 
 
void dc_get_token(SCP_string &out_str)
Returns/Advances past a single token. 
 
bool ch_is_exp_prefix(char ch)
 
void dc_required_string(char *pstr)
Searches for a specified required string, throwing an errParse if not found. 
 
Sign character for mantessa. 
 
bool dc_maybe_stuff_string_white(char *str, size_t len)
Tries to stuff a whitespace delimited string to out_str from the command line, stopping at the end of...