X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fyacsloader%2FxmlParserBase.hxx;h=aa47603054db1fe3736907a54847fd863cdad79e;hb=91945d98482a02a05a3f5df7511a4e5760db2a94;hp=c505ba842231d96efe97bd269edf078d1ce4e99f;hpb=c81be9b5e74b26e207bd6efd0ccf68418ac536a3;p=modules%2Fyacs.git diff --git a/src/yacsloader/xmlParserBase.hxx b/src/yacsloader/xmlParserBase.hxx index c505ba842..aa4760305 100644 --- a/src/yacsloader/xmlParserBase.hxx +++ b/src/yacsloader/xmlParserBase.hxx @@ -1,9 +1,9 @@ -// Copyright (C) 2006-2012 CEA/DEN, EDF R&D +// Copyright (C) 2006-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -20,41 +20,11 @@ #ifndef __XMLPARSERBASE_HXX_ #define __XMLPARSERBASE_HXX_ - -// --- select only one of the following packages ------------------------------ -// - libxml2 comes with gnome, so it's almost always already installed, -// but may not not work (see below). -// - libexpat is a less common package, but light, and works fine. - -// With standard installation of libxml2, C++ exception cannot be catched -// during the parse process. This is required for normal use of yacs. -// libxml2 must be generated with configure --with-fexceptions ... -// (to be tested) -// Developpement and tests are done with libexpat. - -//#define USE_LIBXML2 -#define USE_EXPAT - -// --- specific part for libxml2 ---------------------------------------------- - -#ifdef USE_LIBXML2 -extern "C" -{ #include -} + #define XMLCALL #define XML_Char char inline XML_Char* tochar(const xmlChar *c) { return (XML_Char*)c; }; -#endif - -// --- specific part for expat ------------------------------------------------ - -#ifdef USE_EXPAT - #include -#define xmlChar XML_Char -inline const XML_Char* tochar(const xmlChar *c) { return c; }; -#endif - // --- generic part ----------------------------------------------------------- @@ -114,15 +84,9 @@ public: std::map< std::string, int > counts; -#ifdef USE_LIBXML2 static _xmlParserCtxt* _xmlParser; static void XML_SetUserData(_xmlParserCtxt* ctxt, xmlParserBase* parser); -#endif - -#ifdef USE_EXPAT - static XML_Parser _xmlParser; -#endif static std::stack _stackParser;