58 std::ostringstream
str;
61 const char *
slash =
"";
85 str <<
" " <<
_(
"shows all options");
104 WAR <<
"attempt to set option help for non-existing option."
105 <<
" text: " <<
help_str << std::endl;
119 std::vector<int>
ret;
127 if (
'0' <= *
cp && *
cp <=
'9' )
139 if (
num !=
unsigned(-1) )
184 const char *
sep =
"(";
188 if ( *
sep !=
',' )
sep =
",";
unsigned _default
index of the default option
const StrVector & options() const
bool isYesNoPrompt() const
ColorString optionString() const
Option string (may have embedded color codes)
int _shown_count
Number of options to show (the rest will still be available and visible through '?...
std::vector< int > getReplyMatches(const std::string &reply_r) const
Return the indices of option string matches (lowercase/prefix or #NUM).
std::string replyMatchesStr(const std::vector< int > &matches_r) const
The returned reply matches as '(,)' list.
PromptOptions()
Default c-tor.
StrVector _opt_help
help strings corresponding to options
bool isDisabled(unsigned opt) const
StrVector _options
option strings
std::vector< std::string > StrVector
void setOptionHelp(unsigned opt, const std::string &help_str)
void setOptions(StrVector options_r, unsigned defaultOpt_r)
Colored string if do_colors.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
String related utilities and Regular expression matching.
bool hasPrefix(const C_Str &str_r, const C_Str &prefix_r)
Return whether str_r has prefix prefix_r.
std::string toLower(const std::string &s)
Return lowercase version of s.
unsigned split(const C_Str &line_r, TOutputIterator result_r, const C_Str &sepchars_r=" \t", const Trim trim_r=NO_TRIM)
Split line_r into words.
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...