The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Static Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | List of all members
toptions Struct Reference

A singleton class containing the parsed command line parameters. More...

#include <options.hpp>

Inheritance diagram for toptions:
Inheritance graph

Static Public Member Functions

static const toptionsparse (int argc, char *argv[])
 Parses the command line. More...
 
static const toptionsoptions ()
 Returns the cached parsed command line parameters. More...
 

Public Attributes

std::string input_filename
 The filename of the input file. More...
 
std::string output_filename
 The filename of the output file. More...
 
std::vector< std::stringfilters
 The filters to apply to the input file. More...
 
bool time
 Display the time that applying the filters took. More...
 
int count
 The number of times the filter has to be applied. More...
 

Private Member Functions

 toptions ()
 

Static Private Member Functions

static toptionssingleton (const bool is_initialized)
 Helper which contains the single instance of this class. More...
 

Detailed Description

A singleton class containing the parsed command line parameters.

Definition at line 29 of file options.hpp.

Constructor & Destructor Documentation

toptions::toptions ( )
private

Definition at line 25 of file options.cpp.

Member Function Documentation

const toptions & toptions::options ( )
static

Returns the cached parsed command line parameters.

This function shall only be called after toptions::parse has been called.

Returns
The parsed options.

Definition at line 255 of file options.cpp.

References singleton().

const toptions & toptions::parse ( int  argc,
char *  argv[] 
)
static

Parses the command line.

This function shall be called once at the beginning of the program.

Parameters
argcThe argc to main.
argvThe argv to main.
Returns
The parsed options.

Definition at line 157 of file options.cpp.

References count, filters, i, input_filename, output_filename, print_help(), singleton(), time, and VALIDATE_NOT_PAST_END.

Referenced by main().

toptions & toptions::singleton ( const bool  is_initialized)
staticprivate

Helper which contains the single instance of this class.

Parameters
is_initializedHelper variable to track whether toptions::parse is only called once and whether toptions::options isn't called before toptions::parse.
Returns
The single instance of this class.

Definition at line 261 of file options.cpp.

References initialized.

Referenced by options(), and parse().

Member Data Documentation

int toptions::count

The number of times the filter has to be applied.

This feature is for performance testing only.

Definition at line 79 of file options.hpp.

Referenced by main(), and parse().

std::vector<std::string> toptions::filters

The filters to apply to the input file.

Definition at line 69 of file options.hpp.

Referenced by main(), and parse().

std::string toptions::input_filename

The filename of the input file.

Definition at line 63 of file options.hpp.

Referenced by main(), and parse().

std::string toptions::output_filename

The filename of the output file.

Definition at line 66 of file options.hpp.

Referenced by main(), and parse().

bool toptions::time

Display the time that applying the filters took.

Definition at line 72 of file options.hpp.

Referenced by main(), and parse().


The documentation for this struct was generated from the following files: