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 <regex>
5
#include <string>
6
#include <sstream>
7
8
//* Text
12
class
Text
13
{
14
public
:
20
static
std::string
EscapeXML
(
const
std::string& src)
21
{
22
std::stringstream dst;
23
for
(
char
ch : src)
24
{
25
switch
(ch)
26
{
27
case
'&'
: dst <<
"&"
;
break
;
28
case
'\''
: dst <<
"'"
;
break
;
29
case
'"'
: dst <<
"""
;
break
;
30
case
'<'
: dst <<
"<"
;
break
;
31
case
'>'
: dst <<
">"
;
break
;
32
default
: dst << ch;
break
;
33
}
34
}
35
36
return
dst.str();
37
}
38
};
39
40
#endif // TEXT_H_
Text::EscapeXML
static std::string EscapeXML(const std::string &src)
Escapes XML signs, to send XML strings.
Definition:
Text.h:20
Text
Contains utilities to format text.
Definition:
Text.h:12
Generated on Sat Mar 18 2017 10:18:53 for Mania++ by
1.8.6