src/corelib/ncbiargs.cpp File Reference

#include <ncbi_pch.hpp>
#include <corelib/ncbiapp.hpp>
#include <corelib/ncbiargs.hpp>
#include <corelib/ncbienv.hpp>
#include <corelib/error_codes.hpp>
#include <algorithm>
#include "ncbiargs_p.hpp"

Include dependency graph for ncbiargs.cpp:

Go to the source code of this file.

Classes

class  CArgDesc_NameOnly

Defines

#define NCBI_USE_ERRCODE_X   Corelib_Config
#define NCBIARGS__CPP
#define THROW_CArg_NoValue

Functions

string s_ArgExptMsg (const string &name, const string &what, const string &attr)
void s_WriteEscapedStr (CNcbiOstream &out, const char *s)
void s_WriteXmlLine (CNcbiOstream &out, const string &tag, const string &data)
bool operator< (const CRef< CArgValue > &x, const CRef< CArgValue > &y)
bool s_IsKey (const CArgDesc &arg)
bool s_IsPositional (const CArgDesc &arg)
bool s_IsOptional (const CArgDesc &arg)
bool s_IsFlag (const CArgDesc &arg)
bool s_IsAlias (const CArgDesc &arg)
bool operator< (const AutoPtr< CArgDesc > &x, const AutoPtr< CArgDesc > &y)
string s_KeyUsageSynopsis (const string &name, const string &synopsis, bool name_only)
static string s_ComposeNameExtra (size_t idx)
bool s_IsArgNameChar (char c)
static void s_PrintCommentBody (list< string > &arr, const string &s, SIZE_TYPE width)
bool s_IsAllowedSymbol (unsigned char ch, CArgAllow_Symbols::ESymbolClass symbol_class, const string &symbol_set)
static string s_GetUsageSymbol (CArgAllow_Symbols::ESymbolClass symbol_class, const string &symbol_set)
static string s_GetSymbolClass (CArgAllow_Symbols::ESymbolClass symbol_class)

Variables

static const char * s_AutoHelp = "h"
static const char * s_AutoHelpFull = "help"
static const char * s_AutoHelpXml = "xmlhelp"
static const char * s_ExtraName = "...."


Define Documentation

#define NCBI_USE_ERRCODE_X   Corelib_Config
 

Definition at line 51 of file ncbiargs.cpp.

#define NCBIARGS__CPP
 

Definition at line 61 of file ncbiargs.cpp.

#define THROW_CArg_NoValue
 

Value:

NCBI_THROW(CArgException,eNoValue, s_ArgExptMsg(GetName(), \
        "Optional argument must have a default value", "NULL"));

Definition at line 174 of file ncbiargs.cpp.

Referenced by CArg_NoValue::AsBoolean(), CArg_NoValue::AsDouble(), CArg_NoValue::AsInputFile(), CArg_NoValue::AsInt8(), CArg_NoValue::AsInteger(), CArg_NoValue::AsOutputFile(), CArg_NoValue::AsString(), and CArg_NoValue::CloseFile().


Function Documentation

bool operator< const AutoPtr< CArgDesc > &  x,
const AutoPtr< CArgDesc > &  y
[inline]
 

Definition at line 612 of file ncbiargs.cpp.

bool operator< const CRef< CArgValue > &  x,
const CRef< CArgValue > &  y
[inline]
 

Definition at line 151 of file ncbiargs.cpp.

string s_ArgExptMsg const string &  name,
const string &  what,
const string &  attr
[inline]
 

Definition at line 80 of file ncbiargs.cpp.

References s_ExtraName.

Referenced by CArg_String::AsBoolean(), CArg_String::AsDouble(), CArg_String::AsInputFile(), CArg_String::AsInt8(), CArg_String::AsInteger(), CArg_String::AsOutputFile(), CArg_Boolean::CArg_Boolean(), CArg_Double::CArg_Double(), CArg_Int8::CArg_Int8(), CArg_Integer::CArg_Integer(), CArgDescMandatory::CArgDescMandatory(), CArg_OutputFile::CloseFile(), CArg_InputFile::CloseFile(), CArg_String::CloseFile(), CArgDescMandatory::ProcessArgument(), CArgDescMandatory::ProcessDefault(), CArgDesc::SetConstraint(), CArg_OutputFile::x_Open(), and CArg_InputFile::x_Open().

static string s_ComposeNameExtra size_t  idx  )  [static]
 

Definition at line 1293 of file ncbiargs.cpp.

References NStr::UInt8ToString().

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

static string s_GetSymbolClass CArgAllow_Symbols::ESymbolClass  symbol_class  )  [static]
 

Definition at line 2912 of file ncbiargs.cpp.

References _TROUBLE, 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::eUser, CArgAllow_Symbols::eXdigit, and kEmptyStr.

Referenced by CArgAllow_String::PrintUsageXml(), and CArgAllow_Symbols::PrintUsageXml().

static string s_GetUsageSymbol CArgAllow_Symbols::ESymbolClass  symbol_class,
const string &  symbol_set
[static]
 

Definition at line 2891 of file ncbiargs.cpp.

References _TROUBLE, 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::eUser, CArgAllow_Symbols::eXdigit, kEmptyStr, and NStr::PrintableString().

Referenced by CArgAllow_String::GetUsage(), and CArgAllow_Symbols::GetUsage().

bool s_IsAlias const CArgDesc arg  )  [inline]
 

Definition at line 536 of file ncbiargs.cpp.

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

bool s_IsAllowedSymbol unsigned char  ch,
CArgAllow_Symbols::ESymbolClass  symbol_class,
const string &  symbol_set
[inline]
 

Definition at line 2868 of file ncbiargs.cpp.

References _TROUBLE, 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::eUser, CArgAllow_Symbols::eXdigit, and NPOS.

Referenced by CArgAllow_String::Verify(), and CArgAllow_Symbols::Verify().

bool s_IsArgNameChar char  c  )  [inline]
 

Definition at line 1299 of file ncbiargs.cpp.

Referenced by CArgs::x_Find().

bool s_IsFlag const CArgDesc arg  )  [inline]
 

Definition at line 530 of file ncbiargs.cpp.

Referenced by CArgDescriptions::AddNegatedFlagAlias(), CArgDesc::PrintXml(), CArgDescriptions::SetArgsType(), and CArgDescriptions::x_AddDesc().

bool s_IsKey const CArgDesc arg  )  [inline]
 

Definition at line 512 of file ncbiargs.cpp.

Referenced by CArgDesc::PrintXml(), s_IsPositional(), and CArgDescriptions::x_AddDesc().

bool s_IsOptional const CArgDesc arg  )  [inline]
 

Definition at line 524 of file ncbiargs.cpp.

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

bool s_IsPositional const CArgDesc arg  )  [inline]
 

Definition at line 518 of file ncbiargs.cpp.

References s_IsKey().

Referenced by CArgDesc::PrintXml().

string s_KeyUsageSynopsis const string &  name,
const string &  synopsis,
bool  name_only
[inline]
 

Definition at line 1147 of file ncbiargs.cpp.

Referenced by CArgDesc_KeyDef::GetUsageSynopsis(), CArgDesc_KeyOpt::GetUsageSynopsis(), and CArgDesc_Key::GetUsageSynopsis().

static void s_PrintCommentBody list< string > &  arr,
const string &  s,
SIZE_TYPE  width
[static]
 

Definition at line 2413 of file ncbiargs.cpp.

References NStr::fWrap_Hyphenate, and NStr::Wrap().

void s_WriteEscapedStr CNcbiOstream out,
const char *  s
[inline]
 

Definition at line 87 of file ncbiargs.cpp.

References NStr::XmlEncode().

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

void s_WriteXmlLine CNcbiOstream out,
const string &  tag,
const string &  data
 

Definition at line 92 of file ncbiargs.cpp.

References eEncoding_Unknown, and s_WriteEscapedStr().

Referenced by CArgAllow_Doubles::PrintUsageXml(), CArgAllow_Int8s::PrintUsageXml(), CArgAllow_Strings::PrintUsageXml(), CArgAllow_String::PrintUsageXml(), CArgAllow_Symbols::PrintUsageXml(), CArgDescriptions::PrintUsageXml(), CArgDesc::PrintXml(), and CArgDescriptions::x_PrintAliasesAsXml().


Variable Documentation

const char* s_AutoHelp = "h" [static]
 

Definition at line 70 of file ncbiargs.cpp.

Referenced by CArgDescriptions::CArgDescriptions(), CArgDescriptions::PrintUsage(), CArgDescriptions::SetArgsType(), and CArgDescriptions::x_CheckAutoHelp().

const char* s_AutoHelpFull = "help" [static]
 

Definition at line 71 of file ncbiargs.cpp.

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

const char* s_AutoHelpXml = "xmlhelp" [static]
 

Definition at line 72 of file ncbiargs.cpp.

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

const char* s_ExtraName = "...." [static]
 

Definition at line 73 of file ncbiargs.cpp.

Referenced by CArgDesc_Pos::GetUsageSynopsis(), and s_ArgExptMsg().


Generated on Mon Dec 7 07:36:21 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:21:45 2009 by modify_doxy.py rev. 173732