This class can be used to read the sections, the map names and the attributes from a file. Usually, the LEMON programs know that, which type of graph, which maps and which attributes should be read from a file, but in general tools (like glemon) the contents of an LGF file should be guessed somehow. This class reads the graph and stores the appropriate information for reading the graph.
#include <lemon/lgf_reader.h>
Public Member Functions | |
LgfContents (std::istream &is) | |
Constructor. More... | |
LgfContents (const std::string &fn) | |
Constructor. More... | |
LgfContents (const char *fn) | |
Constructor. More... | |
~LgfContents () | |
Destructor. | |
Node Sections | |
int | nodeSectionNum () const |
Gives back the number of node sections in the file. More... | |
const std::string & | nodeSection (int i) const |
Returns the node section name at the given position. More... | |
const std::vector< std::string > & | nodeMapNames (int i) const |
Gives back the node maps for the given section. More... | |
Arc/Edge Sections | |
int | arcSectionNum () const |
Gives back the number of arc/edge sections in the file. More... | |
const std::string & | arcSection (int i) const |
Returns the arc/edge section name at the given position. More... | |
const std::vector< std::string > & | arcMapNames (int i) const |
Gives back the arc/edge maps for the given section. More... | |
Synonyms | |
int | edgeSectionNum () const |
Gives back the number of arc/edge sections in the file. More... | |
const std::string & | edgeSection (int i) const |
Returns the section name at the given position. More... | |
const std::vector< std::string > & | edgeMapNames (int i) const |
Gives back the edge maps for the given section. More... | |
Attribute Sections | |
int | attributeSectionNum () const |
Gives back the number of attribute sections in the file. More... | |
const std::string & | attributeSectionNames (int i) const |
Returns the attribute section name at the given position. More... | |
const std::vector< std::string > & | attributes (int i) const |
Gives back the attributes for the given section. More... | |
Extra Sections | |
int | extraSectionNum () const |
Gives back the number of extra sections in the file. More... | |
const std::string & | extraSection (int i) const |
Returns the extra section type at the given position. More... | |
Execution of the Contents Reader | |
void | run () |
Starts the reading. More... | |
|
inline |
Construct an LGF contents reader, which reads from the given input stream.
|
inline |
Construct an LGF contents reader, which reads from the given file.
|
inline |
Construct an LGF contents reader, which reads from the given file.
|
inline |
Gives back the number of node sections in the file.
|
inline |
Returns the node section name at the given position.
|
inline |
Gives back the node maps for the given section.
|
inline |
Gives back the number of arc/edge sections in the file.
edgeSectionNum()
.
|
inline |
Returns the arc/edge section name at the given position.
edgeSection()
.
|
inline |
Gives back the arc/edge maps for the given section.
edgeMapNames()
.
|
inline |
Gives back the number of arc/edge sections in the file.
arcSectionNum()
.
|
inline |
Returns the section name at the given position.
arcSection()
.
|
inline |
Gives back the edge maps for the given section.
arcMapNames()
.
|
inline |
Gives back the number of attribute sections in the file.
|
inline |
Returns the attribute section name at the given position.
|
inline |
Gives back the attributes for the given section.
|
inline |
Gives back the number of extra sections in the file.
|
inline |
Returns the section type at the given position.
|
inline |
This function starts the reading.