PUMA Library Reference Manual
Loading...
Searching...
No Matches
Puma::ParserKey Class Reference

#include <Puma/ParserKey.h>

Description

Options parser key helper.

Supports Unix-like short key '-' and long key '–'.

Static Public Member Functions

static char getKey ()
 Get the short key character.
 
static const char * getLongKey ()
 Get the long key character sequence.
 
static unsigned int getKeyLength ()
 Get the length of the short key.
 
static unsigned int getLongKeyLength ()
 Get the length of the long key.
 
static bool isKey (const std::string &str)
 Check if the given string starts with the short key.
 
static bool isLongKey (const std::string &str)
 Check if the given string starts with the long key.
 

Member Function Documentation

◆ getKey()

static char Puma::ParserKey::getKey ( )
inlinestatic

Get the short key character.

Returns
The short key character.

◆ getKeyLength()

static unsigned int Puma::ParserKey::getKeyLength ( )
inlinestatic

Get the length of the short key.

Returns
The length.

◆ getLongKey()

static const char * Puma::ParserKey::getLongKey ( )
inlinestatic

Get the long key character sequence.

Returns
The long key character sequence.

◆ getLongKeyLength()

static unsigned int Puma::ParserKey::getLongKeyLength ( )
inlinestatic

Get the length of the long key.

Returns
The length.

◆ isKey()

static bool Puma::ParserKey::isKey ( const std::string & str)
inlinestatic

Check if the given string starts with the short key.

The string may still start with a long key, so check this first.

Parameters
strThe string to check.
Returns
True if it starts with the short key.

◆ isLongKey()

static bool Puma::ParserKey::isLongKey ( const std::string & str)
inlinestatic

Check if the given string starts with the long key.

Parameters
strThe string to check.
Returns
True if it starts with the long key.