Mania++
Main Page
Related Pages
Classes
Files
File List
All
Classes
Functions
Variables
Pages
src
Utils
Text.h
1
#ifndef TEXT_H_
2
#define TEXT_H_
3
4
#include <string>
5
#include <sstream>
6
7
//* Text
11
class
Text
12
{
13
public
:
19
static
std::string
EscapeXML
(
const
std::string& src)
20
{
21
std::stringstream dst;
22
for
(
char
ch : src)
23
{
24
switch
(ch)
25
{
26
case
'&'
: dst <<
"&"
;
break
;
27
case
'\''
: dst <<
"'"
;
break
;
28
case
'"'
: dst <<
"""
;
break
;
29
case
'<'
: dst <<
"<"
;
break
;
30
case
'>'
: dst <<
">"
;
break
;
31
default
: dst << ch;
break
;
32
}
33
}
34
35
return
dst.str();
36
}
37
};
38
39
#endif // TEXT_H_
Text::EscapeXML
static std::string EscapeXML(const std::string &src)
Escapes XML signs, to send XML strings.
Definition:
Text.h:19
Text
Contains utilities to format text.
Definition:
Text.h:11
Generated on Tue Jan 10 2017 21:40:49 for Mania++ by
1.8.6