NCBI C++ ToolKit
Public Member Functions | Private Attributes | List of all members
CArgDescMandatory Class Referenceabstract

Search Toolkit Book for CArgDescMandatory

#include "ncbiargs_p.hpp"
(Private to src/corelib.)

+ Inheritance diagram for CArgDescMandatory:
+ Collaboration diagram for CArgDescMandatory:

Public Member Functions

 CArgDescMandatory (const string &name, const string &comment, CArgDescriptions::EType type, CArgDescriptions::TFlags flags)
 
virtual ~CArgDescMandatory (void)
 
CArgDescriptions::EType GetType (void) const
 
virtual string GetUsageSynopsis (bool name_only=false) const =0
 Get usage synopsis. More...
 
virtual string GetUsageCommentAttr (void) const
 Get usage comment attribute. More...
 
virtual CArgValueProcessArgument (const string &value) const
 Process argument with specified value. More...
 
virtual CArgValueProcessDefault (void) const
 Process argument default. More...
 
virtual void SetConstraint (const CArgAllow *constraint, CArgDescriptions::EConstraintNegate negate)
 Set argument constraint. More...
 
virtual const CArgAllowGetConstraint (void) const
 Get argument constraint. More...
 
virtual bool IsConstraintInverted () const
 Returns TRUE if associated constraint is inverted (NOT) More...
 
virtual const CArgErrorHandlerGetErrorHandler (void) const
 Get error handler for the argument. More...
 
virtual void SetErrorHandler (CArgErrorHandler *err_handler)
 Set error handler for the argument. More...
 
- Public Member Functions inherited from CArgDesc
 CArgDesc (const string &name, const string &comment, CArgDescriptions::TFlags flags=0)
 Constructor. More...
 
virtual ~CArgDesc (void)
 Destructor. More...
 
const stringGetName (void) const
 Get argument name. More...
 
const stringGetComment (void) const
 Get argument description. More...
 
virtual size_t GetGroup (void) const
 Get argument group. More...
 
virtual void SetGroup (size_t)
 Set argument group. More...
 
virtual void VerifyDefault (void) const
 Verify argument default value. More...
 
string GetUsageConstraint (void) const
 Get usage constraint. More...
 
CArgDescriptions::TFlags GetFlags (void) const
 Get argument flags. More...
 
string PrintXml (CNcbiOstream &out) const
 Print description in XML format. More...
 

Private Attributes

CArgDescriptions::EType m_Type
 
CConstRef< CArgAllowm_Constraint
 
CArgDescriptions::EConstraintNegate m_NegateConstraint
 
CRef< CArgErrorHandlerm_ErrorHandler
 

Detailed Description

Definition at line 316 of file ncbiargs_p.hpp.

Constructor & Destructor Documentation

◆ CArgDescMandatory()

CArgDescMandatory::CArgDescMandatory ( const string name,
const string comment,
CArgDescriptions::EType  type,
CArgDescriptions::TFlags  flags 
)

◆ ~CArgDescMandatory()

CArgDescMandatory::~CArgDescMandatory ( void  )
virtual

Definition at line 1152 of file ncbiargs.cpp.

Member Function Documentation

◆ GetConstraint()

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

Get argument constraint.

Reimplemented from CArgDesc.

Definition at line 1287 of file ncbiargs.cpp.

References m_Constraint.

◆ GetErrorHandler()

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

Get error handler for the argument.

Reimplemented from CArgDesc.

Definition at line 339 of file ncbiargs_p.hpp.

References CRef< C, Locker >::GetPointerOrNull(), and m_ErrorHandler.

◆ GetType()

CArgDescriptions::EType CArgDescMandatory::GetType ( void  ) const
inline

◆ GetUsageCommentAttr()

string CArgDescMandatory::GetUsageCommentAttr ( void  ) const
virtual

Get usage comment attribute.

Implements CArgDesc.

Definition at line 1158 of file ncbiargs.cpp.

References CArgDescriptions::eDateTime, GetType(), CArgDescriptions::GetTypeName(), CArgDesc::GetUsageConstraint(), and str().

Referenced by ProcessDefault().

◆ GetUsageSynopsis()

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

Get usage synopsis.

Implements CArgDesc.

Implemented in CArgDesc_KeyDef, CArgDesc_KeyOpt, CArgDesc_Key, CArgDesc_Opening, and CArgDesc_Pos.

◆ IsConstraintInverted()

bool CArgDescMandatory::IsConstraintInverted ( ) const
virtual

Returns TRUE if associated constraint is inverted (NOT)

See also
SetConstraint

Reimplemented from CArgDesc.

Definition at line 1293 of file ncbiargs.cpp.

References CArgDescriptions::eConstraintInvert, and m_NegateConstraint.

◆ ProcessArgument()

CArgValue * CArgDescMandatory::ProcessArgument ( const string value) const
virtual

◆ ProcessDefault()

CArgValue * CArgDescMandatory::ProcessDefault ( void  ) const
virtual

Process argument default.

Implements CArgDesc.

Reimplemented in CArgDescDefault, and CArgDescOptional.

Definition at line 1270 of file ncbiargs.cpp.

References CArgDesc::GetName(), GetUsageCommentAttr(), NCBI_THROW, and s_ArgExptMsg().

◆ SetConstraint()

void CArgDescMandatory::SetConstraint ( const CArgAllow constraint,
CArgDescriptions::EConstraintNegate  negate 
)
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 from CArgDesc.

Definition at line 1278 of file ncbiargs.cpp.

References m_Constraint, and m_NegateConstraint.

◆ SetErrorHandler()

virtual void CArgDescMandatory::SetErrorHandler ( CArgErrorHandler )
inlinevirtual

Set error handler for the argument.

Reimplemented from CArgDesc.

Definition at line 341 of file ncbiargs_p.hpp.

References err_handler(), m_ErrorHandler, and CRef< C, Locker >::Reset().

Member Data Documentation

◆ m_Constraint

CConstRef<CArgAllow> CArgDescMandatory::m_Constraint
private

Definition at line 346 of file ncbiargs_p.hpp.

Referenced by GetConstraint(), ProcessArgument(), and SetConstraint().

◆ m_ErrorHandler

CRef<CArgErrorHandler> CArgDescMandatory::m_ErrorHandler
private

Definition at line 348 of file ncbiargs_p.hpp.

Referenced by GetErrorHandler(), and SetErrorHandler().

◆ m_NegateConstraint

CArgDescriptions::EConstraintNegate CArgDescMandatory::m_NegateConstraint
private

Definition at line 347 of file ncbiargs_p.hpp.

Referenced by IsConstraintInverted(), ProcessArgument(), and SetConstraint().

◆ m_Type

CArgDescriptions::EType CArgDescMandatory::m_Type
private

Definition at line 345 of file ncbiargs_p.hpp.

Referenced by GetType().


The documentation for this class was generated from the following files:
Modified on Fri May 24 14:56:15 2024 by modify_doxy.py rev. 669887