Main header file. More...
#include <iostream>
#include <sstream>
#include <string>
#include <xercesc/sax2/SAX2XMLReader.hpp>
#include <xercesc/sax2/XMLReaderFactory.hpp>
#include <xercesc/sax2/DefaultHandler.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
#include <xercesc/util/OutOfMemoryException.hpp>
#include <libmlp-cpp/MlpDtdResolver.hpp>
#include <libmlp-cpp/MlpXmlString.hpp>
#include <libmlp-cpp/MlpParseHandlers.hpp>
#include <libmlp-cpp/MlpErrorHandler.hpp>
#include <libmlp-cpp/MlpLog.hpp>
#include <libmlp-cpp/MlpMessage.hpp>
#include <libmlp-cpp/MlpConfig.hpp>
#include <libmlp-cpp/MlpXmlException.hpp>
Go to the source code of this file.
Classes | |
class | MlpParser |
Main parser class. More... | |
Defines | |
#define | MLP_LIB_CPP_INIT |
Macro to initialize the environment. | |
#define | MLP_LIB_CPP_TERMINATE |
Macro to clean the environment. |
Main header file.
This file contains MlpParser class declaration.
#define MLP_LIB_CPP_INIT |
do \ { \ try { \ xercesc::XMLPlatformUtils::Initialize(); \ } \ catch (const xercesc::XMLException& e){ \ std::ostringstream error; \ error << "MlpXmlException: Error during Xerces-c initialization! :\n" \ << "MlpXmlException: Exception message is: \n" \ << "MlpXmlException: " << MlpXmlString( e.getMessage() ) ; \ MLP_LOG_ERROR( error.str() ); \ throw MlpXmlException( error.str() ); \ } \ } \ while ( false )
Macro to initialize the environment.
This macro should be used at the beginning of program before creating any MLP parser. It initiates Xerces environment. It is better not to use this macro in constructor as it throws the MlpXmlException.
MlpXmlException |
#define MLP_LIB_CPP_TERMINATE |
do \ { \ try { \ xercesc::XMLPlatformUtils::Terminate(); \ } \ catch ( const xercesc::XMLException& e ) { \ std::ostringstream error; \ error << "MlpXmlException: Error during Xerces-c termination! :\n" \ << "MlpXmlException: Exception message is: \n" \ << "MlpXmlException: " << MlpXmlString( e.getMessage() ) ; \ MLP_LOG_ERROR( error.str() ); \ throw MlpXmlException( error.str() ); \ } \ } \ while ( false ) \
Macro to clean the environment.
This macro should be used at the end of program to clean things up. It cleans Xerces environment. It is better not to use this macro in destructors as it throws the MlpXmlException. Destructors should never throw the exceptions.
MlpXmlException |