Open Lighting Architecture: ola::Flag< std::string > Class Reference

| Open Lighting Architecture 0.10.9

Loading...
Searching...
No Matches
Public Member Functions | List of all members
ola::Flag< std::string > Class Reference
Command Line Flags

## Detailed Description

a string flag

Inheritance diagram for ola::Flag< std::string >:

## Public Member Functions
| Flag (const char *name, const char *arg_type, const char *short_opt, std::string default_value, const char *help, const bool has_arg)
const char * | name () const
| Get the flag name.
bool | has_arg () const
| Whether the flag requires an argument.
std::string | default_value () const
const char * | arg_type () const
| Get the flag argument type.
| operator const char * () const
| operator std::string () const
std::string | str () const
Flag & | operator= (const std::string &v)
bool | SetValue (const std::string &input)
| Set the flag value.
| operator std::string () const
Public Member Functions inherited from ola::BaseFlag
| BaseFlag (const char *arg_type, const char *short_opt, const char *help)
| Create a new BaseFlag.
char | short_opt () const
| Get the flag short option.
std::string | help () const
| Get the flag help string.
bool | present () const
| Check if the flag was present on the command line. Good for switching behaviour when a flag is used.
void | MarkAsPresent ()
| Set that the flag was present on the command line.

## Additional Inherited Members
Protected Member Functions inherited from ola::BaseFlag
void | ReplaceUnderscoreWithHyphen (char *input)
const char * | NewCanonicalName (const char *name)

## Member Function Documentation

## ◆ arg_type()

const char * ola::Flag< std::string >::arg_type | ( |  | ) | const
| inlinevirtual

Get the flag argument type.

Reimplemented from ola::BaseFlag.

## ◆ has_arg()

bool ola::Flag< std::string >::has_arg | ( |  | ) | const
| inlinevirtual

Whether the flag requires an argument.

Implements ola::FlagInterface.

## ◆ name()

const char * ola::Flag< std::string >::name | ( |  | ) | const
| inlinevirtual

Get the flag name.

Implements ola::FlagInterface.

## ◆ SetValue()

bool ola::Flag< std::string >::SetValue | ( | const std::string & | input | ) |
| inlinevirtual

Set the flag value.

Parameters

  input | the input passed on the command line

Returns
  true on success, false otherwise

Implements ola::FlagInterface.

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

- include/ola/base/FlagsPrivate.h