|
| static void | extract (std::ostringstream &messages, const char *parameter, command< text_note > element) |
| | Dummy for use with text embedded in the parameter lists. More...
|
| |
| static void | extract (std::ostringstream &messages, const char *parameter, command< bool > element) |
| | Extract a boolean value of the parameter from the command line parameters. More...
|
| |
| template<typename TYPE , typename std::enable_if< std::is_same< TYPE, short >::value||std::is_same< TYPE, int >::value||std::is_same< TYPE, long >::value||std::is_same< TYPE, long long >::value >::type * = nullptr> |
| static void | extract (std::ostringstream &messages, const char *parameter, command< TYPE > element) |
| | Extract an integer value of the parameter from the command line parameters. More...
|
| |
| template<typename TYPE , typename std::enable_if< std::is_same< TYPE, unsigned short >::value||std::is_same< TYPE, unsigned int >::value||std::is_same< TYPE, unsigned long >::value||std::is_same< TYPE, unsigned long long >::value >::type * = nullptr> |
| static void | extract (std::ostringstream &messages, const char *parameter, command< TYPE > element) |
| | Extract an unsigned integer value of the parameter from the command line parameters. More...
|
| |
| template<typename TYPE , typename std::enable_if< std::is_same< TYPE, float >::value||std::is_same< TYPE, double >::value >::type * = nullptr> |
| static void | extract (std::ostringstream &messages, const char *parameter, command< TYPE > element) |
| | Extract a floating point value of the parameter from the command line parameters. More...
|
| |
| static void | extract (std::ostringstream &messages, const char *parameter, command< std::string > element) |
| | Extract a string value of the parameter from the command line parameters. More...
|
| |
| template<typename TYPE > |
| static void | extract (std::ostringstream &messages, const char *parameter, TYPE element) |
| | Catch all for unknown types. More...
|
| |
| template<std::size_t I = 0, typename... Tp> |
| static std::enable_if< I==sizeof...(Tp), void >::type | for_each_parameter (std::ostringstream &messages, size_t &arg, const char *argv[], std::tuple< Tp... > &) |
| | Iterate over each parameter looking for one that matches. More...
|
| |
| template<std::size_t I = 0, typename... Tp> |
| static std::enable_if< I==sizeof...(Tp), void >::type | for_each_usage_print (std::ostream &out, size_t width_of_shortname, size_t width_of_longname, const std::tuple< Tp... > &) |
| | Iterate over each parameter printing the shortname, longname, and description. More...
|
| |
|
| template<std::size_t I = 0, typename... Tp> |
| std::enable_if< I< sizeof...(Tp), void >::type static for_each_parameter(std::ostringstream &messages, size_t &arg, const char *argv[], std::tuple< Tp... > &tuple) { if(std::get< I >tuple).shortname.size()==0||std::get< I >tuple).longname.size()==0) for_each_parameter< I+1, Tp... >messages, arg, argv, tuple);else if(strcmp(argv[arg], std::get< I >tuple).shortname.c_str())==0) { extract(messages, argv[++arg], std::get< I >tuple));if(typeid(std::get< I >tuple).parameter) !=typeid(bool)) arg++;} else if(strcmp(argv[arg], std::get< I >tuple).longname.c_str())==0) { extract(messages, argv[++arg], std::get< I >tuple));if(typeid(std::get< I >tuple).parameter) !=typeid(bool)) arg++;} else if(strncmp(argv[arg], std::get< I >tuple).longname.c_str(), std::get< I >tuple).longname.size())==0) { extract(messages, argv[arg]+std::get< I >tuple).longname.size(), std::get< I >tuple));arg++;} else if(strncmp(argv[arg], std::get< I >tuple).shortname.c_str(), std::get< I >tuple).shortname.size())==0) { extract(messages, argv[arg]+std::get< I >tuple).shortname.size(), std::get< I >tuple));arg++;} else for_each_parameter< I+1, Tp... >messages, arg, argv, tuple);} template< std::size_t I=0, typename... Tp > inline typename std::enable_if< I==sizeof...(Tp), void >::type static for_each_usage_formatting(size_t &width_of_shortname, size_t &width_of_longname, const std::tuple< Tp... > &) { } template< std::size_t I=0, typename... Tp > inline typename std::enable_if< I< sizeof...(Tp), void >::type static for_each_usage_formatting(size_t &width_of_shortname, size_t &width_of_longname, const std::tuple< Tp... > &tuple) { if(std::get< I >tuple).shortname.size() > width_of_shortname) width_of_shortname=std::get< I >tuple).shortname.size();if(std::get< I >tuple).longname.size() > width_of_longname | width_of_longname = std::get<I>(tuple).longname.size() |
| | Iterate over each parameter looking for one that matches. More...
|
| |
template<typename TYPE , typename std::enable_if< std::is_same< TYPE, short >::value||std::is_same< TYPE, int >::value||std::is_same< TYPE, long >::value||std::is_same< TYPE, long long >::value >::type * = nullptr>
| static void JASS::commandline::extract |
( |
std::ostringstream & |
messages, |
|
|
const char * |
parameter, |
|
|
command< TYPE > |
element |
|
) |
| |
|
inlinestaticprivate |
Extract an integer value of the parameter from the command line parameters.
All signed integer types can be decode in this one method by assuming the largest type and then checking for out of range
- Parameters
-
| messages | [out] Any errors are reported down this stream. |
| parameter | [in] The unparsed paramter as given by the user |
| element | [out] where to put the value. |
template<typename TYPE , typename std::enable_if< std::is_same< TYPE, unsigned short >::value||std::is_same< TYPE, unsigned int >::value||std::is_same< TYPE, unsigned long >::value||std::is_same< TYPE, unsigned long long >::value >::type * = nullptr>
| static void JASS::commandline::extract |
( |
std::ostringstream & |
messages, |
|
|
const char * |
parameter, |
|
|
command< TYPE > |
element |
|
) |
| |
|
inlinestaticprivate |
Extract an unsigned integer value of the parameter from the command line parameters.
All unsigned integer types can be decode in this one method by assuming the largest type and then checking for out of range
- Parameters
-
| messages | [out] Any errors are reported down this stream. |
| parameter | [in] The unparsed paramter as given by the user |
| element | [out] where to put the value. |
template<typename TYPE , typename std::enable_if< std::is_same< TYPE, float >::value||std::is_same< TYPE, double >::value >::type * = nullptr>
| static void JASS::commandline::extract |
( |
std::ostringstream & |
messages, |
|
|
const char * |
parameter, |
|
|
command< TYPE > |
element |
|
) |
| |
|
inlinestaticprivate |
Extract a floating point value of the parameter from the command line parameters.
manages floats and doubles and checks for out of range
- Parameters
-
| messages | [out] Any errors are reported down this stream. |
| parameter | [in] The unparsed paramter as given by the user |
| element | [out] where to put the value. |