paludis::args::EnumArg Class Reference

#include <args_option.hh>

Inheritance diagram for paludis::args::EnumArg:

paludis::args::ArgsOption paludis::PrivateImplementationPattern< C_ > paludis::args::DepsOptionArg paludis::args::LogLevelArg

List of all members.

Iterate over our allowed arguments and associated descriptions

typedef WrappedForwardIterator
< AllowedArgConstIteratorTag,
const AllowedEnumArg
AllowedArgConstIterator
AllowedArgConstIterator begin_allowed_args () const
AllowedArgConstIterator end_allowed_args () const

Public Member Functions

 EnumArg (ArgsGroup *const group, const std::string &long_name, const char short_name, const std::string &description, const EnumArgOptions &opts, const std::string &default_arg)
const std::string & argument () const
void set_argument (const std::string &arg)
void set_default_arg (const std::string &arg)
const std::string & default_arg () const
virtual bool can_be_negated () const
virtual const std::string forwardable_string () const PALUDIS_ATTRIBUTE((warn_unused_result))

Classes

class  EnumArgOptions


Detailed Description

An option that takes one of a predefined set of string arguments.

Constructor & Destructor Documentation

paludis::args::EnumArg::EnumArg ( ArgsGroup *const   group,
const std::string &  long_name,
const char  short_name,
const std::string &  description,
const EnumArgOptions opts,
const std::string &  default_arg 
)

Constructor.


Member Function Documentation

const std::string& paludis::args::EnumArg::argument (  )  const [inline]

Fetch the argument that was given to this option.

void paludis::args::EnumArg::set_argument ( const std::string &  arg  ) 

Set the argument returned by argument(), having verified that it is one of the arguments allowed for this option.

void paludis::args::EnumArg::set_default_arg ( const std::string &  arg  ) 

Change the default option (should be called before set_argument()).

const std::string& paludis::args::EnumArg::default_arg (  )  const [inline]

Fetch the default option, as specified to the constructor or set_default_arg().

virtual bool paludis::args::EnumArg::can_be_negated (  )  const [virtual]

Can we be negated?

Needs to match up with ArgsVisitor logic.

Implements paludis::args::ArgsOption.

virtual const std::string paludis::args::EnumArg::forwardable_string (  )  const [virtual]

Ourself as a forwardable string.

For example, '--foo bar' or '--foo bar --foo baz' or '--foo', or if not specified, the empty string.

Since:
0.40

Implements paludis::args::ArgsOption.


The documentation for this class was generated from the following file:
Generated on Mon Sep 21 10:36:12 2009 for paludis by  doxygen 1.5.4