From 07a306aa81c435ac049f50aee41f05c319b37892 Mon Sep 17 00:00:00 2001 From: LAGNEAU Romain Date: Wed, 4 Dec 2024 10:58:36 +0100 Subject: [PATCH] [CORE] Moved include in the CPP, using forward declaration instead --- modules/core/include/visp3/core/vpXmlParser.h | 14 +++++++++++--- modules/core/src/tools/xml/vpXmlParser.cpp | 6 ++++++ modules/core/test/tools/xml/testXmlParser.cpp | 2 ++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/modules/core/include/visp3/core/vpXmlParser.h b/modules/core/include/visp3/core/vpXmlParser.h index adce5cad4f..7485b1ab48 100644 --- a/modules/core/include/visp3/core/vpXmlParser.h +++ b/modules/core/include/visp3/core/vpXmlParser.h @@ -45,8 +45,6 @@ #include -#include - #include #include #include @@ -54,6 +52,14 @@ #include #include +struct _xmlDoc; +typedef _xmlDoc xmlDoc; +typedef xmlDoc *xmlDocPtr; + +struct _xmlNode; +typedef _xmlNode xmlNode; +typedef xmlNode *xmlNodePtr; + BEGIN_VISP_NAMESPACE /*! \class vpXmlParser @@ -93,6 +99,8 @@ BEGIN_VISP_NAMESPACE A class to parse this document is declared as follows: \code + #include + class vpDataParser: public vpXmlParser { private: @@ -307,7 +315,7 @@ class VISP_EXPORT vpXmlParser static function vpXmlParser::cleanup() that calls xmlCleanupParser() that could be called just before exit(). */ - static void cleanup() { xmlCleanupParser(); } + static void cleanup(); //@} }; END_VISP_NAMESPACE diff --git a/modules/core/src/tools/xml/vpXmlParser.cpp b/modules/core/src/tools/xml/vpXmlParser.cpp index 140b5f83fe..87e62771ed 100644 --- a/modules/core/src/tools/xml/vpXmlParser.cpp +++ b/modules/core/src/tools/xml/vpXmlParser.cpp @@ -482,6 +482,12 @@ void vpXmlParser::save(const std::string &filename, bool append) xmlSaveFormatFile(filename.c_str(), doc, 1); xmlFreeDoc(doc); } + +void vpXmlParser::cleanup() +{ + xmlCleanupParser(); +} + END_VISP_NAMESPACE #elif !defined(VISP_BUILD_SHARED_LIBS) // Work around to avoid warning: libvisp_core.a(vpXmlParser.cpp.o) has no symbols diff --git a/modules/core/test/tools/xml/testXmlParser.cpp b/modules/core/test/tools/xml/testXmlParser.cpp index 98c41d3905..96192c96f6 100644 --- a/modules/core/test/tools/xml/testXmlParser.cpp +++ b/modules/core/test/tools/xml/testXmlParser.cpp @@ -58,6 +58,8 @@ #include #include +#include + #include #ifndef DOXYGEN_SHOULD_SKIP_THIS