void operator() (binary_node<Tag> const& x) const { if (x.type() != tags::mult::str() && x.type() != tags::div::str()) { str_ += "("; } boost::apply_visitor(expression_string(str_),x.left); str_ += x.type(); boost::apply_visitor(expression_string(str_),x.right); if (x.type() != tags::mult::str() && x.type() != tags::div::str()) { str_ += ")"; } }
void operator() (unary_node<Tag> const& x) const { str_ += Tag::str(); str_ += "("; boost::apply_visitor(expression_string(str_),x.expr); str_ += ")"; }
void operator() (regex_match_node const & x) const { // TODO - replace with pre ICU 4.2 compatible fromUTF32() #if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >=2) boost::apply_visitor(expression_string(str_),x.expr); str_ +=".match('"; std::string utf8; UnicodeString ustr = UnicodeString::fromUTF32( &x.pattern.str()[0] ,x.pattern.str().length()); to_utf8(ustr,utf8); str_ += utf8; str_ +="')"; #endif }
void operator() (regex_match_node const & x) const { boost::apply_visitor(expression_string(str_),x.expr); str_ +=".match('"; #if defined(BOOST_REGEX_HAS_ICU) std::string utf8; UnicodeString ustr = UnicodeString::fromUTF32( &x.pattern.str()[0] ,x.pattern.str().length()); to_utf8(ustr,utf8); str_ += utf8; #else str_ += x.pattern.str(); #endif str_ +="')"; }
void operator() (regex_replace_node const & x) const { boost::apply_visitor(expression_string(str_),x.expr); str_ +=".replace("; str_ += "'"; #if defined(BOOST_REGEX_HAS_ICU) std::string utf8; mapnik::value_unicode_string ustr = mapnik::value_unicode_string::fromUTF32( &x.pattern.str()[0] ,x.pattern.str().length()); to_utf8(ustr,utf8); str_ += utf8; str_ +="','"; to_utf8(x.format ,utf8); str_ += utf8; #else str_ += x.pattern.str(); str_ +="','"; str_ += x.format; #endif str_ +="')"; }