A single option supported by an ACL: -x[=value] or –name[=value]. More...

#include <Options.h>

Inheritance diagram for Acl::Option:
Collaboration diagram for Acl::Option:

Public Types

enum  ValueExpectation {
  valueNone ,
  valueOptional ,

Public Member Functions

 Option (const char *nameThatEnables, const char *nameThatDisables=nullptr, ValueExpectation vex=valueNone)
virtual ~Option ()
virtual bool configured () const =0
virtual void enable () const =0
 called after parsing onName without a value (e.g., -x or –enable-x) More...
virtual void configureWith (const SBuf &rawValue) const =0
 called after parsing onName and a value (e.g., -x=v or –enable-x=v) More...
virtual void disable () const =0
 called after parsing offName (e.g., +i or –disable-x) More...
virtual void unconfigure () const =0
 clear enable(), configureWith(), or disable() effects More...
virtual bool disabled () const =0
 whether disable() has been called More...
virtual bool valued () const =0
virtual void print (std::ostream &os) const =0
 prints a configuration snippet (as an admin could have typed) More...

Public Attributes

const char *const onName = nullptr
 A name that must be used to explicitly enable this Option (required). More...
const char *const offName = nullptr
ValueExpectation valueExpectation = valueNone
 expect "=value" part? More...

Detailed Description

Definition at line 56 of file Options.h.

Member Enumeration Documentation

◆ ValueExpectation


Definition at line 59 of file Options.h.

Constructor & Destructor Documentation

◆ Option()

Acl::Option::Option ( const char *  nameThatEnables,
const char *  nameThatDisables = nullptr,
ValueExpectation  vex = valueNone 

Definition at line 66 of file Options.cc.

References assert, and onName.

◆ ~Option()

virtual Acl::Option::~Option ( )

Definition at line 61 of file Options.h.

Member Function Documentation

◆ configured()

virtual bool Acl::Option::configured ( ) const
pure virtual

whether the admin explicitly specified this option (i.e., whether enable(), configureWith(), or disable() has been called)

Implemented in Acl::TypedOption< Recipient >, and Acl::TypedOption< CharacterSetOptionValue >.

◆ configureWith()

virtual void Acl::Option::configureWith ( const SBuf rawValue) const
pure virtual

◆ disable()

virtual void Acl::Option::disable ( ) const
pure virtual

◆ disabled()

virtual bool Acl::Option::disabled ( ) const
pure virtual

◆ enable()

virtual void Acl::Option::enable ( ) const
pure virtual

◆ print()

virtual void Acl::Option::print ( std::ostream &  os) const
pure virtual

◆ unconfigure()

virtual void Acl::Option::unconfigure ( ) const
pure virtual

◆ valued()

virtual bool Acl::Option::valued ( ) const
pure virtual

Member Data Documentation

◆ offName

const char* const Acl::Option::offName = nullptr

A name that must be used to explicitly disable this Option (optional). Nil for (and only for) options that cannot be disabled().

Definition at line 92 of file Options.h.

Referenced by Acl::TypedOption< Recipient >::disabled(), and Acl::TypedOption< Recipient >::print().

◆ onName

const char* const Acl::Option::onName = nullptr

Definition at line 88 of file Options.h.

Referenced by Option(), and Acl::TypedOption< Recipient >::print().

◆ valueExpectation

ValueExpectation Acl::Option::valueExpectation = valueNone

Definition at line 94 of file Options.h.

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






Web Site Translations