Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
TsplibXmlParser.h
Go to the documentation of this file.
1
32#pragma once
33
35
36#include <sstream>
37#include <string>
38
39namespace ogdf {
40class Graph;
41class GraphAttributes;
42
54private:
55 pugi::xml_document m_xml; // hold as a class member, so it gets desctructed at the same time as the parser.
57
59
60 // Called on constructing, to initially load the file.
61 // Basic errors are catched, like missing essential tags.
62 // Parsing is done on read, which might also raise errors.
63 bool load(std::istream& in, std::string& error);
64
65 // Unified read with all the logic.
66 bool read(Graph& G, GraphAttributes* GA);
67
68public:
69 explicit TsplibXmlParser(std::istream& in);
70 ~TsplibXmlParser() = default;
71
72 bool read(Graph& G);
73 bool read(Graph& G, GraphAttributes& GA);
74};
75
76}
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Parses tsplib files in xml format.
bool read(Graph &G, GraphAttributes &GA)
bool read(Graph &G)
bool read(Graph &G, GraphAttributes *GA)
pugi::xml_document m_xml
bool load(std::istream &in, std::string &error)
TsplibXmlParser(std::istream &in)
~TsplibXmlParser()=default
pugi::xml_node m_graphTag
The namespace for all OGDF objects.