A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/ncbiargs_8hpp_source.html below:

NCBI C++ ToolKit: include/corelib/ncbiargs.hpp Source File

1 #ifndef CORELIB___NCBIARGS__HPP 2 #define CORELIB___NCBIARGS__HPP 187  const string

&

GetName

(

void

)

const

{

return

m_Name; }

211  virtual const string

&

AsString

(

void

)

const

= 0;

266

fTruncate = (1 << 12),

268

fCreatePath = (1 << 8)

327

fArgValue_HasDefault = (1 << 0),

328

fArgValue_FromDefault = (1 << 1)

366  void

x_SetDefault(

const string

& def_value,

bool

from_def);

428  bool

Exist(

const string

& name)

const

;

442  const CArgValue

& operator[] (

const string

& name)

const

;

448  const CArgValue

& operator[] (

size_t

idx)

const

;

451 

vector< CRef<CArgValue> > GetAll(

void

)

const

;

454  string

&

Print

(

string

&

str

)

const

;

474  bool

update =

false

,

475  bool

add_value =

false

);

478  bool

IsEmpty(

void

)

const

;

481  void

Remove(

const string

& name);

512  TArgsCI

x_Find(

const string

& name)

const

;

513  TArgsI

x_Find(

const string

& name);

541  const string

&

value

)

const

;

590  void

SetArgsType(EArgSetType args_type);

601

ePositionalMode_Loose

606

{ m_PositionalMode = positional_mode; }

631  static const char

* GetTypeName(EType

type

);

647 

fTruncate = (1 << 12),

651 

fCreatePath = (1 << 8),

654 

fFileFlags = fPreOpen | fBinary | fAppend | fTruncate |

fNoCreate

| fCreatePath,

658 

fAllowMultiple = (1 << 3),

664 

fIgnoreInvalidValue = (1 << 4),

667 

fWarnOnInvalidValue = (1 << 5),

676 

fOptionalSeparator = (1 << 6),

679 

fOptionalSeparatorAllowConflict = (1 << 9),

682 

fMandatorySeparator = (1 << 7),

697 

fConfidential = (1 << 13),

700 

fStandard = (1 << 14)

718  void

