Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
GexfParser.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
36
38
39#include <sstream>
40#include <string>
41#include <unordered_map>
42
43namespace ogdf {
44class ClusterGraphAttributes;
45class GraphAttributes;
46
47namespace gexf {
48
49
50class Parser {
51private:
52 std::istream& m_is;
53
56
57 std::unordered_map<std::string, node> m_nodeId;
58 std::unordered_map<std::string, cluster> m_clusterId;
59
60 std::unordered_map<std::string, std::string> m_nodeAttr, m_edgeAttr;
61
62 bool init();
66 const pugi::xml_node rootTag);
69
70 static void error(const pugi::xml_node tag, const std::string& msg);
71
72public:
73 explicit Parser(std::istream& is);
74
75 bool read(Graph& G);
76 bool read(Graph& G, GraphAttributes& GA);
77 bool read(Graph& G, ClusterGraph& C);
79};
80
81}
82}
Derived class of GraphObserver providing additional functionality to handle clustered graphs.
Includes declaration of graph class.
Representation of clusters in a clustered graph.
Stores additional attributes of a clustered graph (like layout information).
Representation of clustered graphs.
Class for the representation of edges.
Definition Graph_d.h:364
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Class for the representation of nodes.
Definition Graph_d.h:241
std::unordered_map< std::string, std::string > m_nodeAttr
Definition GexfParser.h:60
static void error(const pugi::xml_node tag, const std::string &msg)
std::unordered_map< std::string, node > m_nodeId
Definition GexfParser.h:57
bool readAttributes(GraphAttributes &GA, edge e, const pugi::xml_node edgeTag)
bool read(Graph &G, ClusterGraph &C)
pugi::xml_node m_edgesTag
Definition GexfParser.h:55
bool readNodes(Graph &G, GraphAttributes *GA)
bool readCluster(Graph &G, ClusterGraph &C, ClusterGraphAttributes *CA, cluster rootCluster, const pugi::xml_node rootTag)
bool read(Graph &G, GraphAttributes &GA)
bool readEdges(Graph &G, ClusterGraph *C, GraphAttributes *GA)
bool read(Graph &G, ClusterGraph &C, ClusterGraphAttributes &CA)
bool read(Graph &G)
std::unordered_map< std::string, cluster > m_clusterId
Definition GexfParser.h:58
pugi::xml_node m_graphTag
Definition GexfParser.h:55
std::unordered_map< std::string, std::string > m_edgeAttr
Definition GexfParser.h:60
bool readAttributes(GraphAttributes &GA, node v, const pugi::xml_node nodeTag)
Parser(std::istream &is)
pugi::xml_document m_xml
Definition GexfParser.h:54
pugi::xml_node m_nodesTag
Definition GexfParser.h:55
std::istream & m_is
Definition GexfParser.h:52
The namespace for all OGDF objects.