Added XPath method used to escape XPath strings.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6539 acf43c95-373e-0410-b603-e72c3f656dc1remotes/trunk
parent
9c9129aa98
commit
8c9c4b2664
|
@ -3914,6 +3914,18 @@ void XPath::dump(ObjList& lst, bool escape) const
|
|||
}
|
||||
}
|
||||
|
||||
String& XPath::escape(String& buf, const String& str, char quot, bool literal)
|
||||
{
|
||||
if (quot != '"' && quot != '\'')
|
||||
quot = '"';
|
||||
if (!str)
|
||||
return buf << quot << quot;
|
||||
buf << quot;
|
||||
if (literal)
|
||||
return XPathParseData::escapeStringLiteral(buf,str,quot) << quot;
|
||||
return XmlSaxParser::escape(buf,str) << quot;
|
||||
}
|
||||
|
||||
unsigned int XPath::maxStepPredicates()
|
||||
{
|
||||
return XPATH_MAX_PREDICATES;
|
||||
|
|
11
yatexml.h
11
yatexml.h
|
@ -2132,6 +2132,17 @@ public:
|
|||
*/
|
||||
void dump(ObjList& lst, bool escape = true) const;
|
||||
|
||||
/**
|
||||
* Escape a string and add quoted value to buffer
|
||||
* @param buf Destination buffer
|
||||
* @param str String to escape
|
||||
* @param quot Character to use for quoting. Use " if not " or '
|
||||
* @param literal Escape as literal (used in comparison operators) or
|
||||
* XML string (used in function parameters)
|
||||
* @return Destination buffer reference
|
||||
*/
|
||||
static String& escape(String& buf, const String& str, char quot = '"', bool literal = true);
|
||||
|
||||
/**
|
||||
* Retrieve the number of maximum allowed predicates in a path step
|
||||
* @return Maximum allowed predicates in a path step
|
||||
|
|
Loading…
Reference in New Issue