#include "ACEXML/common/XML_Util.h"
Go to the source code of this file.
Defines | |
#define | CSTRLEN(x) ((sizeof(x) / sizeof(ACEXML_Char)) - 1) |
Functions | |
ACEXML_String | ACEXML_escape_string (const ACEXML_String &str) |
void | ACEXML_escape_string (const ACEXML_String &in, ACEXML_String &out) |
Variables | |
static const ACEXML_Char | ESCAPED_AMP [] = ACE_TEXT("&") |
static const ACEXML_Char | ESCAPED_LESS [] = ACE_TEXT("<") |
static const ACEXML_Char | ESCAPED_GREATER [] = ACE_TEXT(">") |
static const ACEXML_Char | ESCAPED_APOS [] = ACE_TEXT("'") |
static const ACEXML_Char | ESCAPED_QUOTE [] = ACE_TEXT(""") |
#define CSTRLEN | ( | x | ) | ((sizeof(x) / sizeof(ACEXML_Char)) - 1) |
Definition at line 11 of file XML_Util.cpp.
ACEXML_String ACEXML_escape_string | ( | const ACEXML_String & | str | ) |
Definition at line 13 of file XML_Util.cpp.
{ ACEXML_String ret(str.length ()); ACEXML_escape_string(str, ret); return ret; }
void ACEXML_escape_string | ( | const ACEXML_String & | in, | |
ACEXML_String & | out | |||
) |
Definition at line 20 of file XML_Util.cpp.
{ size_t len = in.length (); out.clear(); for (size_t stridx = 0; stridx < len; ++stridx) { switch (in[stridx]) { case '&': out.append(ESCAPED_AMP, CSTRLEN(ESCAPED_AMP)); break; case '<': out.append(ESCAPED_LESS, CSTRLEN(ESCAPED_LESS)); break; case '>': out.append(ESCAPED_GREATER, CSTRLEN(ESCAPED_GREATER)); break; case '\'': out.append(ESCAPED_APOS, CSTRLEN(ESCAPED_APOS)); break; case '\"': out.append(ESCAPED_QUOTE, CSTRLEN(ESCAPED_QUOTE)); break; default: out += in[stridx]; } } }
const ACEXML_Char ESCAPED_AMP[] = ACE_TEXT("&") [static] |
Definition at line 5 of file XML_Util.cpp.
const ACEXML_Char ESCAPED_APOS[] = ACE_TEXT("'") [static] |
Definition at line 8 of file XML_Util.cpp.
const ACEXML_Char ESCAPED_GREATER[] = ACE_TEXT(">") [static] |
Definition at line 7 of file XML_Util.cpp.
const ACEXML_Char ESCAPED_LESS[] = ACE_TEXT("<") [static] |
Definition at line 6 of file XML_Util.cpp.
const ACEXML_Char ESCAPED_QUOTE[] = ACE_TEXT(""") [static] |
Definition at line 9 of file XML_Util.cpp.