VSDXMLHelper.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/*
3 * This file is part of the libvisio project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#ifndef __VSDXMLHELPER_H__
11#define __VSDXMLHELPER_H__
12
13#include <map>
14#include <memory>
15#include <string>
16
17#include <librevenge-stream/librevenge-stream.h>
18#include <libxml/xmlreader.h>
19#include "VSDTypes.h"
20
21namespace libvisio
22{
23
24class VSDCollector;
25
26// Helper classes to properly handle OPC relationships
27
29{
30public:
31 VSDXRelationship(xmlTextReaderPtr reader);
34
35 void rebaseTarget(const char *baseDir);
36
37 const std::string getId() const
38 {
39 return m_id;
40 }
41 const std::string getType() const
42 {
43 return m_type;
44 }
45 const std::string getTarget() const
46 {
47 return m_target;
48 }
49
50private:
51 std::string m_id;
52 std::string m_type;
53 std::string m_target;
54};
55
57{
58public:
59 VSDXRelationships(librevenge::RVNGInputStream *input);
61
62 void rebaseTargets(const char *baseDir);
63
64 const VSDXRelationship *getRelationshipByType(const char *type) const;
65 const VSDXRelationship *getRelationshipById(const char *id) const;
66
67 bool empty() const
68 {
69 return m_relsByType.empty() && m_relsById.empty();
70 }
71
72private:
73 std::map<std::string, VSDXRelationship> m_relsByType;
74 std::map<std::string, VSDXRelationship> m_relsById;
75};
76
77} // namespace libvisio
78
79#endif // __VSDXMLHELPER_H__
80/* vim:set shiftwidth=2 softtabstop=2 expandtab: */
Definition VSDCollector.h:21
Definition VSDXMLHelper.h:29
VSDXRelationship(xmlTextReaderPtr reader)
Definition VSDXMLHelper.cpp:23
std::string m_id
Definition VSDXMLHelper.h:51
std::string m_type
Definition VSDXMLHelper.h:52
void rebaseTarget(const char *baseDir)
Definition VSDXMLHelper.cpp:53
~VSDXRelationship()
Definition VSDXMLHelper.cpp:49
std::string m_target
Definition VSDXMLHelper.h:53
const std::string getType() const
Definition VSDXMLHelper.h:41
const std::string getId() const
Definition VSDXMLHelper.h:37
const std::string getTarget() const
Definition VSDXMLHelper.h:45
VSDXRelationship()
Definition VSDXMLHelper.cpp:44
std::map< std::string, VSDXRelationship > m_relsById
Definition VSDXMLHelper.h:74
~VSDXRelationships()
Definition VSDXMLHelper.cpp:133
VSDXRelationships(librevenge::RVNGInputStream *input)
Definition VSDXMLHelper.cpp:89
bool empty() const
Definition VSDXMLHelper.h:67
const VSDXRelationship * getRelationshipByType(const char *type) const
Definition VSDXMLHelper.cpp:146
void rebaseTargets(const char *baseDir)
Definition VSDXMLHelper.cpp:137
std::map< std::string, VSDXRelationship > m_relsByType
Definition VSDXMLHelper.h:73
const VSDXRelationship * getRelationshipById(const char *id) const
Definition VSDXMLHelper.cpp:156
Definition libvisio_utils.h:49

Generated for libvisio by doxygen 1.14.0