Open Lighting Architecture  Latest Git
Namespaces | Macros | Functions
Flags.h File Reference

Detailed Description

Defines macros to ease creation of command line flags.

Include dependency graph for Flags.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 ola
 The namespace containing all OLA symbols.
 

Macros

#define DECLARE_bool(name)   DECLARE_flag(bool, name)
 Reuse a bool flag from another file. More...
 
#define DECLARE_int8(name)   DECLARE_flag(int8_t, name)
 Reuse an int8_t flag from another file. More...
 
#define DECLARE_int16(name)   DECLARE_flag(int16_t, name)
 Reuse an int16_t flag from another file. More...
 
#define DECLARE_int32(name)   DECLARE_flag(int32_t, name)
 Reuse an int32_t flag from another file. More...
 
#define DECLARE_uint8(name)   DECLARE_flag(uint8_t, name)
 Reuse a uint8_t flag from another file. More...
 
#define DECLARE_uint16(name)   DECLARE_flag(uint16_t, name)
 Reuse a uint16_t flag from another file. More...
 
#define DECLARE_uint32(name)   DECLARE_flag(uint32_t, name)
 Reuse a uint32_t flag from another file. More...
 
#define DECLARE_string(name)   DECLARE_flag(std::string, name)
 Reuse a string flag from another file. More...
 
#define DEFINE_bool(name, default_value, help_str)   DEFINE_flag(bool, name, \0, default_value, help_str, true)
 Create a new longname bool flag. More...
 
#define DEFINE_s_bool(name, short_opt, default_value, help_str)   DEFINE_flag_with_short(bool, name, short_opt, default_value, help_str, true)
 Create a new bool flag with a long and short name. More...
 
#define DEFINE_default_bool(name, default_value, help_str)   DEFINE_flag(bool, name, \0, default_value, help_str, false)
 Create a new longname bool flag that doesn't require an argument. More...
 
#define DEFINE_s_default_bool(name, short_opt, default_value, help_str)   DEFINE_flag_with_short(bool, name, short_opt, default_value, help_str, false)
 Create a new bool flag with a long and short name that doesn't require an argument. More...
 
#define DEFINE_int8(name, default_value, help_str)   DEFINE_flag(int8_t, name, \0, default_value, help_str, true)
 Create a new longname int8_t flag. More...
 
#define DEFINE_s_int8(name, short_opt, default_value, help_str)
 Create a new int8_t flag with a long and short name. More...
 
#define DEFINE_uint8(name, default_value, help_str)   DEFINE_flag(uint8_t, name, \0, default_value, help_str, true)
 Create a new longname uint8_t flag. More...
 
#define DEFINE_s_uint8(name, short_opt, default_value, help_str)
 Create a new uint8_t flag with a long and short name. More...
 
#define DEFINE_int16(name, default_value, help_str)   DEFINE_flag(int16_t, name, \0, default_value, help_str, true)
 Create a new longname int16_t flag. More...
 
#define DEFINE_s_int16(name, short_opt, default_value, help_str)
 Create a new int16_t flag with a long and short name. More...
 
#define DEFINE_uint16(name, default_value, help_str)   DEFINE_flag(uint16_t, name, \0, default_value, help_str, true)
 Create a new longname uint16_t flag. More...
 
#define DEFINE_s_uint16(name, short_opt, default_value, help_str)
 Create a new uint16_t flag with a long and short name. More...
 
#define DEFINE_int32(name, default_value, help_str)   DEFINE_flag(int32_t, name, \0, default_value, help_str, true)
 Create a new longname int32_t flag. More...
 
#define DEFINE_s_int32(name, short_opt, default_value, help_str)
 Create a new int32_t flag with a long and short name. More...
 
#define DEFINE_uint32(name, default_value, help_str)   DEFINE_flag(uint32_t, name, \0, default_value, help_str, true)
 Create a new longname uint32_t flag. More...
 
#define DEFINE_s_uint32(name, short_opt, default_value, help_str)
 Create a new int32_t flag with a long and short name. More...
 
#define DEFINE_string(name, default_value, help_str)   DEFINE_flag(std::string, name, \0, default_value, help_str, true)
 Create a new longname string flag. More...
 
#define DEFINE_s_string(name, short_opt, default_value, help_str)
 Create a new string flag with a long and short name. More...
 

Functions

void ola::SetHelpString (const std::string &first_line, const std::string &description)
 Set the help string for the program. More...
 
void ola::DisplayUsage ()
 Print the usage text to stdout.
 
void ola::DisplayUsageAndExit ()
 Print the usage text to stdout then exit.
 
void ola::DisplayVersion ()
 Print the version text to stdout.
 
void ola::ParseFlags (int *argc, char **argv)
 Parses the command line flags up to the first non-flag value. argv is re-arranged so that it only contains non-flag arguments. More...