ucommon
7.0.0
About: GNU uCommon C++ is a portable and optimized class framework for writing C++ applications that need to use threads and support concurrent synchronization, and that use sockets, XML parsing, object serialization, thread-optimized string and data structure classes, etc..
![]() ![]() |
Character option for shell parsing. More...
#include <shell.h>
Public Member Functions | |
charopt (char short_option, const char *long_option=NULL, const char *help=NULL, const char *type="char", char default_code=' ') | |
void | set (char value) |
charopt & | operator= (char value) |
operator bool () const | |
bool | operator! () const |
operator char () const | |
char | operator* () const |
![]() | |
Option (char short_option=0, const char *long_option=NULL, const char *value_type=NULL, const char *help=NULL) | |
Construct a shell parser option. More... | |
virtual | ~Option () |
void | disable (void) |
Disable a option. More... | |
virtual const char * | assign (const char *value)=0 |
Used to send option into derived receiver. More... | |
![]() | |
virtual | ~LinkedObject () |
virtual void | release (void) __OVERRIDE |
Release list, mark as no longer linked. More... | |
virtual void | retain (void) __OVERRIDE |
Retain by marking as self referenced list. More... | |
void | enlist (LinkedObject **root) |
Add our object to an existing linked list through a pointer. More... | |
void | delist (LinkedObject **root) |
Locate and remove ourselves from a list of objects. More... | |
bool | is_member (LinkedObject *list) const |
Search to see if we are a member of a specific list. More... | |
LinkedObject * | getNext (void) const |
Get next effective object when iterating. More... | |
Protected Member Functions | |
virtual const char * | assign (const char *value) |
Used to send option into derived receiver. More... | |
![]() | |
LinkedObject (LinkedObject **root) | |
Construct base class attached to a chain of objects. More... | |
LinkedObject () | |
Construct base class unattached to anyone. More... | |
LinkedObject (const LinkedObject &from) | |
Protected Attributes | |
char | code |
![]() | |
LinkedObject * | Next |
Private Member Functions | |
__DELETE_DEFAULTS (charopt) | |
Private Attributes | |
bool | used |
Additional Inherited Members | |
![]() | |
static LinkedObject * | first (void) |
static void | reset (void) |
![]() | |
static void | purge (LinkedObject *root) |
Release all objects from a list. More... | |
static unsigned | count (const LinkedObject *root) |
Count the number of linked objects in a list. More... | |
static LinkedObject * | getIndexed (LinkedObject *root, unsigned index) |
Get member by index. More... | |
![]() | |
char | short_option |
const char * | long_option |
const char * | uses_option |
const char * | help_string |
bool | trigger_option |
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.
ucommon::shell::charopt::charopt | ( | char | short_option, |
const char * | long_option = NULL , |
||
const char * | help = NULL , |
||
const char * | type = "char" , |
||
char | default_code = ' ' |
||
) |
|
private |
|
protectedvirtual |
Used to send option into derived receiver.
value | option that was received. |
Implements ucommon::shell::Option.
Definition at line 255 of file shell.cpp.
References ucommon::shell::BAD_VALUE, ucommon::shell::errmsg(), and ucommon::shell::OPTION_USED.
|
inline |
|
protected |
|
private |