Classes | Functions

ContentHandler_Test.cpp File Reference

#include "ACEXML/common/DefaultHandler.h"
#include "ACEXML/common/InputSource.h"
#include "ACEXML/common/StrCharStream.h"
#include "ACEXML/parser/parser/Parser.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_main.h"
Include dependency graph for ContentHandler_Test.cpp:

Go to the source code of this file.

Classes

class  Basic_Content_Tester

Functions

int ACE_TMAIN (int, ACE_TCHAR *[])

Detailed Description

Id:
ContentHandler_Test.cpp 80826 2008-03-04 14:51:23Z wotte
Author:
Steve Huston <shuston@riverace.com>

Definition in file ContentHandler_Test.cpp.


Function Documentation

int ACE_TMAIN ( int  ,
ACE_TCHAR [] 
)

Definition at line 70 of file ContentHandler_Test.cpp.

{
  int status = 0;
  Basic_Content_Tester tester;
  ACEXML_StrCharStream *test_stream = 0;
  ACE_NEW_RETURN (test_stream, ACEXML_StrCharStream, -1);
  if (test_stream->open (tester.get_test_string (),
                         ACE_TEXT ("test_stream")) < 0)
    {
      ACE_ERROR ((LM_ERROR, ACE_TEXT ("Unable to create input stream\n")));
      return -1;
    }
  ACEXML_InputSource input (test_stream);
  ACEXML_Parser parser;
  parser.setContentHandler (&tester);
  ACEXML_TRY_NEW_ENV
  {
    parser.setFeature (ACE_TEXT ("http://xml.org/sax/features/validation"),
                       0
                       ACEXML_ENV_ARG_PARAMETER);
    ACEXML_TRY_CHECK;
    parser.parse (&input ACEXML_ENV_ARG_PARAMETER);
    ACEXML_TRY_CHECK;
  }
  ACEXML_CATCH (ACEXML_SAXException, ex)
  {
    ex.print();
    status = 1;
  }
  ACEXML_ENDTRY;
  return status;
}

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines