NCBI C++ ToolKit
Classes | Typedefs | Enumerations | Enumerator | Functions | Variables | Friends
Command-Line Argument Processing
+ Collaboration diagram for Command-Line Argument Processing:

Classes

class  CArgException
 CArgException –. More...
 
class  CArgHelpException
 CArgHelpException –. More...
 
class  CArgValue
 CArgValue –. More...
 
class  CArgs
 CArgs –. More...
 
class  CArgErrorHandler
 CArgErrorHandler –. More...
 
class  CArgDescriptions
 CArgDescriptions –. More...
 
struct  CArgDescriptions::SArgDependency
 
class  CArgDescriptions::CPrintUsage
 
class  CArgDescriptions::CPrintUsageXml
 
class  CCommandArgDescriptions
 CCommandArgDescriptions –. More...
 
class  CArgAllow
 CArgAllow –. More...
 
class  CArgAllow_Symbols
 CArgAllow_Symbols –. More...
 
class  CArgAllow_String
 CArgAllow_String –. More...
 
class  CArgAllow_Strings
 CArgAllow_Strings –. More...
 
class  CArgAllow_Int8s
 CArgAllow_Int8s –. More...
 
class  CArgAllow_Integers
 CArgAllow_Integers –. More...
 
class  CArgAllow_Doubles
 CArgAllow_Doubles –. More...
 
class  CArgDesc
 CArgDesc –. More...
 
class  CArgDependencyGroup
 
class  CArgAllow_Regexp
 CArgAllow_Regexp –. More...
 

Typedefs

typedef unsigned int CArgValue::TFileFlags
 Bitwise OR of "EFileFlags". More...
 
typedef vector< stringCArgValue::TStringArray
 Some values types can contain several value lists. More...
 
typedef unsigned int CArgValue::TArgValueFlags
 Bitwise OR of "EArgValueFlags". More...
 
typedef set< CRef< CArgValue > > CArgs::TArgs
 Type for arguments. More...
 
typedef TArgs::iterator CArgs::TArgsI
 Type for iterator. More...
 
typedef TArgs::const_iterator CArgs::TArgsCI
 Type for const iterator. More...
 
typedef unsigned int CArgDescriptions::TFlags
 Bitwise OR of "EFlags". More...
 
typedef int CArgDescriptions::TMiscFlags
 Bitwise OR of "EMiscFlags". More...
 
typedef int CArgDescriptions::THideStdArgs
 Binary OR of "EHideStdArgs". More...
 
typedef set< AutoPtr< CArgDesc > > CArgDescriptions::TArgs
 Argument descr. type. More...
 
typedef TArgs::iterator CArgDescriptions::TArgsI
 Arguments iterator. More...
 
typedef TArgs::const_iterator CArgDescriptions::TArgsCI
 Const arguments iterator. More...
 
typedef vector< stringCArgDescriptions::TPosArgs
 Positional arg. vector. More...
 
typedef list< stringCArgDescriptions::TKeyFlagArgs
 List of flag arguments. More...
 
typedef vector< stringCArgDescriptions::TArgGroups
 Argument groups. More...
 
typedef multimap< string, SArgDependencyCArgDescriptions::TDependencies
 
typedef TDependencies::const_iterator CArgDescriptions::TDependency_CI
 
typedef unsigned int CCommandArgDescriptions::TCommandArgFlags
 Bitwise OR of ECommandArgFlags. More...
 
typedef map< string, AutoPtr< CArgDescriptions > > CCommandArgDescriptions::TDescriptions
 
typedef pair< ESymbolClass, stringCArgAllow_Symbols::TSymClass
 
typedef set< string, PNocase_ConditionalCArgAllow_Strings::TStrings
 Type of the container that contains the allowed string values. More...
 
typedef pair< Int8, Int8CArgAllow_Int8s::TInterval
 
typedef pair< double, double > CArgAllow_Doubles::TInterval
 

Enumerations

enum  CArgException::EErrCode {
  CArgException::eInvalidArg , CArgException::eNoValue , CArgException::eExcludedValue , CArgException::eWrongCast ,
  CArgException::eConvert , CArgException::eNoFile , CArgException::eConstraint , CArgException::eArgType ,
  CArgException::eNoArg , CArgException::eSynopsis
}
 Error types for improperly formatted arguments. More...
 
enum  CArgHelpException::EErrCode {
  CArgHelpException::eHelp , CArgHelpException::eHelpFull , CArgHelpException::eHelpShowAll , CArgHelpException::eHelpXml ,
  CArgHelpException::eHelpErr
}
 Error type for help exception. More...
 
enum  CArgValue::EFileFlags {
  CArgValue::fBinary = (1 << 1) , CArgValue::fText = 0 , CArgValue::fAppend = (1 << 2) , CArgValue::fTruncate = (1 << 12) ,
  CArgValue::fNoCreate = (1 << 11) , CArgValue::fCreatePath = (1 << 8)
}
 
enum  CArgValue::EArgValueFlags { CArgValue::fArgValue_HasDefault = (1 << 0) , CArgValue::fArgValue_FromDefault = (1 << 1) }
 Whether the argument: More...
 
enum  CArgDescriptions::EArgSetType { CArgDescriptions::eRegularArgs , CArgDescriptions::eCgiArgs }
 Type of CArgDescriptions For a CGI application positional arguments and flags does not make sense (this syntax cannot be expressed by CGI protocol) More...
 
enum  CArgDescriptions::EArgPositionalMode { CArgDescriptions::ePositionalMode_Strict , CArgDescriptions::ePositionalMode_Loose }
 Processing of positional arguments. More...
 
enum  CArgDescriptions::EType {
  CArgDescriptions::eString = 0 , CArgDescriptions::eBoolean , CArgDescriptions::eInt8 , CArgDescriptions::eInteger ,
  CArgDescriptions::eIntId , CArgDescriptions::eDouble , CArgDescriptions::eInputFile , CArgDescriptions::eOutputFile ,
  CArgDescriptions::eIOFile , CArgDescriptions::eDirectory , CArgDescriptions::eDataSize , CArgDescriptions::eDateTime ,
  CArgDescriptions::k_EType_Size
}
 Available argument types. More...
 
enum  CArgDescriptions::EFlags {
  CArgDescriptions::fPreOpen = (1 << 0) , CArgDescriptions::fBinary = (1 << 1) , CArgDescriptions::fAppend = (1 << 2) , CArgDescriptions::fTruncate = (1 << 12) ,
  CArgDescriptions::fNoCreate = (1 << 11) , CArgDescriptions::fCreatePath = (1 << 8) , CArgDescriptions::fFileFlags = fPreOpen | fBinary | fAppend | fTruncate | fNoCreate | fCreatePath , CArgDescriptions::fAllowMultiple = (1 << 3) ,
  CArgDescriptions::fIgnoreInvalidValue = (1 << 4) , CArgDescriptions::fWarnOnInvalidValue = (1 << 5) , CArgDescriptions::fOptionalSeparator = (1 << 6) , CArgDescriptions::fOptionalSeparatorAllowConflict = (1 << 9) ,
  CArgDescriptions::fMandatorySeparator = (1 << 7) , CArgDescriptions::fHidden = (1 << 10) , CArgDescriptions::fConfidential = (1 << 13)
}
 Additional flags, the first group is file related flags. More...
 
enum  CArgDescriptions::EFlagValue { CArgDescriptions::eFlagHasValueIfMissed = 0 , CArgDescriptions::eFlagHasValueIfSet = 1 }
 Define how flag presence affect CArgValue::HasValue(). More...
 
enum  CArgDescriptions::EConstraintNegate { CArgDescriptions::eConstraintInvert , CArgDescriptions::eConstraint }
 Flag to invert constraint logically. More...
 
enum  CArgDescriptions::EDependency { CArgDescriptions::eRequires , CArgDescriptions::eExcludes }
 Dependencies between arguments. More...
 
enum  CArgDescriptions::EMiscFlags {
  CArgDescriptions::fNoUsage = 1 << 0 , CArgDescriptions::fUsageIfNoArgs = 1 << 1 , CArgDescriptions::fUsageSortArgs = 1 << 2 , CArgDescriptions::fDupErrToCerr = 1 << 3 ,
  CArgDescriptions::fMisc_Default = 0
}
 Miscellaneous flags. More...
 
enum  CArgDescriptions::EHideStdArgs {
  CArgDescriptions::fHideLogfile = 0x01 , CArgDescriptions::fHideConffile = 0x02 , CArgDescriptions::fHideVersion = 0x04 , CArgDescriptions::fHideFullVersion = 0x08 ,
  CArgDescriptions::fHideDryRun = 0x10 , CArgDescriptions::fHideHelp = 0x20 , CArgDescriptions::fHideFullHelp = 0x40 , CArgDescriptions::fHideXmlHelp = 0x80 ,
  CArgDescriptions::fHideAll = 0xFF
}
 Which standard flag's descriptions should not be displayed in the usage message. More...
 
enum  CArgDescriptions::EPostCheckCaller { CArgDescriptions::eCreateArgs , CArgDescriptions::eConvertKeys }
 
enum  CCommandArgDescriptions::ECommandArgFlags { CCommandArgDescriptions::eCommandMandatory = 0 , CCommandArgDescriptions::eCommandOptional = 1 , CCommandArgDescriptions::eNoSortCommands = (1<<1) , CCommandArgDescriptions::eNoSortGroups = (1<<2) }
 
enum  CCommandArgDescriptions::ECommandFlags { CCommandArgDescriptions::eDefault = 0 , CCommandArgDescriptions::eHidden = 1 }
 
enum  CArgAllow_Symbols::ESymbolClass {
  CArgAllow_Symbols::eAlnum , CArgAllow_Symbols::eAlpha , CArgAllow_Symbols::eCntrl , CArgAllow_Symbols::eDigit ,
  CArgAllow_Symbols::eGraph , CArgAllow_Symbols::eLower , CArgAllow_Symbols::ePrint , CArgAllow_Symbols::ePunct ,
  CArgAllow_Symbols::eSpace , CArgAllow_Symbols::eUpper , CArgAllow_Symbols::eXdigit , CArgAllow_Symbols::eUser
}
 Symbol class for defining sets of characters. More...
 
enum  CArgDependencyGroup::EInstantSet { CArgDependencyGroup::eNoInstantSet , CArgDependencyGroup::eInstantSet }
 Control whether the "setting" of this particular member marks the whole group as "set" regardless of the value passed to SetMinMembers() More...
 

Functions

virtual const char * CArgException::GetErrCodeString (void) const override
 Translate from the error code value to its string representation. More...
 
 CArgException::NCBI_EXCEPTION_DEFAULT (CArgException, CCoreException)
 
virtual const char * CArgHelpException::GetErrCodeString (void) const override
 Translate from the error code value to its string representation. More...
 
 CArgHelpException::NCBI_EXCEPTION_DEFAULT (CArgHelpException, CArgException)
 
const stringCArgValue::GetName (void) const
 Get argument name. More...
 
virtual bool CArgValue::HasValue (void) const =0
 Check if argument holds a value. More...
 
 CArgValue::DECLARE_OPERATOR_BOOL (HasValue())
 Synonym for HasValue(). More...
 
virtual const stringCArgValue::AsString (void) const =0
 Get the argument's string value. More...
 
virtual Int8 CArgValue::AsInt8 (void) const =0
 Get the argument's integer (8-byte long) value. More...
 
virtual int CArgValue::AsInteger (void) const =0
 Get the argument's integer value. More...
 
virtual TIntId CArgValue::AsIntId (void) const =0
 Get the argument's value as an integer id (TIntId). More...
 
virtual double CArgValue::AsDouble (void) const =0
 Get the argument's double value. More...
 
virtual bool CArgValue::AsBoolean (void) const =0
 Get the argument's boolean value. More...
 
virtual CNcbiIstreamCArgValue::AsInputFile (TFileFlags flags=0) const =0
 Get the argument as an input file stream. More...
 
virtual CNcbiOstreamCArgValue::AsOutputFile (TFileFlags flags=0) const =0
 Get the argument as an output file stream. More...
 
virtual CNcbiIostreamCArgValue::AsIOFile (TFileFlags flags=0) const =0
 Get the argument as a file stream. More...
 
virtual const CDirCArgValue::AsDirectory (void) const =0
 Get the argument as a directory. More...
 
virtual const CTimeCArgValue::AsDateTime (void) const =0
 Get the argument as a DateTime. More...
 
virtual void CArgValue::CloseFile (void) const =0
 Close the file. More...
 
virtual const TStringArrayCArgValue::GetStringList () const
 Get the value list. More...
 
virtual TStringArrayCArgValue::SetStringList ()
 Get reference on value list for further modification. More...
 
size_t CArgValue::GetOrdinalPosition (void) const
 Get ordinal position of the value. More...
 
const stringCArgValue::GetDefault (TArgValueFlags *flags=NULL) const
 Get default value of the argument. More...
 
 CArgValue::CArgValue (const string &name)
 Protected constructor and destructor. More...
 
virtual CArgValue::~CArgValue (void)
 
void CArgValue::SetOrdinalPosition (size_t pos)
 
void CArgValue::x_SetDefault (const string &def_value, bool from_def)
 
bool operator< (const CRef< CArgValue > &x, const CRef< CArgValue > &y)
 
 CArgs::CArgs (void)
 Constructor. More...
 
 CArgs::~CArgs (void)
 Destructor. More...
 
 CArgs::CArgs (const CArgs &other)
 Creating copy of this object usually makes no sense if it is really required, please use Assign method. More...
 
CArgsCArgs::operator= (const CArgs &other)
 Creating copy of this object usually makes no sense if it is really required, please use Assign method. More...
 
CArgsCArgs::Assign (const CArgs &other)
 Copy contents of another object into this one. More...
 
bool CArgs::Exist (const string &name) const
 Check existence of argument description. More...
 
const CArgValueCArgs::operator[] (const string &name) const
 Get value of argument by name. More...
 
size_t CArgs::GetNExtra (void) const
 Get the number of unnamed positional (a.k.a. extra) args. More...
 
const CArgValueCArgs::operator[] (size_t idx) const
 Return N-th extra arg value, N = 1 to GetNExtra(). More...
 
vector< CRef< CArgValue > > CArgs::GetAll (void) const
 Get all available arguments. More...
 
stringCArgs::Print (string &str) const
 Print (append) all arguments to the string "str" and return "str". More...
 
void CArgs::Add (CArgValue *arg, bool update=false, bool add_value=false)
 Add new argument name and value. More...
 
bool CArgs::IsEmpty (void) const
 Check if there are no arguments in this container. More...
 
void CArgs::Remove (const string &name)
 Remove argument of name "name". More...
 
void CArgs::Reset (void)
 Remove all arguments. More...
 
string CArgs::GetCommand (void) const
 Get current command. More...
 
CArgsCArgs::SetCommand (const string &command)
 Set current command. More...
 
TArgsCI CArgs::x_Find (const string &name) const
 Find argument value with name "name". More...
 
TArgsI CArgs::x_Find (const string &name)
 
virtual CArgValueCArgErrorHandler::HandleError (const CArgDesc &arg_desc, const string &value) const
 Process invalid argument value. More...
 
 CArgDescriptions::CArgDescriptions (bool auto_help=true, CArgErrorHandler *err_handler=0)
 Constructor. More...
 
virtual CArgDescriptions::~CArgDescriptions (void)
 Destructor. More...
 
void CArgDescriptions::SetArgsType (EArgSetType args_type)
 Set type of argument description (cmdline vs CGI). More...
 
EArgSetType CArgDescriptions::GetArgsType () const
 
void CArgDescriptions::SetPositionalMode (EArgPositionalMode positional_mode)
 Select mode for processing positional arguments. More...
 
EArgPositionalMode CArgDescriptions::GetPositionalMode () const
 
static const char * CArgDescriptions::GetTypeName (EType type)
 Get argument type's name. More...
 
void CArgDescriptions::AddKey (const string &name, const string &synopsis, const string &comment, EType type, TFlags flags=0)
 Add description for mandatory key. More...
 
void CArgDescriptions::AddOptionalKey (const string &name, const string &synopsis, const string &comment, EType type, TFlags flags=0)
 Add description for optional key without default value. More...
 
void CArgDescriptions::AddDefaultKey (const string &name, const string &synopsis, const string &comment, EType type, const string &default_value, TFlags flags=0, const string &env_var=kEmptyStr, const char *display_value=nullptr)
 Add description for optional key with default value. More...
 
void CArgDescriptions::AddFlag (const string &name, const string &comment, CBoolEnum< EFlagValue > set_value=eFlagHasValueIfSet, TFlags flags=0)
 Add description for flag argument. More...
 
void CArgDescriptions::AddOpening (const string &name, const string &comment, EType type, TFlags flags=0)
 Add description of mandatory opening positional argument. More...
 
void CArgDescriptions::AddPositional (const string &name, const string &comment, EType type, TFlags flags=0)
 Add description for mandatory positional argument. More...
 
void CArgDescriptions::AddOptionalPositional (const string &name, const string &comment, EType type, TFlags flags=0)
 Add description for optional positional argument without default value. More...
 
void CArgDescriptions::AddDefaultPositional (const string &name, const string &comment, EType type, const string &default_value, TFlags flags=0, const string &env_var=kEmptyStr, const char *display_value=nullptr)
 Add description for optional positional argument with default value. More...
 
void CArgDescriptions::AddExtra (unsigned n_mandatory, unsigned n_optional, const string &comment, EType type, TFlags flags=0)
 Add description for the extra, unnamed positional arguments. More...
 
void CArgDescriptions::AddAlias (const string &alias, const string &arg_name)
 Add argument alias. More...
 
void CArgDescriptions::AddNegatedFlagAlias (const string &alias, const string &arg_name, const string &comment=kEmptyStr)
 Add negated alias for a flag argument. More...
 
void CArgDescriptions::AddDependencyGroup (CArgDependencyGroup *dep_group)
 Add a dependency group. More...
 
void CArgDescriptions::SetConstraint (const string &name, const CArgAllow *constraint, EConstraintNegate negate=eConstraint)
 Set additional user defined constraint on argument value. More...
 
void CArgDescriptions::SetConstraint (const string &name, const CArgAllow &constraint, EConstraintNegate negate=eConstraint)
 This version of SetConstraint doesn't take the ownership of object 'constraint'. More...
 
void CArgDescriptions::SetDependency (const string &arg1, EDependency dep, const string &arg2)
 Define a dependency. More...
 
void CArgDescriptions::SetCurrentGroup (const string &group)
 Set current arguments group name. More...
 
void CArgDescriptions::SetErrorHandler (const string &name, CArgErrorHandler *err_handler)
 Set individual error handler for the argument. More...
 
bool CArgDescriptions::Exist (const string &name) const
 Check if there is already an argument description with specified name. More...
 
void CArgDescriptions::Delete (const string &name)
 Delete description of argument with name "name". More...
 
void CArgDescriptions::SetUsageContext (const string &usage_name, const string &usage_description, bool usage_sort_args=false, SIZE_TYPE usage_width=78)
 Set extra info to be used by PrintUsage(). More...
 
void CArgDescriptions::SetDetailedDescription (const string &usage_description)
 Set detailed usage description. More...
 
void CArgDescriptions::PrintUsageIfNoArgs (bool do_print=true)
 Print usage and exit. More...
 
void CArgDescriptions::SetMiscFlags (TMiscFlags flags)
 Set the selected flags. More...
 
void CArgDescriptions::ResetMiscFlags (TMiscFlags flags)
 Clear the selected usage flags. More...
 
bool CArgDescriptions::IsSetMiscFlag (EMiscFlags flag) const
 Check if the flag is set. More...
 
virtual stringCArgDescriptions::PrintUsage (string &str, bool detailed=false) const
 Print usage message to end of specified string. More...
 
virtual void CArgDescriptions::PrintUsageXml (CNcbiOstream &out) const
 Print argument description in XML format. More...
 
static bool CArgDescriptions::VerifyName (const string &name, bool extended=false)
 Verify if argument "name" is spelled correctly. More...
 
bool CArgDescriptions::IsAutoHelpEnabled (void) const
 See if special flag "-h" is activated. More...
 
CArgDescriptionsCArgDescriptions::ShowAllArguments (bool show_all)
 Include hidden arguments into USAGE. More...
 
virtual void CArgDescriptions::AddStdArguments (THideStdArgs mask)
 Add standard arguments. More...
 
void CArgDescriptions::AddDefaultFileArguments (const string &default_config)
 Add logfile and conffile arguments. More...
 
 CArgDescriptions::SArgDependency::SArgDependency (const string arg, EDependency dep)
 
void CArgDescriptions::x_PrintAliasesAsXml (CNcbiOstream &out, const string &name, bool negated=false) const
 
TArgsI CArgDescriptions::x_Find (const string &name, bool *negative=NULL)
 Helper method to find named parameter. More...
 
TArgsCI CArgDescriptions::x_Find (const string &name, bool *negative=NULL) const
 Helper method to find named parameter – const version. More...
 
size_t CArgDescriptions::x_GetGroupIndex (const string &group) const
 Get group index. More...
 
void CArgDescriptions::x_AddDesc (CArgDesc &arg)
 Helper method for adding description. More...
 
void CArgDescriptions::x_PreCheck (void) const
 Helper method for doing pre-processing consistency checks. More...
 
void CArgDescriptions::x_PrintComment (list< string > &arr, const CArgDesc &arg, SIZE_TYPE width) const
 
bool CArgDescriptions::x_CreateArg (const string &arg1, bool have_arg2, const string &arg2, unsigned *n_plain, CArgs &args) const
 Process arguments. More...
 
bool CArgDescriptions::x_CreateArg (const string &arg1, const string &name, bool have_arg2, const string &arg2, unsigned int n_plain, CArgs &args, bool update=false, CArgValue **new_value=0) const
 
void CArgDescriptions::x_PostCheck (CArgs &args, unsigned int n_plain, EPostCheckCaller caller) const
 Helper method for doing post-processing consistency checks. More...
 
bool CArgDescriptions::x_IsMultiArg (const string &name) const
 Returns TRUE if parameter supports multiple arguments. More...
 
void CArgDescriptions::x_CheckAutoHelp (const string &arg) const
 Helper method for checking if auto help requested and throw CArgHelpException if help requested. More...
 
 CArgDescriptions::CPrintUsage::CPrintUsage (const CArgDescriptions &desc)
 
 CArgDescriptions::CPrintUsage::~CPrintUsage ()
 
void CArgDescriptions::CPrintUsage::AddSynopsis (list< string > &arr, const string &intro, const string &prefix) const
 
void CArgDescriptions::CPrintUsage::AddDescription (list< string > &arr, bool detailed) const
 
void CArgDescriptions::CPrintUsage::AddCommandDescription (list< string > &arr, const string &cmd, const map< string, string > *aliases, size_t max_cmd_len, bool detailed) const
 
void CArgDescriptions::CPrintUsage::AddDetails (list< string > &arr) const
 
 CArgDescriptions::CPrintUsageXml::CPrintUsageXml (const CArgDescriptions &desc, CNcbiOstream &out)
 
 CArgDescriptions::CPrintUsageXml::~CPrintUsageXml ()
 
void CArgDescriptions::CPrintUsageXml::PrintArguments (const CArgDescriptions &desc) const
 
template<class TSize , class TArray >
CArgsCArgDescriptions::CreateArgs (TSize argc, TArray argv) const
 Create parsed arguments in CArgs object. More...
 
virtual CArgsCArgDescriptions::CreateArgs (const CNcbiArguments &argv) const
 Parse command-line arguments 'argv' out of CNcbiArguments. More...
 
template<class T >
void CArgDescriptions::ConvertKeys (CArgs *args, const T &arg_map, bool update) const
 Convert argument map (key-value pairs) into arguments in accordance with the argument descriptions. More...
 
virtual list< CArgDescriptions * > CArgDescriptions::GetAllDescriptions (void)
 
 CCommandArgDescriptions::CCommandArgDescriptions (bool auto_help=true, CArgErrorHandler *err_handler=0, TCommandArgFlags cmd_flags=eCommandMandatory)
 Constructor. More...
 
virtual CCommandArgDescriptions::~CCommandArgDescriptions (void)
 Destructor. More...
 
void CCommandArgDescriptions::SetCurrentCommandGroup (const string &group)
 Set current command group name. More...
 
void CCommandArgDescriptions::AddCommand (const string &cmd, CArgDescriptions *description, const string &alias=kEmptyStr, ECommandFlags flags=eDefault)
 Add command argument descriptions. More...
 
virtual CArgsCCommandArgDescriptions::CreateArgs (const CNcbiArguments &argv) const
 Parse command-line arguments 'argv'. More...
 
virtual void CCommandArgDescriptions::AddStdArguments (THideStdArgs mask)
 Add standard arguments. More...
 
virtual stringCCommandArgDescriptions::PrintUsage (string &str, bool detailed=false) const
 Print usage message to end of specified string. More...
 
virtual void CCommandArgDescriptions::PrintUsageXml (CNcbiOstream &out) const
 Print argument description in XML format. More...
 
virtual list< CArgDescriptions * > CCommandArgDescriptions::GetAllDescriptions (void)
 
void CCommandArgDescriptions::SetArgsType (EArgSetType)
 
bool CCommandArgDescriptions::x_IsCommandMandatory (void) const
 
size_t CCommandArgDescriptions::x_GetCommandGroupIndex (const string &group) const
 
string CCommandArgDescriptions::x_IdentifyCommand (const string &command) const
 
virtual bool CArgAllow::Verify (const string &value) const =0
 Verify if specified value is allowed. More...
 
virtual string CArgAllow::GetUsage (void) const =0
 Get usage information. More...
 
virtual void CArgAllow::PrintUsageXml (CNcbiOstream &out) const
 Print constraints in XML format. More...
 
virtual CArgAllow::~CArgAllow (void)
 
virtual CArgAllowCArgAllow::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 
 CArgAllow::CArgAllow (void)
 
 CArgAllow_Symbols::CArgAllow_Symbols (ESymbolClass symbol_class)
 Constructor. More...
 
 CArgAllow_Symbols::CArgAllow_Symbols (const string &symbol_set)
 Constructor for user defined eUser class. More...
 
CArgAllow_SymbolsCArgAllow_Symbols::Allow (ESymbolClass symbol_class)
 Add allowed symbols. More...
 
CArgAllow_SymbolsCArgAllow_Symbols::Allow (const string &symbol_set)
 
virtual bool CArgAllow_Symbols::Verify (const string &value) const
 Verify if specified value is allowed. More...
 
virtual string CArgAllow_Symbols::GetUsage (void) const
 Get usage information. More...
 
virtual void CArgAllow_Symbols::PrintUsageXml (CNcbiOstream &out) const
 Print constraints in XML format. More...
 
 CArgAllow_Symbols::CArgAllow_Symbols (void)
 
virtual CArgAllowCArgAllow_Symbols::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 
 CArgAllow_String::CArgAllow_String (ESymbolClass symbol_class)
 Constructor. More...
 
 CArgAllow_String::CArgAllow_String (const string &symbol_set)
 Constructor for user defined eUser class. More...
 
virtual bool CArgAllow_String::Verify (const string &value) const
 Verify if specified value is allowed. More...
 
virtual string CArgAllow_String::GetUsage (void) const
 Get usage information. More...
 
virtual void CArgAllow_String::PrintUsageXml (CNcbiOstream &out) const
 Print constraints in XML format. More...
 
 CArgAllow_String::CArgAllow_String (void)
 
virtual CArgAllowCArgAllow_String::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 
 CArgAllow_Strings::CArgAllow_Strings (NStr::ECase use_case=NStr::eCase)
 Constructor. More...
 
 CArgAllow_Strings::CArgAllow_Strings (initializer_list< string > values, NStr::ECase use_case=NStr::eCase)
 Constructor. More...
 
CArgAllow_StringsCArgAllow_Strings::Allow (const string &value)
 Add allowed string values. More...
 
CArgAllow_StringsCArgAllow_Strings::AllowValue (const string &value)
 Add allowed string values. More...
 
CArgAllow_StringsCArgAllow_Strings::operator, (const string &value)
 Short notation operator for adding allowed string values. More...
 
virtual bool CArgAllow_Strings::Verify (const string &value) const
 Verify if specified value is allowed. More...
 
virtual string CArgAllow_Strings::GetUsage (void) const
 Get usage information. More...
 
virtual void CArgAllow_Strings::PrintUsageXml (CNcbiOstream &out) const
 Print constraints in XML format. More...
 
virtual CArgAllowCArgAllow_Strings::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 
 CArgAllow_Int8s::CArgAllow_Int8s (Int8 x_value)
 Constructor specifying an allowed integer value. More...
 
 CArgAllow_Int8s::CArgAllow_Int8s (Int8 x_min, Int8 x_max)
 Constructor specifying range of allowed integer values. More...
 
CArgAllow_Int8sCArgAllow_Int8s::AllowRange (Int8 from, Int8 to)
 Add allow values. More...
 
CArgAllow_Int8sCArgAllow_Int8s::Allow (Int8 value)
 
virtual bool CArgAllow_Int8s::Verify (const string &value) const
 Verify if specified value is allowed. More...
 
virtual string CArgAllow_Int8s::GetUsage (void) const
 Get usage information. More...
 
virtual void CArgAllow_Int8s::PrintUsageXml (CNcbiOstream &out) const
 Print constraints in XML format. More...
 
 CArgAllow_Int8s::CArgAllow_Int8s (void)
 
virtual CArgAllowCArgAllow_Int8s::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 
 CArgAllow_Integers::CArgAllow_Integers (int x_value)
 Constructor specifying an allowed integer value. More...
 
 CArgAllow_Integers::CArgAllow_Integers (int x_min, int x_max)
 Constructor specifying range of allowed integer values. More...
 
virtual string CArgAllow_Integers::GetUsage (void) const
 Get usage information. More...
 
 CArgAllow_Integers::CArgAllow_Integers (void)
 
virtual CArgAllowCArgAllow_Integers::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 
 CArgAllow_Doubles::CArgAllow_Doubles (double x_value)
 Constructor specifying an allowed double value. More...
 
 CArgAllow_Doubles::CArgAllow_Doubles (double x_min, double x_max)
 Constructor specifying range of allowed double values. More...
 
CArgAllow_DoublesCArgAllow_Doubles::AllowRange (double from, double to)
 Add allowed values. More...
 
CArgAllow_DoublesCArgAllow_Doubles::Allow (double value)
 
virtual bool CArgAllow_Doubles::Verify (const string &value) const
 Verify if specified value is allowed. More...
 
virtual string CArgAllow_Doubles::GetUsage (void) const
 Get usage information. More...
 
virtual void CArgAllow_Doubles::PrintUsageXml (CNcbiOstream &out) const
 Print constraints in XML format. More...
 
 CArgAllow_Doubles::CArgAllow_Doubles (void)
 
virtual CArgAllowCArgAllow_Doubles::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 
 CArgDesc::CArgDesc (const string &name, const string &comment, CArgDescriptions::TFlags flags=0)
 Constructor. More...
 
virtual CArgDesc::~CArgDesc (void)
 Destructor. More...
 
const stringCArgDesc::GetName (void) const
 Get argument name. More...
 
const stringCArgDesc::GetComment (void) const
 Get argument description. More...
 
virtual size_t CArgDesc::GetGroup (void) const
 Get argument group. More...
 
virtual void CArgDesc::SetGroup (size_t)
 Set argument group. More...
 
virtual string CArgDesc::GetUsageSynopsis (bool name_only=false) const =0
 Get usage synopsis. More...
 
virtual string CArgDesc::GetUsageCommentAttr (void) const =0
 Get usage comment attribute. More...
 
virtual CArgValueCArgDesc::ProcessArgument (const string &value) const =0
 Process argument with specified value. More...
 
virtual CArgValueCArgDesc::ProcessDefault (void) const =0
 Process argument default. More...
 
virtual void CArgDesc::VerifyDefault (void) const
 Verify argument default value. More...
 
virtual void CArgDesc::SetConstraint (const CArgAllow *constraint, CArgDescriptions::EConstraintNegate negate=CArgDescriptions::eConstraint)
 Set argument constraint. More...
 
virtual bool CArgDesc::IsConstraintInverted () const
 Returns TRUE if associated constraint is inverted (NOT) More...
 
virtual const CArgAllowCArgDesc::GetConstraint (void) const
 Get argument constraint. More...
 
string CArgDesc::GetUsageConstraint (void) const
 Get usage constraint. More...
 
virtual const CArgErrorHandlerCArgDesc::GetErrorHandler (void) const
 Get error handler for the argument. More...
 
virtual void CArgDesc::SetErrorHandler (CArgErrorHandler *)
 Set error handler for the argument. More...
 
CArgDescriptions::TFlags CArgDesc::GetFlags (void) const
 Get argument flags. More...
 
string CArgDesc::PrintXml (CNcbiOstream &out) const
 Print description in XML format. More...
 
static CRef< CArgDependencyGroupCArgDependencyGroup::Create (const string &name, const string &description=kEmptyStr)
 Create new dependency group. More...
 
virtual CArgDependencyGroup::~CArgDependencyGroup (void)
 
CArgDependencyGroupCArgDependencyGroup::SetMinMembers (size_t min_members)
 
CArgDependencyGroupCArgDependencyGroup::SetMaxMembers (size_t max_members)
 
CArgDependencyGroupCArgDependencyGroup::Add (const string &arg_name, EInstantSet instant_set=eNoInstantSet)
 Make a regular argument a member of this dependency group. More...
 
CArgDependencyGroupCArgDependencyGroup::Add (CArgDependencyGroup *dep_group, EInstantSet instant_set=eNoInstantSet)
 Make another dependency group a member of this dependency group. More...
 
bool CArgDependencyGroup::x_Evaluate (const CArgs &args, string *arg_set, string *arg_unset) const
 
 CArgDependencyGroup::CArgDependencyGroup (void)
 
 CArgDependencyGroup::CArgDependencyGroup (const CArgDependencyGroup &dep_group)
 
CArgDependencyGroupCArgDependencyGroup::operator= (const CArgDependencyGroup &)
 
void CArgDependencyGroup::PrintUsage (list< string > &arr, size_t offset) const
 
void CArgDependencyGroup::PrintUsageXml (CNcbiOstream &out) const
 
void CArgDependencyGroup::Evaluate (const CArgs &args) const
 
 CArgAllow_Regexp::CArgAllow_Regexp (const string &pattern)
 
virtual CArgAllow_Regexp::~CArgAllow_Regexp (void)
 
virtual bool CArgAllow_Regexp::Verify (const string &value) const
 
virtual string CArgAllow_Regexp::GetUsage (void) const
 Get usage information. More...
 
virtual void CArgAllow_Regexp::PrintUsageXml (CNcbiOstream &out) const
 Print constraints in XML format. More...
 
virtual CArgAllowCArgAllow_Regexp::Clone (void) const
 Create object's clone, moving it from stack memory into heap. More...
 

Variables

string CArgValue::m_Name
 Argument name. More...
 
size_t CArgValue::m_Ordinal
 
string CArgValue::m_Default
 
TArgValueFlags CArgValue::m_Flags
 
TArgs CArgs::m_Args
 Assoc. map of arguments' name/value. More...
 
size_t CArgs::m_nExtra
 Cached # of unnamed positional arguments. More...
 
string CArgs::m_Command
 
string CArgDescriptions::SArgDependency::m_Arg
 
EDependency CArgDescriptions::SArgDependency::m_Dep
 
EArgSetType CArgDescriptions::m_ArgsType
 Type of arguments. More...
 
TArgs CArgDescriptions::m_Args
 Assoc.map of arguments' name/descr. More...
 
TPosArgs CArgDescriptions::m_PosArgs
 Pos. args, ordered by position in cmd.-line. More...
 
TPosArgs CArgDescriptions::m_OpeningArgs
 Opening args, ordered by position in cmd.-line. More...
 
TKeyFlagArgs CArgDescriptions::m_KeyFlagArgs
 Key/flag args, in order of insertion. More...
 
string CArgDescriptions::m_NoSeparator
 Arguments allowed to use no separator. More...
 
unsigned CArgDescriptions::m_nExtra
 
unsigned CArgDescriptions::m_nExtraOpt
 > # of mandatory extra args More...
 
TArgGroups CArgDescriptions::m_ArgGroups
 Argument groups. More...
 
size_t CArgDescriptions::m_CurrentGroup
 Currently selected group (0 = no group) More...
 
EArgPositionalMode CArgDescriptions::m_PositionalMode
 Processing of positional args. More...
 
TDependencies CArgDescriptions::m_Dependencies
 Arguments' dependencies. More...
 
TMiscFlags CArgDescriptions::m_MiscFlags
 Flags for USAGE, error handling etc. More...
 
set< CConstRef< CArgDependencyGroup > > CArgDescriptions::m_DependencyGroups
 
string CArgDescriptions::m_UsageName
 Program name. More...
 
string CArgDescriptions::m_UsageDescription
 Program description. More...
 
string CArgDescriptions::m_DetailedDescription
 Program long description. More...
 
SIZE_TYPE CArgDescriptions::m_UsageWidth
 Maximum length of a usage line. More...
 
bool CArgDescriptions::m_AutoHelp
 Special flag "-h" activated. More...
 
bool CArgDescriptions::m_HasHidden
 Has hidden arguments. More...
 
CRef< CArgErrorHandlerCArgDescriptions::m_ErrorHandler
 Global error handler or NULL. More...
 
const CArgDescriptionsCArgDescriptions::CPrintUsage::m_desc
 
list< const CArgDesc * > CArgDescriptions::CPrintUsage::m_args
 
const CArgDescriptionsCArgDescriptions::CPrintUsageXml::m_desc
 
CNcbiOstreamCArgDescriptions::CPrintUsageXml::m_out
 
TCommandArgFlags CCommandArgDescriptions::m_Cmd_req
 
TDescriptions CCommandArgDescriptions::m_Description
 command to ArgDescriptions More...
 
map< string, size_t > CCommandArgDescriptions::m_Groups
 command to group # More...
 
map< string, stringCCommandArgDescriptions::m_Aliases
 command to alias; one alias only More...
 
list< stringCCommandArgDescriptions::m_Commands
 command names, and order More...
 
