Skip to content

Commit

Permalink
[CORE] Moved include in the CPP, using forward declaration instead
Browse files Browse the repository at this point in the history
  • Loading branch information
LAGNEAU Romain committed Dec 4, 2024
1 parent 412c791 commit 07a306a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
14 changes: 11 additions & 3 deletions modules/core/include/visp3/core/vpXmlParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,21 @@

#include <visp3/core/vpException.h>

#include <libxml/parser.h>

#include <iomanip>
#include <map>
#include <sstream>
#include <string.h>
#include <string>
#include <typeinfo>

struct _xmlDoc;
typedef _xmlDoc xmlDoc;
typedef xmlDoc *xmlDocPtr;

struct _xmlNode;
typedef _xmlNode xmlNode;
typedef xmlNode *xmlNodePtr;

BEGIN_VISP_NAMESPACE
/*!
\class vpXmlParser
Expand Down Expand Up @@ -93,6 +99,8 @@ BEGIN_VISP_NAMESPACE
A class to parse this document is declared as follows:
\code
#include <libxml/parser.h>
class vpDataParser: public vpXmlParser
{
private:
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions modules/core/src/tools/xml/vpXmlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions modules/core/test/tools/xml/testXmlParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
#include <visp3/core/vpXmlParser.h>
#include <visp3/io/vpParseArgv.h>

#include <libxml/parser.h>

#include <string>

#ifndef DOXYGEN_SHOULD_SKIP_THIS
Expand Down

0 comments on commit 07a306a

Please sign in to comment.