Menu

[r330]: / framework / trunk / text_tool.cpp  Maximize  Restore  History

Download this file

24 lines (20 with data), 393 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "text_tool.h"
using namespace std;
namespace cppcms{
namespace texttool {
void text2html(string const &s,string &content)
{
unsigned i;
for(i=0;i<s.size();i++) {
char c=s[i];
switch(c){
case '<': content+="&lt;"; break;
case '>': content+="&gt;"; break;
case '&': content+="&amp;"; break;
case '\"': content+="&quot;"; break;
default: content+=c;
}
}
}
}
}
MongoDB Logo MongoDB