void INIFile::Key::setStringValue(const std::string& newValue) { if(CompleteLine[ValueStringBegin-1] == '"') { CompleteLine.replace(ValueStringBegin-1,ValueStringLength+2, escapeValue(newValue)); } else { CompleteLine.replace(ValueStringBegin,ValueStringLength, escapeValue(newValue)); } }
PUBLIC void espAnchor(HttpConn *conn, cchar *text, cchar *uri, cchar *optionString) { MprHash *options; options = httpGetOptions(optionString); text = escapeValue(text, options); espRender(conn, "<a href='%s'%s>%s</a>", uri, map(conn, options), text); }
PUBLIC void espAlert(HttpConn *conn, cchar *text, cchar *optionString) { MprHash *options; options = httpGetOptions(optionString); httpInsertOption(options, "class", ESTYLE("alert")); text = escapeValue(text, options); espRender(conn, "<div%s>%s</div>", map(conn, options), text); }
std::string format() { std::string out(name); for (std::map<std::string, std::string>::const_iterator i = tags.begin(); i != tags.end(); i++) { out += "," + escapeTag(i->first) + "=" + escapeTag(i->second); } bool first = true; for (std::map<std::string, std::string>::const_iterator i = fields.begin(); i != fields.end(); i++) { if (first) { out += " "; first = false; } else { out += ","; } out += escapeTag(i->first) + "=" + escapeValue(i->second); } return out + "\n"; }
INIFile::Key::Key(const std::string& keyname, const std::string& value) : INIFileLine(keyname + " = " + escapeValue(value)), KeyStringBegin(0), KeyStringLength(keyname.size()), ValueStringBegin(keyname.size() + 3 + (escapingValueNeeded(value) ? 1 : 0)), ValueStringLength(value.size()), nextKey(NULL), prevKey(NULL) { }