top | up | prev | next

XPathNumberExpr Class

Definition at line 311 of XPathExpr.hpp

Constructors

XPathNumberExpr(const std::u32string& value_)
XPathNumberExpr(double value_)

Member Functions

std::unique_ptr<XPathObject> Evaluate(XPathContext& context) override
std::unique_ptr<Node> ToDom() const override

Member Variables

double value

Constructor Details

XPathNumberExpr Constructor

sngxml::xpath::XPathNumberExpr::XPathNumberExpr(const std::u32string& value_)

Definition at line 1609 of XPathExpr.cpp :
1610 {
1611     std::string s = ToUtf8(value_);
1612     std::stringstream strm;
1613     strm.str(s);
1614     strm >> value;
1615 }


Declaration at line 314 of XPathExpr.hpp


XPathNumberExpr Constructor

sngxml::xpath::XPathNumberExpr::XPathNumberExpr(double value_)

Definition at line 1617 of XPathExpr.cpp :
1617 : value(value_)
1618 {
1619 }


Declaration at line 315 of XPathExpr.hpp


Member Function Details

Evaluate Member Function

std::unique_ptr<XPathObject > sngxml::xpath::XPathNumberExpr::Evaluate(XPathContext & context) override

Definition at line 1621 of XPathExpr.cpp :
1622 {
1623     return std::unique_ptr<XPathObject>(new XPathNumber(value));
1624 }


Declaration at line 316 of XPathExpr.hpp

Base class overridden functions: sngxml::xpath::XPathExpr::Evaluate


ToDom Member Function

std::unique_ptr<Node > sngxml::xpath::XPathNumberExpr::ToDom() const override

Definition at line 1626 of XPathExpr.cpp :
1627 {
1628     std::unique_ptr<dom::Element> element(new dom::Element(U"number"));
1629     element->SetAttribute(U"value"ToUtf32(std::to_string(value)));
1630     return std::unique_ptr<dom::Node>(element.release());
1631 }


Declaration at line 317 of XPathExpr.hpp

Base class overridden functions: sngxml::xpath::XPathExpr::ToDom


top | up | prev | next