AAO DRAMA/DRAMA2 C++ Interface
|
A class which reads Boolean values from SDS argument structures.
This is a C++ class which provides an interface to GitArgGetL(). It Implements a boolean type which includes the operation gitarg::Bool::Get , to fetch its value from an SDS structure.
By default, the string combinations "YES/NO" and "TRUE/FALSE" are accepted as Boolean values, with any input string being converted to upper case and abbreviations being accepted. There is also a constructor which does the Get() operation.
By overriding the method Lookup() in a sub-class, you can supply alternative lists of True/False strings.
#include "gitarg.hh"
Public Member Functions | |
Bool (bool initVal=false) | |
Simple constructor with a default value of false. More... | |
Bool (const sds::Id &Id, const std::string &Name="Argument1", const int Position=1, const bool Default=false, const Flags flags=(Flags::Upper|Flags::Abbrev|Flags::KeepErr)) | |
Constructor which constructs the value from an item in an SDS structure. More... | |
virtual | ~Bool () |
Destructor. More... | |
virtual void | Get (const sds::Id &Id, const std::string &Name="Argument1", const int Position=1, const bool Default=false, const Flags flags=(Flags::Upper|Flags::Abbrev|Flags::KeepErr)) |
Get the value of the object from an SDS struture. More... | |
operator bool () const | |
Conversion operator - given gitarg::Bool, return a bool. More... | |
Bool | operator= (const bool src) |
Assign a bool to this gitarg::Bool item. More... | |
Protected Member Functions | |
virtual const GitLogStrType * | Lookup () |
Return a pointer to an array of enum strings equivalents. More... | |
|
inline |
Simple constructor with a default value of false.
|
inline |
Constructor which constructs the value from an item in an SDS structure.
The value is fetched from the named item (arg #2) within the SDS structure specified. or the Position (constructor arg #3) item in the structure if the item named does not exist.
Id | The SDS structure. |
Name | The name of the item within the structure. |
Position | If the item does not exist by the name, then presume this position. |
Default | The default value. |
flags | Which GIT Flags to apply. If you specify KeepErr, then an exception is throw if the value in the SDS structure is invalid. If you don't specify KeepErr and and the SDS structure does not contain a value item, then the value is set to the supplied default. |
References drama::Default, and Get().
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Get the value of the object from an SDS struture.
(arg #2) within the SDS structure specified. or the Position (constructor arg #3) item in the structure if the item named does not exist.
Id | The SDS structure. |
Name | The name of the item within the structure. |
Position | If the item does not exist by the name, then presume this position. |
Default | The default value. |
flags | Which GIT Flags to apply. If you specify KeepErr, then an exception is throw if the value in the SDS structure is invalid. If you don't specify KeepErr and and the SDS structure does not contain a value item, then the value is set to the supplied default. |
References drama::Default, DramaTHROW, and Lookup().
Referenced by Bool().
|
inlineprotectedvirtual |
Return a pointer to an array of enum strings equivalents.
The result here is passed to GitArgGetS(), hence the old C style interface we use here.
Referenced by Get().
|
inline |
Conversion operator - given gitarg::Bool, return a bool.
|
inline |
Assign a bool to this gitarg::Bool item.
src | Source value |
Click here for the DRAMA home page and here for the AAO home page.
For more information, contact tjf@aao.gov.au Generated on Mon Feb 22 2016 15:57:53 for AAO DRAMA/DRAMA2 C++ Interface by