27 #include "../../../core/translator/Translator.h" 28 #include "../../../fe/BinaryOperator.h" 29 #include "../../../fe/Expression.h" 30 #include "../../../fe/Globals.h" 31 #include "../../../fe/Literal.h" 32 #include "../../../fe/PropertyName.h" 33 #include "../../../xml/AbstractWriter.h" 34 #include "../../../xml/Reader.h" 35 #include "../../Exception.h" 42 #include <boost/format.hpp> 63 ExpressionFnctIdxType::const_iterator it =
m_fncts.find(name);
66 throw Exception((boost::format(
TE_TR(
"Could not find a reader for the following expression type: %1%.")) % name).str());
70 return it->second(reader);
86 std::string name =
"ogc:";
155 std::unique_ptr<te::fe::BinaryOperator> exp(op);
166 return exp.release();
186 exp->setValue(value);
193 return exp.release();
198 exp->setValue(value);
203 return exp.release();
222 return exp.release();
const std::string & getName() const
It returns the property name.
boost::function< te::fe::Expression *(te::xml::Reader &)> ExpressionReadFnctType
static const char * sm_mul
ExpressionFnctIdxType m_fncts
This class models a XML reader object.
virtual void writeStartElement(const std::string &qName)=0
void visit(const te::fe::BinaryOperator &visited)
Base exception class for plugin module.
te::fe::Expression * read(te::xml::Reader &reader) const
void write(const te::fe::Expression *exp, te::xml::AbstractWriter &writer)
virtual std::string getElementLocalName() const =0
It returns the local part of the element name in the case of an element node.
virtual ReturnType accept(VisitorType &guest) const =0
It call the visit method from the guest object.
This class models a XML writer object.
#define TE_TR(message)
It marks a string in order to get translated.
static const char * sm_div
virtual void writeElement(const std::string &qName, const std::string &value)=0
A function is a named procedure that performs a distinct computation.
This class can be used to represent binary operation expressions.
static T & getInstance()
It returns a reference to the singleton instance.
This class is used to encode the name of any property of an object.
This is an abstract class that models a Filter Encoding expression.
Expression * getSecond() const
It returns the second operand.
Expression * getFirst() const
It returns the first operand.
te::xml::AbstractWriter * m_writer
This is an abstract class that models a Filter Encoding expression.
static const char * sm_add
This class can be used to represent literal values.
static const char * sm_sub
void reg(const std::string &expName, const ExpressionReadFnctType &fnct)
virtual void writeEndElement(const std::string &qName)=0
te::fe::Expression * LiteralReader(te::xml::Reader &reader)
virtual std::string getElementValue() const =0
It returns the element data value in the case of VALUE node.
virtual NodeType getNodeType() const =0
It return the type of node read.
const std::string & getValue() const
It returns the literal value.
te::fe::Expression * BinaryOperatorReader(te::xml::Reader &reader)
const char * getName() const
It returns the operator name.
virtual bool next()=0
It gets the next event to be read.
te::fe::Expression * PropertyNameReader(te::xml::Reader &reader)