ParamKit
A small library helping to parse commandline parameters (for Windows).
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Namespaces | Classes | Functions | Variables
paramkit Namespace Reference

Namespaces

 util
 

Classes

class  Param
 The base class of a parameter. More...
 
class  ParamCompare
 A comparator class for Param class. More...
 
class  IntParam
 A parameter storing an integer value. More...
 
class  StringParam
 A parameter storing a string value. More...
 
class  WStringParam
 A parameter storing a wide string value. More...
 
class  BoolParam
 A parameter storing a boolean value. More...
 
class  EnumParam
 A parameter storing an enum value. More...
 
class  StringListParam
 
class  IntListParam
 
class  ParamGroup
 The class responsible for grouping parameters (objects of the type Param) More...
 
class  Params
 The class responsible for storing and parsing parameters (objects of the type Param), possibly divided into groups (ParamGroup) More...
 

Functions

bool is_hex (const char *buf, size_t len)
 
bool is_hex_with_prefix (const char *buf)
 
bool is_dec (const char *buf, size_t len)
 
bool is_number (const char *my_buf)
 
long get_number (const char *my_buf)
 
size_t strip_to_list (IN std::string s, IN std::string delim, OUT std::set< std::string > &elements_list)
 
std::string & trim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 
bool get_console_color (HANDLE hConsole, int &color)
 
void print_in_color (int color, const std::string &text)
 
template<typename T_CHAR >
std::string to_string (T_CHAR *str1)
 
template<typename T_CHAR >
int loadInt (const T_CHAR *str1, bool isHex=false)
 
template<typename T_CHAR >
bool loadBoolean (IN const T_CHAR *str1, OUT bool &value)
 
template<typename T_STR , typename T_CHAR >
size_t copy_to_cstr (T_STR value, T_CHAR *buf, size_t buf_count)
 Copy the std::string/std::wstring value into an buffer of a given character count. More...
 
std::string & ltrim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 
std::string & rtrim (std::string &str, const std::string &chars="\t\n\v\f\r ")
 

Variables

const WORD ERROR_COLOR = RED
 
const WORD WARNING_COLOR = RED
 
const WORD HILIGHTED_COLOR = WHITE
 
const WORD HEADER_COLOR = YELLOW
 
const WORD SEPARATOR_COLOR = BROWN
 
const WORD INACTIVE_COLOR = GRAY
 
const WORD PARAM_SIMILAR_NAME = MAKE_COLOR(MAGENTA, BLACK)
 
const WORD PARAM_SIMILAR_DESC = MAKE_COLOR(BLACK, MAGENTA)
 

Function Documentation

◆ copy_to_cstr()

template<typename T_STR , typename T_CHAR >
size_t paramkit::copy_to_cstr ( T_STR  value,
T_CHAR *  buf,
size_t  buf_count 
)

Copy the std::string/std::wstring value into an buffer of a given character count.

Definition at line 93 of file pk_util.h.

◆ get_console_color()

bool paramkit::get_console_color ( HANDLE  hConsole,
int &  color 
)

Definition at line 85 of file pk_util.cpp.

◆ get_number()

long paramkit::get_number ( const char *  my_buf)

Definition at line 55 of file pk_util.cpp.

Here is the call graph for this function:

◆ is_dec()

bool paramkit::is_dec ( const char *  buf,
size_t  len 
)

Definition at line 16 of file pk_util.cpp.

◆ is_hex()

bool paramkit::is_hex ( const char *  buf,
size_t  len 
)

Definition at line 4 of file pk_util.cpp.

◆ is_hex_with_prefix()

bool paramkit::is_hex_with_prefix ( const char *  buf)

Definition at line 26 of file pk_util.cpp.

Here is the call graph for this function:

◆ is_number()

bool paramkit::is_number ( const char *  my_buf)

Definition at line 45 of file pk_util.cpp.

Here is the call graph for this function:

◆ loadBoolean()

template<typename T_CHAR >
bool paramkit::loadBoolean ( IN const T_CHAR *  str1,
OUT bool &  value 
)

Definition at line 65 of file pk_util.h.

Here is the call graph for this function:

◆ loadInt()

template<typename T_CHAR >
int paramkit::loadInt ( const T_CHAR *  str1,
bool  isHex = false 
)

Definition at line 49 of file pk_util.h.

Here is the call graph for this function:

◆ ltrim()

std::string& paramkit::ltrim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)

Definition at line 108 of file pk_util.cpp.

◆ print_in_color()

void paramkit::print_in_color ( int  color,
const std::string &  text 
)

Definition at line 93 of file pk_util.cpp.

Here is the call graph for this function:

◆ rtrim()

std::string& paramkit::rtrim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)

Definition at line 114 of file pk_util.cpp.

◆ strip_to_list()

size_t paramkit::strip_to_list ( IN std::string  s,
IN std::string  delim,
OUT std::set< std::string > &  elements_list 
)

Definition at line 126 of file pk_util.cpp.

Here is the call graph for this function:

◆ to_string()

template<typename T_CHAR >
std::string paramkit::to_string ( T_CHAR *  str1)

Definition at line 36 of file pk_util.h.

◆ trim()

std::string & paramkit::trim ( std::string &  str,
const std::string &  chars = "\t\n\v\f\r " 
)

Definition at line 121 of file pk_util.cpp.

Here is the call graph for this function:

Variable Documentation

◆ ERROR_COLOR

const WORD paramkit::ERROR_COLOR = RED

Definition at line 7 of file color_scheme.h.

◆ HEADER_COLOR

const WORD paramkit::HEADER_COLOR = YELLOW

Definition at line 11 of file color_scheme.h.

◆ HILIGHTED_COLOR

const WORD paramkit::HILIGHTED_COLOR = WHITE

Definition at line 9 of file color_scheme.h.

◆ INACTIVE_COLOR

const WORD paramkit::INACTIVE_COLOR = GRAY

Definition at line 13 of file color_scheme.h.

◆ PARAM_SIMILAR_DESC

const WORD paramkit::PARAM_SIMILAR_DESC = MAKE_COLOR(BLACK, MAGENTA)

Definition at line 16 of file color_scheme.h.

◆ PARAM_SIMILAR_NAME

const WORD paramkit::PARAM_SIMILAR_NAME = MAKE_COLOR(MAGENTA, BLACK)

Definition at line 15 of file color_scheme.h.

◆ SEPARATOR_COLOR

const WORD paramkit::SEPARATOR_COLOR = BROWN

Definition at line 12 of file color_scheme.h.

◆ WARNING_COLOR

const WORD paramkit::WARNING_COLOR = RED

Definition at line 8 of file color_scheme.h.