AddKey(

const string

& name,

719  const string

& synopsis,

720  const string

& comment,

739  void

AddOptionalKey(

const string

& name,

740  const string

& synopsis,

741  const string

& comment,

760  void

AddDefaultKey(

const string

& name,

761  const string

& synopsis,

762  const string

& comment,

764  const string

& default_value,

770  const char

* display_value =

nullptr 776

eFlagHasValueIfMissed = 0,

777

eFlagHasValueIfSet = 1

795  void

AddFlag(

const string

& name,

796  const string

& comment,

818  void

AddOpening(

const string

& name,

819  const string

& comment,

843  void

AddPositional(

const string

& name,

844  const string

& comment,

866  void

AddOptionalPositional(

const string

& name,

867  const string

& comment,

887  void

AddDefaultPositional(

const string

& name,

888  const string

& comment,

890  const string

& default_value,

896  const char

* display_value =

nullptr 911  void

AddExtra(

unsigned

n_mandatory,

913  const string

& comment,

931  void

AddAlias(

const string

& alias,

const string

& arg_name);

939  void

AddNegatedFlagAlias(

const string

& alias,

940  const string

& arg_name,

976  void

SetConstraint(

const string

& name,

978

EConstraintNegate negate = eConstraint);

982  void

SetConstraint(

const string

& name,

984

EConstraintNegate negate = eConstraint);

997  void

SetDependency(

const string

& arg1,

999  const string

& arg2);

1005  void

SetCurrentGroup(

const string

& group);

1017  void

SetErrorHandler(

const string

& name,

1021  bool

Exist(

const string

& name)

const

;

1028  void

Delete(

const string

& name);

1034  void

SetUsageContext(

const string

& usage_name,

1035  const string

& usage_description,

1036  bool

usage_sort_args =

false

,

1049  void

SetDetailedDescription(

const string

& usage_description);

1061

fUsageIfNoArgs = 1 << 1,

1063 

fUsageSortArgs = 1 << 2,

1064

fDupErrToCerr = 1 << 3,

1073

m_MiscFlags |=

flags

;

1079

m_MiscFlags &= ~

flags

;

1085  return

(m_MiscFlags & flag) != 0;

1096

fHideLogfile = 0x01,

1097

fHideConffile = 0x02,

1098

fHideVersion = 0x04,

1099

fHideFullVersion = 0x08,

1102

fHideFullHelp = 0x40,

1103

fHideXmlHelp = 0x80,

1114  virtual string

& PrintUsage(

string

&

str

,

bool

detailed =

false

)

const

;

1128  static bool

VerifyName(

const string

& name,

bool

extended =

false

);

1140  virtual void

AddStdArguments(THideStdArgs

mask

);

1142  void

AddDefaultFileArguments(

const string

& default_config);

1156

: m_Arg(arg), m_Dep(dep) {}

1197  bool

negated=

false

)

const

;

1233  const string

& arg2,

1241  const string

& name,

1243  const string

& arg2,

1244  unsigned int

n_plain,

1246  bool

update =

false

,

1256  unsigned int

n_plain,

1275  void

AddSynopsis(list<string>&

arr

,

const string

& intro,

const string

& prefix)

const

;

1276  void

AddDescription(list<string>&

arr

,

bool

detailed)

const

;

1277  void

AddCommandDescription(list<string>&

arr

,

const string

&

cmd

,

1279  void

AddDetails(list<string>&

arr

)

const

;

1310  template

<

class

TSize,

class

TArray>

1317

unique_ptr<CArgs> args(

new CArgs

());

1320  if

(GetArgsType() == eCgiArgs && argc == 2) {

1321

x_CheckAutoHelp(argv[1]);

1322  return

args.release();

1327  for

(TSize

i

= 1;

i

< argc;

i

++) {

1328  bool

have_arg2 = (

i

+ 1 < argc);

1329  if

( x_CreateArg(argv[

i

], have_arg2,

1330

have_arg2 ? (

string

) argv[

i

+1] :

kEmptyStr

,

1331

&n_plain, *args) ) {

1342

x_PostCheck(*args, n_plain, eCreateArgs);

1343  return

args.release();

1359  const string

& param_name = *it;

1362  typename

T::const_iterator vit = arg_map.find(param_name);

1363  typename

T::const_iterator vend = arg_map.end();

1367

x_CreateArg(param_name, param_name,

1375  if

(new_arg_value && x_IsMultiArg(param_name)) {

1380  for

(++vit; vit != vend; ++vit) {

1381  if

(vit->first != param_name)

1383

varr.push_back(vit->second);

1390

x_PostCheck(*args, 0, eConvertKeys);

1394  return

list<CArgDescriptions*>({

this

});

1417

eCommandMandatory = 0,

1418

eCommandOptional = 1,

1419

eNoSortCommands = (1<<1),

1420

eNoSortGroups = (1<<2)

1439  void

SetCurrentCommandGroup(

const string

& group);

1462  virtual void

AddStdArguments(THideStdArgs

mask

);

1470  virtual string

& PrintUsage(

string

&

str

,

bool

detailed =

false

)

const

;

1478  virtual

list<CArgDescriptions*> GetAllDescriptions(

void

);

1484  bool

x_IsCommandMandatory(

void

)

const

;

1485  size_t

x_GetCommandGroupIndex(

const string

& group)

const

;

1486  string

x_IdentifyCommand(

const string

&

command

)

const

;

1541  virtual CArgAllow

* Clone(

void

)

const

;

1600  virtual bool

Verify(

const string

&

value

)

const

;

1603  virtual string

GetUsage(

void

)

const

;

1610  virtual CArgAllow

* Clone(

void

)

const

;

1642  virtual bool

Verify(

const string

&

value

)

const

;

1645  virtual string

GetUsage(

void

)

const

;

1652  virtual CArgAllow

* Clone(

void

)

const

;

1703  return

AllowValue(

value

);

1708  virtual bool

Verify(

const string

&

value

)

const

;

1711  virtual string

GetUsage(

void

)

const

;

1716  virtual CArgAllow

* Clone(

void

)

const

;

1752  virtual bool

Verify(

const string

&

value

)

const

;

1755  virtual string

GetUsage(

void

)

const

;

1762  virtual CArgAllow

* Clone(

void

)

const

;

1792  virtual string

GetUsage(

void

)

const

;

1796  virtual CArgAllow

* Clone(

void

)

const

;

1827  virtual bool

Verify(

const string

&

value

)

const

;

1830  virtual string

GetUsage(

void

)

const

;

1837  virtual CArgAllow

* Clone(

void

)

const

;

1861  const string

& comment,

1869  const string

&

GetName

(

void

)

const

{

return

m_Name; }

1892  virtual void

VerifyDefault (

void

)

const

;

1900  void

SetConstraint(

const CArgAllow

* constraint,

1909  virtual const CArgAllow

* GetConstraint(

void

)

const

;

1912  string

GetUsageConstraint(

void

)

const

;

1943  const string

& name,

const string

& description =

kEmptyStr

);

1982

EInstantSet instant_set = eNoInstantSet);

1993

EInstantSet instant_set = eNoInstantSet);

1996  bool

x_Evaluate(

const CArgs

& args,

string

* arg_set,

string

* arg_unset)

const

;

2010  void

PrintUsage(list<string>&

arr

,

size_t offset

)

const

;

2012  void

Evaluate(

const CArgs

& args)

const

;

ncbi::TMaskedQueryRegions mask

Template used to replace bool type arguments with some strict equivalent.

CCommandArgDescriptions –.

container_type::const_iterator const_iterator

parent_type::iterator iterator

parent_type::const_iterator const_iterator

void Print(const CCompactSAMApplication::AlignInfo &ai)

static vector< string > arr

std::ofstream out("events_result.xml")

main entry point for tests

static int err_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr)

static const char * str(char *buf, int n)

#define NCBI_DEPRECATED_CTOR(decl)

Macro used to mark a constructor as deprecated.

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

virtual list< CArgDescriptions * > GetAllDescriptions(void)

EFlags

Additional flags, the first group is file related flags.

size_t GetOrdinalPosition(void) const

Get ordinal position of the value.

unsigned int TCommandArgFlags

Bitwise OR of ECommandArgFlags.

TArgs::const_iterator TArgsCI

Type for const iterator.

virtual bool AsBoolean(void) const =0

Get the argument's boolean value.

TArgGroups m_ArgGroups

Argument groups.

virtual CArgValue * ProcessDefault(void) const =0

Process argument default.

CArgs * CreateArgs(TSize argc, TArray argv) const

Create parsed arguments in CArgs object.

CArgDescriptions::TFlags GetFlags(void) const

Get argument flags.

void x_CheckAutoHelp(const string &arg) const

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

map< string, EInstantSet > m_Arguments

TArgsI x_Find(const string &name, bool *negative=NULL)

Helper method to find named parameter.

set< string, PNocase_Conditional > TStrings

Type of the container that contains the allowed string values.

string m_Name

Argument name.

virtual const string & AsString(void) const =0

Get the argument's string value.

list< const CArgDesc * > m_args

virtual double AsDouble(void) const =0

Get the argument's double value.

void x_PrintAliasesAsXml(CNcbiOstream &out, const string &name, bool negated=false) const

string m_Command

current command

map< CConstRef< CArgDependencyGroup >, EInstantSet > m_Groups

TArgs m_Args

Assoc.map of arguments' name/descr.

string m_Name

Argument name.

CRef< CArgErrorHandler > m_ErrorHandler

Global error handler or NULL.

size_t x_GetGroupIndex(const string &group) const

Get group index.

const string & GetName(void) const

Get argument name.

virtual string GetUsageSynopsis(bool name_only=false) const =0

Get usage synopsis.

TPosArgs m_OpeningArgs

Opening args, ordered by position in cmd.-line.

CArgDependencyGroup(const CArgDependencyGroup &dep_group)

set< AutoPtr< CArgDesc > > TArgs

Argument descr. type.

set< CRef< CArgValue > > TArgs

Type for arguments.

EMiscFlags

Miscellaneous flags.

void SetMiscFlags(TMiscFlags flags)

Set the selected flags.

SIZE_TYPE m_UsageWidth

Maximum length of a usage line.

multimap< string, SArgDependency > TDependencies

virtual const CDir & AsDirectory(void) const =0

Get the argument as a directory.

void SetArgsType(EArgSetType)

bool IsAutoHelpEnabled(void) const

See if special flag "-h" is activated.

TStrings m_Strings

Set of allowed string values.

list< string > m_CmdGroups

group names, and order

virtual const CArgErrorHandler * GetErrorHandler(void) const

Get error handler for the argument.

size_t IsStandard(void) const

Checks that this is a standard/special argument.

string m_Comment

Argument description.

TDependencies::const_iterator TDependency_CI

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

virtual void SetErrorHandler(CArgErrorHandler *)

Set error handler for the argument.

void SetPositionalMode(EArgPositionalMode positional_mode)

Select mode for processing positional arguments.

virtual bool IsConstraintInverted() const

Returns TRUE if associated constraint is inverted (NOT)

unsigned int TFileFlags

Bitwise OR of "EFileFlags".

EErrCode

Error types for improperly formatted arguments.

vector< string > TArgGroups

Argument groups.

void x_PreCheck(void) const

Helper method for doing pre-processing consistency checks.

EArgSetType GetArgsType() const

virtual CNcbiIostream & AsIOFile(TFileFlags flags=0) const =0

Get the argument as a file stream.

virtual string GetUsage(void) const =0

Get usage information.

CArgAllow_Strings & operator,(const string &value)

Short notation operator for adding allowed string values.

EArgPositionalMode GetPositionalMode() const

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

CArgs * SetCommand(const string &command)

Set current command.

virtual CNcbiIstream & AsInputFile(TFileFlags flags=0) const =0

Get the argument as an input file stream.

TArgs::iterator TArgsI

Type for iterator.

bool x_CreateArg(const string &arg1, bool have_arg2, const string &arg2, unsigned *n_plain, CArgs &args) const

Process arguments.

void ResetMiscFlags(TMiscFlags flags)

Clear the selected usage flags.

virtual string GetUsageCommentAttr(void) const =0

Get usage comment attribute.

string m_UsageName

Program name.

SArgDependency(const string arg, EDependency dep)

NCBI_EXCEPTION_DEFAULT(CArgException, CCoreException)

EArgSetType m_ArgsType

Type of arguments.

const string & GetName(void) const

Get argument name.

void SetOrdinalPosition(size_t pos)

set< TSymClass > m_SymClass

CArgDescriptions::TFlags m_Flags

string GetCommand(void) const

Get current command.

EArgValueFlags

Whether the argument:

size_t m_CurrentCmdGroup

current group #

pair< double, double > TInterval

set< CConstRef< CArgDependencyGroup > > m_DependencyGroups

virtual void SetGroup(size_t)

Set argument group.

map< string, AutoPtr< CArgDescriptions > > TDescriptions

virtual bool Verify(const string &value) const =0

Verify if specified value is allowed.

list< string > m_Commands

command names, and order

TArgs::iterator TArgsI

Arguments iterator.

EArgSetType

Type of CArgDescriptions For a CGI application positional arguments and flags does not make sense (th...

bool m_HasHidden

Has hidden arguments.

TDependencies m_Dependencies

Arguments' dependencies.

map< string, string > m_Aliases

command to alias; one alias only

virtual CNcbiOstream & AsOutputFile(TFileFlags flags=0) const =0

Get the argument as an output file stream.

unsigned int TFlags

Bitwise OR of "EFlags".

virtual bool HasValue(void) const =0

Check if argument holds a value.

DECLARE_OPERATOR_BOOL(HasValue())

Synonym for HasValue().

TArgs m_Args

Assoc. map of arguments' name/value.

size_t m_nExtra

Cached # of unnamed positional arguments.

void ConvertKeys(CArgs *args, const T &arg_map, bool update) const

Convert argument map (key-value pairs) into arguments in accordance with the argument descriptions.

set< TInterval > m_MinMax

EFlagValue

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

list< string > TKeyFlagArgs

List of flag arguments.

virtual CArgValue * ProcessArgument(const string &value) const =0

Process argument with specified value.

EDependency

Dependencies between arguments.

void x_AddDesc(CArgDesc &arg)

Helper method for adding description.

virtual size_t GetGroup(void) const

Get argument group.

EInstantSet

Control whether the "setting" of this particular member marks the whole group as "set" regardless of ...

size_t m_CurrentGroup

Currently selected group (0 = no group)

virtual void CloseFile(void) const =0

Close the file.

string m_DetailedDescription

Program long description.

EType

Available argument types.

TMiscFlags m_MiscFlags

Flags for USAGE, error handling etc.

string m_UsageDescription

Program description.

TDescriptions m_Description

command to ArgDescriptions

virtual int AsInteger(void) const =0

Get the argument's integer value.

const string & GetComment(void) const

Get argument description.

EHideStdArgs

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

string m_NoSeparator

Arguments allowed to use no separator.

virtual TStringArray & SetStringList()

Get reference on value list for further modification.

int THideStdArgs

Binary OR of "EHideStdArgs".

unsigned int TArgValueFlags

Bitwise OR of "EArgValueFlags".

virtual const CTime & AsDateTime(void) const =0

Get the argument as a DateTime.

bool m_AutoHelp

Special flag "-h" activated.

EArgPositionalMode

Processing of positional arguments.

TArgs::const_iterator TArgsCI

Const arguments iterator.

pair< ESymbolClass, string > TSymClass

vector< string > TStringArray

Some values types can contain several value lists.

set< TInterval > m_MinMax

vector< string > TPosArgs

Positional arg. vector.

ESymbolClass

Symbol class for defining sets of characters.

const CArgDescriptions & m_desc

const CArgDescriptions & m_desc

EArgPositionalMode m_PositionalMode

Processing of positional args.

virtual Int8 AsInt8(void) const =0

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

unsigned m_nExtraOpt

> # of mandatory extra args

virtual TIntId AsIntId(void) const =0

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

TKeyFlagArgs m_KeyFlagArgs

Key/flag args, in order of insertion.

EConstraintNegate

Flag to invert constraint logically.

size_t GetNExtra(void) const

Get the number of unnamed positional (a.k.a. extra) args.

map< string, size_t > m_Groups

command to group #

bool 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

TPosArgs m_PosArgs

Pos. args, ordered by position in cmd.-line.

bool x_IsMultiArg(const string &name) const

Returns TRUE if parameter supports multiple arguments.

pair< Int8, Int8 > TInterval

int TMiscFlags

Bitwise OR of "EMiscFlags".

TCommandArgFlags m_Cmd_req

void x_PostCheck(CArgs &args, unsigned int n_plain, EPostCheckCaller caller) const

Helper method for doing post-processing consistency checks.

bool IsSetMiscFlag(EMiscFlags flag) const

Check if the flag is set.

NCBI_EXCEPTION_DEFAULT(CArgHelpException, CArgException)

@ eConvertKeys

called by ConvertKeys()

@ eCreateArgs

called by CreateArgs()

@ eHelpShowAll

Error code for detailed help message which includes hidden arguments.

@ eHelp

Error code for short help message.

@ eHelpXml

Error code for XML formatted help message.

@ eHelpFull

Error code for detailed help message.

@ eExcludedValue

The value is excluded by another argument.

@ eNoFile

Expecting a file.

@ eNoValue

Expecting an argument value.

@ eWrongCast

Incorrect cast for an argument.

@ eArgType

Wrong argument type.

@ eConvert

Conversion problem.

@ eConstraint

Argument value outside constraints.

@ eInvalidArg

Invalid argument.

@ eRegularArgs

Regular application.

@ eRequires

One argument requires another.

@ eInt8

Convertible into an integer number (Int8 only)

@ eInputFile

Name of file (must exist and be readable)

@ eBoolean

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

@ eDouble

Convertible into a floating point number (double)

@ eDataSize

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

@ eIntId

Convertible to TIntId (int or Int8 depending on NCBI_INT8_GI)

@ eIOFile

Name of file (must be writable)

@ eOutputFile

Name of file (must be writable)

@ eInteger

Convertible into an integer number (int or Int8)

@ eDirectory

Name of file directory.

@ ePositionalMode_Strict

Strict mode (default)

@ eLower

Lowercase characters.

@ eAlnum

Alphanumeric characters.

@ eGraph

Graphical characters.

@ ePrint

Printable characters.

@ eSpace

Space characters.

@ eDigit

Digit characters.

@ eUpper

Uppercase characters.

@ eXdigit

Hexadecimal characters.

@ eCntrl

Control characters.

@ ePunct

Punctuation characters.

@ eAlpha

Alphabet characters.

@ eConstraintInvert

Logical NOT.

@ eConstraint

Constraint is not inverted (taken as is)

CException & operator=(const CException &)

Private assignment operator to prohibit assignment.

TFlags m_Flags

Flags, hints, attributes.

virtual const char * GetErrCodeString(void) const override

Translate from the error code value to its string representation.

int64_t Int8

8-byte (64-bit) signed integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

IO_PREFIX::iostream CNcbiIostream

Portable alias for iostream.

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

NCBI_NS_STD::string::size_type SIZE_TYPE

ECase

Which type of string comparison.

@ eCase

Case sensitive compare.

#define NCBI_XNCBI_EXPORT

const GenericPointer< typename T::ValueType > T2 value

Miscellaneous common-use basic types and functionality.

Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.

Defines: CTimeFormat - storage class for time format.

@ fNoCreate

Command does not create blob if it does not exist.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4