MEMBERS //--------------------------------------------------------------------------- /* */ Encode( const str& xs ) : str (> {{ str s; int pos, last = 0; for(pos = xs.find_first_of("&<>'\"\r\n"); pos != str::npos; pos = xs.find_first_of("&<>'\"\r\n", pos)) { s += xs.substr(last, pos - last); switch(xs[pos]) { case '\"': s +="""; break; case '\'': s +="'"; break; case '\n': s += " "; break; case '\r': break; case '&': s += "&"; break; case '<': s +="<"; break; case '>': s += ">"; break; default: throw CTT_Error(ctos(s[pos]) + " found in EncodeContent"); } pos++; last = pos; } s += xs.substr(last, xs.size() - last); return s; }} <) //--------------------------------------------------------------------------- /* */ m_vIndent( ) : vstr [MemberOptions] IsVariable=true (> <) //--------------------------------------------------------------------------- /* */ m_vTag( ) : vstr [MemberOptions] IsVariable=true (> <) //--------------------------------------------------------------------------- /* */ WriteAttibute( const str& xsKey, const str& xsValue ) (> {{ out << " " << xsKey << "=" << xsValue; }} <) //--------------------------------------------------------------------------- /* */ WriteTagClose( ) (> {{ out << ">" << endl; m_vIndent.push_back(m_vIndent.back() + "\t"); }} <) //--------------------------------------------------------------------------- /* */ WriteTagEnd( ) (> {{ m_vIndent.pop_back(); out << m_vIndent.back() << "" << endl; m_vTag.pop_back(); }} <) //--------------------------------------------------------------------------- /* */ WriteTagOpen( const str& xs ) (> {{ m_vTag.push_back(xs); out << m_vIndent.back() << "<" << xs; }} <) //--------------------------------------------------------------------------- /* tag without attributes */ WriteTagStart( const str& xs ) (> {{ WriteTagOpen(xs); WriteTagClose(); }} <) //--------------------------------------------------------------------------- /* */ WriteXMLEnd( ) (> {{ WriteTagEnd(); }} <) //--------------------------------------------------------------------------- /* */ WriteXMLtStart( const str& xsTag ) (> {{ //out << "" << endl; out << "" << endl; m_vIndent.push_back(""); WriteTagStart(xsTag); }} <)