VSDXMLHelper.h Source File documentation

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
28 class VSDXRelationship
29{
30public:
31 VSDXRelationship(xmlTextReaderPtr reader);
32 VSDXRelationship();
33 ~VSDXRelationship();
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
56 class VSDXRelationships
57{
58public:
59 VSDXRelationships(librevenge::RVNGInputStream *input);
60 ~VSDXRelationships();
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: */
VSDTypes.h
libvisio::VSDCollector
Definition VSDCollector.h:21
libvisio::VSDXRelationship
Definition VSDXMLHelper.h:29
libvisio::VSDXRelationship::VSDXRelationship
VSDXRelationship(xmlTextReaderPtr reader)
Definition VSDXMLHelper.cpp:23
libvisio::VSDXRelationship::m_id
std::string m_id
Definition VSDXMLHelper.h:51
libvisio::VSDXRelationship::m_type
std::string m_type
Definition VSDXMLHelper.h:52
libvisio::VSDXRelationship::rebaseTarget
void rebaseTarget(const char *baseDir)
Definition VSDXMLHelper.cpp:53
libvisio::VSDXRelationship::~VSDXRelationship
~VSDXRelationship()
Definition VSDXMLHelper.cpp:49
libvisio::VSDXRelationship::m_target
std::string m_target
Definition VSDXMLHelper.h:53
libvisio::VSDXRelationship::getType
const std::string getType() const
Definition VSDXMLHelper.h:41
libvisio::VSDXRelationship::getId
const std::string getId() const
Definition VSDXMLHelper.h:37
libvisio::VSDXRelationship::getTarget
const std::string getTarget() const
Definition VSDXMLHelper.h:45
libvisio::VSDXRelationship::VSDXRelationship
VSDXRelationship()
Definition VSDXMLHelper.cpp:44
libvisio::VSDXRelationships::m_relsById
std::map< std::string, VSDXRelationship > m_relsById
Definition VSDXMLHelper.h:74
libvisio::VSDXRelationships::~VSDXRelationships
~VSDXRelationships()
Definition VSDXMLHelper.cpp:133
libvisio::VSDXRelationships::VSDXRelationships
VSDXRelationships(librevenge::RVNGInputStream *input)
Definition VSDXMLHelper.cpp:89
libvisio::VSDXRelationships::empty
bool empty() const
Definition VSDXMLHelper.h:67
libvisio::VSDXRelationships::getRelationshipByType
const VSDXRelationship * getRelationshipByType(const char *type) const
Definition VSDXMLHelper.cpp:146
libvisio::VSDXRelationships::rebaseTargets
void rebaseTargets(const char *baseDir)
Definition VSDXMLHelper.cpp:137
libvisio::VSDXRelationships::m_relsByType
std::map< std::string, VSDXRelationship > m_relsByType
Definition VSDXMLHelper.h:73
libvisio::VSDXRelationships::getRelationshipById
const VSDXRelationship * getRelationshipById(const char *id) const
Definition VSDXMLHelper.cpp:156
libvisio
Definition libvisio_utils.h:49