AAO DRAMA C++ Interface (Old style)
DRAMA C++, Depreciated, don't use for new code
Public Types | Public Member Functions | Protected Member Functions | List of all members
GitBool Class Reference

A class which reads logical values from SDS argument structures. More...

#include <Git.h>

Inheritance diagram for GitBool:
Git

Public Types

enum  {
  Upper =GIT_M_ARG_UPPER , Lower =GIT_M_ARG_LOWER , KeepErr =GIT_M_ARG_KEEPERR , Abbrev = GIT_M_ARG_ABBREV ,
  LastBit =GIT_M_ARG_LASTBIT , KeepValErr =GIT_M_ARG_KEEPVALERR
}
 

Public Member Functions

 GitBool ()
 Simple constructor with a default value of false.
 
 GitBool (const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const bool Default=false, const int Flags=(Git::Upper|Git::Abbrev))
 Constructor with the initial value set from an SDS structure.
 
virtual ~GitBool ()
 Destructor.
 
virtual void Get (const SdsId &Id, const char *const Name, const int Position, StatusType *const status, const bool Default=false, const int Flags=(Git::Upper|Git::Abbrev))
 Get the value of the object from an SDS struture.
 
 operator bool () const
 Conversion operator - given GitBool, return a bool.
 
 operator int () const
 Conversion operator - given GitBool, return an int.
 

Protected Member Functions

virtual const GitLogStrTypeLookup ()
 Return a pointer to an array of enum strings equivalents.
 

Detailed Description

A class which reads logical values from SDS argument structures.

This is C++ class which provides an interface to GitArgGetL(). It Implements a boolean type which includes the operation GotBool::Get , to fetch its value from an Sds structure.

By default, the string combinations "YES/NO" and "TRUE/FALSE" are accepted as boolean values, 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 GitEnum::Lookup in an inheriting class, you can supplied alternative lists of True/False strings - but WARNING, these alternatives are NOT available from the constructor, only from the Get() (since virtual functions are not invoked by the virtual pointer in a constructor). Also note that strings can be at most GIT_ARG_LMAX (20) characters long.

See also
GitArgGetL()

The documentation for this class was generated from the following file: