COOPY » Guide  version 0.6.5
Public Member Functions | Data Fields
coopy::app::Options Class Reference

Set up options. More...

#include <Options.h>

Public Member Functions

 Options ()
int apply (int argc, char *argv[])
const std::vector< std::string > & getCore () const
std::vector< std::string > & getCoreMod ()
const coopy::cmp::CompareFlagsgetCompareFlags () const
bool checkBool (const char *name, bool fallback=false) const
void setBool (const char *name, bool val)
void addStringToList (const char *name, const char *val)
std::string checkString (const char *name, const char *fallback="") const
bool isStringList (const char *name) const
const std::vector< std::string > & getStringList (const char *name) const
bool isVerbose () const
bool isHelp () const
 Options (const char *name)
bool isDiffLike () const
bool isPatchLike () const
bool isRediffLike () const
bool isResolveLike () const
bool isMergeLike () const
bool isFormatLike () const
std::string getVersion () const
void add (int coverage, const char *name, const char *desc)
void addAll (const char *name, const char *desc)
void addTransform (const char *name, const char *desc)
void addCompare (const char *name, const char *desc)
void showOptions (int filter)
void beginHelp ()
void addUsage (const char *usage)
void addDescription (const char *desc)
ExampleaddExample (const char *code, const char *desc)
RecipeaddRecipe (const char *name, const char *code)
void endHelp ()
const std::vector< Option > & getOptionList () const
const std::string & getName () const
const std::vector< std::string > & getUsages () const
const std::vector< Example > & getExamples () const
const std::vector< std::string > getExampleReqs () const
const std::vector< std::string > getExampleRecipes (const std::vector< std::string > &reqs) const
const std::string & getDescription () const
int getOptionFilter () const

Data Fields

coopy::cmp::CompareFlags flags
std::map< std::string, bool > option_bool
std::map< std::string,
std::string > 
option_string
std::vector< std::string > core

Detailed Description

Set up options.

This object must exist at the widest possible scope.

Definition at line 67 of file Options.h.


Constructor & Destructor Documentation

coopy::app::Options::Options ( )
Options::Options ( const char *  name)

Member Function Documentation

void Options::add ( int  coverage,
const char *  name,
const char *  desc 
)
void coopy::app::Options::addAll ( const char *  name,
const char *  desc 
) [inline]

Definition at line 140 of file Options.h.

References add(), and OPTION_FOR_ALL.

Referenced by Options().

void coopy::app::Options::addCompare ( const char *  name,
const char *  desc 
) [inline]

Definition at line 148 of file Options.h.

References add(), and OPTION_FOR_COMPARE.

Referenced by Options().

void Options::addDescription ( const char *  desc)

Definition at line 1136 of file Options.cpp.

Referenced by main().

Example& coopy::app::Options::addExample ( const char *  code,
const char *  desc 
) [inline]

Definition at line 160 of file Options.h.

References coopy::app::Example::code, and coopy::app::Example::desc.

Referenced by main().

Recipe& coopy::app::Options::addRecipe ( const char *  name,
const char *  code 
) [inline]

Definition at line 167 of file Options.h.

References coopy::app::Example::code, and coopy::app::Example::desc.

Referenced by endHelp().

void coopy::app::Options::addStringToList ( const char *  name,
const char *  val 
) [inline]

Definition at line 86 of file Options.h.

Referenced by apply().

void coopy::app::Options::addTransform ( const char *  name,
const char *  desc 
) [inline]

Definition at line 144 of file Options.h.

References add(), OPTION_FOR_DIFF, OPTION_FOR_MERGE, OPTION_FOR_PATCH, and OPTION_FOR_REDIFF.

Referenced by Options().

void Options::addUsage ( const char *  usage)

Definition at line 1132 of file Options.cpp.

Referenced by main().

int Options::apply ( int  argc,
char *  argv[] 
)
void Options::beginHelp ( )

Definition at line 1129 of file Options.cpp.

Referenced by main().

bool coopy::app::Options::checkBool ( const char *  name,
bool  fallback = false 
) const [inline]

Definition at line 77 of file Options.h.

References option_bool.

Referenced by coopy::app::Diff::apply(), isHelp(), isVerbose(), and main().

std::string coopy::app::Options::checkString ( const char *  name,
const char *  fallback = "" 
) const [inline]

Definition at line 93 of file Options.h.

