Files Classes Functions Hierarchy
#include <stringserialization.h>
Static Public Member Functions | |
| static boolc | serialize (string &str, stringc &html) |
| Convert html to text. | |
| static boolc | serializeInverse (string &html, stringc &str) |
| static boolc | ishtml (stringc &str) |
| If html encoding is present return true. | |
Static Public Attributes | |
| static string | lessthan = "<" |
| static string | greaterthan = ">" |
| static string | amp = "&" |
| static string | quot = """ |
i.e. Save text in xml tags without interfering with the tags.
Definition at line 71 of file stringserialization.h.
If html encoding is present return true.
Definition at line 77 of file stringserialization.cpp.
References amp, greaterthan, lessthan, and quot.
Referenced by stringserializationtest::unittest01().
00078 { 00079 string s2(str); 00080 string find; 00081 00082 find=lessthan; 00083 00084 vector<string> vs; 00085 vs.push_back(lessthan); 00086 vs.push_back(greaterthan); 00087 vs.push_back(amp); 00088 vs.push_back(quot); 00089 00090 for (uint i=0; i<vs.size(); ++i) 00091 { 00092 find=vs[i]; 00093 if (s2.find(find) != string::npos) 00094 return true; 00095 } 00096 00097 return false; 00098 }
Convert html to text.
e.g. & is replaced by &.
Definition at line 52 of file stringserialization.cpp.
References amp, stringconvert::findandreplace(), greaterthan, lessthan, and quot.
Referenced by stringserializationtest::unittest01().
00053 { 00054 str=html; 00055 string& s2(str); 00056 00057 stringconvert::findandreplace(s2,lessthan,"<"); 00058 stringconvert::findandreplace(s2,greaterthan,">"); 00059 stringconvert::findandreplace(s2,amp,"&"); 00060 stringconvert::findandreplace(s2,quot,"\""); 00061 00062 return true; 00063 }
Definition at line 65 of file stringserialization.cpp.
References amp, stringconvert::findandreplace(), greaterthan, lessthan, and quot.
Referenced by modulereport::compilerhtmldetailed(), stringserializationtest::unittest01(), and modulereport::unittestshtmldetailed().
00066 { 00067 html = str; 00068 stringconvert::findandreplace(html,"&",amp); 00069 stringconvert::findandreplace(html,"<",lessthan); 00070 stringconvert::findandreplace(html,">",greaterthan); 00071 stringconvert::findandreplace(html,"\"",quot); 00072 00073 return true; 00074 }
string htmlstring::amp = "&" [static] |
Definition at line 77 of file stringserialization.h.
Referenced by ishtml(), serialize(), and serializeInverse().
string htmlstring::greaterthan = ">" [static] |
Definition at line 76 of file stringserialization.h.
Referenced by ishtml(), serialize(), and serializeInverse().
string htmlstring::lessthan = "<" [static] |
Definition at line 75 of file stringserialization.h.
Referenced by ishtml(), serialize(), and serializeInverse().
string htmlstring::quot = """ [static] |
Definition at line 78 of file stringserialization.h.
Referenced by ishtml(), serialize(), and serializeInverse().
1.5.8