64 #if !defined(ST_NO_NAMESPACES)
68 inline void StPrompt()
70 cout <<
"-- Press return to continue -- ";
75 inline void StPrompt(
const char *text, T& var)
80 cout << text <<
" [" << var <<
"]: ";
81 while ((c = cin.get()) && c !=
'\n') line += c;
82 if (line.length() > 0) {
83 istrstream ist(line.c_str(), line.length());
88 inline void StPrompt(
const char *text,
string& var)
93 cout << text <<
" [" << var.c_str() <<
"]: ";
94 while ((c = cin.get()) && c !=
'\n') line += c;
95 if (line.length() > 0) var = line;
98 #if defined (__SUNPRO_CC) && __SUNPRO_CC < 0x500
99 inline void StBoolPrompt(
const char *text,
bool& var)
101 inline void StPrompt(
const char *text,
bool& var)
106 string svar = var ?
"true" :
"false";
108 cout << text <<
" [" << svar.c_str() <<
"]: ";
109 while ((c = cin.get()) && c !=
'\n') line += c;
110 if (line.length() > 0) {
113 else if (line ==
"t")
115 else if (line ==
"yes")
117 else if (line ==
"y")
119 else if (line ==
"on")
121 else if (line ==
"1")
129 inline void StPrompt(
const char *text,
char* var,
unsigned int maxlength)
134 cout << text <<
" [" << var <<
"]: ";
135 while ((c = cin.get()) && c !=
'\n' && line.length() < maxlength)
137 if (line.length() > 0) strcpy(var, line.c_str());