PStack  2.0
Stack trace printer for MSVC and GCC binaries
addr2ln_options.cpp File Reference

Define the command-line options interface for the Addr2ln application. More...

#include "addr2ln/addr2ln_options.hpp"
#include <climits>
#include <iostream>
#include <psystem/framework/iomanip.hpp>
#include <psystem/exception/ui_exception.hpp>
Include dependency graph for addr2ln_options.cpp:

Classes

struct  addr2ln::addr2ln_options::options_data
 The full set of options information available to addr2ln::addr2ln_options. More...
 

Namespaces

 anonymous_namespace{addr2ln_options.cpp}
 Data local to this compilation unit.
 
 addr2ln
 Contains functionality required to map addresses to source code information.
 

Functions

static psystem::address_t anonymous_namespace{addr2ln_options.cpp}::fetch_address (char const *text)
 Translate a string into an address. More...
 

Variables

addr2ln::addr2ln_optionsanonymous_namespace{addr2ln_options.cpp}::g_options = nullptr
 The options block is supposed to be a singleton. More...
 

Convenience Macros

#define MAKE_OPTION_FLAG(opt)   "-" opt
 Creates a string for a command-line flag. More...
 
#define PRINT_OPTION(opt, desc)
 Used to print a help option. More...
 
#define PRINT_OPTION_FLAG(opt, desc)
 Used to print a help option for a "flag.". More...
 
#define PRINT_INDENTED(desc)    std::cout << " " << desc << '\n'
 Print the continuation of a description in the help option output. More...
 

Detailed Description

Define the command-line options interface for the Addr2ln application.

Author
Matt Bisson
Date
14 August, 2016
Since
Addr2ln 0.1
Version
Addr2ln 0.1
Todo:
Consolidate macros between option class types.

Macro Definition Documentation

#define MAKE_OPTION_FLAG (   opt)    "-" opt

Creates a string for a command-line flag.

This is done by by appending the platform-specific option flag starting token (i.e., '-' in a "-h" flag) to the opt parameter.

Parameters
optThe option flag — it should be a single letter to qualify as a "flag." This must be a quoted C string literal.
#define PRINT_INDENTED (   desc)    std::cout << " " << desc << '\n'

Print the continuation of a description in the help option output.

Parameters
descThe text to print after the indentation.
#define PRINT_OPTION (   opt,
  desc 
)
Value:
std::cout \
<< " " << std::setw(11) << std::left << opt \
<< ' ' << desc << '\n'

Used to print a help option.

Parameters
optThe option (as the user would specify it).
descA description of the option.
#define PRINT_OPTION_FLAG (   opt,
  desc 
)
Value:
std::cout \
<< " " << std::setw(11) << std::left << MAKE_OPTION_FLAG(opt) \
<< ' ' << desc << '\n'
#define MAKE_OPTION_FLAG(opt)
Creates a string for a command-line flag.
Definition: addr2ln_options.cpp:44

Used to print a help option for a "flag.".

A "flag" in this context is a single-letter command-line argument.

Parameters
optThe single letter for the flag.
descA description of the option.