27 #include "../../../qt/widgets/se/Symbol.h"
28 #include "../../../qt/widgets/se/SymbolLibrary.h"
29 #include "../../../qt/widgets/se/SymbolLibraryManager.h"
30 #include "../../../xml/Reader.h"
31 #include "../../../xml/ReaderFactory.h"
32 #include "../../Exception.h"
33 #include "../../se/Symbolizer.h"
41 #include <boost/format.hpp>
46 reader->read(symbolLibraryFileName);
49 throw Exception((boost::format(
TR_SERIALIZATION(
"Could not read symbol library information in file: %1%.")) % symbolLibraryFileName).str());
52 throw Exception((boost::format(
TR_SERIALIZATION(
"Error reading the document %1%, the start element wasn't found.")) % symbolLibraryFileName).str());
54 if(reader->getElementLocalName() !=
"SymbolLibrary")
55 throw Exception((boost::format(
TR_SERIALIZATION(
"The first tag in the document %1% is not 'SymbolLibrary'.")) % symbolLibraryFileName).str());
57 std::string name = reader->getAttr(
"name");
64 (reader->getElementLocalName() ==
"Symbol"))
67 library->insert(symbol);
137 symbol->setInfo(info);
149 return symbol.release();
This class models a XML reader object.
std::string m_description
static te::xml::Reader * make()
It creates a new XML reader using the dafault implementation.
virtual bool next()=0
It gets the next event to be read.
#define TR_SERIALIZATION(message)
It marks a string in order to get translated. This is a special mark used in the XML module of TerraL...
TESERIALIZATIONEXPORT void ReadSymbolLibrary(const std::string &symbolLibraryFileName)
This class represents a symbol. TODO: More description!
virtual std::string getElementValue() const =0
It returns the element data value in the case of VALUE node.
TESERIALIZATIONEXPORT te::qt::widgets::Symbol * ReadSymbol(te::xml::Reader &reader)
This class represents a library of symbols.
This class represents a symbol.
Information about a given Symbol.
static SymbolLibraryManager & getInstance()
It returns a reference to the singleton instance.
virtual NodeType getNodeType() const =0
It return the type of node read.
virtual std::string getElementLocalName() const =0
It returns the local part of the element name in the case of an element node.