list< stringCCommandArgDescriptions::m_CmdGroups
 group names, and order More...
 
size_t CCommandArgDescriptions::m_CurrentCmdGroup
 current group # More...
 
string CCommandArgDescriptions::m_Command
 current command More...
 
set< TSymClassCArgAllow_Symbols::m_SymClass
 
TStrings CArgAllow_Strings::m_Strings
 Set of allowed string values. More...
 
set< TIntervalCArgAllow_Int8s::m_MinMax
 
set< TIntervalCArgAllow_Doubles::m_MinMax
 
string CArgDesc::m_Name
 Argument name. More...
 
string CArgDesc::m_Comment
 Argument description. More...
 
CArgDescriptions::TFlags CArgDesc::m_Flags
 
string CArgDependencyGroup::m_Name
 
string CArgDependencyGroup::m_Description
 
size_t CArgDependencyGroup::m_MinMembers
 
size_t CArgDependencyGroup::m_MaxMembers
 
map< string, EInstantSetCArgDependencyGroup::m_Arguments
 
map< CConstRef< CArgDependencyGroup >, EInstantSetCArgDependencyGroup::m_Groups
 
const string CArgAllow_Regexp::m_Pattern
 Regexp pattern to match against. More...
 
CRegexp CArgAllow_Regexp::m_Regexp
 Pre-compiled regexp. More...
 

Friends

class CArgValue::CArgs
 
class CArgValue::CArgDescDefault
 
class CArgValue::CArgDescMandatory
 
class CArgValue::CArgDesc_Flag
 
class CArgs::CCommandArgDescriptions
 
class CArgDescriptions::CCommandArgDescriptions
 

Detailed Description

Typedef Documentation

◆ TArgGroups

typedef vector<string> CArgDescriptions::TArgGroups
private

Argument groups.

Definition at line 1118 of file ncbiargs.hpp.

◆ TArgs [1/2]

typedef set< CRef<CArgValue> > CArgs::TArgs
private

Type for arguments.

Definition at line 480 of file ncbiargs.hpp.

◆ TArgs [2/2]

Argument descr. type.

Definition at line 1113 of file ncbiargs.hpp.

◆ TArgsCI [1/2]

Type for const iterator.

Definition at line 482 of file ncbiargs.hpp.

◆ TArgsCI [2/2]

Const arguments iterator.

Definition at line 1115 of file ncbiargs.hpp.

◆ TArgsI [1/2]

typedef TArgs::iterator CArgs::TArgsI
private

Type for iterator.

Definition at line 481 of file ncbiargs.hpp.

◆ TArgsI [2/2]

Arguments iterator.

Definition at line 1114 of file ncbiargs.hpp.

◆ TArgValueFlags

typedef unsigned int CArgValue::TArgValueFlags

Bitwise OR of "EArgValueFlags".

Definition at line 315 of file ncbiargs.hpp.

◆ TCommandArgFlags

Bitwise OR of ECommandArgFlags.

Definition at line 1390 of file ncbiargs.hpp.

◆ TDependencies

Definition at line 1129 of file ncbiargs.hpp.

◆ TDependency_CI

Definition at line 1130 of file ncbiargs.hpp.

◆ TDescriptions

Definition at line 1456 of file ncbiargs.hpp.

◆ TFileFlags

typedef unsigned int CArgValue::TFileFlags

Bitwise OR of "EFileFlags".

Definition at line 270 of file ncbiargs.hpp.

◆ TFlags

typedef unsigned int CArgDescriptions::TFlags

Bitwise OR of "EFlags".

Definition at line 676 of file ncbiargs.hpp.

◆ THideStdArgs

Binary OR of "EHideStdArgs".

Definition at line 1074 of file ncbiargs.hpp.

◆ TInterval [1/2]

typedef pair<Int8, Int8> CArgAllow_Int8s::TInterval
protected

Definition at line 1733 of file ncbiargs.hpp.

◆ TInterval [2/2]

typedef pair<double,double> CArgAllow_Doubles::TInterval
protected

Definition at line 1807 of file ncbiargs.hpp.

◆ TKeyFlagArgs

typedef list<string> CArgDescriptions::TKeyFlagArgs
private

List of flag arguments.

Definition at line 1117 of file ncbiargs.hpp.

◆ TMiscFlags

Bitwise OR of "EMiscFlags".

Definition at line 1036 of file ncbiargs.hpp.

◆ TPosArgs

typedef vector<string> CArgDescriptions::TPosArgs
private

Positional arg. vector.

Definition at line 1116 of file ncbiargs.hpp.

◆ TStringArray

Some values types can contain several value lists.

Example: CGIs pass list selections by repeating the same name

Definition at line 293 of file ncbiargs.hpp.

◆ TStrings

Type of the container that contains the allowed string values.

See also
m_Strings

Definition at line 1688 of file ncbiargs.hpp.

◆ TSymClass

Definition at line 1580 of file ncbiargs.hpp.

Enumeration Type Documentation

◆ EArgPositionalMode

Processing of positional arguments.

In strict mode any value starting with '-' is treated as a key/flag unless any positional arguments have already been found (e.g. after '–' argument). In loose mode any argument is treated as positional if it can not be processed as a valid key or flag.

Enumerator
ePositionalMode_Strict 

Strict mode (default)

ePositionalMode_Loose 

Loose mode.

Definition at line 576 of file ncbiargs.hpp.

◆ EArgSetType

Type of CArgDescriptions For a CGI application positional arguments and flags does not make sense (this syntax cannot be expressed by CGI protocol)

Enumerator
eRegularArgs 

Regular application.

eCgiArgs 

CGI application.

Definition at line 559 of file ncbiargs.hpp.

◆ EArgValueFlags

Whether the argument:

See also
GetDefault()
Enumerator
fArgValue_HasDefault 

Has default value.

fArgValue_FromDefault 

Not provided in command line.

Definition at line 311 of file ncbiargs.hpp.

◆ ECommandArgFlags

Enumerator
eCommandMandatory 

Nonempty command is required.

eCommandOptional 

Command is not necessary.

eNoSortCommands 

On PrintUsage, keep commands unsorted.

eNoSortGroups 

On PrintUsage, keep command groups unsorted.

Definition at line 1384 of file ncbiargs.hpp.

◆ ECommandFlags

Enumerator
eDefault 
eHidden 

Hide command in Usage.

Definition at line 1409 of file ncbiargs.hpp.

◆ EConstraintNegate

Flag to invert constraint logically.

Enumerator
eConstraintInvert 

Logical NOT.

eConstraint 

Constraint is not inverted (taken as is)

Definition at line 922 of file ncbiargs.hpp.

◆ EDependency

Dependencies between arguments.

Enumerator
eRequires 

One argument requires another.

eExcludes 

One argument excludes another.

Definition at line 955 of file ncbiargs.hpp.

◆ EErrCode [1/2]

Error types for improperly formatted arguments.

These error conditions are checked for and caught when processing arguments.

Enumerator
eInvalidArg 

Invalid argument.

eNoValue 

Expecting an argument value.

eExcludedValue 

The value is excluded by another argument.

eWrongCast 

Incorrect cast for an argument.

eConvert 

Conversion problem.

eNoFile 

Expecting a file.

eConstraint 

Argument value outside constraints.

eArgType 

Wrong argument type.

eNoArg 

No argument.

eSynopsis 

Synopsis error.

Definition at line 126 of file ncbiargs.hpp.

◆ EErrCode [2/2]

Error type for help exception.

Enumerator
eHelp 

Error code for short help message.

eHelpFull 

Error code for detailed help message.

eHelpShowAll 

Error code for detailed help message which includes hidden arguments.

eHelpXml 

Error code for XML formatted help message.

eHelpErr 

Show short help message and return error.

Definition at line 161 of file ncbiargs.hpp.

◆ EFileFlags

Enumerator
fBinary 

Open file in binary mode.

fText 

Open file in text mode.

fAppend 

Open file in append mode.

fTruncate 

Open file in truncate mode.

fNoCreate 

Open existing file, never create it.

fCreatePath 

If needed, create directory where the file is located.

Definition at line 262 of file ncbiargs.hpp.

◆ EFlags

Additional flags, the first group is file related flags.

Must match the argument type, or an exception will be thrown. ( File related are for eInputFile and eOutputFiler argument types.)

Enumerator
fPreOpen 

Open file right away; for eInputFile, eOutputFile, eIOFile.

fBinary 

Open as binary file; for eInputFile, eOutputFile, eIOFile.

fAppend 

Append to end-of-file; for eOutputFile or eIOFile.

fTruncate 

Delete contents of an existing file; for eOutputFile or eIOFile.

fNoCreate 

If the file does not exist, do not create it; for eOutputFile or eIOFile.

fCreatePath 

If needed, create directory where the file is located.

fFileFlags 

Mask for all file-related flags.

fAllowMultiple 

Repeated key arguments are legal (use with AddKey)

fIgnoreInvalidValue 

Ignore invalid argument values.

If not set, exceptions will be thrown on invalid values.

fWarnOnInvalidValue 

Post warning when an invalid value is ignored (no effect if fIgnoreInvalidValue is not set).

fOptionalSeparator 

Allow to ignore separator between the argument's name and value.

Usual ' ' or '=' separators can still be used with the argument. The following restrictions apply to a no-separator argument:

  • the argument must be a key (including optional or default);
  • the argument's name must be a single char;
  • no other argument's name can start with the same char, unless fOptionalSeparatorAllowConflict is also specified.
fOptionalSeparatorAllowConflict 

For arguments with fOptionalSeparator flag, allow other arguments which names begin with the same char.

fMandatorySeparator 

Require '=' separator.

fHidden 

Hide it in Usage.

fConfidential 

Confidential argument Such arguments can be read from command line, from file, or from console.

On command line, they can appear in one of the following forms: -key – read value from console, with automatically generated prompt -key-file fname – read value from file 'fname', if 'fname' equals '-', read value from standard input (stdin) without any prompt -key-verbatim value – read value from the command line, as is

Definition at line 614 of file ncbiargs.hpp.

◆ EFlagValue

Define how flag presence affect CArgValue::HasValue().

See also
AddFlag
Enumerator
eFlagHasValueIfMissed 
eFlagHasValueIfSet 

Definition at line 749 of file ncbiargs.hpp.

◆ EHideStdArgs

Which standard flag's descriptions should not be displayed in the usage message.

Do not display descriptions of the standard flags such as the -h, -logfile, -conffile, -version flags in the usage message. Note that you still can pass them in the command line.

Enumerator
fHideLogfile 

Hide log file description.

fHideConffile 

Hide configuration file description.

fHideVersion 

Hide version description.

fHideFullVersion 

Hide full version description.

fHideDryRun 

Hide dryrun description.

fHideHelp 

Hide help description.

fHideFullHelp 

Hide full help description.

fHideXmlHelp 

Hide XML help description.

fHideAll 

Hide all standard argument descriptions.

Definition at line 1063 of file ncbiargs.hpp.

◆ EInstantSet

Control whether the "setting" of this particular member marks the whole group as "set" regardless of the value passed to SetMinMembers()

See also
SetMinMembers(), Add()
Enumerator
eNoInstantSet 
eInstantSet 

Definition at line 1935 of file ncbiargs.hpp.

◆ EMiscFlags

Miscellaneous flags.

Enumerator
fNoUsage 

Do not print USAGE on argument error.

fUsageIfNoArgs 

Force printing USAGE (and then exit) if no command line args are present.

fUsageSortArgs 

Sort args when printing USAGE.

fDupErrToCerr 

Print arg error to both log and cerr.

fMisc_Default 

Definition at line 1027 of file ncbiargs.hpp.

◆ EPostCheckCaller

See also
x_PostCheck()
Enumerator
eCreateArgs 

called by CreateArgs()

eConvertKeys 

called by ConvertKeys()

Definition at line 1218 of file ncbiargs.hpp.

◆ ESymbolClass

Symbol class for defining sets of characters.

Symbol character classes patterned after those defined in <ctype.h>.

Enumerator
eAlnum 

Alphanumeric characters.

eAlpha 

Alphabet characters.

eCntrl 

Control characters.

eDigit 

Digit characters.

eGraph 

Graphical characters.

eLower 

Lowercase characters.

ePrint 

Printable characters.

ePunct 

Punctuation characters.

eSpace 

Space characters.

eUpper 

Uppercase characters.

eXdigit 

Hexadecimal characters.

eUser 

User defined characters using constructor with string&.

Definition at line 1540 of file ncbiargs.hpp.

◆ EType

Available argument types.

Enumerator
eString 

An arbitrary string.

eBoolean 

{'true', 't', 'false', 'f'}, case-insensitive

eInt8 

Convertible into an integer number (Int8 only)

eInteger 

Convertible into an integer number (int or Int8)

eIntId 

Convertible to TIntId (int or Int8 depending on NCBI_INT8_GI)

eDouble 

Convertible into a floating point number (double)

eInputFile 

Name of file (must exist and be readable)

eOutputFile 

Name of file (must be writable)

eIOFile 

Name of file (must be writable)

eDirectory 

Name of file directory.

eDataSize 

Integer number with possible "software" qualifiers (KB, KiB, et al)

eDateTime 

DateTime string, formats: "M/D/Y h:m:s", "Y-M-DTh:m:g", "Y/M/D h:m:g", "Y-M-D h:m:g".

Time string can have trailing 'Z' symbol, specifying that it represent time in the UTC format.

k_EType_Size 

For internal use only.

Definition at line 588 of file ncbiargs.hpp.

Function Documentation

◆ Add() [1/3]

CArgDependencyGroup & CArgDependencyGroup::Add ( CArgDependencyGroup dep_group,
EInstantSet  instant_set = eNoInstantSet 
)

Make another dependency group a member of this dependency group.

Attention
The "dep_group" will be added by reference, and its lifetime will be managed according to the usual CObject/CRef rules.
Parameters
instant_set"eInstantSet" means that if the added group ("dep_group") is set, then the SetMinMembers() condition doesn't apply anymore.
Returns
"*this"

Definition at line 4932 of file ncbiargs.cpp.

References CArgDependencyGroup::m_Groups.

◆ Add() [2/3]

void CArgs::Add ( CArgValue arg,
bool  update = false,
bool  add_value = false 
)

Add new argument name and value.

Throw an exception if the "name" is not an empty string, and if there is an argument with this name already and "update" parameter is not set.

HINT: Use empty "name" to add extra (unnamed) args, and they will be automagically assigned with the virtual names: "#1", "#2", "#3", etc.

Parameters
argargument value added to the collection
updatewhen TRUE and argument already exists it will be replaced when FALSE throws an exception
add_valuewhen TRUE and argument already exists the value is added to the string list (multiple argument)

Definition at line 1917 of file ncbiargs.cpp.

References _ASSERT, CArgValue::AsString(), set< Key, Compare >::end(), CArgValue::GetName(), set< Key, Compare >::insert(), CArgs::m_Args, CArgValue::m_Name, CArgs::m_nExtra, NCBI_THROW, CArgs::Remove(), s_ComposeNameExtra(), CArgValue::SetOrdinalPosition(), CArgValue::SetStringList(), set< Key, Compare >::size(), CArgDescriptions::VerifyName(), and CArgs::x_Find().

Referenced by CArgDescriptions::x_PostCheck().

◆ Add() [3/3]

CArgDependencyGroup & CArgDependencyGroup::Add ( const string arg_name,
EInstantSet  instant_set = eNoInstantSet 
)

Make a regular argument a member of this dependency group.

An argument with this name will need to be added separately using CArgDescriptions::AddXXX().

Parameters
arg_nameName of the argument, as specified in CArgDescriptions::AddXXX()
instant_set"eInstantSet" means that if the added argument ("arg_name") is set, then the SetMinMembers() condition doesn't apply anymore.
Returns
"*this"

Definition at line 4926 of file ncbiargs.cpp.

References CArgDependencyGroup::m_Arguments.

◆ AddAlias()

void CArgDescriptions::AddAlias ( const string alias,
const string arg_name 
)

Add argument alias.

The alias can be used in the command line instead of the original argument. Accessing argument value by its alias is not allowed (will be reported as an unknown argument). The alias will be printed in USAGE after the original argument name.

Parameters
aliasNew alias for a real argument.
arg_nameThe real argument's name.

Definition at line 2557 of file ncbiargs.cpp.

References kEmptyStr, and CArgDescriptions::x_AddDesc().

Referenced by s_AddLatencyOptions(), CPsgClientApp::s_InitRequest(), CGappedArgs::SetArgumentDescriptions(), and CInputStreamSource::SetStandardInputArgs().

◆ AddCommand()

void CCommandArgDescriptions::AddCommand ( const string cmd,
CArgDescriptions description,
const string alias = kEmptyStr,
ECommandFlags  flags = eDefault 
)

◆ AddCommandDescription()

void CArgDescriptions::CPrintUsage::AddCommandDescription ( list< string > &  arr,
const string cmd,
const map< string, string > *  aliases,
size_t  max_cmd_len,
bool  detailed 
) const

◆ AddDefaultFileArguments()

void CArgDescriptions::AddDefaultFileArguments ( const string default_config)

◆ AddDefaultKey()

void CArgDescriptions::AddDefaultKey ( const string name,
const string synopsis,
const string comment,
EType  type,
const string default_value,
TFlags  flags = 0,
const string env_var = kEmptyStr,
const char *  display_value = nullptr 
)

Add description for optional key with default value.

Optional key with default value has the following syntax:

arg_key_dflt := [-<key>

]

Will throw exception CArgException if:

  • description with name "name" already exists
  • "name" contains symbols other than {alnum, '-', '_'}
  • "name" starts with more than one '-'
  • "synopsis" contains symbols other than {alnum, '_'}
  • "flags" are inconsistent with "type"

Any argument can be later referenced using its unique name "name".

Parameters
nameName of argument key
synopsisSynopsis for argument
commentArgument description
typeArgument type
default_valueDefault value
flagsOptional flags
env_varOptional name of environment variable that contains default value
display_valueDefault value shown in Usage

Definition at line 2441 of file ncbiargs.cpp.

References flags, and CArgDescriptions::x_AddDesc().

Referenced by CFlatFileConfig::AddArgumentDescriptions(), CArgDescriptions::AddDefaultFileArguments(), CWinMaskConfig::AddWinMaskArgs(), CSdbapiTest::Init(), CAVApp::Init(), CId2FetchApp::Init(), CSdbapiSimpleApp::Init(), CDbapiTestSpeedApp::InitSample(), s_InitPsgOptions(), CPsgClientApp::s_InitRequest(), CStdCmdLineArgs::SetArgumentDescriptions(), CTaskCmdLineArgs::SetArgumentDescriptions(), COffDiagonalRangeArg::SetArgumentDescriptions(), CRMBlastNArg::SetArgumentDescriptions(), CGenericSearchArgs::SetArgumentDescriptions(), CFilteringArgs::SetArgumentDescriptions(), CCompositionBasedStatsArgs::SetArgumentDescriptions(), CLargestIntronSizeArgs::SetArgumentDescriptions(), CGeneticCodeArgs::SetArgumentDescriptions(), CGapTriggerArgs::SetArgumentDescriptions(), CPssmEngineArgs::SetArgumentDescriptions(), CPsiBlastArgs::SetArgumentDescriptions(), CKBlastpArgs::SetArgumentDescriptions(), CDeltaBlastArgs::SetArgumentDescriptions(), CMappingArgs::SetArgumentDescriptions(), CQueryOptionsArgs::SetArgumentDescriptions(), CMapperQueryOptionsArgs::SetArgumentDescriptions(), CIgBlastArgs::SetArgumentDescriptions(), CFormattingArgs::SetArgumentDescriptions(), CMapperFormattingArgs::SetArgumentDescriptions(), CMTArgs::SetArgumentDescriptions(), CMbIndexArgs::SetArgumentDescriptions(), CSRASearchModeArgs::SetArgumentDescriptions(), CMapperGenericSearchArgs::SetArgumentDescriptions(), CMapperNuclArgs::SetArgumentDescriptions(), CMapperLargestIntronSizeArgs::SetArgumentDescriptions(), CInputStreamSource::SetStandardInputArgs(), CAdvancedAlignCleanup::SetupArgDescriptions(), CSplignArgUtil::SetupArgDescriptions(), CAlignCollapser::SetupArgDescriptions(), CGnomonAnnotatorArgUtil::SetupArgDescriptions(), CChainerArgUtil::SetupArgDescriptions(), CMultAlign::SetupArgDescriptions(), CCompartOptions::SetupArgDescriptions(), CProSplignOptions_Base::SetupArgDescriptions(), CProSplignScoring::SetupArgDescriptions(), CProSplignOutputOptions::SetupArgDescriptions(), CDBLBClientApp::x_InitLookup(), CDBLBClientApp::x_InitWhereIs(), and CTbl2AsnApp::x_SetAlnArgs().

◆ AddDefaultPositional()

void CArgDescriptions::AddDefaultPositional ( const string name,
const string comment,
EType  type,
const string default_value,
TFlags  flags = 0,
const string env_var = kEmptyStr,
const char *  display_value = nullptr 
)

Add description for optional positional argument with default value.

Optional positional argument with default value has the following syntax:

arg_pos_dflt := [

]

Will throw exception CArgException if:

  • description with name "name" already exists
  • "name" contains symbols other than {alnum, '-', '_'}
  • "name" starts with more than one '-'
  • "flags" are inconsistent with "type"
See also
NOTE for AddPositional()
Parameters
nameName of argument
commentArgument description
typeArgument type
default_valueDefault value
flagsOptional flags
env_varOptional name of environment variable that contains default value
display_valueDefault value shown in Usage

Definition at line 2511 of file ncbiargs.cpp.

References flags, and CArgDescriptions::x_AddDesc().

◆ AddDependencyGroup()

void CArgDescriptions::AddDependencyGroup ( CArgDependencyGroup dep_group)

Add a dependency group.

The argument constraints specified by the dependency group(s) will be processed only after all regular dependencies for arguments and dependency groups have been processed.

Attention
The "dep_group" will be added by reference, and its lifetime will then be managed according to the usual CObject/CRef rules.
See also
SetDependency()

Definition at line 2586 of file ncbiargs.cpp.

References set< Key, Compare >::insert(), and CArgDescriptions::m_DependencyGroups.

◆ AddDescription()

void CArgDescriptions::CPrintUsage::AddDescription ( list< string > &  arr,
bool  detailed 
) const

Definition at line 3696 of file ncbiargs.cpp.

References arr, and s_PrintCommentBody().

Referenced by CArgDescriptions::PrintUsage(), and CCommandArgDescriptions::PrintUsage().

◆ AddDetails()

void CArgDescriptions::CPrintUsage::AddDetails ( list< string > &  arr) const

◆ AddExtra()

void CArgDescriptions::AddExtra ( unsigned  n_mandatory,
unsigned  n_optional,
const string comment,
EType  type,
TFlags  flags = 0 
)

Add description for the extra, unnamed positional arguments.

The name of this description is always an empty string. Names of the resulting arg.values will be: "#1", "#2", ... By default, no extra args are allowed.

To allow an unlimited # of optional argumens pass "n_optional" = kMax_UInt.

Will throw exception CArgException if:

  • description with name "name" already exists
  • "flags" are inconsistent with "type"
Parameters
n_mandatoryNumber of mandatory args
n_optionalNumber of optional args
commentArgument description
typeArgument type
flagsOptional flags

Definition at line 2528 of file ncbiargs.cpp.

References flags, kEmptyStr, CArgDescriptions::m_nExtra, CArgDescriptions::m_nExtraOpt, NCBI_THROW, and CArgDescriptions::x_AddDesc().

Referenced by CPsgClientApp::s_InitRequest().

◆ AddFlag()

void CArgDescriptions::AddFlag ( const string name,
const string comment,
CBoolEnum< EFlagValue set_value = eFlagHasValueIfSet,
TFlags  flags = 0 
)

Add description for flag argument.

Flag argument has the following syntax:

arg_flag := -<flag>, <flag> := "name"

If argument "set_value" is eFlagHasValueIfSet (TRUE), then:

  • if the flag is provided (in the command-line), then the resultant CArgValue::HasValue() will be TRUE;
  • else it will be FALSE.

Setting argument "set_value" to FALSE will reverse the above meaning.

NOTE: If CArgValue::HasValue() is TRUE, then AsBoolean() is always TRUE.

Parameters
nameName of argument
commentArgument description
flagsOptional flags

Definition at line 2459 of file ncbiargs.cpp.

References CArgDescriptions::eFlagHasValueIfSet, flags, and CArgDescriptions::x_AddDesc().

Referenced by CFlatFileConfig::AddArgumentDescriptions(), CLocalTaxon::AddArguments(), CArgDescriptions::AddStdArguments(), CWinMaskConfig::AddWinMaskArgs(), COMSSA::AppInit(), CArgDescriptions::CArgDescriptions(), CAVApp::Init(), SUApp::Init(), Cn3DNoWin::Init(), CId2FetchApp::Init(), CNcbiTestApplication::Init(), s_AddLatencyOptions(), s_CommandlessInit(), s_InitDataFlags(), s_InitDataOnly(), s_InitPsgOptions(), CPsgClientApp::s_InitRequest(), CStdCmdLineArgs::SetArgumentDescriptions(), CRMBlastNArg::SetArgumentDescriptions(), CNuclArgs::SetArgumentDescriptions(), CCompositionBasedStatsArgs::SetArgumentDescriptions(), CGappedArgs::SetArgumentDescriptions(), CPsiBlastArgs::SetArgumentDescriptions(), CDeltaBlastArgs::SetArgumentDescriptions(), CQueryOptionsArgs::SetArgumentDescriptions(), CMapperQueryOptionsArgs::SetArgumentDescriptions(), CBlastDatabaseArgs::SetArgumentDescriptions(), CIgBlastArgs::SetArgumentDescriptions(), CFormattingArgs::SetArgumentDescriptions(), CMapperFormattingArgs::SetArgumentDescriptions(), CRemoteArgs::SetArgumentDescriptions(), CDebugArgs::SetArgumentDescriptions(), CHspFilteringArgs::SetArgumentDescriptions(), CSRASearchModeArgs::SetArgumentDescriptions(), CMapperGenericSearchArgs::SetArgumentDescriptions(), CAdvancedAlignCleanup::SetupArgDescriptions(), CAlignCollapser::SetupArgDescriptions(), CGnomonAnnotatorArgUtil::SetupArgDescriptions(), CChainerArgUtil::SetupArgDescriptions(), CGridWorkerApp::SetupArgDescriptions(), CProSplignOptions_Base::SetupArgDescriptions(), CProSplignOutputOptions::SetupArgDescriptions(), CDBLBClientApp::x_InitLookup(), and CDBLBClientApp::x_InitWhereIs().

◆ AddKey()

void CArgDescriptions::AddKey ( const string name,
const string synopsis,
const string comment,
EType  type,
TFlags  flags = 0 
)

Add description for mandatory key.

Mandatory key has the syntax:

arg_key := -<key>

Will throw exception CArgException if:

  • description with name "name" already exists
  • "name" contains symbols other than {alnum, '-', '_'}
  • "name" starts with more than one '-'
  • "synopsis" contains symbols other than {alnum, '_'}
  • "flags" are inconsistent with "type"

Any argument can be later referenced using its unique name "name".

Parameters
nameName of argument key
synopsisSynopsis for argument
commentArgument description
typeArgument type
flagsOptional flags

Definition at line 2411 of file ncbiargs.cpp.

References flags, and CArgDescriptions::x_AddDesc().

Referenced by CWinMaskConfig::AddWinMaskArgs(), CAVApp::Init(), SUApp::Init(), Cn3DNoWin::Init(), CPsgClientApp::s_InitRequest(), CTaskCmdLineArgs::SetArgumentDescriptions(), CBlastDatabaseArgs::SetArgumentDescriptions(), CInputStreamSource::SetStandardInputArgs(), CGnomonAnnotatorArgUtil::SetupArgDescriptions(), CChainerArgUtil::SetupArgDescriptions(), and CDBLBClientApp::x_InitLookup().

◆ AddNegatedFlagAlias()

void CArgDescriptions::AddNegatedFlagAlias ( const string alias,
const string arg_name,
const string comment = kEmptyStr 
)

Add negated alias for a flag argument.

Using the alias in the command line produces the same effect as using the original flag with the opposite value. If 'arg_name' does not describe a flag argument, an exception is thrown.

See also
AddAlias()

Definition at line 2568 of file ncbiargs.cpp.

References set< Key, Compare >::end(), CArgDescriptions::m_Args, NCBI_THROW, orig, s_IsFlag(), CArgDescriptions::x_AddDesc(), and CArgDescriptions::x_Find().

◆ AddOpening()

void CArgDescriptions::AddOpening ( const string name,
const string comment,
EType  type,
TFlags  flags = 0 
)

Add description of mandatory opening positional argument.

Mandatory opening argument has the following syntax: arg_pos :=

NOTE: In command line, mandatory opening arguments must go first, before any other arguments; their order is defined by the order in which they were described and added into CArgDescriptions.

Will throw exception CArgException if:

  • description with name "name" already exists
  • "name" contains symbols other than {alnum, '-', '_'}
  • "name" starts with more than one '-'
  • "flags" are inconsistent with "type"

Any argument can be later referenced using its unique name "name".

Parameters
nameName of argument
commentArgument description
typeArgument type
flagsOptional flags

Definition at line 2484 of file ncbiargs.cpp.

References flags, and CArgDescriptions::x_AddDesc().

Referenced by s_InitCreate(), and s_InitPost().

◆ AddOptionalKey()

void CArgDescriptions::AddOptionalKey ( const string name,
const string synopsis,
const string comment,
EType  type,
TFlags  flags = 0 
)

Add description for optional key without default value.

Optional key without default value has the following syntax:

arg_key_opt := [-<key>

]

Will throw exception CArgException if:

  • description with name "name" already exists
  • "name" contains symbols other than {alnum, '-', '_'}
  • "name" starts with more than one '-'
  • "synopsis" contains symbols other than {alnum, '_'}
  • "flags" are inconsistent with "type"

Any argument can be later referenced using its unique name "name".

Parameters
nameName of argument key
synopsisSynopsis for argument
commentArgument description
typeArgument type
flagsOptional flags

Definition at line 2426 of file ncbiargs.cpp.

References flags, and CArgDescriptions::x_AddDesc().

Referenced by CFlatFileConfig::AddArgumentDescriptions(), CGenomicCollectionsService::AddArguments(), CLocalTaxon::AddArguments(), CArgDescriptions::AddDefaultFileArguments(), CArgDescriptions::AddStdArguments(), CWinMaskConfig::AddWinMaskArgs(), SUApp::Init(), Cn3DNoWin::Init(), CId2FetchApp::Init(), CNcbiTestApplication::Init(), CDbapiTestSpeedApp::InitSample(), CLangQueryApp::InitSample(), s_InitDataOnly(), s_InitPost(), s_InitPsgOptions(), CPsgClientApp::s_InitRequest(), CStdCmdLineArgs::SetArgumentDescriptions(), CWindowSizeArg::SetArgumentDescriptions(), CWordThresholdArg::SetArgumentDescriptions(), CMatrixNameArg::SetArgumentDescriptions(), CGenericSearchArgs::SetArgumentDescriptions(), CFilteringArgs::SetArgumentDescriptions(), CNuclArgs::SetArgumentDescriptions(), CDiscontiguousMegablastArgs::SetArgumentDescriptions(), CGappedArgs::SetArgumentDescriptions(), CFrameShiftArgs::SetArgumentDescriptions(), CSearchStrategyArgs::SetArgumentDescriptions(), CPsiBlastArgs::SetArgumentDescriptions(), CPhiBlastArgs::SetArgumentDescriptions(), CMappingArgs::SetArgumentDescriptions(), CQueryOptionsArgs::SetArgumentDescriptions(), CMapperQueryOptionsArgs::SetArgumentDescriptions(), CBlastDatabaseArgs::SetArgumentDescriptions(), CIgBlastArgs::SetArgumentDescriptions(), CFormattingArgs::SetArgumentDescriptions(), CMapperFormattingArgs::SetArgumentDescriptions(), CHspFilteringArgs::SetArgumentDescriptions(), CMbIndexArgs::SetArgumentDescriptions(), CMapperStdCmdLineArgs::SetArgumentDescriptions(), CInputStreamSource::SetStandardInputArgs(), CAdvancedAlignCleanup::SetupArgDescriptions(), CSplignArgUtil::SetupArgDescriptions(), CChainerArgUtil::SetupArgDescriptions(), CGridWorkerApp::SetupArgDescriptions(), CRemoteCgiApp::SetupArgDescriptions(), CDBLBClientApp::x_InitLookup(), and CTbl2AsnApp::x_SetAlnArgs().

◆ AddOptionalPositional()

void CArgDescriptions::AddOptionalPositional ( const string name,
const string comment,
EType  type,
TFlags  flags = 0 
)

Add description for optional positional argument without default value.

Optional positional argument, without default value has the following syntax:

arg_pos_opt := [

]

Will throw exception CArgException if:

  • description with name "name" already exists
  • "name" contains symbols other than {alnum, '-', '_'}
  • "name" starts with more than one '-'
  • "flags" are inconsistent with "type"

Any argument can be later referenced using its unique name "name".

See also
NOTE for AddPositional()
Parameters
nameName of argument
commentArgument descr.
typeArgument type
flagsOptional flags

Definition at line 2497 of file ncbiargs.cpp.

References flags, and CArgDescriptions::x_AddDesc().

Referenced by s_InitQuery(), and CPsgClientApp::s_InitRequest().

◆ AddPositional()

void CArgDescriptions::AddPositional ( const string name,
const string comment,
EType  type,
TFlags  flags = 0 
)

Add description for mandatory positional argument.

Mandatory positional argument has the following syntax:

arg_pos :=

NOTE: For all types of positional arguments:

  • The order is important! That is, the N-th positional argument passed in the cmd.-line will be matched against (and processed according to) the N-th added named positional argument description.
  • Mandatory positional args always go first.

Will throw exception CArgException if:

  • description with name "name" already exists
  • "name" contains symbols other than {alnum, '-', '_'}
  • "name" starts with more than one '-'
  • "flags" are inconsistent with "type"

Any argument can be later referenced using its unique name "name".

Parameters
nameName of argument
commentArgument description
typeArgument type
flagsOptional flags

Definition at line 2471 of file ncbiargs.cpp.

References flags, and CArgDescriptions::x_AddDesc().

Referenced by CAVApp::Init(), CSdbapiSimpleApp::Init(), s_CommandlessInit(), s_InitPost(), CPsgClientApp::s_InitRequest(), CDBLBClientApp::x_InitWhatIs(), and CDBLBClientApp::x_InitWhereIs().

◆ AddStdArguments() [1/2]

void CArgDescriptions::AddStdArguments ( THideStdArgs  mask)
virtual

◆ AddStdArguments() [2/2]

void CCommandArgDescriptions::AddStdArguments ( THideStdArgs  mask)
virtual

◆ AddSynopsis()

void CArgDescriptions::CPrintUsage::AddSynopsis ( list< string > &  arr,
const string intro,
const string prefix 
) const

◆ Allow() [1/5]

CArgAllow_Symbols & CArgAllow_Symbols::Allow ( const string symbol_set)

◆ Allow() [2/5]

CArgAllow_Strings * CArgAllow_Strings::Allow ( const string value)

◆ Allow() [3/5]

CArgAllow_Doubles & CArgAllow_Doubles::Allow ( double  value)

◆ Allow() [4/5]

CArgAllow_Symbols & CArgAllow_Symbols::Allow ( CArgAllow_Symbols::ESymbolClass  symbol_class)

Add allowed symbols.

Definition at line 4489 of file ncbiargs.cpp.

References set< Key, Compare >::insert(), kEmptyStr, and CArgAllow_Symbols::m_SymClass.

Referenced by CArgAllow_Symbols::CArgAllow_Symbols().

◆ Allow() [5/5]

CArgAllow_Int8s & CArgAllow_Int8s::Allow ( Int8  value)

◆ AllowRange() [1/2]

CArgAllow_Doubles & CArgAllow_Doubles::AllowRange ( double  from,
double  to 
)

Add allowed values.

Definition at line 4874 of file ncbiargs.cpp.

References set< Key, Compare >::insert(), and CArgAllow_Doubles::m_MinMax.

Referenced by CArgAllow_Doubles::CArgAllow_Doubles().

◆ AllowRange() [2/2]

CArgAllow_Int8s & CArgAllow_Int8s::AllowRange ( Int8  from,
Int8  to 
)

Add allow values.

Definition at line 4743 of file ncbiargs.cpp.

References set< Key, Compare >::insert(), and CArgAllow_Int8s::m_MinMax.

Referenced by CArgAllow_Int8s::CArgAllow_Int8s().

◆ AllowValue()

CArgAllow_Strings & CArgAllow_Strings::AllowValue ( const string value)

Add allowed string values.

Parameters
valueString to add to the set of allowed string values

Definition at line 4656 of file ncbiargs.cpp.

References CArgAllow_Strings::Allow(), and rapidjson::value.

Referenced by CArgAllow_Strings::operator,().

◆ AsBoolean()

virtual bool CArgValue::AsBoolean ( void  ) const
pure virtual

Get the argument's boolean value.

If you request a wrong value type, such as a call to "AsBoolean()" for a "integer" argument, an exception is thrown.

NOTE: Do not confuse HasValue(), operator bool() and AsBoolean(). The former two methods check if the argument has any value, they do not return its actual value.

See also
HasValue(), AsString(), AsInt8(), AsInteger, AsDouble()

Implemented in CArg_Boolean, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

◆ AsDateTime()

virtual const CTime& CArgValue::AsDateTime ( void  ) const
pure virtual

Get the argument as a DateTime.

Implemented in CArg_String, CArg_ExcludedValue, CArg_NoValue, and CArg_DateTime.

◆ AsDirectory()

virtual const CDir& CArgValue::AsDirectory ( void  ) const
pure virtual

Get the argument as a directory.

Implemented in CArg_String, CArg_ExcludedValue, CArg_NoValue, and CArg_Dir.

◆ AsDouble()

virtual double CArgValue::AsDouble ( void  ) const
pure virtual

Get the argument's double value.

If you request a wrong value type, such as a call to "AsDouble()" for a "boolean" argument, an exception is thrown.

See also
AsString(), AsInt8(), AsInteger, AsBoolean()

Implemented in CArg_Double, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

◆ AsInputFile()

virtual CNcbiIstream& CArgValue::AsInputFile ( TFileFlags  flags = 0) const
pure virtual

Get the argument as an input file stream.

Implemented in CArg_Ios, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

Referenced by CDataTool::GenerateCode(), and CSplignApp::x_ReadFastaSetId().

◆ AsInt8()

virtual Int8 CArgValue::AsInt8 ( void  ) const
pure virtual

Get the argument's integer (8-byte long) value.

If you request a wrong value type, such as a call to "AsInt8()" for a "boolean" argument, an exception is thrown. This will however work okay for "plain integer" argument.

See also
AsInteger(), AsString(), AsDouble, AsBoolean()

Implemented in CArg_DataSize, CArg_Int8, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

◆ AsInteger()

virtual int CArgValue::AsInteger ( void  ) const
pure virtual

Get the argument's integer value.

If you request a wrong value type, such as a call to "AsInteger()" for a "boolean" or even "Int8" argument, an exception is thrown.

See also
AsInt8(), AsString(), AsDouble, AsBoolean()

Implemented in CArg_IntId, CArg_Integer, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

Referenced by CProjBulderApp::ParseArguments().

◆ AsIntId()

virtual TIntId CArgValue::AsIntId ( void  ) const
pure virtual

Get the argument's value as an integer id (TIntId).

The actual value is Int4 or Int8 depending on the NCBI_INT8_GI definition.

If you request a wrong value type, such as a call to "AsIntId()" for a "boolean", an exception is thrown. Calling AsIntId() on an integer argument is always allowed. For an Int8 argument it will throw an exception if NCBI_INT8_GI is not defined.

See also
AsInteger(), AsInt8()

Implemented in CArg_IntId, CArg_Integer, CArg_Int8, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

◆ AsIOFile()

virtual CNcbiIostream& CArgValue::AsIOFile ( TFileFlags  flags = 0) const
pure virtual

Get the argument as a file stream.

Implemented in CArg_Ios, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

◆ AsOutputFile()

virtual CNcbiOstream& CArgValue::AsOutputFile ( TFileFlags  flags = 0) const
pure virtual

Get the argument as an output file stream.

Implemented in CArg_Ios, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

◆ Assign()

CArgs & CArgs::Assign ( const CArgs other)

Copy contents of another object into this one.

Definition at line 1770 of file ncbiargs.cpp.

References CArgs::m_Args, CArgs::m_Command, and CArgs::m_nExtra.

Referenced by CArgs::CArgs(), CCgiApplication::InitArgs(), CInputStreamSource::InitArgs(), CArgs::operator=(), and CXcompareAnnotsApplication::Run().

◆ AsString()

virtual const string& CArgValue::AsString ( void  ) const
pure virtual

Get the argument's string value.

If it is a value of a flag argument, then return either "true" or "false".

See also
AsInteger(), AsInt8(), AsDouble(), AsBoolean()

Implemented in CArg_String, CArg_ExcludedValue, and CArg_NoValue.

Referenced by CArgs::Add(), ArgToSeq_id(), CCodeGenerator::GetOpt(), CProjBulderApp::ParseArguments(), CArgs::Print(), CAsn2Asn::RunAsn2Asn(), CMakeBlastDBApp::x_ProcessMaskData(), and CSplignApp::x_ReadFastaSetId().

◆ CArgAllow()

CArgAllow::CArgAllow ( void  )
inlineprotected

Definition at line 1515 of file ncbiargs.hpp.

◆ CArgAllow_Doubles() [1/3]

CArgAllow_Doubles::CArgAllow_Doubles ( double  x_min,
double  x_max 
)

Constructor specifying range of allowed double values.

Definition at line 4814 of file ncbiargs.cpp.

References CArgAllow_Doubles::AllowRange().

◆ CArgAllow_Doubles() [2/3]

CArgAllow_Doubles::CArgAllow_Doubles ( double  x_value)

Constructor specifying an allowed double value.

Definition at line 4808 of file ncbiargs.cpp.

References CArgAllow_Doubles::Allow().

◆ CArgAllow_Doubles() [3/3]

CArgAllow_Doubles::CArgAllow_Doubles ( void  )
inlineprotected

Definition at line 1803 of file ncbiargs.hpp.

Referenced by CArgAllow_Doubles::Clone().

◆ CArgAllow_Int8s() [1/3]

CArgAllow_Int8s::CArgAllow_Int8s ( Int8  x_min,
Int8  x_max 
)

Constructor specifying range of allowed integer values.

Definition at line 4679 of file ncbiargs.cpp.

References CArgAllow_Int8s::AllowRange().

◆ CArgAllow_Int8s() [2/3]

CArgAllow_Int8s::CArgAllow_Int8s ( Int8  x_value)

Constructor specifying an allowed integer value.

Definition at line 4673 of file ncbiargs.cpp.

References CArgAllow_Int8s::Allow().

◆ CArgAllow_Int8s() [3/3]

CArgAllow_Int8s::CArgAllow_Int8s ( void  )
inlineprotected

Definition at line 1728 of file ncbiargs.hpp.

Referenced by CArgAllow_Int8s::Clone().

◆ CArgAllow_Integers() [1/3]

CArgAllow_Integers::CArgAllow_Integers ( int  x_min,
int  x_max 
)

Constructor specifying range of allowed integer values.

Definition at line 4773 of file ncbiargs.cpp.

◆ CArgAllow_Integers() [2/3]

CArgAllow_Integers::CArgAllow_Integers ( int  x_value)

Constructor specifying an allowed integer value.

Definition at line 4768 of file ncbiargs.cpp.

◆ CArgAllow_Integers() [3/3]

CArgAllow_Integers::CArgAllow_Integers ( void  )
inlineprotected

Definition at line 1762 of file ncbiargs.hpp.

Referenced by CArgAllow_Integers::Clone().

◆ CArgAllow_Regexp()

CArgAllow_Regexp::CArgAllow_Regexp ( const string pattern)
Parameters
patternPerl regexp pattern that the argument value must match
See also
CRegexp

Definition at line 45 of file arg_regexp.cpp.

Referenced by CArgAllow_Regexp::Clone().

◆ CArgAllow_String() [1/3]

CArgAllow_String::CArgAllow_String ( const string symbol_set)

Constructor for user defined eUser class.

Definition at line 4521 of file ncbiargs.cpp.

◆ CArgAllow_String() [2/3]

CArgAllow_String::CArgAllow_String ( ESymbolClass  symbol_class)

Constructor.

Definition at line 4514 of file ncbiargs.cpp.

◆ CArgAllow_String() [3/3]

CArgAllow_String::CArgAllow_String ( void  )
inlineprotected

Definition at line 1618 of file ncbiargs.hpp.

Referenced by CArgAllow_String::Clone().

◆ CArgAllow_Strings() [1/2]

CArgAllow_Strings::CArgAllow_Strings ( initializer_list< string values,
NStr::ECase  use_case = NStr::eCase 
)

Constructor.

Parameters
valuesStrings to add to the set of allowed string values
use_caseIf to ignore the case of the characters

Definition at line 4592 of file ncbiargs.cpp.

◆ CArgAllow_Strings() [2/2]

CArgAllow_Strings::CArgAllow_Strings ( NStr::ECase  use_case = NStr::eCase)

Constructor.

Parameters
use_caseIf to ignore the case of the characters

Definition at line 4584 of file ncbiargs.cpp.

Referenced by CArgAllow_Strings::Clone().

◆ CArgAllow_Symbols() [1/3]

CArgAllow_Symbols::CArgAllow_Symbols ( const string symbol_set)

Constructor for user defined eUser class.

Definition at line 4437 of file ncbiargs.cpp.

References CArgAllow_Symbols::Allow().

◆ CArgAllow_Symbols() [2/3]

CArgAllow_Symbols::CArgAllow_Symbols ( ESymbolClass  symbol_class)

Constructor.

Definition at line 4429 of file ncbiargs.cpp.

References CArgAllow_Symbols::Allow().

◆ CArgAllow_Symbols() [3/3]

CArgAllow_Symbols::CArgAllow_Symbols ( void  )
inlineprotected

Definition at line 1576 of file ncbiargs.hpp.

Referenced by CArgAllow_Symbols::Clone().

◆ CArgDependencyGroup() [1/2]

CArgDependencyGroup::CArgDependencyGroup ( const CArgDependencyGroup dep_group)
private

◆ CArgDependencyGroup() [2/2]

CArgDependencyGroup::CArgDependencyGroup ( void  )
private

Definition at line 4905 of file ncbiargs.cpp.

Referenced by CArgDependencyGroup::Create().

◆ CArgDesc()

CArgDesc::CArgDesc ( const string name,
const string comment,
CArgDescriptions::TFlags  flags = 0 
)

Constructor.

Parameters
nameArgument name
commentArgument description

Definition at line 923 of file ncbiargs.cpp.

References CArgDesc::m_Name, NCBI_THROW, and CArgDescriptions::VerifyName().

◆ CArgDescriptions()

CArgDescriptions::CArgDescriptions ( bool  auto_help = true,
CArgErrorHandler err_handler = 0 
)

Constructor.

If "auto_help" is passed TRUE, then a special flag "-h" will be added to the list of accepted arguments. Passing "-h" in the command line will printout USAGE and ignore all other passed arguments. Error handler is used to process errors when parsing arguments. If not set the default handler is used.

Definition at line 2189 of file ncbiargs.cpp.

References CArgDescriptions::AddFlag(), kEmptyStr, CArgDescriptions::m_ArgGroups, CArgDescriptions::m_AutoHelp, CArgDescriptions::m_ErrorHandler, CRef< C, Locker >::Reset(), s_AutoHelp, s_AutoHelpFull, s_AutoHelpShowAll, s_AutoHelpXml, and CArgDescriptions::SetUsageContext().

◆ CArgs() [1/2]

CArgs::CArgs ( const CArgs other)

Creating copy of this object usually makes no sense if it is really required, please use Assign method.

Definition at line 1760 of file ncbiargs.cpp.

References CArgs::Assign().

◆ CArgs() [2/2]

CArgs::CArgs ( void  )

Constructor.

Definition at line 1749 of file ncbiargs.cpp.

References CArgs::m_nExtra.

◆ CArgValue()

CArgValue::CArgValue ( const string name)
protected

Protected constructor and destructor.

Prohibit explicit instantiation of CArgValue with name.

Definition at line 151 of file ncbiargs.cpp.

References CArgValue::m_Name, NCBI_THROW, and CArgDescriptions::VerifyName().

◆ CCommandArgDescriptions()

CCommandArgDescriptions::CCommandArgDescriptions ( bool  auto_help = true,
CArgErrorHandler err_handler = 0,
TCommandArgFlags  cmd_flags = eCommandMandatory 
)

Constructor.

If "auto_help" is passed TRUE, then a special flag "-h" will be added to the list of accepted arguments. Passing "-h" in the command line will printout USAGE and ignore all other passed arguments. Error handler is used to process errors when parsing arguments. If not set the default handler is used.

Definition at line 3979 of file ncbiargs.cpp.

◆ Clone() [1/8]

CArgAllow * CArgAllow::Clone ( void  ) const
virtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented in CArgAllow_Regexp, CArgAllow_Doubles, CArgAllow_Integers, CArgAllow_Int8s, CArgAllow_Strings, CArgAllow_String, and CArgAllow_Symbols.

Definition at line 4350 of file ncbiargs.cpp.

References NULL.

Referenced by CArgDescriptions::SetConstraint().

◆ Clone() [2/8]

CArgAllow * CArgAllow_Symbols::Clone ( void  ) const
protectedvirtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented from CArgAllow.

Reimplemented in CArgAllow_String.

Definition at line 4501 of file ncbiargs.cpp.

References CArgAllow_Symbols::CArgAllow_Symbols(), and CArgAllow_Symbols::m_SymClass.

◆ Clone() [3/8]

CArgAllow * CArgAllow_String::Clone ( void  ) const
protectedvirtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented from CArgAllow_Symbols.

Definition at line 4571 of file ncbiargs.cpp.

References CArgAllow_String::CArgAllow_String(), and CArgAllow_Symbols::m_SymClass.

◆ Clone() [4/8]

CArgAllow * CArgAllow_Strings::Clone ( void  ) const
protectedvirtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented from CArgAllow.

Definition at line 4661 of file ncbiargs.cpp.

References CArgAllow_Strings::CArgAllow_Strings(), and CArgAllow_Strings::m_Strings.

◆ Clone() [5/8]

CArgAllow * CArgAllow_Int8s::Clone ( void  ) const
protectedvirtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented from CArgAllow.

Reimplemented in CArgAllow_Integers.

Definition at line 4755 of file ncbiargs.cpp.

References CArgAllow_Int8s::CArgAllow_Int8s(), and CArgAllow_Int8s::m_MinMax.

◆ Clone() [6/8]

CArgAllow * CArgAllow_Integers::Clone ( void  ) const
protectedvirtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented from CArgAllow_Int8s.

Definition at line 4796 of file ncbiargs.cpp.

References CArgAllow_Integers::CArgAllow_Integers(), and CArgAllow_Int8s::m_MinMax.

◆ Clone() [7/8]

CArgAllow * CArgAllow_Doubles::Clone ( void  ) const
protectedvirtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented from CArgAllow.

Definition at line 4886 of file ncbiargs.cpp.

References CArgAllow_Doubles::CArgAllow_Doubles(), and CArgAllow_Doubles::m_MinMax.

◆ Clone() [8/8]

CArgAllow * CArgAllow_Regexp::Clone ( void  ) const
virtual

Create object's clone, moving it from stack memory into heap.

The method is required only when using objects created on stack.

NOTE: Default implementation returns NULL. Inherited classes must override this method.

See also
CArgDescriptions::SetConstraint

Reimplemented from CArgAllow.

Definition at line 80 of file arg_regexp.cpp.

References CArgAllow_Regexp::CArgAllow_Regexp(), and CArgAllow_Regexp::m_Pattern.

◆ CloseFile()

virtual void CArgValue::CloseFile ( void  ) const
pure virtual

Close the file.

Implemented in CArg_Ios, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

◆ ConvertKeys()

template<class T >
void CArgDescriptions::ConvertKeys ( CArgs args,
const T arg_map,
bool  update 
) const
inline

◆ CPrintUsage()

CArgDescriptions::CPrintUsage::CPrintUsage ( const CArgDescriptions desc)

◆ CPrintUsageXml()

CArgDescriptions::CPrintUsageXml::CPrintUsageXml ( const CArgDescriptions desc,
CNcbiOstream out 
)

◆ Create()

CRef< CArgDependencyGroup > CArgDependencyGroup::Create ( const string name,
const string description = kEmptyStr 
)
static

Create new dependency group.

Parameters
nameName of the group
descriptionUser-provided description of the dependency group (for Usage). A generated description will be added to it.

Definition at line 4896 of file ncbiargs.cpp.

References CArgDependencyGroup::CArgDependencyGroup().

◆ CreateArgs() [1/3]

CArgs * CArgDescriptions::CreateArgs ( const CNcbiArguments argv) const
virtual

Parse command-line arguments 'argv' out of CNcbiArguments.

Reimplemented in CCommandArgDescriptions.

Definition at line 2833 of file ncbiargs.cpp.

References CArgDescriptions::CreateArgs(), kEmptyStr, CArgDescriptions::SetCurrentGroup(), and CNcbiArguments::Size().

◆ CreateArgs() [2/3]

CArgs * CCommandArgDescriptions::CreateArgs ( const CNcbiArguments argv) const
virtual

◆ CreateArgs() [3/3]

template<class TSize , class TArray >
CArgs* CArgDescriptions::CreateArgs ( TSize  argc,
TArray  argv 
) const
inline

Create parsed arguments in CArgs object.

Parse command-line arguments, and create "CArgs" args object from the passed command-line arguments "argc" and "argv".

Throw

Note
Deallocate the resulting "CArgs" object using 'delete'.
Attention
This function is not suitable for parsing URL-encoded _CGI_ arg outside of the CCgiApplication framework.

Definition at line 1279 of file ncbiargs.hpp.

References CArgDescriptions::eCgiArgs, CArgDescriptions::eCreateArgs, CArgDescriptions::GetArgsType(), i, kEmptyStr, kMax_UInt, CArgDescriptions::x_CheckAutoHelp(), CArgDescriptions::x_CreateArg(), CArgDescriptions::x_PostCheck(), and CArgDescriptions::x_PreCheck().

Referenced by CArgDescriptions::CreateArgs(), CCommandArgDescriptions::CreateArgs(), CBlastArgs::s_CreateBlastOptions(), and CNcbiApplicationAPI::SetupArgDescriptions().

◆ DECLARE_OPERATOR_BOOL()

CArgValue::DECLARE_OPERATOR_BOOL ( HasValue()  )

Synonym for HasValue().

◆ Delete()

void CArgDescriptions::Delete ( const string name)

Delete description of argument with name "name".

Extra arguments get deleted by the name passed as "".

Throw the CArgException (eSynopsis error code) exception if the specified name cannot be found.

Definition at line 2660 of file ncbiargs.cpp.

References _ASSERT, set< Key, Compare >::end(), set< Key, Compare >::erase(), CArgDescriptions::m_Args, CArgDescriptions::m_AutoHelp, CArgDescriptions::m_KeyFlagArgs, CArgDescriptions::m_nExtra, CArgDescriptions::m_nExtraOpt, CArgDescriptions::m_PosArgs, NCBI_THROW, s_AutoHelp, and CArgDescriptions::x_Find().

Referenced by CCommandArgDescriptions::AddCommand(), and CArgDescriptions::AddStdArguments().

◆ Evaluate()

void CArgDependencyGroup::Evaluate ( const CArgs args) const

Definition at line 4939 of file ncbiargs.cpp.

References CArgDependencyGroup::x_Evaluate().

◆ Exist() [1/2]

bool CArgs::Exist ( const string name) const

Check existence of argument description.

Return TRUE if arg "name" was described in the parent CArgDescriptions.

NOTE: Do not confuse this method with CArgValue::HasValue() which checks if the argument not just exists, but was assigned a value (possibly the default one).

Definition at line 1813 of file ncbiargs.cpp.

References set< Key, Compare >::end(), CArgs::m_Args, and CArgs::x_Find().

Referenced by BuildAlgorithmParametersString(), CGenomicCollectionsService::CGenomicCollectionsService(), CBlastDBAliasApp::ConvertGiFile(), CBlastDBAliasApp::CreateAliasFile(), CWinMaskConfig::CWinMaskConfig(), CMapperMTArgs::ExtractAlgorithmOptions(), CMapperQueryOptionsArgs::ExtractAlgorithmOptions(), CMapperFormattingArgs::ExtractAlgorithmOptions(), CBlastDatabaseArgs::ExtractAlgorithmOptions(), CFormattingArgs::ExtractAlgorithmOptions(), CMbIndexArgs::ExtractAlgorithmOptions(), CStdCmdLineArgs::ExtractAlgorithmOptions(), CGenericSearchArgs::ExtractAlgorithmOptions(), CFilteringArgs::ExtractAlgorithmOptions(), CNuclArgs::ExtractAlgorithmOptions(), CCompositionBasedStatsArgs::ExtractAlgorithmOptions(), CPssmEngineArgs::ExtractAlgorithmOptions(), CPsiBlastArgs::ExtractAlgorithmOptions(), CPhiBlastArgs::ExtractAlgorithmOptions(), CKBlastpArgs::ExtractAlgorithmOptions(), CDeltaBlastArgs::ExtractAlgorithmOptions(), CMappingArgs::ExtractAlgorithmOptions(), CQueryOptionsArgs::ExtractAlgorithmOptions(), CIgBlastArgs::ExtractAlgorithmOptions(), CRemoteArgs::ExtractAlgorithmOptions(), NParamsBuilder::SOneRequest::GetDataOnlyEnabled(), NParamsBuilder::SOneRequest::GetDataOnlyOutputFormat(), CSearchStrategyArgs::GetExportStream(), CSearchStrategyArgs::GetImportStream(), GetSubjectFile(), CBlastDatabaseArgs::HasBeenSet(), CMbIndexArgs::HasBeenSet(), RecoverSearchStrategy(), CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), CSeedTopApp::Run(), CTblastnApp::Run(), CIgBlastnApp::Run(), CNcbiApplogApp::Run(), CTbl2AsnApp::Run(), BlastdbCopyApplication::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CClientGenomicCollectionsSvcApplication::Run(), CSampleBasicApplication::Run(), CBlastAppArgs::SetOptions(), CBlastnAppArgs::x_CreateOptionsHandle(), CBlastpAppArgs::x_CreateOptionsHandle(), CBlastxAppArgs::x_CreateOptionsHandle(), CPsiBlastAppArgs::x_CreateOptionsHandle(), CTblastnAppArgs::x_CreateOptionsHandle(), CTblastnVdbAppArgs::x_CreateOptionsHandle(), CArgDependencyGroup::x_Evaluate(), CMTArgs::x_ExtractAlgorithmOptions(), CMakeProfileDBApp::x_InitProgramParameters(), CArgDescriptions::x_PostCheck(), CDataLoadersUtil::x_SetupASNCacheDataLoader(), CDataLoadersUtil::x_SetupBlastDataLoader(), CDataLoadersUtil::x_SetupGenbankDataLoader(), CDataLoadersUtil::x_SetupLDS2DataLoader(), CDataLoadersUtil::x_SetupSRADataLoader(), and CDataLoadersUtil::x_SetupVDBDataLoader().

◆ Exist() [2/2]

bool CArgDescriptions::Exist ( const string name) const

◆ GetAll()

vector< CRef< CArgValue > > CArgs::GetAll ( void  ) const

Get all available arguments.

Definition at line 1864 of file ncbiargs.cpp.

References a, ITERATE, and CArgs::m_Args.

Referenced by CJniUtil::GetArgsFromNcbiApp(), CArgDescriptions::x_CreateArg(), and CBlastAppArgs::x_IssueWarningsForIgnoredOptions().

◆ GetAllDescriptions() [1/2]

virtual list<CArgDescriptions*> CArgDescriptions::GetAllDescriptions ( void  )
inlinevirtual

◆ GetAllDescriptions() [2/2]

list< CArgDescriptions * > CCommandArgDescriptions::GetAllDescriptions ( void  )
virtual

◆ GetArgsType()

EArgSetType CArgDescriptions::GetArgsType ( ) const
inline

◆ GetCommand()

string CArgs::GetCommand ( void  ) const
inline

◆ GetComment()

const string& CArgDesc::GetComment ( void  ) const
inline

Get argument description.

Definition at line 1840 of file ncbiargs.hpp.

References CArgDesc::m_Comment.

Referenced by CArgDesc::PrintXml(), and CArgDescriptions::x_PrintComment().

◆ GetConstraint()

const CArgAllow * CArgDesc::GetConstraint ( void  ) const
virtual

Get argument constraint.

Reimplemented in CArgDescMandatory.

Definition at line 957 of file ncbiargs.cpp.

Referenced by CArgDesc::GetUsageConstraint(), and CArgDesc::PrintXml().

◆ GetDefault()

const string & CArgValue::GetDefault ( TArgValueFlags flags = NULL) const

Get default value of the argument.

Parameters
flagsIndicate whether the argument has default value, and if the arg's value was set from the command line or from the default value.
Returns
Default value, if specified for this argument. If the argument doesn't have a default value: empty string. If the argument is a flag: "false" or "true".

Definition at line 173 of file ncbiargs.cpp.

References CArgValue::m_Default, and CArgValue::m_Flags.

◆ GetErrCodeString() [1/2]

const char * CArgException::GetErrCodeString ( void  ) const
overridevirtual

◆ GetErrCodeString() [2/2]

const char * CArgHelpException::GetErrCodeString ( void  ) const
overridevirtual

◆ GetErrorHandler()

virtual const CArgErrorHandler* CArgDesc::GetErrorHandler ( void  ) const
inlinevirtual

Get error handler for the argument.

Reimplemented in CArgDescMandatory.

Definition at line 1883 of file ncbiargs.hpp.

◆ GetFlags()

CArgDescriptions::TFlags CArgDesc::GetFlags ( void  ) const
inline

◆ GetGroup()

virtual size_t CArgDesc::GetGroup ( void  ) const
inlinevirtual

Get argument group.

Reimplemented in CArgDesc_Flag, and CArgDescOptional.

Definition at line 1843 of file ncbiargs.hpp.

Referenced by CArgDesc::PrintXml().

◆ GetName() [1/2]

const string& CArgValue::GetName ( void  ) const
inline

◆ GetName() [2/2]

const string& CArgDesc::GetName ( void  ) const
inline

◆ GetNExtra()

size_t CArgs::GetNExtra ( void  ) const
inline

◆ GetOrdinalPosition()

size_t CArgValue::GetOrdinalPosition ( void  ) const
inline

Get ordinal position of the value.

NOTE: this is not the position in command line, rather this reflects the order in which values were added to the list.

Definition at line 304 of file ncbiargs.hpp.

References CArgValue::m_Ordinal.

◆ GetPositionalMode()

EArgPositionalMode CArgDescriptions::GetPositionalMode ( ) const
inline

◆ GetStringList()

const CArgValue::TStringArray & CArgValue::GetStringList ( ) const
virtual

Get the value list.

Reimplemented in CArg_String.

Definition at line 211 of file ncbiargs.cpp.

References THROW_CArg_NoValue.

Referenced by CArgs::Print().

◆ GetTypeName()

const char * CArgDescriptions::GetTypeName ( EType  type)
static

◆ GetUsage() [1/8]

string CArgAllow_Symbols::GetUsage ( void  ) const
protectedvirtual

Get usage information.

Implements CArgAllow.

Reimplemented in CArgAllow_String.

Definition at line 4459 of file ncbiargs.cpp.

References ITERATE, CArgAllow_Symbols::m_SymClass, pi, s_GetUsageSymbol(), and usage.

◆ GetUsage() [2/8]

string CArgAllow_String::GetUsage ( void  ) const
protectedvirtual

Get usage information.

Reimplemented from CArgAllow_Symbols.

Definition at line 4544 of file ncbiargs.cpp.

References ITERATE, CArgAllow_Symbols::m_SymClass, pi, s_GetUsageSymbol(), and usage.

◆ GetUsage() [3/8]

string CArgAllow_Strings::GetUsage ( void  ) const
protectedvirtual

◆ GetUsage() [4/8]

string CArgAllow_Int8s::GetUsage ( void  ) const
protectedvirtual

◆ GetUsage() [5/8]

string CArgAllow_Integers::GetUsage ( void  ) const
protectedvirtual

◆ GetUsage() [6/8]

string CArgAllow_Doubles::GetUsage ( void  ) const
protectedvirtual

◆ GetUsage() [7/8]

string CArgAllow_Regexp::GetUsage ( void  ) const
virtual

Get usage information.

Implements CArgAllow.

Definition at line 66 of file arg_regexp.cpp.

References CArgAllow_Regexp::m_Pattern.

◆ GetUsage() [8/8]

virtual string CArgAllow::GetUsage ( void  ) const
pure virtual

◆ GetUsageCommentAttr()

virtual string CArgDesc::GetUsageCommentAttr ( void  ) const
pure virtual

Get usage comment attribute.

Implemented in CArgDesc_Alias, CArgDesc_Flag, CArgDescMandatory, and CArgDesc_NameOnly.

Referenced by CArgDescriptions::x_PrintComment().

◆ GetUsageConstraint()

string CArgDesc::GetUsageConstraint ( void  ) const

◆ GetUsageSynopsis()

virtual string CArgDesc::GetUsageSynopsis ( bool  name_only = false) const
pure virtual

◆ HandleError()

CArgValue * CArgErrorHandler::HandleError ( const CArgDesc arg_desc,
const string value 
) const
virtual

Process invalid argument value.

The base implementation returns NULL or throws exception depending on the CArgDesc flags.

Parameters
arg_descCArgDesc object which failed to initialize.
valueString value which caused the error.
Returns
Return new CArgValue object or NULL if the argument should be ignored (as if it has not been set in the command line).

Definition at line 2166 of file ncbiargs.cpp.

References ERR_POST_X, CArgDescriptions::fIgnoreInvalidValue, CArgDescriptions::fWarnOnInvalidValue, CArgDesc::GetFlags(), CArgDesc::GetName(), CArgDesc::ProcessArgument(), rapidjson::value, and Warning().

◆ HasValue()

virtual bool CArgValue::HasValue ( void  ) const
pure virtual

Check if argument holds a value.

Argument does not hold value if it was described as optional argument without default value, and if it was not passed a value in the command line. On attempt to retrieve the value from such "no-value" argument, exception will be thrown.

NOTE: HasValue() and operator bool() check if the argument has any value, they do not return the actual value of boolean arguments. if (args["bv"]) ... - check if "bv" has any value if (args["bv"].AsBoolean()) ... - check the actual value of "bv" argument

Implemented in CArg_Flag, CArg_String, CArg_ExcludedValue, and CArg_NoValue.

Referenced by CCodeGenerator::GetOpt(), and CMakeBlastDBApp::x_ProcessMaskData().

◆ IsAutoHelpEnabled()

bool CArgDescriptions::IsAutoHelpEnabled ( void  ) const
inline

See if special flag "-h" is activated.

Definition at line 1099 of file ncbiargs.hpp.

References CArgDescriptions::m_AutoHelp.

◆ IsConstraintInverted()

virtual bool CArgDesc::IsConstraintInverted ( ) const
inlinevirtual

Returns TRUE if associated constraint is inverted (NOT)

See also
SetConstraint

Reimplemented in CArgDescMandatory.

Definition at line 1874 of file ncbiargs.hpp.

Referenced by CArgDesc::GetUsageConstraint(), and CArgDesc::PrintXml().

◆ IsEmpty()

bool CArgs::IsEmpty ( void  ) const

Check if there are no arguments in this container.

Definition at line 1955 of file ncbiargs.cpp.

References set< Key, Compare >::empty(), and CArgs::m_Args.

Referenced by CArgDescriptions::x_PostCheck().

◆ IsSetMiscFlag()

bool CArgDescriptions::IsSetMiscFlag ( EMiscFlags  flag) const
inline

Check if the flag is set.

Definition at line 1051 of file ncbiargs.hpp.

References CArgDescriptions::m_MiscFlags.

Referenced by CArgDescriptions::CPrintUsage::CPrintUsage(), and CArgDescriptions::x_PostCheck().

◆ NCBI_EXCEPTION_DEFAULT() [1/2]

CArgException::NCBI_EXCEPTION_DEFAULT ( CArgException  ,
CCoreException   
)

◆ NCBI_EXCEPTION_DEFAULT() [2/2]

CArgHelpException::NCBI_EXCEPTION_DEFAULT ( CArgHelpException  ,
CArgException   
)

◆ operator,()

CArgAllow_Strings& CArgAllow_Strings::operator, ( const string value)
inline

Short notation operator for adding allowed string values.

Parameters
valueString to add to the set of allowed string values
See also
Allow()

Definition at line 1670 of file ncbiargs.hpp.

References CArgAllow_Strings::AllowValue(), and rapidjson::value.

◆ operator<()

bool operator< ( const CRef< CArgValue > &  x,
const CRef< CArgValue > &  y 
)
inline

Definition at line 356 of file ncbiargs.hpp.

References CArgValue::GetName().

◆ operator=() [1/2]

CArgDependencyGroup& CArgDependencyGroup::operator= ( const CArgDependencyGroup )
private

◆ operator=() [2/2]

CArgs & CArgs::operator= ( const CArgs other)

Creating copy of this object usually makes no sense if it is really required, please use Assign method.

Definition at line 1765 of file ncbiargs.cpp.

References CArgs::Assign().

◆ operator[]() [1/2]

const CArgValue & CArgs::operator[] ( const string name) const

Get value of argument by name.

If the name starts with '-' (e.g. '-arg') the argument can also be found by 'arg' name if there is no another argument named 'arg'.

Throw an exception if such argument does not exist (not described in the CArgDescriptions).

Attention
CArgValue::operator bool() can return TRUE even if the argument was not specified in the command-line – if the argument has a default value.
See also
Exist() above.

Definition at line 1819 of file ncbiargs.cpp.

References set< Key, Compare >::end(), kMax_UInt, CArgs::m_Args, CArgs::m_nExtra, NCBI_THROW, s_ComposeNameExtra(), NStr::StringToUInt(), and CArgs::x_Find().

◆ operator[]() [2/2]

const CArgValue & CArgs::operator[] ( size_t  idx) const

Return N-th extra arg value, N = 1 to GetNExtra().

Definition at line 1859 of file ncbiargs.cpp.

References s_ComposeNameExtra().

◆ Print()

string & CArgs::Print ( string str) const

◆ PrintArguments()

void CArgDescriptions::CPrintUsageXml::PrintArguments ( const CArgDescriptions desc) const

◆ PrintUsage() [1/3]

void CArgDependencyGroup::PrintUsage ( list< string > &  arr,
size_t  offset 
) const

◆ PrintUsage() [2/3]

string & CArgDescriptions::PrintUsage ( string str,
bool  detailed = false 
) const
virtual

Print usage message to end of specified string.

Printout USAGE and append to the string "str" using provided argument descriptions and usage context.

Returns
Appended "str"

Reimplemented in CArgDesc_agp_validate, CDiscRepArgDescriptions, and CCommandArgDescriptions.

Definition at line 3815 of file ncbiargs.cpp.

References CArgDescriptions::CPrintUsage::AddDescription(), CArgDescriptions::CPrintUsage::AddDetails(), CArgDescriptions::CPrintUsage::AddSynopsis(), arr, NStr::Join(), kEmptyStr, CArgDescriptions::m_UsageName, and str().

Referenced by CCgiRequestProcessor::OnException(), CDiscRepArgDescriptions::PrintUsage(), CMakeScoreMethodApp::Run(), and CBlastArgs::s_CreateBlastOptions().

◆ PrintUsage() [3/3]

string & CCommandArgDescriptions::PrintUsage ( string str,
bool  detailed = false 
) const
virtual

◆ PrintUsageIfNoArgs()

void CArgDescriptions::PrintUsageIfNoArgs ( bool  do_print = true)

Print usage and exit.

Force to print USAGE unconditionally (and then exit) if no command-line args are present.

Deprecated:
Use SetMiscFlags(fUsageIfNoArgs) instead.

Definition at line 3410 of file ncbiargs.cpp.

References CArgDescriptions::fUsageIfNoArgs, CArgDescriptions::ResetMiscFlags(), and CArgDescriptions::SetMiscFlags().

◆ PrintUsageXml() [1/10]

void CArgDescriptions::PrintUsageXml ( CNcbiOstream out) const
virtual

Print argument description in XML format.

Parameters
outPrint into this output stream

Reimplemented in CCommandArgDescriptions.

Definition at line 3953 of file ncbiargs.cpp.

References out(), and CArgDescriptions::CPrintUsageXml::PrintArguments().

Referenced by CCgiRequestProcessor::ProcessHelpRequest().

◆ PrintUsageXml() [2/10]

void CCommandArgDescriptions::PrintUsageXml ( CNcbiOstream out) const
virtual

◆ PrintUsageXml() [3/10]

void CArgAllow::PrintUsageXml ( CNcbiOstream out) const
virtual

Print constraints in XML format.

Reimplemented in CArgAllow_Regexp, CArgAllow_Doubles, CArgAllow_Int8s, CArgAllow_Strings, CArgAllow_String, and CArgAllow_Symbols.

Definition at line 4346 of file ncbiargs.cpp.

Referenced by CArgDesc::PrintXml().

◆ PrintUsageXml() [4/10]

void CArgAllow_Symbols::PrintUsageXml ( CNcbiOstream out) const
protectedvirtual

Print constraints in XML format.

Reimplemented from CArgAllow.

Reimplemented in CArgAllow_String.

Definition at line 4472 of file ncbiargs.cpp.

References CArgAllow_Symbols::eUser, ITERATE, CArgAllow_Symbols::m_SymClass, out(), pi, s_GetSymbolClass(), and s_WriteXmlLine().

◆ PrintUsageXml() [5/10]

void CArgAllow_String::PrintUsageXml ( CNcbiOstream out) const
protectedvirtual

Print constraints in XML format.

Reimplemented from CArgAllow_Symbols.

Definition at line 4558 of file ncbiargs.cpp.

References CArgAllow_Symbols::eUser, ITERATE, CArgAllow_Symbols::m_SymClass, out(), pi, s_GetSymbolClass(), and s_WriteXmlLine().

◆ PrintUsageXml() [6/10]

void CArgAllow_Strings::PrintUsageXml ( CNcbiOstream out) const
protectedvirtual

Print constraints in XML format.

Reimplemented from CArgAllow.

Definition at line 4639 of file ncbiargs.cpp.

References ITERATE, CArgAllow_Strings::m_Strings, out(), and s_WriteXmlLine().

◆ PrintUsageXml() [7/10]

void CArgAllow_Int8s::PrintUsageXml ( CNcbiOstream out) const
protectedvirtual

Print constraints in XML format.

Reimplemented from CArgAllow.

Definition at line 4729 of file ncbiargs.cpp.

References NStr::Int8ToString(), ITERATE, CArgAllow_Int8s::m_MinMax, out(), pi, s_WriteXmlLine(), and tag.

◆ PrintUsageXml() [8/10]

void CArgAllow_Doubles::PrintUsageXml ( CNcbiOstream out) const
protectedvirtual

Print constraints in XML format.

Reimplemented from CArgAllow.

Definition at line 4864 of file ncbiargs.cpp.

References NStr::DoubleToString(), ITERATE, CArgAllow_Doubles::m_MinMax, out(), pi, and s_WriteXmlLine().

◆ PrintUsageXml() [9/10]

void CArgDependencyGroup::PrintUsageXml ( CNcbiOstream out) const

◆ PrintUsageXml() [10/10]

void CArgAllow_Regexp::PrintUsageXml ( CNcbiOstream out) const
virtual

Print constraints in XML format.

Reimplemented from CArgAllow.

Definition at line 72 of file arg_regexp.cpp.

References CArgAllow_Regexp::m_Pattern, and out().

◆ PrintXml()

string CArgDesc::PrintXml ( CNcbiOstream out) const

◆ ProcessArgument()

virtual CArgValue* CArgDesc::ProcessArgument ( const string value) const
pure virtual

Process argument with specified value.

Implemented in CArgDesc_Alias, CArgDesc_Flag, CArgDescMandatory, and CArgDesc_NameOnly.

Referenced by CArgErrorHandler::HandleError().

◆ ProcessDefault()

virtual CArgValue* CArgDesc::ProcessDefault ( void  ) const
pure virtual

◆ Remove()

void CArgs::Remove ( const string name)

Remove argument of name "name".

Definition at line 1903 of file ncbiargs.cpp.

References set< Key, Compare >::erase(), set< Key, Compare >::find(), and CArgs::m_Args.

Referenced by CArgs::Add(), and CPsiBlastApp::x_RunLocalPsiBlastIterations().

◆ Reset()

void CArgs::Reset ( void  )

Remove all arguments.

Definition at line 1910 of file ncbiargs.cpp.

References set< Key, Compare >::clear(), CArgs::m_Args, and CArgs::m_nExtra.

Referenced by CTbl2AsnApp::Run().

◆ ResetMiscFlags()

void CArgDescriptions::ResetMiscFlags ( TMiscFlags  flags)
inline

Clear the selected usage flags.

Definition at line 1045 of file ncbiargs.hpp.

References flags, and CArgDescriptions::m_MiscFlags.

Referenced by CArgDescriptions::PrintUsageIfNoArgs(), and CArgDescriptions::SetUsageContext().

◆ SArgDependency()

CArgDescriptions::SArgDependency::SArgDependency ( const string  arg,
EDependency  dep 
)
inline

Definition at line 1123 of file ncbiargs.hpp.

◆ SetArgsType() [1/2]

void CArgDescriptions::SetArgsType ( EArgSetType  args_type)

Set type of argument description (cmdline vs CGI).

Method performs verification of arguments, throws an exception if it finds positional args set for a CGI

Definition at line 2361 of file ncbiargs.cpp.

References CArgDescriptions::eCgiArgs, CArgDescriptions::m_ArgsType, CArgDescriptions::m_nExtra, CArgDescriptions::m_nExtraOpt, CArgDescriptions::m_PosArgs, and NCBI_THROW.

Referenced by CCgiApplication::SetupArgDescriptions().

◆ SetArgsType() [2/2]

void CCommandArgDescriptions::SetArgsType ( EArgSetType  )
inlineprivate

Definition at line 1450 of file ncbiargs.hpp.

◆ SetCommand()

CArgs* CArgs::SetCommand ( const string command)
inlineprotected

Set current command.

See also
CCommandArgDescriptions

Definition at line 473 of file ncbiargs.hpp.

References command, and CArgs::m_Command.

Referenced by CCommandArgDescriptions::CreateArgs().

◆ SetConstraint() [1/3]

void CArgDesc::SetConstraint ( const CArgAllow constraint,
CArgDescriptions::EConstraintNegate  negate = CArgDescriptions::eConstraint 
)
virtual

Set argument constraint.

Parameters
constraintThe constraint object. ATTN: A CRef must always be taken on the object by the derived class's implementation of this method!

Reimplemented in CArgDescMandatory.

Definition at line 945 of file ncbiargs.cpp.

References CArgDesc::GetName(), CArgAllow::GetUsage(), kEmptyStr, NCBI_THROW, and s_ArgExptMsg().

◆ SetConstraint() [2/3]

void CArgDescriptions::SetConstraint ( const string name,
const CArgAllow constraint,
EConstraintNegate  negate = eConstraint 
)

This version of SetConstraint doesn't take the ownership of object 'constraint'.

Rather, it creates and uses a clone of the object.

Definition at line 2605 of file ncbiargs.cpp.

References CArgAllow::Clone(), CArgDescriptions::eConstraint, NCBI_THROW, and CArgDescriptions::SetConstraint().

◆ SetConstraint() [3/3]

void CArgDescriptions::SetConstraint ( const string name,
const CArgAllow constraint,
EConstraintNegate  negate = eConstraint 
)

Set additional user defined constraint on argument value.

Constraint is defined by CArgAllow and its derived classes. The constraint object must be allocated by "new", and it must NOT be freed by "delete" after it has been passed to CArgDescriptions!

Parameters
nameName of the parameter(flag) to check
constraintThe constraint object. NOTE: A CRef will always be taken on the object, and its lifetime will be controlled by the CObject's smart-pointer mechanism.
negateFlag indicates if this is inverted(NOT) constaint
See also
See "CArgAllow_***" classes for some pre-defined constraints

Definition at line 2591 of file ncbiargs.cpp.

References CArgDescriptions::eConstraint, set< Key, Compare >::end(), CArgDescriptions::m_Args, NCBI_THROW, and CArgDescriptions::x_Find().

Referenced by CFlatFileConfig::AddArgumentDescriptions(), CWinMaskConfig::AddWinMaskArgs(), CAVApp::Init(), SUApp::Init(), Cn3DNoWin::Init(), CId2FetchApp::Init(), CDbapiTestSpeedApp::InitSample(), s_InitDataOnly(), CPsgClientApp::s_InitRequest(), CStdCmdLineArgs::SetArgumentDescriptions(), CTaskCmdLineArgs::SetArgumentDescriptions(), CWindowSizeArg::SetArgumentDescriptions(), COffDiagonalRangeArg::SetArgumentDescriptions(), CWordThresholdArg::SetArgumentDescriptions(), CRMBlastNArg::SetArgumentDescriptions(), CGenericSearchArgs::SetArgumentDescriptions(), CNuclArgs::SetArgumentDescriptions(), CDiscontiguousMegablastArgs::SetArgumentDescriptions(), CLargestIntronSizeArgs::SetArgumentDescriptions(), CFrameShiftArgs::SetArgumentDescriptions(), CGeneticCodeArgs::SetArgumentDescriptions(), CPsiBlastArgs::SetArgumentDescriptions(), CMappingArgs::SetArgumentDescriptions(), CQueryOptionsArgs::SetArgumentDescriptions(), CMapperQueryOptionsArgs::SetArgumentDescriptions(), CBlastDatabaseArgs::SetArgumentDescriptions(), CIgBlastArgs::SetArgumentDescriptions(), CFormattingArgs::SetArgumentDescriptions(), CMapperFormattingArgs::SetArgumentDescriptions(), CMTArgs::SetArgumentDescriptions(), CHspFilteringArgs::SetArgumentDescriptions(), CMapperGenericSearchArgs::SetArgumentDescriptions(), CMapperNuclArgs::SetArgumentDescriptions(), CMapperLargestIntronSizeArgs::SetArgumentDescriptions(), CArgDescriptions::SetConstraint(), CSplignArgUtil::SetupArgDescriptions(), CCompartOptions::SetupArgDescriptions(), CProSplignOutputOptions::SetupArgDescriptions(), CDBLBClientApp::x_InitLookup(), CDBLBClientApp::x_InitWhereIs(), and CTbl2AsnApp::x_SetAlnArgs().

◆ SetCurrentCommandGroup()

void CCommandArgDescriptions::SetCurrentCommandGroup ( const string group)

Set current command group name.

When printing help, commands will be arranged by group name.

Definition at line 3989 of file ncbiargs.cpp.

References CCommandArgDescriptions::m_CmdGroups, CCommandArgDescriptions::m_CurrentCmdGroup, and CCommandArgDescriptions::x_GetCommandGroupIndex().

Referenced by CCommandArgDescriptions::AddCommand().

◆ SetCurrentGroup()

void CArgDescriptions::SetCurrentGroup ( const string group)

Set current arguments group name.

When printing descriptions for optional arguments (on -help command), they will be arranged by group name. Empty group name resets the group. Arguments without group are listed first immediately after mandatory arguments.

Definition at line 2632 of file ncbiargs.cpp.

References CArgDescriptions::m_ArgGroups, CArgDescriptions::m_CurrentGroup, and CArgDescriptions::x_GetGroupIndex().

Referenced by CFlatFileConfig::AddArgumentDescriptions(), CGenomicCollectionsService::AddArguments(), CWinMaskConfig::AddWinMaskArgs(), CArgDescriptions::CreateArgs(), CStdCmdLineArgs::SetArgumentDescriptions(), CTaskCmdLineArgs::SetArgumentDescriptions(), CWindowSizeArg::SetArgumentDescriptions(), COffDiagonalRangeArg::SetArgumentDescriptions(), CWordThresholdArg::SetArgumentDescriptions(), CRMBlastNArg::SetArgumentDescriptions(), CMatrixNameArg::SetArgumentDescriptions(), CGenericSearchArgs::SetArgumentDescriptions(), CFilteringArgs::SetArgumentDescriptions(), CNuclArgs::SetArgumentDescriptions(), CDiscontiguousMegablastArgs::SetArgumentDescriptions(), CCompositionBasedStatsArgs::SetArgumentDescriptions(), CGappedArgs::SetArgumentDescriptions(), CLargestIntronSizeArgs::SetArgumentDescriptions(), CFrameShiftArgs::SetArgumentDescriptions(), CGeneticCodeArgs::SetArgumentDescriptions(), CGapTriggerArgs::SetArgumentDescriptions(), CPssmEngineArgs::SetArgumentDescriptions(), CSearchStrategyArgs::SetArgumentDescriptions(), CPsiBlastArgs::SetArgumentDescriptions(), CPhiBlastArgs::SetArgumentDescriptions(), CKBlastpArgs::SetArgumentDescriptions(), CDeltaBlastArgs::SetArgumentDescriptions(), CMappingArgs::SetArgumentDescriptions(), CQueryOptionsArgs::SetArgumentDescriptions(), CMapperQueryOptionsArgs::SetArgumentDescriptions(), CBlastDatabaseArgs::SetArgumentDescriptions(), CIgBlastArgs::SetArgumentDescriptions(), CFormattingArgs::SetArgumentDescriptions(), CMapperFormattingArgs::SetArgumentDescriptions(), CMTArgs::SetArgumentDescriptions(), CRemoteArgs::SetArgumentDescriptions(), CDebugArgs::SetArgumentDescriptions(), CHspFilteringArgs::SetArgumentDescriptions(), CMbIndexArgs::SetArgumentDescriptions(), CSRASearchModeArgs::SetArgumentDescriptions(), CMapperStdCmdLineArgs::SetArgumentDescriptions(), CMapperGenericSearchArgs::SetArgumentDescriptions(), CMapperNuclArgs::SetArgumentDescriptions(), CMapperLargestIntronSizeArgs::SetArgumentDescriptions(), CInputStreamSource::SetStandardInputArgs(), CAdvancedAlignCleanup::SetupArgDescriptions(), CSplignArgUtil::SetupArgDescriptions(), CAlignCollapser::SetupArgDescriptions(), CGnomonAnnotatorArgUtil::SetupArgDescriptions(), and CChainerArgUtil::SetupArgDescriptions().

◆ SetDependency()

void CArgDescriptions::SetDependency ( const string arg1,
EDependency  dep,
const string arg2 
)

Define a dependency.

If arg1 was specified and requires arg2, arg2 is treated as a mandatory one even if was defined as optional. If arg1 excludes arg2, arg2 must not be set even if it's mandatory. This allows to create a set of arguments exactly one of which must be set.

Definition at line 2618 of file ncbiargs.cpp.

References CArgDescriptions::eExcludes, multimap_checker< Container >::insert(), and CArgDescriptions::m_Dependencies.

Referenced by CFlatFileConfig::AddArgumentDescriptions(), CLocalTaxon::AddArguments(), s_AddLatencyOptions(), s_InitDataFlags(), s_InitDataOnly(), CPsgClientApp::s_InitRequest(), CStdCmdLineArgs::SetArgumentDescriptions(), CDiscontiguousMegablastArgs::SetArgumentDescriptions(), CFrameShiftArgs::SetArgumentDescriptions(), CSearchStrategyArgs::SetArgumentDescriptions(), CPsiBlastArgs::SetArgumentDescriptions(), CPhiBlastArgs::SetArgumentDescriptions(), CDeltaBlastArgs::SetArgumentDescriptions(), CMapperQueryOptionsArgs::SetArgumentDescriptions(), CBlastDatabaseArgs::SetArgumentDescriptions(), CFormattingArgs::SetArgumentDescriptions(), CMapperFormattingArgs::SetArgumentDescriptions(), CMTArgs::SetArgumentDescriptions(), CHspFilteringArgs::SetArgumentDescriptions(), CMapperStdCmdLineArgs::SetArgumentDescriptions(), CMapperGenericSearchArgs::SetArgumentDescriptions(), CInputStreamSource::SetStandardInputArgs(), CAdvancedAlignCleanup::SetupArgDescriptions(), CCompartOptions::SetupArgDescriptions(), CDBLBClientApp::x_InitLookup(), and CTbl2AsnApp::x_SetAlnArgs().

◆ SetDetailedDescription()

void CArgDescriptions::SetDetailedDescription ( const string usage_description)

Set detailed usage description.

In short help message, program will print short description defined in SetUsageContext method. In detailed help message, program will use detailed description defined here.

Parameters
usage_descriptionDetailed usage description
See also
SetUsageContext

Definition at line 3333 of file ncbiargs.cpp.

References CArgDescriptions::m_DetailedDescription.

◆ SetErrorHandler() [1/2]

virtual void CArgDesc::SetErrorHandler ( CArgErrorHandler )
inlinevirtual

Set error handler for the argument.

Reimplemented in CArgDescMandatory.

Definition at line 1885 of file ncbiargs.hpp.

Referenced by CArgDescriptions::x_AddDesc().

◆ SetErrorHandler() [2/2]

void CArgDescriptions::SetErrorHandler ( const string name,
CArgErrorHandler err_handler 
)

Set individual error handler for the argument.

The handler overrides the default one (if any) provided through the constructor. The same handler may be shared by several arguments. The handler object must be allocated by "new", and it must NOT be freed by "delete" after it has been passed to CArgDescriptions!

Parameters
nameName of the parameter (flag) to set handler for
err_handlerError handler

Definition at line 2642 of file ncbiargs.cpp.

References set< Key, Compare >::end(), err_handler(), CArgDescriptions::m_Args, NCBI_THROW, and CArgDescriptions::x_Find().

◆ SetGroup()

virtual void CArgDesc::SetGroup ( size_t  )
inlinevirtual

Set argument group.

Reimplemented in CArgDesc_Flag, and CArgDescOptional.

Definition at line 1845 of file ncbiargs.hpp.

Referenced by CArgDescriptions::x_AddDesc().

◆ SetMaxMembers()

CArgDependencyGroup & CArgDependencyGroup::SetMaxMembers ( size_t  max_members)
Parameters
max_membersNo more than "max_members" of members (args or immediate groups listed in this group) are allowed to be in the "set" state. If this condition is not met, then this group will be marked as "not set".
Returns
"*this"

Definition at line 4920 of file ncbiargs.cpp.

References CArgDependencyGroup::m_MaxMembers.

◆ SetMinMembers()

CArgDependencyGroup & CArgDependencyGroup::SetMinMembers ( size_t  min_members)
Parameters
min_membersMark this group as "set" (in the context of CArgDescriptions::EDependency) if at least "min_members" of its members (args or groups listed in this group) are set.
Note
This condition can be weakened by "eInstantSet" mechanism.
See also
EInstantSet
Returns
"*this"

Definition at line 4914 of file ncbiargs.cpp.

References CArgDependencyGroup::m_MinMembers.

◆ SetMiscFlags()

void CArgDescriptions::SetMiscFlags ( TMiscFlags  flags)
inline

Set the selected flags.

Definition at line 1039 of file ncbiargs.hpp.

References flags, and CArgDescriptions::m_MiscFlags.

Referenced by CArgDescriptions::PrintUsageIfNoArgs(), and CArgDescriptions::SetUsageContext().

◆ SetOrdinalPosition()

void CArgValue::SetOrdinalPosition ( size_t  pos)
inlineprotected

Definition at line 340 of file ncbiargs.hpp.

References CArgValue::m_Ordinal.

Referenced by CArgs::Add().

◆ SetPositionalMode()

void CArgDescriptions::SetPositionalMode ( EArgPositionalMode  positional_mode)
inline

Select mode for processing positional arguments.

Definition at line 582 of file ncbiargs.hpp.

References CArgDescriptions::m_PositionalMode.

◆ SetStringList()

CArgValue::TStringArray & CArgValue::SetStringList ( )
virtual

Get reference on value list for further modification.

Reimplemented in CArg_String.

Definition at line 167 of file ncbiargs.cpp.

References CArgValue::m_Name, and NCBI_THROW.

Referenced by CArgs::Add(), and CArgDescriptions::ConvertKeys().

◆ SetUsageContext()

void CArgDescriptions::SetUsageContext ( const string usage_name,
const string usage_description,
bool  usage_sort_args = false,
SIZE_TYPE  usage_width = 78 
)

◆ ShowAllArguments()

CArgDescriptions * CArgDescriptions::ShowAllArguments ( bool  show_all)

Include hidden arguments into USAGE.

Definition at line 2353 of file ncbiargs.cpp.

References CArgDescriptions::GetAllDescriptions(), and CArgDescriptions::m_HasHidden.

◆ Verify() [1/7]

bool CArgAllow_Symbols::Verify ( const string value) const
protectedvirtual

Verify if specified value is allowed.

Implements CArgAllow.

Reimplemented in CArgAllow_String.

Definition at line 4445 of file ncbiargs.cpp.

References ITERATE, CArgAllow_Symbols::m_SymClass, pi, s_IsAllowedSymbol(), and rapidjson::value.

◆ Verify() [2/7]

bool CArgAllow_String::Verify ( const string value) const
protectedvirtual

Verify if specified value is allowed.

Reimplemented from CArgAllow_Symbols.

Definition at line 4528 of file ncbiargs.cpp.

References ITERATE, CArgAllow_Symbols::m_SymClass, pi, s_IsAllowedSymbol(), and rapidjson::value.

◆ Verify() [3/7]

bool CArgAllow_Strings::Verify ( const string value) const
protectedvirtual

Verify if specified value is allowed.

Implements CArgAllow.

Definition at line 4605 of file ncbiargs.cpp.

References set< Key, Compare >::end(), set< Key, Compare >::find(), CArgAllow_Strings::m_Strings, and rapidjson::value.

◆ Verify() [4/7]

bool CArgAllow_Int8s::Verify ( const string value) const
protectedvirtual

Verify if specified value is allowed.

Implements CArgAllow.

Definition at line 4686 of file ncbiargs.cpp.

References ITERATE, CArgAllow_Int8s::m_MinMax, pi, s_StringToInt8(), val, and rapidjson::value.

◆ Verify() [5/7]

bool CArgAllow_Doubles::Verify ( const string value) const
protectedvirtual

Verify if specified value is allowed.

Implements CArgAllow.

Definition at line 4821 of file ncbiargs.cpp.

