Apache Log4cxx Version 1.1.0
Loading...
Searching...
No Matches
log4cxx::helpers::Transform Class Reference

Utility class for transforming strings. More...

#include <transform.h>

Static Public Member Functions

static void appendEscapingTags (LogString &buf, const LogString &input)
 This method takes a string which may contain HTML tags (ie, <b>, <table>, etc) and replaces any '<' and '>' characters with respective predefined entity references.
 
static void appendEscapingCDATA (LogString &buf, const LogString &input)
 Add input to buf while ensuring embedded CDEnd strings (]]>) are handled properly within the message.
 
static void appendCharacterReference (LogString &buf, int ch)
 Add ch to buf as an XML character reference.
 
static void appendLegalCharacters (LogString &buf, const LogString &input)
 Append a transformation of input onto buf.
 

Detailed Description

Utility class for transforming strings.

Member Function Documentation

◆ appendCharacterReference()

static void log4cxx::helpers::Transform::appendCharacterReference ( LogString buf,
int  ch 
)
static

Add ch to buf as an XML character reference.

Parameters
bufoutput stream holding the XML data to this point.
chthe value to encode as a XML character reference

◆ appendEscapingCDATA()

static void log4cxx::helpers::Transform::appendEscapingCDATA ( LogString buf,
const LogString input 
)
static

Add input to buf while ensuring embedded CDEnd strings (]]>) are handled properly within the message.

The initial CDStart (<![CDATA[) and terminating CDEnd (]]>) of the CDATA section must be added by the calling method. Any NUL character in input is not copied to buf. A character reference is used in place of a character whose value is not permitted by the XML 1.0 specification.

Parameters
bufTransformed input text is added to this.
inputThe text to be appended to buf

◆ appendEscapingTags()

static void log4cxx::helpers::Transform::appendEscapingTags ( LogString buf,
const LogString input 
)
static

This method takes a string which may contain HTML tags (ie, <b>, <table>, etc) and replaces any '<' and '>' characters with respective predefined entity references.

Any NUL character in input is not copied to buf. A character reference is used in place of a character whose value is not permitted by the XML 1.0 specification.

Parameters
bufoutput stream where to write the modified string.
inputThe text to be converted.
Returns
The input string with the characters '<' and '>' replaced with &lt; and &gt; respectively.

◆ appendLegalCharacters()

static void log4cxx::helpers::Transform::appendLegalCharacters ( LogString buf,
const LogString input 
)
static

Append a transformation of input onto buf.

Only the valid XML 1.0 specification characters (#x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]) are copied to buf. Any special character (<, >, & and ") is replaced with an entity reference.

Parameters
bufTransformed input text is added to this.
inputThe text to be transformed.

The documentation for this class was generated from the following file: