Functions
zorba::fn Namespace Reference

Functions

ZORBA_DLL_PUBLIC String encode_for_uri (String const &uri_part)
 Encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI.
ZORBA_DLL_PUBLIC bool ends_with (String const &arg1, String const &arg2)
 Tests whether or not the value of arg1 ends with a sequence of collation units that provides a match to the collation units of arg2.
ZORBA_DLL_PUBLIC bool ends_with (String const &arg1, char const *arg2)
 Tests whether or not the value of arg1 ends with a sequence of collation units that provides a match to the collation units of arg2.
ZORBA_DLL_PUBLIC String lower_case (String const &arg)
 Translates every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard.
ZORBA_DLL_PUBLIC bool starts_with (String const &arg1, String const &arg2)
 Tests whether or not the value of arg1 starts with a sequence of collation units that provides a match to the collation units of arg2.
ZORBA_DLL_PUBLIC bool starts_with (String const &arg1, char const *arg2)
 Tests whether or not the value of arg1 starts with a sequence of collation units that provides a match to the collation units of arg2.
ZORBA_DLL_PUBLIC Sequence< Stringtokenize (String const &input, char const *pattern, char const *flags="")
 This function breaks the input string into a sequence of strings, treating any substring that matches pattern as a separator.
Sequence< Stringtokenize (String const &input, String const &pattern, char const *flags="")
 This function breaks the input string into a sequence of strings, treating any substring that matches pattern as a separator.
ZORBA_DLL_PUBLIC String upper_case (String const &arg)
 Translates every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard.

Function Documentation

ZORBA_DLL_PUBLIC String zorba::fn::encode_for_uri ( String const &  uri_part)

Encodes reserved characters in an xs:string that is intended to be used in the path segment of a URI.

It is invertible but not idempotent.

This function applies the URI escaping rules defined in section 2 of [RFC 3986] to the xs:string supplied as uri_part. The effect of the function is to escape reserved characters. Each such character in the string is replaced with its percent-encoded form as described in [RFC 3986].

All characters are escaped except those identified as "unreserved" by [RFC 3986], that is the upper- and lower-case letters A-Z, the digits 0-9, HYPHEN-MINUS ("-"), LOW LINE ("_"), FULL STOP ".", and TILDE "~".

Parameters:
uri_partThe URI to be encoded.
Returns:
the encoded string.
ZORBA_DLL_PUBLIC bool zorba::fn::ends_with ( String const &  arg1,
String const &  arg2 
)

Tests whether or not the value of arg1 ends with a sequence of collation units that provides a match to the collation units of arg2.

Parameters:
arg1The string to test.
arg2The substring.
Returns:
true only if arg1 ends with arg2 or arg2 is the zero-length string.
ZORBA_DLL_PUBLIC bool zorba::fn::ends_with ( String const &  arg1,
char const *  arg2 
)

Tests whether or not the value of arg1 ends with a sequence of collation units that provides a match to the collation units of arg2.

Parameters:
arg1The string to test.
arg2The substring.
Returns:
true only if arg1 ends with arg2 or arg2 is the zero-length string.
ZORBA_DLL_PUBLIC String zorba::fn::lower_case ( String const &  arg)

Translates every character to its lower-case correspondent as defined in the appropriate case mappings section in the Unicode standard.

Every upper-case character that does not have a lower-case correspondent, as well as every lower-case character, is included in the returned value in its original form.

Parameters:
argThe string to translate.
Returns:
arg translated to lower-case.
ZORBA_DLL_PUBLIC bool zorba::fn::starts_with ( String const &  arg1,
String const &  arg2 
)

Tests whether or not the value of arg1 starts with a sequence of collation units that provides a match to the collation units of arg2.

Parameters:
arg1The string to test.
arg2The substring.
Returns:
true only if arg1 starts with arg2 or arg2 is the zero-length string.
ZORBA_DLL_PUBLIC bool zorba::fn::starts_with ( String const &  arg1,
char const *  arg2 
)

Tests whether or not the value of arg1 starts with a sequence of collation units that provides a match to the collation units of arg2.

Parameters:
arg1The string to test.
arg2The substring.
Returns:
true only if arg1 starts with arg2 or arg2 is the zero-length string.
ZORBA_DLL_PUBLIC Sequence<String> zorba::fn::tokenize ( String const &  input,
char const *  pattern,
char const *  flags = "" 
)

This function breaks the input string into a sequence of strings, treating any substring that matches pattern as a separator.

The separators themselves are not returned.

Performance note: if pattern is a simple string (not a regular expression with meta-characers), it is more efficient to use String::find().

Parameters:
inputThe string to be split into tokens. If input is the empty sequence, or if input is the zero-length string, the result is the empty sequence.
patternThe regular expression. If it matches a zero-length string, then an error is raised: [err:FORX0003].
flagsThe regular expression flags, if any.
Returns:
a sequence of strings for the tokens.

Referenced by tokenize().

Sequence<String> zorba::fn::tokenize ( String const &  input,
String const &  pattern,
char const *  flags = "" 
) [inline]

This function breaks the input string into a sequence of strings, treating any substring that matches pattern as a separator.

The separators themselves are not returned.

Performance note: if pattern is a simple string (not a regular expression with meta-characers), it is more efficient to use String::find().

Parameters:
inputThe string to be split into tokens. If input is the empty sequence, or if input is the zero-length string, the result is the empty sequence.
patternThe regular expression. If it matches a zero-length string, then an error is raised: [err:FORX0003].
flagsThe regular expression flags, if any.
Returns:
a sequence of strings for the tokens.

Definition at line 222 of file xquery_functions.h.

References tokenize(), and zorba::String::c_str().

ZORBA_DLL_PUBLIC String zorba::fn::upper_case ( String const &  arg)

Translates every character to its upper-case correspondent as defined in the appropriate case mappings section in the Unicode standard.

Every lower-case character that does not have an upper-case correspondent, as well as every upper-case character, is included in the returned value in its original form.

Parameters:
argThe string to translate.
Returns:
arg translated to upper-case.
blog comments powered by Disqus