XML_Util.h File Reference

#include "ACEXML/common/ACEXML_Export.h"
#include "ACEXML/common/XML_Types.h"

Include dependency graph for XML_Util.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Functions

ACEXML_Export ACEXML_String ACEXML_escape_string (const ACEXML_String &str)
ACEXML_Export void ACEXML_escape_string (const ACEXML_String &in, ACEXML_String &out)


Detailed Description

Initially contains a function to escape strings for use in XML files.

XML_Util.h,v 1.2 2005/05/26 07:34:37 jwillemsen Exp

Author:
Justin Michel <michel_j@ociweb.com>

Definition in file XML_Util.h.


Function Documentation

ACEXML_Export void ACEXML_escape_string const ACEXML_String in,
ACEXML_String out
 

Definition at line 20 of file XML_Util.cpp.

References ACEXML_String, CSTRLEN, ESCAPED_AMP, ESCAPED_APOS, ESCAPED_GREATER, ESCAPED_LESS, and ESCAPED_QUOTE.

Referenced by ACEXML_escape_string(), and run_tests().

00021 {
00022   size_t len = in.length ();
00023   out.clear();
00024   for (size_t stridx = 0; stridx < len; ++stridx)
00025   {
00026     switch (in[stridx]) {
00027     case '&':
00028       out.append(ESCAPED_AMP, CSTRLEN(ESCAPED_AMP));
00029       break;
00030     case '<':
00031       out.append(ESCAPED_LESS, CSTRLEN(ESCAPED_LESS));
00032       break;
00033     case '>':
00034       out.append(ESCAPED_GREATER, CSTRLEN(ESCAPED_GREATER));
00035       break;
00036     case '\'':
00037       out.append(ESCAPED_APOS, CSTRLEN(ESCAPED_APOS));
00038       break;
00039     case '\"':
00040       out.append(ESCAPED_QUOTE, CSTRLEN(ESCAPED_QUOTE));
00041       break;
00042     default:
00043       out += in[stridx];
00044     }
00045   }
00046 }

ACEXML_Export ACEXML_String ACEXML_escape_string const ACEXML_String str  ) 
 

Definition at line 13 of file XML_Util.cpp.

References ACEXML_escape_string(), and ACEXML_String.

00014 {
00015   ACEXML_String ret(str.length ());
00016   ACEXML_escape_string(str, ret);
00017   return ret;
00018 }


Generated on Thu Nov 9 11:47:33 2006 for ACEXML by doxygen 1.3.6