ROOT 6.10/09 Reference Guide |
This class represents a RFC 3986 compatible URI.
See http://rfc.net/rfc3986.html. It provides member functions to set and return the different the different parts of an URI. The functionality is that of a validating parser.
Public Member Functions | |
TUri (const TUri &uri) | |
TUri copy ctor. More... | |
TUri () | |
TUri (const TString &uri) | |
Constructor that calls SetUri with a complete URI. More... | |
TUri (const char *uri) | |
Constructor that calls SetUri with a complete URI. More... | |
virtual | ~TUri () |
const TString | GetAuthority () const |
Returns the authority part of the instance: authority = [ userinfo "@" ] host [ ":" port ] . More... | |
const TString | GetFragment () const |
const TString | GetHierPart () const |
hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty | |
const TString | GetHost () const |
const TString | GetPath () const |
const TString | GetPort () const |
const TString | GetQuery () const |
const TString | GetRelativePart () const |
relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty | |
const TString | GetScheme () const |
const TString | GetUri () const |
Returns the whole URI - an implementation of chapter 5.3 component recomposition. More... | |
const TString | GetUserInfo () const |
Bool_t | HasAuthority () const |
Bool_t | HasFragment () const |
Bool_t | HasHierPart () const |
Bool_t | HasHost () const |
Bool_t | HasPath () const |
Bool_t | HasPort () const |
Bool_t | HasQuery () const |
Bool_t | HasRelativePart () const |
Bool_t | HasScheme () const |
Bool_t | HasUserInfo () const |
Bool_t | IsAbsolute () const |
Returns kTRUE if instance qualifies as absolute-URI absolute-URI = scheme ":" hier-part [ "?" query ] cf. More... | |
Bool_t | IsReference () const |
Returns kTRUE if instance qualifies as URI-reference URI-reference = URI / relative-ref cf. More... | |
Bool_t | IsRelative () const |
Returns kTRUE if instance qualifies as relative-ref relative-ref = relative-part [ "?" query ] [ "#" fragment ] cf. More... | |
Bool_t | IsSortable () const |
Bool_t | IsUri () const |
Returns kTRUE if instance qualifies as URI URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] cf. More... | |
void | Normalise () |
Syntax based normalisation according to RFC chapter 6.2.2. More... | |
TUri & | operator= (const TUri &rhs) |
TUri assignment operator. More... | |
void | Print (Option_t *option="") const |
Display function,. More... | |
void | Reset () |
Initialize this URI object. More... | |
Bool_t | SetAuthority (const TString &authority) |
Set authority part of URI: authority = [ userinfo "@" ] host [ ":" port ] . More... | |
Bool_t | SetFragment (const TString &fragment) |
Set fragment component of URI: fragment = *( pchar / "/" / "?" ) . More... | |
Bool_t | SetHierPart (const TString &hier) |
returns hier-part component of URI hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty | |
Bool_t | SetHost (const TString &host) |
Set host component of URI: RFC 3986: host = IP-literal / IPv4address / reg-name implemented: host = IPv4address / reg-name . More... | |
Bool_t | SetPath (const TString &path) |
Set path component of URI: path = path-abempty ; begins with "/" or is empty / path-absolute ; begins with "/" but not "//" / path-noscheme ; begins with a non-colon segment / path-rootless ; begins with a segment / path-empty ; zero characters . More... | |
Bool_t | SetPort (const TString &port) |
Set port component of URI: port = *DIGIT . More... | |
Bool_t | SetQuery (const TString &path) |
Set query component of URI: query = *( pchar / "/" / "?" ) . More... | |
Bool_t | SetRelativePart (const TString &) |
Returns kTRUE is string qualifies as relative-part: relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty . More... | |
Bool_t | SetScheme (const TString &scheme) |
Set scheme component of URI: . More... | |
Bool_t | SetUri (const TString &uri) |
Parse URI and set the member variables accordingly, returns kTRUE if URI validates, and kFALSE otherwise: URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty . More... | |
Bool_t | SetUserInfo (const TString &userinfo) |
Set userinfo component of URI: userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) . More... | |
Public Member Functions inherited from TObject | |
TObject () | |
TObject constructor. More... | |
TObject (const TObject &object) | |
TObject copy ctor. More... | |
virtual | ~TObject () |
TObject destructor. More... | |
void | AbstractMethod (const char *method) const |
Use this method to implement an "abstract" method that you don't want to leave purely abstract. More... | |
virtual void | AppendPad (Option_t *option="") |
Append graphics object to current pad. More... | |
virtual void | Browse (TBrowser *b) |
Browse object. May be overridden for another default action. More... | |
virtual const char * | ClassName () const |
Returns name of class to which the object belongs. More... | |
virtual void | Clear (Option_t *="") |
virtual TObject * | Clone (const char *newname="") const |
Make a clone of an object using the Streamer facility. More... | |
virtual Int_t | Compare (const TObject *obj) const |
Compare abstract method. More... | |
virtual void | Copy (TObject &object) const |
Copy this to obj. More... | |
virtual void | Delete (Option_t *option="") |
Delete this object. More... | |
virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
Computes distance from point (px,py) to the object. More... | |
virtual void | Draw (Option_t *option="") |
Default Draw method for all objects. More... | |
virtual void | DrawClass () const |
Draw class inheritance tree of the class to which this object belongs. More... | |
virtual TObject * | DrawClone (Option_t *option="") const |
Draw a clone of this object in the current selected pad for instance with: gROOT->SetSelectedPad(gPad) . More... | |
virtual void | Dump () const |
Dump contents of object on stdout. More... | |
virtual void | Error (const char *method, const char *msgfmt,...) const |
Issue error message. More... | |
virtual void | Execute (const char *method, const char *params, Int_t *error=0) |
Execute method on this object with the given parameter string, e.g. More... | |
virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=0) |
Execute method on this object with parameters stored in the TObjArray. More... | |
virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
Execute action corresponding to an event at (px,py). More... | |
virtual void | Fatal (const char *method, const char *msgfmt,...) const |
Issue fatal error message. More... | |
virtual TObject * | FindObject (const char *name) const |
Must be redefined in derived classes. More... | |
virtual TObject * | FindObject (const TObject *obj) const |
Must be redefined in derived classes. More... | |
virtual Option_t * | GetDrawOption () const |
Get option used by the graphics system to draw this object. More... | |
virtual const char * | GetIconName () const |
Returns mime type name of object. More... | |
virtual const char * | GetName () const |
Returns name of object. More... | |
virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
Returns string containing info about the object at position (px,py). More... | |
virtual Option_t * | GetOption () const |
virtual const char * | GetTitle () const |
Returns title of object. More... | |
virtual UInt_t | GetUniqueID () const |
Return the unique object id. More... | |
virtual Bool_t | HandleTimer (TTimer *timer) |
Execute action in response of a timer timing out. More... | |
virtual ULong_t | Hash () const |
Return hash value for this object. More... | |
virtual void | Info (const char *method, const char *msgfmt,...) const |
Issue info message. More... | |
virtual Bool_t | InheritsFrom (const char *classname) const |
Returns kTRUE if object inherits from class "classname". More... | |
virtual Bool_t | InheritsFrom (const TClass *cl) const |
Returns kTRUE if object inherits from TClass cl. More... | |
virtual void | Inspect () const |
Dump contents of this object in a graphics canvas. More... | |
void | InvertBit (UInt_t f) |
virtual Bool_t | IsEqual (const TObject *obj) const |
Default equal comparison (objects are equal if they have the same address in memory). More... | |
virtual Bool_t | IsFolder () const |
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects). More... | |
Bool_t | IsOnHeap () const |
Bool_t | IsZombie () const |
virtual void | ls (Option_t *option="") const |
The ls function lists the contents of a class on stdout. More... | |
void | MayNotUse (const char *method) const |
Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary). More... | |
virtual Bool_t | Notify () |
This method must be overridden to handle object notification. More... | |
void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
Use this method to declare a method obsolete. More... | |
void | operator delete (void *ptr) |
Operator delete. More... | |
void | operator delete[] (void *ptr) |
Operator delete []. More... | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *vp) |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, void *vp) |
TObject & | operator= (const TObject &rhs) |
TObject assignment operator. More... | |
virtual void | Paint (Option_t *option="") |
This method must be overridden if a class wants to paint itself. More... | |
virtual void | Pop () |
Pop on object drawn in a pad to the top of the display list. More... | |
virtual Int_t | Read (const char *name) |
Read contents of object with specified name from the current directory. More... | |
virtual void | RecursiveRemove (TObject *obj) |
Recursively remove this object from a list. More... | |
void | ResetBit (UInt_t f) |
virtual void | SaveAs (const char *filename="", Option_t *option="") const |
Save this object in the file specified by filename. More... | |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save a primitive as a C++ statement(s) on output stream "out". More... | |
void | SetBit (UInt_t f, Bool_t set) |
Set or unset the user status bits as specified in f. More... | |
void | SetBit (UInt_t f) |
virtual void | SetDrawOption (Option_t *option="") |
Set drawing option for object. More... | |
virtual void | SetUniqueID (UInt_t uid) |
Set the unique object id. More... | |
virtual void | SysError (const char *method, const char *msgfmt,...) const |
Issue system error message. More... | |
Bool_t | TestBit (UInt_t f) const |
Int_t | TestBits (UInt_t f) const |
virtual void | UseCurrentStyle () |
Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked. More... | |
virtual void | Warning (const char *method, const char *msgfmt,...) const |
Issue warning message. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
Write this object to the current directory. More... | |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Write this object to the current directory. More... | |
Static Public Member Functions | |
static Bool_t | IsAuthority (const TString &) |
Returns kTRUE if string qualifies as valid URI authority: authority = [ userinfo "@" ] host [ ":" port ] . More... | |
static Bool_t | IsFragment (const TString &) |
Returns kTRUE if string qualifies as valid fragment component fragment = *( pchar / "/" / "?" ) . More... | |
static Bool_t | IsHierPart (const TString &) |
Returns kTRUE if string qualifies as hier-part: hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty . More... | |
static Bool_t | IsHost (const TString &) |
Returns kTRUE if string qualifies as valid host component: host = IP-literal / IPv4address / reg-name implemented: host = IPv4address / reg-name. More... | |
static Bool_t | IsIpv4 (const TString &) |
Returns kTRUE, if string holds a valid IPv4 address currently only decimal variant supported. More... | |
static Bool_t | IsPath (const TString &) |
Returns kTRUE if string qualifies as valid path component: path = path-abempty ; begins with "/" or is empty / path-absolute ; begins with "/" but not "//" / path-noscheme ; begins with a non-colon segment / path-rootless ; begins with a segment / path-empty ; zero characters . More... | |
static Bool_t | IsPathAbempty (const TString &) |
Returns kTRUE if string qualifies as valid path-abempty component: path-abempty = *( "/" segment ) segment = *pchar . More... | |
static Bool_t | IsPathAbsolute (const TString &) |
Returns kTRUE if string qualifies as valid path-absolute component path-absolute = "/" [ segment-nz *( "/" segment ) ] segment-nz = 1*pchar segment = *pchar . More... | |
static Bool_t | IsPathEmpty (const TString &) |
Returns kTRUE if string qualifies as valid path-empty component: path-empty = 0<pchar> . More... | |
static Bool_t | IsPathNoscheme (const TString &) |
Returns kTRUE if string qualifies as valid path-noscheme component: path-noscheme = segment-nz-nc *( "/" segment ) segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" ) segment = *pchar . More... | |
static Bool_t | IsPathRootless (const TString &) |
Returns kTRUE if string qualifies as valid path-rootless component: path-rootless = segment-nz *( "/" segment ) . More... | |
static Bool_t | IsPort (const TString &) |
Returns kTRUE if string qualifies as valid port component: RFC 3986: port = *DIGIT . More... | |
static Bool_t | IsQuery (const TString &) |
Returns kTRUE if string qualifies as URI query: query = *( pchar / "/" / "?" ) . More... | |
static Bool_t | IsRegName (const TString &) |
Returns kTRUE if string qualifies as valid reg-name: reg-name = *( unreserved / pct-encoded / sub-delims ) sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "=" . More... | |
static Bool_t | IsRelativePart (const TString &) |
Returns kTRUE is string qualifies as relative-part: relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-empty . More... | |
static Bool_t | IsScheme (const TString &) |
Returns kTRUE if string qualifies as URI scheme: . More... | |
static Bool_t | IsUnreserved (const TString &string) |
Returns kTRUE, if the given string does not contain RFC 3986 reserved characters . More... | |
static Bool_t | IsUserInfo (const TString &) |
Return kTRUE is string qualifies as valid URI userinfo: userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) this equals to pchar without the '@' character. More... | |
static const TString | MergePaths (const TUri &reference, const TUri &base) |
RFC 3986, 5.3.2. More... | |
static const TString | PctDecode (const TString &source) |
Percent-decode the given string according to chapter 2.1 we assume a valid pct-encoded string. More... | |
static const TString | PctDecodeUnreserved (const TString &source) |
Percent-decode the given string according to chapter 2.1 we assume a valid pct-encoded string. More... | |
static const TString | PctEncode (const TString &source) |
Percent-encode and return the given string according to RFC 3986 in principle, this function cannot fail or produce an error. More... | |
static const TString | PctNormalise (const TString &source) |
Normalise the percent-encoded parts of the string i.e. More... | |
static const TString | RemoveDotSegments (const TString &) |
This functions implements the "remove_dot_segments" routine of chapter 5.2.4 "for interpreting and removing the special '. More... | |
static TUri | Transform (const TUri &reference, const TUri &base) |
Transform a URI reference into its target URI using given a base URI. More... | |
Static Public Member Functions inherited from TObject | |
static Long_t | GetDtorOnly () |
Return destructor only flag. More... | |
static Bool_t | GetObjectStat () |
Get status of object stat flag. More... | |
static void | SetDtorOnly (void *obj) |
Set destructor only flag. More... | |
static void | SetObjectStat (Bool_t stat) |
Turn on/off tracking of objects in the TObjectTable. More... | |
Friends | |
Bool_t | operator== (const TUri &u1, const TUri &u2) |
Implementation of a TUri Equivalence operator that uses syntax-based normalisation see chapter 6.2.2. More... | |
Additional Inherited Members | |
Public Types inherited from TObject | |
enum | { kIsOnHeap = 0x01000000, kNotDeleted = 0x02000000, kZombie = 0x04000000, kBitMask = 0x00ffffff } |
enum | { kSingleKey = BIT(0), kOverwrite = BIT(1), kWriteDelete = BIT(2) } |
enum | EStatusBits { kCanDelete = BIT(0), kMustCleanup = BIT(3), kObjInCanvas = BIT(3), kIsReferenced = BIT(4), kHasUUID = BIT(5), kCannotPick = BIT(6), kNoContextMenu = BIT(8), kInvalidObject = BIT(13) } |
Protected Member Functions inherited from TObject | |
virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
Interface to ErrorHandler (protected). More... | |
void | MakeZombie () |
#include <TUri.h>
TUri::TUri | ( | const TString & | uri | ) |
TUri::TUri | ( | const char * | uri | ) |
const TString TUri::GetAuthority | ( | ) | const |
const TString TUri::GetHierPart | ( | ) | const |
const TString TUri::GetRelativePart | ( | ) | const |
const TString TUri::GetUri | ( | ) | const |
Returns the whole URI - an implementation of chapter 5.3 component recomposition.
The result URI is composed out of the five basic parts.
Bool_t TUri::IsAbsolute | ( | ) | const |
Bool_t TUri::IsReference | ( | ) | const |
Bool_t TUri::IsRelative | ( | ) | const |
|
inlinevirtual |
Bool_t TUri::IsUri | ( | ) | const |
RFC 3986, 5.3.2.
If the base URI has a defined authority component and an empty path, then return a string consisting of "/" concatenated with the reference's path; otherwise, return a string consisting of the reference's path component appended to all but the last segment of the base URI's path (i.e., excluding any characters after the right-most "/" in the base URI path, or excluding the entire base URI path if it does not contain any "/" characters).
void TUri::Normalise | ( | ) |
Set authority part of URI:
.
Split into components {userinfo@, host, :port}, remember that according to the RFC, it is necessary to distinguish between missing component (no delimiter) and empty component (delimiter present).