UCommon
ucommon::shell::charopt Class Reference

Character option for shell parsing. More...

#include <shell.h>

Inheritance diagram for ucommon::shell::charopt:
[legend]
Collaboration diagram for ucommon::shell::charopt:
[legend]

Public Member Functions

 charopt (char short_option, const char *long_option=NULL, const char *help=NULL, const char *type="char", char default_code=' ')
 operator bool () const
 operator char () const
bool operator! () const
char operator* () const
charoptoperator= (char value)
void set (char value)
Public Member Functions inherited from ucommon::shell::Option
void disable (void)
 Disable a option.
 Option (char short_option=0, const char *long_option=NULL, const char *value_type=NULL, const char *help=NULL)
 Construct a shell parser option.
Public Member Functions inherited from ucommon::LinkedObject
void delist (LinkedObject **root)
 Locate and remove ourselves from a list of objects.
void enlist (LinkedObject **root)
 Add our object to an existing linked list through a pointer.
LinkedObjectgetNext (void) const
 Get next effective object when iterating.
bool is_member (LinkedObject *list) const
 Search to see if we are a member of a specific list.
virtual void release (void)
 Release list, mark as no longer linked.
virtual void retain (void)
 Retain by marking as self referenced list.
Public Member Functions inherited from ucommon::ObjectProtocol
ObjectProtocolcopy (void)
 Retain (increase retention of) object when copying.
void operator++ (void)
 Increase retention operator.
void operator-- (void)
 Decrease retention operator.
virtual ~ObjectProtocol ()
 Required virtual destructor.

Protected Member Functions

virtual const char * assign (const char *value)
 Used to send option into derived receiver.
Protected Member Functions inherited from ucommon::LinkedObject
 LinkedObject ()
 Construct base class unattached to anyone.
 LinkedObject (const LinkedObject &from)
 LinkedObject (LinkedObject **root)
 Construct base class attached to a chain of objects.

Protected Attributes

char code
Protected Attributes inherited from ucommon::LinkedObject
LinkedObjectNext

Additional Inherited Members

Static Public Member Functions inherited from ucommon::shell::Option
static LinkedObjectfirst (void)
static void reset (void)
Static Public Member Functions inherited from ucommon::LinkedObject
static unsigned count (const LinkedObject *root)
 Count the number of linked objects in a list.
static LinkedObjectgetIndexed (LinkedObject *root, unsigned index)
 Get member by index.
static void purge (LinkedObject *root)
 Release all objects from a list.
Data Fields inherited from ucommon::shell::Option
const char * help_string
const char * long_option
char short_option
bool trigger_option
const char * uses_option

Detailed Description

Character option for shell parsing.

This offers a quick-use class to parse a shell flag, along with a character code that may be saved. Multiple invocations is an error.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 342 of file shell.h.

Member Function Documentation

◆ assign()

virtual const char * ucommon::shell::charopt::assign ( const char * value)
protectedvirtual

Used to send option into derived receiver.

Parameters
valueoption that was received.
Returns
NULL or error string to use.

Implements ucommon::shell::Option.

Here is the call graph for this function:

◆ operator bool()

ucommon::shell::charopt::operator bool ( ) const
inline

Definition at line 366 of file shell.h.

◆ operator char()

ucommon::shell::charopt::operator char ( ) const
inline

Definition at line 374 of file shell.h.

◆ operator!()

bool ucommon::shell::charopt::operator! ( ) const
inline

Definition at line 370 of file shell.h.

◆ operator*()

char ucommon::shell::charopt::operator* ( ) const
inline

Definition at line 378 of file shell.h.

◆ operator=()

charopt & ucommon::shell::charopt::operator= ( char value)
inline

Definition at line 361 of file shell.h.

◆ set()

void ucommon::shell::charopt::set ( char value)
inline

Definition at line 357 of file shell.h.

Field Documentation

◆ code

char ucommon::shell::charopt::code
protected

Definition at line 350 of file shell.h.


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