void CmdIndex(int code) /****************************************************************************** purpose: convert \index{classe!article@\textit{article}!section} to {\xe\v "classe:{\i article}:section"} ******************************************************************************/ { char cThis, *text, *r, *s, *t; cThis = getNonBlank(); text = getDelimitedText('{', '}', TRUE); diagnostics(4, "CmdIndex \\index{%s}", text); fprintRTF("{\\xe{\\v "); t = text; while (t) { s = t; t = strchr(s,'!'); if (t) *t = '\0'; r = strchr(s,'@'); if (r) s=r+1; ConvertString(s); /* while (*s && *s != '@') putRtfChar(*s++);*/ if (t) { fprintRTF("\\:"); t++; } } fprintRTF("}}"); diagnostics(4, "leaving CmdIndex"); free(text); }
static char * getAngleParam(void) /****************************************************************************** purpose: return bracketed parameter \item<1> ---> "1" \item<> ---> "" \item the ---> NULL ^ ^ ^ \item <1> ---> "1" \item <> ---> "" \item the ---> NULL ^ ^ ^ ******************************************************************************/ { char c, *text; c = getNonBlank(); if (c == '<') { text = getDelimitedText('<','>',TRUE); diagnostics(5, "getAngleParam [%s]", text); } else { ungetTexChar(c); text = NULL; diagnostics(5, "getAngleParam []"); } return text; }
std::string Strings::getCommaText() const { UINT bakDefined = defined_; char bakDelimiter = delimiter_; char bakQuoteChar = quoteChar_; const_cast<Strings&>(*this).setDelimiter(DEFAULT_DELIMITER); const_cast<Strings&>(*this).setQuoteChar(DEFAULT_QUOTE_CHAR); std::string result = getDelimitedText(); // 不可以抛出异常 const_cast<Strings&>(*this).defined_ = bakDefined; const_cast<Strings&>(*this).delimiter_ = bakDelimiter; const_cast<Strings&>(*this).quoteChar_ = bakQuoteChar; return result; }