Elm  2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
StringList Class Reference

#include <elm/option/StringList.h>

+ Inheritance diagram for StringList:

Public Member Functions

 StringList (const Make &m)
 
usage_t usage (void) override
 
cstring argDescription (void) override
 
void process (string arg) override
 
 operator bool (void) const
 
const stringoperator[] (int index) const
 
int count (void) const
 
- Public Member Functions inherited from Option
 Option ()
 
 Option (const Make &make)
 
virtual ~Option ()
 
virtual cstring description ()
 

Additional Inherited Members

- Protected Attributes inherited from Option
cstring desc
 

Detailed Description

This class is used for getting a command line option composed of several strings each one prefixed with the option short or long name.

Constructor & Destructor Documentation

◆ StringList()

StringList ( const Make m)

Build a string option with a short name.

Parameters
mOption maker.

Member Function Documentation

◆ argDescription()

cstring argDescription ( void  )
overridevirtual

If the option requires an argument, get the description of the argument.

Returns
Argument description.

Implements Option.

◆ count()

int count ( void  ) const
inline

Get the count of arguments in this option.

Returns
Argument count.

References Vector< T, E, A >::count().

◆ operator bool()

operator bool ( void  ) const
inline

Test if some argument has been passed.

Returns
True if there is some value, false else.

◆ operator[]()

const string & operator[] ( int  index) const
inline

Get the indexed argument in the argument list.

Parameters
indexIndex of the argument to get.
Returns
Argument matching the index.
Warning
It is an error if index >= count() .

◆ process()

void process ( string  arg)
overridevirtual

This method is called by the option manager when the option is encountered.

Parameters
argIf the option requires an argument, the value of the argument.

Implements Option.

References Vector< T, E, A >::add().

◆ usage()

usage_t usage ( void  )
overridevirtual

Get the argument usage type of this function.

Returns
Argument usage type.

Implements Option.

References elm::option::arg_required.


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