References NStr::fDecimalPosixOrLocal, ITERATE, CArgAllow_Doubles::m_MinMax, pi, NStr::StringToDouble(), val, and rapidjson::value.

◆ Verify() [6/7]

bool CArgAllow_Regexp::Verify ( const string value) const
virtual
Parameters
valueArgument value to match against the Perl regular expression
See also
CArgAllow_Regexp()

Implements CArgAllow.

Definition at line 60 of file arg_regexp.cpp.

References CArgAllow_Regexp::m_Regexp, and rapidjson::value.

◆ Verify() [7/7]

virtual bool CArgAllow::Verify ( const string value) const
pure virtual

◆ VerifyDefault()

void CArgDesc::VerifyDefault ( void  ) const
virtual

Verify argument default value.

Reimplemented in CArgDescDefault.

Definition at line 939 of file ncbiargs.cpp.

Referenced by CArgDescriptions::x_PreCheck().

◆ VerifyName()

bool CArgDescriptions::VerifyName ( const string name,
bool  extended = false 
)
static

Verify if argument "name" is spelled correctly.

Argument name can contain only alphanumeric characters, dashes ('-') and underscore ('_'), or be empty. If the leading dash is present, it must be followed by a non-dash char ('-' or '–foo' are not valid names).

Definition at line 3338 of file ncbiargs.cpp.

References isdigit(), and s_IsArgNameChar().

Referenced by CArgs::Add(), CArgDesc::CArgDesc(), CArgValue::CArgValue(), and CArgDescriptions::x_CreateArg().

◆ x_AddDesc()

void CArgDescriptions::x_AddDesc ( CArgDesc arg)
private

◆ x_CheckAutoHelp()

void CArgDescriptions::x_CheckAutoHelp ( const string arg) const
protected

Helper method for checking if auto help requested and throw CArgHelpException if help requested.

Definition at line 2840 of file ncbiargs.cpp.

References kEmptyStr, CArgDescriptions::m_AutoHelp, NCBI_THROW, s_AutoHelp, s_AutoHelpFull, s_AutoHelpShowAll, and s_AutoHelpXml.

Referenced by CCommandArgDescriptions::CreateArgs(), and CArgDescriptions::CreateArgs().

◆ x_CreateArg() [1/2]

bool CArgDescriptions::x_CreateArg ( const string arg1,
bool  have_arg2,
const string arg2,
unsigned *  n_plain,
CArgs args 
) const
private

Process arguments.

Helper method to process arguments and build a CArgs object that is passed as the args parameter.

Returns
TRUE if specified "arg2" was used.
Parameters
arg1Argument to process
have_arg2Is there an arg. that follows?
arg2Following argument
n_plainIndicates number of args
argsContains processed args

Definition at line 2857 of file ncbiargs.cpp.

References set< Key, Compare >::end(), CArgDescriptions::ePositionalMode_Loose, eq(), CArgs::GetAll(), kEmptyStr, kMax_UInt, CArgDescriptions::m_Args, CArgDescriptions::m_nExtra, CArgDescriptions::m_nExtraOpt, CArgDescriptions::m_OpeningArgs, CArgDescriptions::m_PosArgs, CArgDescriptions::m_PositionalMode, NCBI_THROW, NPOS, s_ArgDelimiter, NStr::UIntToString(), CArgDescriptions::VerifyName(), and CArgDescriptions::x_Find().

Referenced by CArgDescriptions::ConvertKeys(), and CArgDescriptions::CreateArgs().

◆ x_CreateArg() [2/2]

bool CArgDescriptions::x_CreateArg ( const string arg1,
const string name,
bool  have_arg2,
const string arg2,
unsigned int  n_plain,
CArgs args,
bool  update = false,
CArgValue **  new_value = 0 
) const
private
Returns
TRUE if specified "arg2" was used.

◆ x_Evaluate()

bool CArgDependencyGroup::x_Evaluate ( const CArgs args,
string arg_set,
string arg_unset 
) const
private

◆ x_Find() [1/4]

CArgs::TArgsI CArgs::x_Find ( const string name)
private

◆ x_Find() [2/4]

CArgs::TArgsCI CArgs::x_Find ( const string name) const
private

Find argument value with name "name".

Definition at line 1792 of file ncbiargs.cpp.

References set< Key, Compare >::end(), set< Key, Compare >::find(), CArgs::m_Args, and s_IsArgNameChar().

Referenced by CArgs::Add(), CArgs::Exist(), and CArgs::operator[]().

◆ x_Find() [3/4]

CArgDescriptions::TArgsI CArgDescriptions::x_Find ( const string name,
bool negative = NULL 
)
private

◆ x_Find() [4/4]

CArgDescriptions::TArgsCI CArgDescriptions::x_Find ( const string name,
bool negative = NULL 
) const
private

Helper method to find named parameter – const version.

'negative' (if provided) will indicate if the name referred to a negative alias.

Definition at line 2718 of file ncbiargs.cpp.

References set< Key, Compare >::end(), set< Key, Compare >::find(), CArgDesc_Alias::GetAliasedName(), CArgDesc_Alias::GetNegativeFlag(), CArgDescriptions::m_Args, negative(), and CArgDescriptions::x_Find().

◆ x_GetCommandGroupIndex()

size_t CCommandArgDescriptions::x_GetCommandGroupIndex ( const string group) const
private

◆ x_GetGroupIndex()

size_t CArgDescriptions::x_GetGroupIndex ( const string group) const
private

Get group index.

Returns group index in the m_ArgGroups, 0 for empty group name or the next group number for undefined group.

Definition at line 2755 of file ncbiargs.cpp.

References NStr::EqualNocase(), i, and CArgDescriptions::m_ArgGroups.

Referenced by CArgDescriptions::SetCurrentGroup().

◆ x_IdentifyCommand()

string CCommandArgDescriptions::x_IdentifyCommand ( const string command) const
private

◆ x_IsCommandMandatory()

bool CCommandArgDescriptions::x_IsCommandMandatory ( void  ) const
private

◆ x_IsMultiArg()

bool CArgDescriptions::x_IsMultiArg ( const string name) const
private

Returns TRUE if parameter supports multiple arguments.

Definition at line 3145 of file ncbiargs.cpp.

References set< Key, Compare >::end(), CArgDescriptions::fAllowMultiple, CArgDesc::GetFlags(), CArgDescriptions::m_Args, and CArgDescriptions::x_Find().

Referenced by CArgDescriptions::ConvertKeys().

◆ x_PostCheck()

void CArgDescriptions::x_PostCheck ( CArgs args,
unsigned int  n_plain,
EPostCheckCaller  caller 
) const
private

◆ x_PreCheck()

void CArgDescriptions::x_PreCheck ( void  ) const
private

◆ x_PrintAliasesAsXml()

void CArgDescriptions::x_PrintAliasesAsXml ( CNcbiOstream out,
const string name,
bool  negated = false 
) const
private

◆ x_PrintComment()

void CArgDescriptions::x_PrintComment ( list< string > &  arr,
const CArgDesc arg,
SIZE_TYPE  width 
) const
private

◆ x_SetDefault()

void CArgValue::x_SetDefault ( const string def_value,
bool  from_def 
)
protected

◆ ~CArgAllow()

CArgAllow::~CArgAllow ( void  )
virtual

Definition at line 4342 of file ncbiargs.cpp.

◆ ~CArgAllow_Regexp()

CArgAllow_Regexp::~CArgAllow_Regexp ( void  )
virtual

Definition at line 54 of file arg_regexp.cpp.

◆ ~CArgDependencyGroup()

CArgDependencyGroup::~CArgDependencyGroup ( void  )
virtual

Definition at line 4910 of file ncbiargs.cpp.

◆ ~CArgDesc()

CArgDesc::~CArgDesc ( void  )
virtual

Destructor.

Definition at line 933 of file ncbiargs.cpp.

◆ ~CArgDescriptions()

CArgDescriptions::~CArgDescriptions ( void  )
virtual

Destructor.

Definition at line 2224 of file ncbiargs.cpp.

◆ ~CArgs()

CArgs::~CArgs ( void  )

Destructor.

Definition at line 1755 of file ncbiargs.cpp.

◆ ~CArgValue()

CArgValue::~CArgValue ( void  )
protectedvirtual

Definition at line 161 of file ncbiargs.cpp.

◆ ~CCommandArgDescriptions()

CCommandArgDescriptions::~CCommandArgDescriptions ( void  )
virtual

Destructor.

Definition at line 3985 of file ncbiargs.cpp.

◆ ~CPrintUsage()

CArgDescriptions::CPrintUsage::~CPrintUsage ( )

Definition at line 3656 of file ncbiargs.cpp.

◆ ~CPrintUsageXml()

CArgDescriptions::CPrintUsageXml::~CPrintUsageXml ( )

Definition at line 3865 of file ncbiargs.cpp.

Variable Documentation

◆ m_Aliases

map<string,string> CCommandArgDescriptions::m_Aliases
private

◆ m_Arg

string CArgDescriptions::SArgDependency::m_Arg

Definition at line 1125 of file ncbiargs.hpp.

◆ m_ArgGroups

TArgGroups CArgDescriptions::m_ArgGroups
private

◆ m_Args [1/2]

TArgs CArgs::m_Args
private

◆ m_Args [2/2]

TArgs CArgDescriptions::m_Args
private

◆ m_args

list<const CArgDesc*> CArgDescriptions::CPrintUsage::m_args
private

Definition at line 1250 of file ncbiargs.hpp.

Referenced by CArgDescriptions::CPrintUsage::CPrintUsage().

◆ m_ArgsType

EArgSetType CArgDescriptions::m_ArgsType
private

Type of arguments.

Definition at line 1133 of file ncbiargs.hpp.

Referenced by CArgDescriptions::GetArgsType(), and CArgDescriptions::SetArgsType().

◆ m_Arguments

map<string, EInstantSet> CArgDependencyGroup::m_Arguments
private

◆ m_AutoHelp

bool CArgDescriptions::m_AutoHelp
protected

◆ m_Cmd_req

TCommandArgFlags CCommandArgDescriptions::m_Cmd_req
private

◆ m_CmdGroups

list<string> CCommandArgDescriptions::m_CmdGroups
private

◆ m_Command [1/2]

string CArgs::m_Command
private

Definition at line 486 of file ncbiargs.hpp.

Referenced by CArgs::Assign(), CArgs::GetCommand(), and CArgs::SetCommand().

◆ m_Command [2/2]

string CCommandArgDescriptions::m_Command
mutableprivate

current command

Definition at line 1464 of file ncbiargs.hpp.

Referenced by CCommandArgDescriptions::CreateArgs(), and CCommandArgDescriptions::PrintUsage().

◆ m_Commands

list<string> CCommandArgDescriptions::m_Commands
private

◆ m_Comment

string CArgDesc::m_Comment
private

Argument description.

Definition at line 1895 of file ncbiargs.hpp.

Referenced by CArgDesc::GetComment().

◆ m_CurrentCmdGroup

size_t CCommandArgDescriptions::m_CurrentCmdGroup
private

current group #

Definition at line 1463 of file ncbiargs.hpp.

Referenced by CCommandArgDescriptions::AddCommand(), and CCommandArgDescriptions::SetCurrentCommandGroup().

◆ m_CurrentGroup

size_t CArgDescriptions::m_CurrentGroup
private

Currently selected group (0 = no group)

Definition at line 1142 of file ncbiargs.hpp.

Referenced by CArgDescriptions::SetCurrentGroup(), and CArgDescriptions::x_AddDesc().

◆ m_Default

string CArgValue::m_Default
protected

Definition at line 348 of file ncbiargs.hpp.

Referenced by CArgValue::GetDefault(), and CArgValue::x_SetDefault().

◆ m_Dep

EDependency CArgDescriptions::SArgDependency::m_Dep

Definition at line 1126 of file ncbiargs.hpp.

◆ m_Dependencies

TDependencies CArgDescriptions::m_Dependencies
private

◆ m_DependencyGroups

set< CConstRef<CArgDependencyGroup> > CArgDescriptions::m_DependencyGroups
private

◆ m_desc [1/2]

const CArgDescriptions& CArgDescriptions::CPrintUsage::m_desc
private

Definition at line 1249 of file ncbiargs.hpp.

◆ m_desc [2/2]

const CArgDescriptions& CArgDescriptions::CPrintUsageXml::m_desc
private

Definition at line 1259 of file ncbiargs.hpp.

◆ m_Description [1/2]

TDescriptions CCommandArgDescriptions::m_Description
private

◆ m_Description [2/2]

string CArgDependencyGroup::m_Description
private

◆ m_DetailedDescription

string CArgDescriptions::m_DetailedDescription
protected

Program long description.

Definition at line 1152 of file ncbiargs.hpp.

Referenced by CArgDescriptions::CPrintUsageXml::CPrintUsageXml(), and CArgDescriptions::SetDetailedDescription().

◆ m_ErrorHandler

CRef<CArgErrorHandler> CArgDescriptions::m_ErrorHandler
private

Global error handler or NULL.

Definition at line 1160 of file ncbiargs.hpp.

Referenced by CArgDescriptions::CArgDescriptions(), and CArgDescriptions::x_AddDesc().

◆ m_Flags [1/2]

TArgValueFlags CArgValue::m_Flags
protected

Definition at line 349 of file ncbiargs.hpp.

Referenced by CArgValue::GetDefault(), and CArgValue::x_SetDefault().

◆ m_Flags [2/2]

CArgDescriptions::TFlags CArgDesc::m_Flags
private

Definition at line 1896 of file ncbiargs.hpp.

Referenced by CArgDesc::GetFlags().

◆ m_Groups [1/2]

map<string, size_t > CCommandArgDescriptions::m_Groups
private

◆ m_Groups [2/2]

map<CConstRef<CArgDependencyGroup>, EInstantSet> CArgDependencyGroup::m_Groups
private

◆ m_HasHidden

bool CArgDescriptions::m_HasHidden
protected

◆ m_KeyFlagArgs

TKeyFlagArgs CArgDescriptions::m_KeyFlagArgs
private

◆ m_MaxMembers

size_t CArgDependencyGroup::m_MaxMembers
private

◆ m_MinMax [1/2]

set< TInterval > CArgAllow_Int8s::m_MinMax
protected

◆ m_MinMax [2/2]

set< TInterval > CArgAllow_Doubles::m_MinMax
protected

◆ m_MinMembers

size_t CArgDependencyGroup::m_MinMembers
private

◆ m_MiscFlags

TMiscFlags CArgDescriptions::m_MiscFlags
private

Flags for USAGE, error handling etc.

Definition at line 1145 of file ncbiargs.hpp.

Referenced by CArgDescriptions::IsSetMiscFlag(), CArgDescriptions::ResetMiscFlags(), and CArgDescriptions::SetMiscFlags().

◆ m_Name [1/3]

string CArgValue::m_Name
protected

Argument name.

Definition at line 346 of file ncbiargs.hpp.

Referenced by CArgs::Add(), CArgValue::CArgValue(), CArgValue::GetName(), and CArgValue::SetStringList().

◆ m_Name [2/3]

string CArgDesc::m_Name
private

Argument name.

Definition at line 1894 of file ncbiargs.hpp.

Referenced by CArgDesc::CArgDesc(), and CArgDesc::GetName().

◆ m_Name [3/3]

string CArgDependencyGroup::m_Name
private

◆ m_nExtra [1/2]

size_t CArgs::m_nExtra
private

Cached # of unnamed positional arguments.

Definition at line 485 of file ncbiargs.hpp.

Referenced by CArgs::Add(), CArgs::Assign(), CArgs::CArgs(), CArgs::GetNExtra(), CArgs::operator[](), and CArgs::Reset().

◆ m_nExtra [2/2]

unsigned CArgDescriptions::m_nExtra
private

◆ m_nExtraOpt

unsigned CArgDescriptions::m_nExtraOpt
private

◆ m_NoSeparator

string CArgDescriptions::m_NoSeparator
private

Arguments allowed to use no separator.

Definition at line 1138 of file ncbiargs.hpp.

Referenced by CArgDescriptions::x_AddDesc(), and CArgDescriptions::x_PreCheck().

◆ m_OpeningArgs

TPosArgs CArgDescriptions::m_OpeningArgs
private

◆ m_Ordinal

size_t CArgValue::m_Ordinal
protected

Definition at line 347 of file ncbiargs.hpp.

Referenced by CArgValue::GetOrdinalPosition(), and CArgValue::SetOrdinalPosition().

◆ m_out

CNcbiOstream& CArgDescriptions::CPrintUsageXml::m_out
private

Definition at line 1260 of file ncbiargs.hpp.

Referenced by CArgDescriptions::CPrintUsageXml::CPrintUsageXml().

◆ m_Pattern

const string CArgAllow_Regexp::m_Pattern
private

Regexp pattern to match against.

Definition at line 84 of file arg_regexp.hpp.

Referenced by CArgAllow_Regexp::Clone(), CArgAllow_Regexp::GetUsage(), and CArgAllow_Regexp::PrintUsageXml().

◆ m_PosArgs

TPosArgs CArgDescriptions::m_PosArgs
private

◆ m_PositionalMode

EArgPositionalMode CArgDescriptions::m_PositionalMode
private

Processing of positional args.

Definition at line 1143 of file ncbiargs.hpp.

Referenced by CArgDescriptions::GetPositionalMode(), CArgDescriptions::SetPositionalMode(), and CArgDescriptions::x_CreateArg().

◆ m_Regexp

CRegexp CArgAllow_Regexp::m_Regexp
private

Pre-compiled regexp.

Definition at line 85 of file arg_regexp.hpp.

Referenced by CArgAllow_Regexp::Verify().

◆ m_Strings

TStrings CArgAllow_Strings::m_Strings
protected

◆ m_SymClass

set< TSymClass > CArgAllow_Symbols::m_SymClass
protected

◆ m_UsageDescription

string CArgDescriptions::m_UsageDescription
protected

Program description.

Definition at line 1151 of file ncbiargs.hpp.

Referenced by CArgDescriptions::CPrintUsageXml::CPrintUsageXml(), and CArgDescriptions::SetUsageContext().

◆ m_UsageName

string CArgDescriptions::m_UsageName
protected

◆ m_UsageWidth

SIZE_TYPE CArgDescriptions::m_UsageWidth
protected

Maximum length of a usage line.

Definition at line 1153 of file ncbiargs.hpp.

Referenced by CArgDescriptions::SetUsageContext().

Friends

◆ CArgDesc_Flag

friend class CArgDesc_Flag
friend

Definition at line 332 of file ncbiargs.hpp.

◆ CArgDescDefault

friend class CArgDescDefault
friend

Definition at line 330 of file ncbiargs.hpp.

◆ CArgDescMandatory

friend class CArgDescMandatory
friend

Definition at line 331 of file ncbiargs.hpp.

◆ CArgs

friend class CArgs
friend

Definition at line 329 of file ncbiargs.hpp.

◆ CCommandArgDescriptions [1/2]

friend class CCommandArgDescriptions
friend

Definition at line 491 of file ncbiargs.hpp.

◆ CCommandArgDescriptions [2/2]

friend class CCommandArgDescriptions
friend

Definition at line 1156 of file ncbiargs.hpp.

Modified on Fri Apr 26 16:26:23 2024 by modify_doxy.py rev. 669887