Objects of this class represent a validating parser for files in Ogml. More...
#include <ogdf/fileformats/OgmlParser.h>
Public Member Functions | |
| OgmlParser () | |
| Constructs an OGML parser. More... | |
| ~OgmlParser () | |
| bool | read (istream &is, Graph &G) |
Reads a graph G from istream is in OGML format. More... | |
| bool | read (istream &is, Graph &G, ClusterGraph &CG) |
Reads a cluster graph CG from istream is in OGML format. More... | |
| bool | read (istream &is, Graph &G, GraphAttributes &GA) |
Reads a graph G with attributes GA from istream is in OGML format. More... | |
| bool | read (istream &is, Graph &G, ClusterGraph &CG, ClusterGraphAttributes &CGA) |
Reads a cluster graph CG with attributes CGA from istream is in OGML format. More... | |
Private Types | |
| enum | Mode { compMode = 0, choiceMode, optMode } |
Private Member Functions | |
| bool | addAttributes (Graph &G, GraphAttributes &GA, ClusterGraphAttributes *pCGA, const XmlTagObject *root) |
| Build a cluster graph with style/layout attributes. More... | |
| bool | buildCluster (const XmlTagObject *rootTag, Graph &G, ClusterGraph &CG) |
| Builds a cluster graph. More... | |
| bool | buildClusterRecursive (const XmlTagObject *xmlTag, cluster parent, Graph &G, ClusterGraph &CG) |
| Recursive part of buildCluster. More... | |
| bool | buildGraph (Graph &G) |
| Builds a graph; ignores nodes which have hierarchical structure. More... | |
| bool | checkGraphType (const XmlTagObject *xmlTag) const |
| Checks the graph type and stores it in the member variable m_graphType xmlTag has to be the root or the graph or the structure Ogml-tag returns false if something goes wrong. More... | |
| bool | doRead (istream &is, Graph &G, ClusterGraph *pCG, GraphAttributes *pGA, ClusterGraphAttributes *pCGA) |
| Unified read method for graphs. More... | |
| EdgeArrow | getArrowStyle (int i) |
| int | getArrowStyleAsInt (string s) |
| FillPattern | getFillPattern (string s) |
Returns fill pattern of string s. More... | |
| Ogml::GraphType | getGraphType () |
| bool | getIdFromString (string str, int &id) |
| Returns the integer value of the id at the end of the string (if it exists). More... | |
| string | getLabelCaptionFromString (string str) |
| string | getNodeTemplateFromOgmlValue (string s) |
| Maps the OGML attribute values to corresponding GDE values. More... | |
| Shape | getShape (string s) |
| Returns the shape as an integer value. More... | |
| StrokeType | getStrokeType (string s) |
| Returns the line type as an integer value. More... | |
| bool | isGraphHierarchical (const XmlTagObject *xmlTag) const |
| Returns true iff subgraph is an hierarchical graph. More... | |
| bool | isNodeHierarchical (const XmlTagObject *xmlTag) const |
| Returns true iff node contains other nodes. More... | |
| void | printValidityInfo (const OgmlTag &ot, const XmlTagObject &xto, int valStatus, int line) |
| Prints some useful information about un-/successful validation. More... | |
| bool | setLabelsRecursive (Graph &G, GraphAttributes &GA, ClusterGraphAttributes *pCGA, XmlTagObject *root) |
| Recursive method for setting labels of clusters and nodes. More... | |
| int | validate (const XmlTagObject *xmlTag, int ogmlTag) |
| Checks if all tags (XmlTagObject), their attributes (XmlAttributeObject) and their values are valid (are tags expected, do they own the rigth attributes...) and sets a valid flag to these. More... | |
Private Attributes | |
| Hashing< int, OgmlAttribute > * | m_attributes |
| Hashtable for saving all ogml attributes. More... | |
| Hashing< int, OgmlAttributeValue > * | m_attValues |
| Hashtable for saving all values of ogml attributes. More... | |
| Hashing< int, string > | m_clusterIds |
| Hashing< string, cluster > | m_clusters |
| XmlTagObject * | m_constraintsTag |
| Hashing< int, string > | m_edgeIds |
| Hashing< string, edge > | m_edges |
| Ogml::GraphType | m_graphType |
| Saves a graph type. More... | |
| Hashing< string, const XmlTagObject * > | m_ids |
| Saves all ids of an ogml-file. More... | |
| Hashing< int, string > | m_nodeIds |
| Hashing< string, node > | m_nodes |
| Hashing< string, OgmlEdgeTemplate * > | m_ogmlEdgeTemplates |
| Hashing< string, OgmlNodeTemplate * > | m_ogmlNodeTemplates |
| Hashing< string, DPoint > | m_points |
| Hashing< int, OgmlTag > * | m_tags |
| Hashtable for saving all ogml tags. More... | |
Friends | |
| ostream & | operator<< (ostream &os, const OgmlParser::OgmlAttribute &oa) |
| ostream & | operator<< (ostream &os, const OgmlParser::OgmlTag &ot) |
Objects of this class represent a validating parser for files in Ogml.
Definition at line 46 of file OgmlParser.h.
|
private |
| Enumerator | |
|---|---|
| compMode | |
| choiceMode | |
| optMode | |
Definition at line 70 of file OgmlParser.h.
| ogdf::OgmlParser::OgmlParser | ( | ) |
Constructs an OGML parser.
| ogdf::OgmlParser::~OgmlParser | ( | ) |
|
private |
Build a cluster graph with style/layout attributes.
|
private |
Builds a cluster graph.
|
private |
Recursive part of buildCluster.
|
private |
Builds a graph; ignores nodes which have hierarchical structure.
|
private |
Checks the graph type and stores it in the member variable m_graphType xmlTag has to be the root or the graph or the structure Ogml-tag returns false if something goes wrong.
|
private |
Unified read method for graphs.
|
private |
|
private |
|
private |
Returns fill pattern of string s.
|
inlineprivate |
Definition at line 123 of file OgmlParser.h.
|
private |
Returns the integer value of the id at the end of the string (if it exists).
|
private |
|
private |
Maps the OGML attribute values to corresponding GDE values.
|
private |
Returns the shape as an integer value.
|
private |
Returns the line type as an integer value.
|
private |
Returns true iff subgraph is an hierarchical graph.
|
private |
Returns true iff node contains other nodes.
|
private |
Prints some useful information about un-/successful validation.
|
inline |
Reads a graph G from istream is in OGML format.
| is | is the input stream to be parsed as OGML file. |
| G | is the graph to be build from the OGML file. |
Definition at line 239 of file OgmlParser.h.
|
inline |
Reads a cluster graph CG from istream is in OGML format.
| is | is the input stream to be parsed as OGML file. |
| G | is the graph to be build from the OGML file; must be the graph associated with CG. |
| CG | is the cluster graph to be build from the OGML file. |
Definition at line 250 of file OgmlParser.h.
|
inline |
Reads a graph G with attributes GA from istream is in OGML format.
| is | is the input stream to be parsed as OGML file. |
| G | is the graph to be build from the OGML file. |
| GA | are the graph attributes (associated with G) in which layout and style information are stored. |
Definition at line 261 of file OgmlParser.h.
|
inline |
Reads a cluster graph CG with attributes CGA from istream is in OGML format.
| is | is the input stream to be parsed as OGML file. |
| G | is the graph to be build from the OGML file; must be the graph associated with CG. |
| CG | is the cluster graph to be build from the OGML file. |
| CGA | are the cluster graph attributes (associated with CG) in which layout and style information are stored. |
Definition at line 277 of file OgmlParser.h.
|
private |
Recursive method for setting labels of clusters and nodes.
|
private |
Checks if all tags (XmlTagObject), their attributes (XmlAttributeObject) and their values are valid (are tags expected, do they own the rigth attributes...) and sets a valid flag to these.
Furthermore it checks if ids of tags are unique and if id references are valid. See OgmlTag.h for semantics of the encodings. Returns the validity state of the current processed tag.
|
friend |
|
friend |
|
private |
Hashtable for saving all ogml attributes.
Definition at line 67 of file OgmlParser.h.
|
private |
Hashtable for saving all values of ogml attributes.
Definition at line 68 of file OgmlParser.h.
|
private |
Definition at line 140 of file OgmlParser.h.
Definition at line 131 of file OgmlParser.h.
|
private |
Definition at line 177 of file OgmlParser.h.
|
private |
Definition at line 139 of file OgmlParser.h.
Definition at line 130 of file OgmlParser.h.
|
mutableprivate |
|
private |
Saves all ids of an ogml-file.
Definition at line 74 of file OgmlParser.h.
|
private |
Definition at line 138 of file OgmlParser.h.
Definition at line 123 of file OgmlParser.h.
|
private |
Definition at line 182 of file OgmlParser.h.
|
private |
Definition at line 181 of file OgmlParser.h.
Definition at line 133 of file OgmlParser.h.
|
private |
Hashtable for saving all ogml tags.
Definition at line 66 of file OgmlParser.h.