References option_string.

Referenced by coopy::app::Diff::apply(), and main().

void Options::endHelp ( )

Definition at line 1140 of file Options.cpp.

References addRecipe(), option_bool, and coopy::app::Example::require().

Referenced by main().

const coopy::cmp::CompareFlags& coopy::app::Options::getCompareFlags ( ) const [inline]

Definition at line 75 of file Options.h.

References flags.

Referenced by coopy::app::Diff::apply().

const std::vector<std::string>& coopy::app::Options::getCore ( ) const [inline]

Definition at line 73 of file Options.h.

References core.

Referenced by coopy::app::Diff::apply(), and main().

std::vector<std::string>& coopy::app::Options::getCoreMod ( ) [inline]

Definition at line 74 of file Options.h.

References core.

Referenced by main().

const std::string& coopy::app::Options::getDescription ( ) const [inline]

Definition at line 183 of file Options.h.

const std::vector< std::string > Options::getExampleRecipes ( const std::vector< std::string > &  reqs) const

Definition at line 1180 of file Options.cpp.

const std::vector< std::string > Options::getExampleReqs ( ) const

Definition at line 1154 of file Options.cpp.

References option::name, and coopy::app::Example::reqs.

const std::vector<Example>& coopy::app::Options::getExamples ( ) const [inline]

Definition at line 180 of file Options.h.

const std::string& coopy::app::Options::getName ( ) const [inline]

Definition at line 178 of file Options.h.

int coopy::app::Options::getOptionFilter ( ) const [inline]

Definition at line 184 of file Options.h.

const std::vector<Option>& coopy::app::Options::getOptionList ( ) const [inline]

Definition at line 177 of file Options.h.

const std::vector<std::string>& coopy::app::Options::getStringList ( const char *  name) const [inline]

Definition at line 102 of file Options.h.

Referenced by coopy::app::Diff::apply().

const std::vector<std::string>& coopy::app::Options::getUsages ( ) const [inline]

Definition at line 179 of file Options.h.

std::string Options::getVersion ( ) const

Definition at line 608 of file Options.cpp.

References QUOTED_VERSION.

Referenced by apply().

bool coopy::app::Options::isDiffLike ( ) const [inline]

Definition at line 112 of file Options.h.

bool coopy::app::Options::isFormatLike ( ) const [inline]

Definition at line 132 of file Options.h.

Referenced by apply(), and coopy::app::Diff::apply().

bool coopy::app::Options::isHelp ( ) const [inline]

Definition at line 108 of file Options.h.

References checkBool().

bool coopy::app::Options::isMergeLike ( ) const [inline]

Definition at line 128 of file Options.h.

Referenced by coopy::app::Diff::apply().

bool coopy::app::Options::isPatchLike ( ) const [inline]

Definition at line 116 of file Options.h.

Referenced by coopy::app::Diff::apply().

bool coopy::app::Options::isRediffLike ( ) const [inline]

Definition at line 120 of file Options.h.

Referenced by coopy::app::Diff::apply().

bool coopy::app::Options::isResolveLike ( ) const [inline]

Definition at line 124 of file Options.h.

Referenced by coopy::app::Diff::apply().

bool coopy::app::Options::isStringList ( const char *  name) const [inline]

Definition at line 98 of file Options.h.

Referenced by coopy::app::Diff::apply().

bool coopy::app::Options::isVerbose ( ) const [inline]

Definition at line 106 of file Options.h.

References checkBool().

void coopy::app::Options::setBool ( const char *  name,
bool  val 
) [inline]

Definition at line 82 of file Options.h.

References option_bool.

void coopy::app::Options::showOptions ( int  filter) [inline]

Definition at line 152 of file Options.h.

Referenced by main().


Field Documentation

std::vector<std::string> coopy::app::Options::core

Definition at line 190 of file Options.h.

Referenced by apply(), getCore(), getCoreMod(), and MergeFrame::OnMerge().

Definition at line 187 of file Options.h.

Referenced by apply(), and getCompareFlags().

std::map<std::string,bool> coopy::app::Options::option_bool

Definition at line 188 of file Options.h.

Referenced by apply(), checkBool(), endHelp(), and setBool().

std::map<std::string,std::string> coopy::app::Options::option_string

Definition at line 189 of file Options.h.

Referenced by apply(), checkString(), and MergeFrame::OnMerge().


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines