Xalan-C++ API Reference  1.12.0
Public Types | Public Member Functions | List of all members
xalanc::XalanXMLFileReporter Class Reference

#include <xalanc/Harness/XalanXMLFileReporter.hpp>

Public Types

typedef XalanMap< XalanDOMString, XalanDOMStringHashtable
 
typedef std::FILE FileHandleType
 

Public Member Functions

 XalanXMLFileReporter (MemoryManager &theManager, const XalanDOMString &fileName)
 
 ~XalanXMLFileReporter ()
 
bool initialize (MemoryManager &theManager)
 
MemoryManager & getMemoryManager ()
 
bool getFlushOnCaseClose ()
 
const XalanDOMStringgetFileName () const
 
void setFileName (const XalanDOMString &fileName)
 
void setFileName (const char *fileName, MemoryManager &theManager)
 
bool checkError ()
 
bool isReady ()
 
void flush ()
 
void close ()
 
void logTestFileInit (const XalanDOMString &msg)
 Report that a testfile has started. More...
 
void logTestFileInit (const char *msg)
 
void logTestFileClose (const XalanDOMString &msg, const XalanDOMString &result)
 Report that a testfile has finished, and report it's result. More...
 
void logTestFileClose (const char *msg, const char *result)
 
void logTestCaseInit (const XalanDOMString &msg)
 
void logTestCaseInit (const char *msg)
 
void logTestCaseClose (const XalanDOMString &msg, const XalanDOMString &result)
 Report that a testcase has finished, and report it's result. More...
 
void logTestCaseClose (const char *msg, const char *result)
 
void logMessage (int level, const XalanDOMString &msg)
 Report a comment to result file with specified severity. More...
 
void logStatistic (int level, long lVal, double dVal, const XalanDOMString &msg)
 Logs out statistics to result file with specified severity. More...
 
void logStatistic (int level, long lVal, double dVal, const char *msg)
 
void addMetricToAttrs (const char *desc, double theMetric, Hashtable &attrs)
 
void logElementWAttrs (int level, const XalanDOMString &element, Hashtable &attrs, const XalanDOMString &msg)
 Logs out a element to results with specified severity. More...
 
void logElementWAttrs (int level, const char *element, Hashtable &attrs, const char *msg)
 
void logElement (int level, const XalanDOMString &element, const XalanDOMString &msg)
 
void logElement (const XalanDOMString &element, const XalanDOMString &msg)
 
void logArbitraryMessage (int level, const XalanDOMString &msg)
 Report an arbitrary XalanDOMString to result file with specified severity. More...
 
void logCheckPass (const XalanDOMString &comment)
 Report a complete Hashtable to result file with specified severity. More...
 
void logCheckAmbiguous (const XalanDOMString &comment)
 Writes out an ambiguous record with comment. More...
 
void logCheckFail (const XalanDOMString &comment)
 Writes out a Fail record with comment. More...
 
void logCheckFail (const XalanDOMString &test, const Hashtable &faildata, const Hashtable &actexp)
 
void logCheckFail (const XalanDOMString &test, const Hashtable &actexp)
 
void logErrorResult (const XalanDOMString &test, const XalanDOMString &reason)
 
void logCheckErr (const XalanDOMString &comment)
 Writes out a Error record with comment. More...
 
XalanDOMStringescapestring (const XalanDOMString &s, XalanDOMString &buffer)
 Escapes a XalanDOMString to remove <, >, ', &, and " so it's valid XML. More...
 

Detailed Description

Definition at line 51 of file XalanXMLFileReporter.hpp.

Member Typedef Documentation

◆ FileHandleType

Definition at line 58 of file XalanXMLFileReporter.hpp.

◆ Hashtable

Definition at line 56 of file XalanXMLFileReporter.hpp.

Constructor & Destructor Documentation

◆ XalanXMLFileReporter()

xalanc::XalanXMLFileReporter::XalanXMLFileReporter ( MemoryManager &  theManager,
const XalanDOMString fileName 
)

◆ ~XalanXMLFileReporter()

xalanc::XalanXMLFileReporter::~XalanXMLFileReporter ( )

Member Function Documentation

◆ addMetricToAttrs()

void xalanc::XalanXMLFileReporter::addMetricToAttrs ( const char *  desc,
double  theMetric,
Hashtable attrs 
)

◆ checkError()

bool xalanc::XalanXMLFileReporter::checkError ( )

◆ close()

void xalanc::XalanXMLFileReporter::close ( )

◆ escapestring()

XalanDOMString& xalanc::XalanXMLFileReporter::escapestring ( const XalanDOMString s,
XalanDOMString buffer 
)

Escapes a XalanDOMString to remove <, >, ', &, and " so it's valid XML.


Stolen mostly from Xalan applet sample.

Parameters
sXalanDOMString to escape.
Returns
XalanDOMString that has been escaped.

◆ flush()

void xalanc::XalanXMLFileReporter::flush ( )

◆ getFileName()

const XalanDOMString& xalanc::XalanXMLFileReporter::getFileName ( ) const

◆ getFlushOnCaseClose()

bool xalanc::XalanXMLFileReporter::getFlushOnCaseClose ( )

◆ getMemoryManager()

MemoryManager& xalanc::XalanXMLFileReporter::getMemoryManager ( )
inline

Definition at line 73 of file XalanXMLFileReporter.hpp.

◆ initialize()

bool xalanc::XalanXMLFileReporter::initialize ( MemoryManager &  theManager)

◆ isReady()

bool xalanc::XalanXMLFileReporter::isReady ( )

◆ logArbitraryMessage()

void xalanc::XalanXMLFileReporter::logArbitraryMessage ( int  level,
const XalanDOMString msg 
)

Report an arbitrary XalanDOMString to result file with specified severity.


Appends and prepends \n newline characters at the start and end of the message to separate it from the tags.

Record format: <arbitrary level="##">
msg
</arbitrary>

Parameters
levelseverity or class of message.
msgarbitrary XalanDOMString to log out.

◆ logCheckAmbiguous()

void xalanc::XalanXMLFileReporter::logCheckAmbiguous ( const XalanDOMString comment)

Writes out an ambiguous record with comment.


Record format: <checkresult result="AMBG" desc="comment"/>

Parameters
commentcomment to log with the ambg record.

◆ logCheckErr()

void xalanc::XalanXMLFileReporter::logCheckErr ( const XalanDOMString comment)

Writes out a Error record with comment.


Record format: <checkresult result="ERRR" desc="comment"/>

Parameters
commentcomment to log with the error record.

◆ logCheckFail() [1/3]

void xalanc::XalanXMLFileReporter::logCheckFail ( const XalanDOMString comment)

Writes out a Fail record with comment.


Record format: <checkresult result="FAIL" desc="comment"/>

Parameters
commentcomment to log with the fail record.

◆ logCheckFail() [2/3]

void xalanc::XalanXMLFileReporter::logCheckFail ( const XalanDOMString test,
const Hashtable actexp 
)

◆ logCheckFail() [3/3]

void xalanc::XalanXMLFileReporter::logCheckFail ( const XalanDOMString test,
const Hashtable faildata,
const Hashtable actexp 
)

◆ logCheckPass()

void xalanc::XalanXMLFileReporter::logCheckPass ( const XalanDOMString comment)

Report a complete Hashtable to result file with specified severity.


Indents each hashitem within the table.

Record format: <hashtable level="##" desc="msg"/>
  <hashitem key="key1">value1</hashitem>
  <hashitem key="key2">value2</hashitem>
</hashtable>

Parameters
levelseverity or class of message.
hashHashtable to log the contents of.
msgdecription of the Hashtable. Writes out a Pass record with comment.

Record format: <checkresult result="PASS" desc="comment"/>

Parameters
commentcomment to log with the pass record.

◆ logElement() [1/2]

void xalanc::XalanXMLFileReporter::logElement ( const XalanDOMString element,
const XalanDOMString msg 
)

◆ logElement() [2/2]

void xalanc::XalanXMLFileReporter::logElement ( int  level,
const XalanDOMString element,
const XalanDOMString msg 
)

◆ logElementWAttrs() [1/2]

void xalanc::XalanXMLFileReporter::logElementWAttrs ( int  level,
const char *  element,
Hashtable attrs,
const char *  msg 
)
inline

Definition at line 200 of file XalanXMLFileReporter.hpp.

◆ logElementWAttrs() [2/2]

void xalanc::XalanXMLFileReporter::logElementWAttrs ( int  level,
const XalanDOMString element,
Hashtable attrs,
const XalanDOMString msg 
)

Logs out a element to results with specified severity.

Uses user-supplied element name and attribute list. Currently attribute values and msg are forced .toString(). Also, 'level' is forced to be the first attribute of the element.

Parameters
levelseverity of message.
elementname of enclosing element
attrshash of name=value attributes; note that the caller must ensure they're legal XML
msgcomment to log out.

◆ logErrorResult()

void xalanc::XalanXMLFileReporter::logErrorResult ( const XalanDOMString test,
const XalanDOMString reason 
)

◆ logMessage()

void xalanc::XalanXMLFileReporter::logMessage ( int  level,
const XalanDOMString msg 
)

Report a comment to result file with specified severity.


Record format: <message level="##">msg</message>

Parameters
levelseverity or class of message.
msgcomment to log out.

◆ logStatistic() [1/2]

void xalanc::XalanXMLFileReporter::logStatistic ( int  level,
long  lVal,
double  dVal,
const char *  msg 
)
inline

Definition at line 179 of file XalanXMLFileReporter.hpp.

◆ logStatistic() [2/2]

void xalanc::XalanXMLFileReporter::logStatistic ( int  level,
long  lVal,
double  dVal,
const XalanDOMString msg 
)

Logs out statistics to result file with specified severity.


Record format: <statistic level="##" desc="msg"><longval>1234</longval><doubleval>1.234</doubleval></statistic>

Parameters
levelseverity of message.
lValstatistic in long format.
dValstatistic in double format.
msgcomment to log out.

◆ logTestCaseClose() [1/2]

void xalanc::XalanXMLFileReporter::logTestCaseClose ( const char *  msg,
const char *  result 
)
inline

Definition at line 152 of file XalanXMLFileReporter.hpp.

◆ logTestCaseClose() [2/2]

void xalanc::XalanXMLFileReporter::logTestCaseClose ( const XalanDOMString msg,
const XalanDOMString result 
)

Report that a testcase has finished, and report it's result.


Parameters
msgmessage to log out
resultresult of testfile

◆ logTestCaseInit() [1/2]

void xalanc::XalanXMLFileReporter::logTestCaseInit ( const char *  msg)
inline

Definition at line 140 of file XalanXMLFileReporter.hpp.

◆ logTestCaseInit() [2/2]

void xalanc::XalanXMLFileReporter::logTestCaseInit ( const XalanDOMString msg)

◆ logTestFileClose() [1/2]

void xalanc::XalanXMLFileReporter::logTestFileClose ( const char *  msg,
const char *  result 
)
inline

Definition at line 133 of file XalanXMLFileReporter.hpp.

◆ logTestFileClose() [2/2]

void xalanc::XalanXMLFileReporter::logTestFileClose ( const XalanDOMString msg,
const XalanDOMString result 
)

Report that a testfile has finished, and report it's result.


Parameters
msgmessage to log out
resultresult of testfile

◆ logTestFileInit() [1/2]

void xalanc::XalanXMLFileReporter::logTestFileInit ( const char *  msg)
inline

Definition at line 121 of file XalanXMLFileReporter.hpp.

◆ logTestFileInit() [2/2]

void xalanc::XalanXMLFileReporter::logTestFileInit ( const XalanDOMString msg)

Report that a testfile has started.


Parameters
msgmessage to log out

◆ setFileName() [1/2]

void xalanc::XalanXMLFileReporter::setFileName ( const char *  fileName,
MemoryManager &  theManager 
)
inline

Definition at line 88 of file XalanXMLFileReporter.hpp.

◆ setFileName() [2/2]

void xalanc::XalanXMLFileReporter::setFileName ( const XalanDOMString fileName)

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