while (s != 2) {
switch (s) {
case 0:
- pnext = m_text.find ("%(", pos);
+ pnext = m_text.find ("${", pos);
if (pnext == m_text.npos) {
result += m_text.substr (pos);
s = 2;
}
break;
case 1:
- pnext = m_text.find (")", pos);
+ pnext = m_text.find ("}", pos);
if (pnext == m_text.npos) {
- result += "%(";
+ result += "${";
result += m_text.substr (pos);
s = 2;
}
return result;
}
- const std::string dec (gint d) {
+ const std::string dec (gint d, const gchar *fmt = "%d") {
char string [32];
- std::snprintf (string, sizeof (string), "%d", d);
+ std::snprintf (string, sizeof (string), fmt, d);
return string;
}
getline (in, line);
size_t pos = line.find ('\t');
if (pos == line.npos) {
- std::cerr << "error: " << line << std::endl;
continue;
}
std::string command = line.substr(0, pos);
return TRUE;
}
+#if 0
static bool
phraseCmp (const SpecialPhrase *first,
const SpecialPhrase *second)
{
return first->position () <= second->position ();
}
+#endif
void
SpecialTable::insert (const std::string &command,
pcji PC机
qiruiqq 奇瑞QQ
qqhao QQ号
-rq %(year)年%(month)月%(day)日
-rq %(year)-%(month)-%(day)
+rq ${year}年${month}月${day}日
+rq ${year}-${month}-${day}
simka SIM卡
-sj %(hour_24)时%(minute)分%(second)秒
-sj %(hour_24):%(minute):%(second)
+sj ${hour_24}时${minute}分${second}秒
+sj ${hour_24}:${minute}:${second}
tixu T恤
tixushan T恤衫
txingtai T型台