9 if (!(nominal == actual))
11 return (nominal == actual);
17 TUri base =
TUri(
"http://a/b/c/d;p?q");
71 for (
char i = 0; i < 127; i++) {
74 sprintf(buffer,
"0x%02x, ", i);
87 TString composed =
"http://user:pass@host.org/some/path/file.avi?key1=value1#anchor3";
92 uri.
SetPath(
"/some/path/file.avi");
95 return uri.
GetUri() == composed;
103 Printf(
"---> F A I L E D F A I L E D F A I L E D\n");
110 valid &=
TUri(
"ftp://ftp.is.co.za/rfc/rfc1808.txt").
IsUri();
111 valid &=
TUri(
"http://www.ietf.org/rfc/rfc2396.txt").
IsUri();
114 valid &=
TUri(
"mailto:John.Doe@example.com").
IsUri();
115 valid &=
TUri(
"news:comp.infosystems.www.servers.unix").
IsUri();
116 valid &=
TUri(
"tel:+1-816-555-1212").
IsUri();
117 valid &=
TUri(
"telnet://192.0.2.16:80/").
IsUri();
118 valid &=
TUri(
"urn:oasis:names:specification:docbook:dtd:xml:4.1.2").
IsUri();
125 Printf(
"\n\nTUri test macro ...");
126 Printf(
"---> Validation");
128 Printf(
"---> Reference Resolution");
130 Printf(
"---> PCT Conversion");
132 Printf(
"---> Equivalence and Normalisation");
133 Answer(
TUri(
"example://a/b/c/%7Bfoo%7D") ==
TUri(
"eXAMPLE://a/./b/../b/%63/%7bfoo%7d"));
134 Printf(
"---> Composition");
Bool_t SetPath(const TString &path)
Set path component of URI: path = path-abempty ; begins with "/" or is empty ...
Bool_t TestResolutionHelper(TUri reference, TUri nominal, TUri &base)
Bool_t SetUserInfo(const TString &userinfo)
Set userinfo component of URI: userinfo = *( unreserved / pct-encoded / sub-delims / ":" )...
This class represents a RFC 3986 compatible URI.
static const TString PctDecode(const TString &source)
Percent-decode the given string according to chapter 2.1 we assume a valid pct-encoded string...
Bool_t SetQuery(const TString &path)
Set query component of URI: query = *( pchar / "/" / "?" ).
const char * Data() const
Bool_t IsUri() const
Returns kTRUE if instance qualifies as URI URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] ...
static const TString PctEncode(const TString &source)
Percent-encode and return the given string according to RFC 3986 in principle, this function cannot f...
Bool_t SetScheme(const TString &scheme)
Set scheme component of URI: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ).
const TString GetUri() const
Returns the whole URI - an implementation of chapter 5.3 component recomposition. ...
Bool_t SetFragment(const TString &fragment)
Set fragment component of URI: fragment = *( pchar / "/" / "?" ).
static TUri Transform(const TUri &reference, const TUri &base)
Transform a URI reference into its target URI using given a base URI.
Bool_t SetHost(const TString &host)
Set host component of URI: RFC 3986: host = IP-literal / IPv4address / reg-name implemented: host ...
std::vector< double > errors
void Answer(Bool_t success)