Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
vpXmlParser.h
1
/*
2
* ViSP, open source Visual Servoing Platform software.
3
* Copyright (C) 2005 - 2024 by Inria. All rights reserved.
4
*
5
* This software is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
9
* See the file LICENSE.txt at the root directory of this source
10
* distribution for additional information about the GNU GPL.
11
*
12
* For using ViSP with software that can not be combined with the GNU
13
* GPL, please contact Inria about acquiring a ViSP Professional
14
* Edition License.
15
*
16
* See https://visp.inria.fr for more information.
17
*
18
* This software was developed at:
19
* Inria Rennes - Bretagne Atlantique
20
* Campus Universitaire de Beaulieu
21
* 35042 Rennes Cedex
22
* France
23
*
24
* If you have questions regarding the use of this file, please contact
25
* Inria at visp@inria.fr
26
*
27
* This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28
* WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29
*
30
* Description:
31
* Tools to automatize the creation of xml parser based on the libXML2
32
*/
33
38
39
#ifndef VP_XML_PARSER_H
40
#define VP_XML_PARSER_H
41
42
#include <visp3/core/vpConfig.h>
43
44
#ifdef VISP_HAVE_XML2
45
46
#include <visp3/core/vpException.h>
47
48
#include <iomanip>
49
#include <map>
50
#include <sstream>
51
#include <string.h>
52
#include <string>
53
#include <typeinfo>
54
55
struct
_xmlDoc;
56
typedef
_xmlDoc xmlDoc;
57
typedef
xmlDoc *xmlDocPtr;
58
59
struct
_xmlNode;
60
typedef
_xmlNode xmlNode;
61
typedef
xmlNode *xmlNodePtr;
62
63
BEGIN_VISP_NAMESPACE
184
class
VISP_EXPORT
vpXmlParser
185
{
186
protected
:
189
199
virtual
void
readMainClass
(xmlDocPtr doc, xmlNodePtr node) = 0;
200
210
virtual
void
writeMainClass
(xmlNodePtr node) = 0;
211
212
bool
xmlReadBoolChild
(xmlDocPtr doc, xmlNodePtr node);
213
char
*
xmlReadCharChild
(xmlDocPtr doc, xmlNodePtr node);
214
double
xmlReadDoubleChild
(xmlDocPtr doc, xmlNodePtr node);
215
float
xmlReadFloatChild
(xmlDocPtr doc, xmlNodePtr node);
216
int
xmlReadIntChild
(xmlDocPtr doc, xmlNodePtr node);
217
std::string
xmlReadStringChild
(xmlDocPtr doc, xmlNodePtr node);
218
unsigned
int
xmlReadUnsignedIntChild
(xmlDocPtr doc, xmlNodePtr node);
219
220
void
xmlWriteBoolChild
(xmlNodePtr node,
const
char
*label,
bool
value);
221
void
xmlWriteCharChild
(xmlNodePtr node,
const
char
*label,
const
char
*value);
222
void
xmlWriteDoubleChild
(xmlNodePtr node,
const
char
*label,
double
value);
223
void
xmlWriteFloatChild
(xmlNodePtr node,
const
char
*label,
float
value);
224
void
xmlWriteIntChild
(xmlNodePtr node,
const
char
*label,
int
value);
225
void
xmlWriteStringChild
(xmlNodePtr node,
const
char
*label,
const
std::string &value);
226
void
xmlWriteUnsignedIntChild
(xmlNodePtr node,
const
char
*label,
unsigned
int
value);
228
229
protected
:
233
std::map<std::string, int>
nodeMap
;
234
238
std::string
main_tag
;
239
240
public
:
243
vpXmlParser
();
244
vpXmlParser
(
const
vpXmlParser
&_twin);
245
virtual
~vpXmlParser
();
246
247
/* virtual */
void
parse
(
const
std::string &filename);
248
/* virtual */
void
save
(
const
std::string &filename,
bool
append =
false
);
249
293
void
setMap
(
const
std::map<std::string, int> &_map) {
nodeMap
= _map; }
294
302
inline
void
setMainTag
(
const
std::string &tag) {
main_tag
= tag; }
304
307
317
static
void
cleanup();
319
};
320
END_VISP_NAMESPACE
321
#endif
/* VISP_HAVE_XML2 */
322
323
#endif
vpXmlParser::xmlWriteIntChild
void xmlWriteIntChild(xmlNodePtr node, const char *label, int value)
Definition
vpXmlParser.cpp:331
vpXmlParser::xmlWriteBoolChild
void xmlWriteBoolChild(xmlNodePtr node, const char *label, bool value)
Definition
vpXmlParser.cpp:395
vpXmlParser::xmlWriteFloatChild
void xmlWriteFloatChild(xmlNodePtr node, const char *label, float value)
Definition
vpXmlParser.cpp:379
vpXmlParser::xmlReadDoubleChild
double xmlReadDoubleChild(xmlDocPtr doc, xmlNodePtr node)
Definition
vpXmlParser.cpp:209
vpXmlParser::xmlWriteDoubleChild
void xmlWriteDoubleChild(xmlNodePtr node, const char *label, double value)
Definition
vpXmlParser.cpp:363
vpXmlParser::xmlReadFloatChild
float xmlReadFloatChild(xmlDocPtr doc, xmlNodePtr node)
Definition
vpXmlParser.cpp:242
vpXmlParser::xmlWriteUnsignedIntChild
void xmlWriteUnsignedIntChild(xmlNodePtr node, const char *label, unsigned int value)
Definition
vpXmlParser.cpp:347
vpXmlParser::xmlWriteCharChild
void xmlWriteCharChild(xmlNodePtr node, const char *label, const char *value)
Definition
vpXmlParser.cpp:303
vpXmlParser::vpXmlParser
vpXmlParser()
Definition
vpXmlParser.cpp:55
vpXmlParser::xmlWriteStringChild
void xmlWriteStringChild(xmlNodePtr node, const char *label, const std::string &value)
Definition
vpXmlParser.cpp:317
vpXmlParser::xmlReadIntChild
int xmlReadIntChild(xmlDocPtr doc, xmlNodePtr node)
Definition
vpXmlParser.cpp:141
vpXmlParser::setMainTag
void setMainTag(const std::string &tag)
Definition
vpXmlParser.h:302
vpXmlParser::nodeMap
std::map< std::string, int > nodeMap
Definition
vpXmlParser.h:233
vpXmlParser::save
void save(const std::string &filename, bool append=false)
Definition
vpXmlParser.cpp:450
vpXmlParser::xmlReadBoolChild
bool xmlReadBoolChild(xmlDocPtr doc, xmlNodePtr node)
Definition
vpXmlParser.cpp:279
vpXmlParser::xmlReadUnsignedIntChild
unsigned int xmlReadUnsignedIntChild(xmlDocPtr doc, xmlNodePtr node)
Definition
vpXmlParser.cpp:175
vpXmlParser::parse
void parse(const std::string &filename)
Definition
vpXmlParser.cpp:418
vpXmlParser::xmlReadCharChild
char * xmlReadCharChild(xmlDocPtr doc, xmlNodePtr node)
Definition
vpXmlParser.cpp:97
vpXmlParser::setMap
void setMap(const std::map< std::string, int > &_map)
Definition
vpXmlParser.h:293
vpXmlParser::readMainClass
virtual void readMainClass(xmlDocPtr doc, xmlNodePtr node)=0
vpXmlParser::xmlReadStringChild
std::string xmlReadStringChild(xmlDocPtr doc, xmlNodePtr node)
Definition
vpXmlParser.cpp:117
vpXmlParser::writeMainClass
virtual void writeMainClass(xmlNodePtr node)=0
vpXmlParser::main_tag
std::string main_tag
Definition
vpXmlParser.h:238
BEGIN_VISP_NAMESPACE
Definition
vpMbtDistanceCircle.cpp:55
modules
core
include
visp3
core
vpXmlParser.h
Generated by
1.17.0