Joedb 10.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
joedb::Arguments Class Reference

Class for conveniently parsing command-line arguments. More...

#include <joedb/ui/Arguments.h>

Public Member Functions

 Arguments (int argc, const char *const *argv)
 Arguments ()
bool has_flag (const char *name)
beman::cstring_view get_string_option (const char *name, const char *description, const char *default_string)
size_t get_enum_option (const char *name, const std::vector< const char * > &labels, size_t default_index)
template<typename T>
T get_option (const char *name, const char *description, T default_value)
template<typename T = beman::cstring_view>
T next_option (const char *name, const char *description, T default_value)
beman::cstring_view get_next ()
beman::cstring_view get_next (const char *parameter)
bool peek (beman::cstring_view s)
void add_parameter (const char *parameter)
std::ostream & print_help (std::ostream &out) const
bool has_error () const
int get_remaining_count () const
int get_index () const
bool missing () const
size_t size () const
beman::cstring_view operator[] (size_t i) const

Detailed Description

Definition at line 15 of file Arguments.h.

Constructor & Destructor Documentation

◆ Arguments() [1/2]

joedb::Arguments::Arguments ( int argc,
const char *const * argv )

Definition at line 27 of file Arguments.cpp.

◆ Arguments() [2/2]

joedb::Arguments::Arguments ( )
inline

Definition at line 72 of file Arguments.h.

Member Function Documentation

◆ add_parameter()

void joedb::Arguments::add_parameter ( const char * parameter)

Definition at line 138 of file Arguments.cpp.

◆ get_enum_option()

size_t joedb::Arguments::get_enum_option ( const char * name,
const std::vector< const char * > & labels,
size_t default_index )

Definition at line 76 of file Arguments.cpp.

◆ get_index()

int joedb::Arguments::get_index ( ) const
inline

Definition at line 156 of file Arguments.h.

◆ get_next() [1/2]

beman::cstring_view joedb::Arguments::get_next ( )

Definition at line 108 of file Arguments.cpp.

◆ get_next() [2/2]

beman::cstring_view joedb::Arguments::get_next ( const char * parameter)

Definition at line 113 of file Arguments.cpp.

◆ get_option()

template<typename T>
T joedb::Arguments::get_option ( const char * name,
const char * description,
T default_value )
inline

Definition at line 90 of file Arguments.h.

◆ get_remaining_count()

int joedb::Arguments::get_remaining_count ( ) const
inline

Definition at line 155 of file Arguments.h.

◆ get_string_option()

beman::cstring_view joedb::Arguments::get_string_option ( const char * name,
const char * description,
const char * default_string )

Definition at line 53 of file Arguments.cpp.

◆ has_error()

bool joedb::Arguments::has_error ( ) const
inline

Definition at line 153 of file Arguments.h.

◆ has_flag()

bool joedb::Arguments::has_flag ( const char * name)

Definition at line 36 of file Arguments.cpp.

◆ missing()

bool joedb::Arguments::missing ( ) const
inline

Definition at line 157 of file Arguments.h.

◆ next_option()

template<typename T = beman::cstring_view>
T joedb::Arguments::next_option ( const char * name,
const char * description,
T default_value )
inline

Definition at line 119 of file Arguments.h.

◆ operator[]()

beman::cstring_view joedb::Arguments::operator[] ( size_t i) const
inline

Definition at line 159 of file Arguments.h.

◆ peek()

bool joedb::Arguments::peek ( beman::cstring_view s)

Definition at line 127 of file Arguments.cpp.

◆ print_help()

std::ostream & joedb::Arguments::print_help ( std::ostream & out) const

Definition at line 143 of file Arguments.cpp.

◆ size()

size_t joedb::Arguments::size ( ) const
inline

Definition at line 158 of file Arguments.h.


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