AAO DRAMA/DRAMA2 C++ Interface
DRAMA C++11 and later interface
Public Member Functions | List of all members
drama::gitarg::ArgFlags< ContainerType, > Class Template Reference

Detailed Description

template<class ContainerType, typename std::enable_if< std::is_base_of< ArgFlagVal, typename ContainerType::value_type >::value >::type * = nullptr>
class drama::gitarg::ArgFlags< ContainerType, >

This class is used to check for the existence of one or more flags in an SDS structure.

Here flags are defined keywords which must exist in a command argument structure. For example, an interface might define that it might accept the keywords DARK and RECORD

The idea is that these are optional and we just want a logical value set if they are present. The result will be a mask of bits representing each flag which is set.

Template Parameters
ContainerTypeThe instantiation of the template must specify a container of items of type ArgFlagVal. Each ArgFlagVal specifies the string value for a flag and the mask value (bit or bits) to be set when that flag is found.

#include "gitarg.hh"

Public Member Functions

 ArgFlags (const ContainerType &validFlagVals, bool ignoreCase=true)
 Constructor.
 
 ArgFlags (const ContainerType &validFlagVals, const sds::Id &Id, const unsigned First=1, const unsigned Last=0, const bool FailOnInvalid=true, const bool IgnoreCase=true)
 Constructor with the initial value set from an SDS structure.
 
unsigned Get (const sds::Id &Id, const unsigned First=1, unsigned Last=0, const bool FailOnInvalid=true)
 Get argument flag value set from an SDS structure.
 
unsigned GetVal ()
 Return the flags value - the mask of set bits.
 

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