COOPY » Guide
version 0.6.5
|
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::CompareFlags & | getCompareFlags () 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) |
Example & | addExample (const char *code, const char *desc) |
Recipe & | addRecipe (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 |
Set up options.
This object must exist at the widest possible scope.
coopy::app::Options::Options | ( | ) |
Options::Options | ( | const char * | name | ) |
Definition at line 405 of file Options.cpp.
References add(), addAll(), addCompare(), addTransform(), OPTION_FOR_COOPY, OPTION_FOR_DIFF, OPTION_FOR_FORMAT, OPTION_FOR_MERGE, OPTION_FOR_PATCH, OPTION_FOR_REDIFF, OPTION_FOR_RESOLVE, and OPTION_PATCH_FORMAT.
void Options::add | ( | int | coverage, |
const char * | name, | ||
const char * | desc | ||
) |
Definition at line 385 of file Options.cpp.
References coopy::app::Option::arg, coopy::app::Option::coverage, coopy::app::Option::desc, coopy::app::Option::is_default, and coopy::app::Option::long_name.
Referenced by addAll(), addCompare(), addTransform(), and Options().
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] |
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[] | ||
) |
Definition at line 746 of file Options.cpp.
References coopy::cmp::CompareFlags::acts, addStringToList(), coopy::cmp::CompareFlags::assume_header, coopy::cmp::CompareFlags::bias_ids, coopy::store::PolyBook::clear(), coopy::cmp::CompareFlags::coined, coopy::cmp::CompareFlags::context_lines, coopy_set_default_eol_style(), coopy_set_default_table_name(), coopy_set_strict(), coopy_set_verbose(), core, coopy::cmp::CompareFlags::create_unknown_sheets, coopy::cmp::CompareFlags::exclude_columns, coopy::cmp::CompareFlags::fixed_columns, flags, coopy::cmp::CompareFlags::foreign_pool, coopy::cmp::CompareFlags::foreign_pool_set, generateExample(), getVersion(), gnulib_getopt_long(), coopy::cmp::CompareFlags::head_trimmed, coopy::cmp::CompareFlags::ids, coopy::cmp::CompareFlags::ignore_case, coopy::cmp::CompareFlags::include_columns, isFormatLike(), coopy::cmp::CompareFlags::mapping_book, option::name, coopy::cmp::CompareFlags::offload_to_sql_when_possible, coopy::cmp::CompareFlags::omit_format_name, coopy::cmp::CompareFlags::omit_sheet_name, optarg, optind, option_bool, OPTION_PATCH_FORMAT, option_string, coopy::cmp::CompareFlags::ordered_tables, coopy::store::PolyBook::read(), coopy::cmp::CompareFlags::resolve, coopy::cmp::CompareFlags::tables, coopy::cmp::CompareFlags::tail_trimmed, coopy::cmp::CompareFlags::trust_column_names, coopy::cmp::CompareFlags::trust_ids, coopy::cmp::CompareFlags::use_order, and coopy::cmp::CompareFlags::variant.
Referenced by main().
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] |
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] |
const std::string& coopy::app::Options::getDescription | ( | ) | const [inline] |
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] |
const std::string& coopy::app::Options::getName | ( | ) | const [inline] |
int coopy::app::Options::getOptionFilter | ( | ) | const [inline] |
const std::vector<Option>& coopy::app::Options::getOptionList | ( | ) | const [inline] |
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] |
std::string Options::getVersion | ( | ) | const |
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] |
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 |
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().