droption_parser_t Class Referenceabstract

#include <droption.h>

Inheritance diagram for droption_parser_t:
droption_t< T >

Public Member Functions

bool specified ()
std::string get_name ()

Static Public Member Functions

static bool parse_argv (unsigned int scope, int argc, const char *argv[], std::string *error_msg, int *last_index)
static std::string usage_short (unsigned int scope)
static std::string usage_long (unsigned int scope, std::string pre_name="----------\n", std::string post_name="\n", std::string pre_value="", std::string post_value="\n", std::string pre_desc="", std::string post_desc="\n")
static void clear_values ()

Detailed Description

Option parser base class.

Member Function Documentation

◆ clear_values()

static void droption_parser_t::clear_values ( )

For clients statically linked into the target application, global state is not reset between a detach and re-attach. Thus, DROPTION_FLAG_ACCUMULATE options will append to their values from the prior run. This function is provided for a client to call on detach or re-attach to reset these values.

◆ get_name()

std::string droption_parser_t::get_name ( )

Returns the name of this option.

◆ parse_argv()

static bool droption_parser_t::parse_argv ( unsigned int  scope,
int  argc,
const char *  argv[],
std::string *  error_msg,
int *  last_index 

Parses the options for client client_id and fills in any registered droption_t class fields. On success, returns true, with the index of the start of the remaining unparsed options, if any, returned in last_index (typically this will be options separated by "--" or when encountering a token that does not start with a leading "-"). On failure, returns false, and if error_msg != NULL, stores a string describing the error there. On failure, last_index is set to the index of the problematic option or option value.

We recommend that Windows standalone applications use UNICODE and call drfront_convert_args() to convert to UTF-8 prior to passing here, for proper internationalization support.

◆ specified()

bool droption_parser_t::specified ( )

Returns whether this option was specified in the argument list.

◆ usage_long()

static std::string droption_parser_t::usage_long ( unsigned int  scope,
std::string  pre_name = "----------\n",
std::string  post_name = "\n",
std::string  pre_value = "",
std::string  post_value = "\n",
std::string  pre_desc = "",
std::string  post_desc = "\n" 

Returns a string containing a list of all of the parameters, their default values, and their long descriptions, with the given pre- and post- values. This is intended for use in generating documentation.

◆ usage_short()

static std::string droption_parser_t::usage_short ( unsigned int  scope)

Returns a string containing a list of all of the parameters, their default values, and their short descriptions.

The documentation for this class was generated from the following file:
  • /home/runner/work/dynamorio/dynamorio/ext/droption/droption.h