VTK  9.4.20241203
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
vtkURI Class Referencefinal

URI representation. More...

#include <vtkURI.h>

Inheritance diagram for vtkURI:
[legend]
Collaboration diagram for vtkURI:
[legend]

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual vtkTypeBool IsA (const char *type)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
vtkURINewInstance () const
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
const vtkURIComponentGetScheme () const
 URI scheme.
 
const vtkURIComponentGetAuthority () const
 URI authority.
 
const vtkURIComponentGetPath () const
 URI path.
 
const vtkURIComponentGetQuery () const
 URI query.
 
const vtkURIComponentGetFragment () const
 URI fragment.
 
vtkSmartPointer< vtkURIClone () const
 
std::string ToString () const
 Construct the string representation of the URI.
 
bool IsReference () const
 URI types determination.
 
bool IsRelative () const
 URI types determination.
 
bool IsAbsolute () const
 URI types determination.
 
bool IsFull () const
 URI types determination.
 
bool IsSameDocRef () const
 URI types determination.
 
bool IsEmpty () const
 URI types determination.
 
- Public Member Functions inherited from vtkObject
 vtkBaseTypeMacro (vtkObject, vtkObjectBase)
 
virtual void DebugOn ()
 Turn debugging output on.
 
virtual void DebugOff ()
 Turn debugging output off.
 
bool GetDebug ()
 Get the value of the debug flag.
 
void SetDebug (bool debugFlag)
 Set the value of the debug flag.
 
virtual void Modified ()
 Update the modification time for this object.
 
virtual vtkMTimeType GetMTime ()
 Return this object's modified time.
 
void PrintSelf (ostream &os, vtkIndent indent) override
 Methods invoked by print to print information about the object including superclasses.
 
void RemoveObserver (unsigned long tag)
 
void RemoveObservers (unsigned long event)
 
void RemoveObservers (const char *event)
 
void RemoveAllObservers ()
 
vtkTypeBool HasObserver (unsigned long event)
 
vtkTypeBool HasObserver (const char *event)
 
vtkTypeBool InvokeEvent (unsigned long event)
 
vtkTypeBool InvokeEvent (const char *event)
 
std::string GetObjectDescription () const override
 The object description printed in messages and PrintSelf output.
 
unsigned long AddObserver (unsigned long event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
unsigned long AddObserver (const char *event, vtkCommand *, float priority=0.0f)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkCommandGetCommand (unsigned long tag)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObserver (vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
void RemoveObservers (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (unsigned long event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
vtkTypeBool HasObserver (const char *event, vtkCommand *)
 Allow people to add/remove/invoke observers (callbacks) to any VTK object.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Overloads to AddObserver that allow developers to add class member functions as callbacks for events.
 
template<class U , class T >
unsigned long AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f)
 Allow user to set the AbortFlagOn() with the return value of the callback method.
 
vtkTypeBool InvokeEvent (unsigned long event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
vtkTypeBool InvokeEvent (const char *event, void *callData)
 This method invokes an event and return whether the event was aborted or not.
 
virtual void SetObjectName (const std::string &objectName)
 Set/get the name of this object for reporting purposes.
 
virtual std::string GetObjectName () const
 Set/get the name of this object for reporting purposes.
 
- Public Member Functions inherited from vtkObjectBase
const char * GetClassName () const
 Return the class name as a string.
 
virtual std::string GetObjectDescription () const
 The object description printed in messages and PrintSelf output.
 
virtual vtkTypeBool IsA (const char *name)
 Return 1 if this class is the same type of (or a subclass of) the named class.
 
virtual vtkIdType GetNumberOfGenerationsFromBase (const char *name)
 Given the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
virtual void Delete ()
 Delete a VTK object.
 
virtual void FastDelete ()
 Delete a reference to this object.
 
void InitializeObjectBase ()
 
void Print (ostream &os)
 Print an object to an ostream.
 
void Register (vtkObjectBase *o)
 Increase the reference count (mark as used by another object).
 
virtual void UnRegister (vtkObjectBase *o)
 Decrease the reference count (release by another object).
 
int GetReferenceCount ()
 Return the current reference count of this object.
 
void SetReferenceCount (int)
 Sets the reference count.
 
bool GetIsInMemkind () const
 A local state flag that remembers whether this object lives in the normal or extended memory space.
 
virtual void PrintHeader (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual void PrintTrailer (ostream &os, vtkIndent indent)
 Methods invoked by print to print information about the object including superclasses.
 
virtual bool UsesGarbageCollector () const
 Indicate whether the class uses vtkGarbageCollector or not.
 

Static Public Member Functions

static vtkTypeBool IsTypeOf (const char *type)
 
static vtkURISafeDownCast (vtkObjectBase *o)
 
static vtkURINew ()
 Construct a new vtkURI.
 
static std::string PercentEncode (const std::string &str)
 Calls PercentEncode(str.data(), str.size())
 
static std::string PercentEncode (const char *str, std::size_t size)
 Encode a string into an URI compatible, percent-encoded, string.
 
static std::string PercentDecode (const std::string &str)
 Calls PercentDecode(str.data(), str.size())
 
static std::string PercentDecode (const char *str, std::size_t size)
 Decode percent-encoded values from given string.
 
static VTK_WRAPEXCLUDE vtkSmartPointer< vtkURIMake (vtkURIComponent scheme=vtkURIComponent::Undefined, vtkURIComponent authority=vtkURIComponent::Undefined, vtkURIComponent path="", vtkURIComponent query=vtkURIComponent::Undefined, vtkURIComponent fragment=vtkURIComponent::Undefined)
 Create a new vtkURI with specified components.
 
static vtkSmartPointer< vtkURIClone (const vtkURI *other)
 Clone a vtkURI.
 
static vtkSmartPointer< vtkURIParse (const std::string &uri)
 Create a new URI from a string.
 
static vtkSmartPointer< vtkURIParse (const char *uri, std::size_t size)
 Create a new URI from a string.
 
static vtkSmartPointer< vtkURIResolve (const vtkURI *baseURI, const vtkURI *uri)
 Resolve an URI from a base URI.
 
- Static Public Member Functions inherited from vtkObject
static vtkObjectNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void BreakOnError ()
 This method is called when vtkErrorMacro executes.
 
static void SetGlobalWarningDisplay (vtkTypeBool val)
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOn ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static void GlobalWarningDisplayOff ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
static vtkTypeBool GetGlobalWarningDisplay ()
 This is a global flag that controls whether any debug, warning or error messages are displayed.
 
- Static Public Member Functions inherited from vtkObjectBase
static vtkTypeBool IsTypeOf (const char *name)
 Return 1 if this class type is the same type of (or a subclass of) the named class.
 
static vtkIdType GetNumberOfGenerationsFromBaseType (const char *name)
 Given a the name of a base class of this class type, return the distance of inheritance between this class type and the named class (how many generations of inheritance are there between this class and the named class).
 
static vtkObjectBaseNew ()
 Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
 
static void SetMemkindDirectory (const char *directoryname)
 The name of a directory, ideally mounted -o dax, to memory map an extended memory space within.
 
static bool GetUsingMemkind ()
 A global state flag that controls whether vtkObjects are constructed in the usual way (the default) or within the extended memory space.
 

Protected Member Functions

virtual vtkObjectBaseNewInstanceInternal () const
 
- Protected Member Functions inherited from vtkObject
 vtkObject ()
 
 ~vtkObject () override
 
void RegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) override
 
void InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=nullptr)
 These methods allow a command to exclusively grab all events.
 
void InternalReleaseFocus ()
 These methods allow a command to exclusively grab all events.
 
- Protected Member Functions inherited from vtkObjectBase
 vtkObjectBase ()
 
virtual ~vtkObjectBase ()
 
virtual void RegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void UnRegisterInternal (vtkObjectBase *, vtkTypeBool check)
 
virtual void ReportReferences (vtkGarbageCollector *)
 
virtual void ObjectFinalize ()
 
 vtkObjectBase (const vtkObjectBase &)
 
void operator= (const vtkObjectBase &)
 

Friends

vtkSmartPointer< vtkURIMakeUnchecked (vtkURIComponent scheme, vtkURIComponent authority, vtkURIComponent path, vtkURIComponent query, vtkURIComponent fragment)
 
vtkSmartPointer< vtkURIClone (const vtkURI *other)
 

Additional Inherited Members

- Static Protected Member Functions inherited from vtkObjectBase
static vtkMallocingFunction GetCurrentMallocFunction ()
 
static vtkReallocingFunction GetCurrentReallocFunction ()
 
static vtkFreeingFunction GetCurrentFreeFunction ()
 
static vtkFreeingFunction GetAlternateFreeFunction ()
 
- Protected Attributes inherited from vtkObject
bool Debug
 
vtkTimeStamp MTime
 
vtkSubjectHelper * SubjectHelper
 
std::string ObjectName
 
- Protected Attributes inherited from vtkObjectBase
std::atomic< int32_t > ReferenceCount
 
vtkWeakPointerBase ** WeakPointers
 

Detailed Description

URI representation.

This class is final and immutable.

Other functions are mainly getters for URI components or URI type identification.

Known limitations:

Definition at line 121 of file vtkURI.h.

Member Typedef Documentation

◆ Superclass

Definition at line 124 of file vtkURI.h.

Member Function Documentation

◆ IsTypeOf()

static vtkTypeBool vtkURI::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual vtkTypeBool vtkURI::IsA ( const char *  name)
virtual

Return 1 if this class is the same type of (or a subclass of) the named class.

Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

static vtkURI * vtkURI::SafeDownCast ( vtkObjectBase o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkURI::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkURI * vtkURI::NewInstance ( ) const

◆ PrintSelf()

void vtkURI::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Methods invoked by print to print information about the object including superclasses.

Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from vtkObject.

◆ New()

static vtkURI * vtkURI::New ( )
static

Construct a new vtkURI.

Default URI as a defined but empty path. Other components are undefined.

Returns
New URI instance

◆ PercentEncode() [1/2]

static std::string vtkURI::PercentEncode ( const std::string &  str)
inlinestatic

Calls PercentEncode(str.data(), str.size())

Parameters
strInput string to encode, may be empty.
Returns
Encodes string from str

Definition at line 142 of file vtkURI.h.

◆ PercentEncode() [2/2]

static std::string vtkURI::PercentEncode ( const char *  str,
std::size_t  size 
)
static

Encode a string into an URI compatible, percent-encoded, string.

Transform all bytes in str that are not part of "reserved" or "unreserved" character sets into percent-encoded values.

Note:

  • All '' in str will be replaced with "%25", even if they already represent a percent-encoded value
Parameters
strInput string to encode, may be null if size is 0.
sizeInput string size, may be 0.
Returns
Encoded string from str

◆ PercentDecode() [1/2]

static std::string vtkURI::PercentDecode ( const std::string &  str)
inlinestatic

Calls PercentDecode(str.data(), str.size())

Parameters
strInput string to decode, may be empty.
Returns
Decoded string from str

Definition at line 172 of file vtkURI.h.

◆ PercentDecode() [2/2]

static std::string vtkURI::PercentDecode ( const char *  str,
std::size_t  size 
)
static

Decode percent-encoded values from given string.

Percent-encoded values are used to store reserved characters in URIs.

This function decode str, replacing HH values with their real value.

Parameters
strInput string to decode, may be null if size is 0.
sizeInput string size, may be 0.
Returns
Decoded string from str

◆ Make()

Create a new vtkURI with specified components.

Syntax of components is checked in order to ensure that they respect RFC3986.

If scheme is "data" (case-insensitive), the path is only checked until the beginning of the data. This is done to prevent massive overhead when constructing a big data URI. Data validation has to be performed by the decoding algorithm. vtkURI::PercentDecode does the required checks for raw data URIs.

Percent-encoded character are not decoded. Use vtkURI::PercentEncode if necessary.

Tip: Parameters may be moved-in to prevent copy of big strings. This function is not wrapped. If you need to construct an URI from a wrapper, use Parse(str).

Parameters
schemeURI scheme, must not be empty if defined.
authorityURI authority, may be defined, but empty.
pathURI path, must be defined, but can be empty.
queryURI query, may be defined, but empty.
fragmentURI fragment, may be defined, but empty.
Returns
nullptr if URI syntax checks do not pass, otherwise a new vtkURI.

◆ Clone() [1/2]

static vtkSmartPointer< vtkURI > vtkURI::Clone ( const vtkURI other)
static

Clone a vtkURI.

Parameters
othervtkURI to clone
Returns
if other == nullptr returns nullptr, otherwise returns a new vtkURI with the exact same components as other

◆ Parse() [1/2]

static vtkSmartPointer< vtkURI > vtkURI::Parse ( const std::string &  uri)
inlinestatic

Create a new URI from a string.

Perform as if by calling vtkURI::Parse(uri.data(), uri.size()).

Parameters
urithe URI string representation, may be empty.
Returns
nullptr if URI syntax checks do not pass, otherwise a new vtkURI.

Definition at line 237 of file vtkURI.h.

◆ Parse() [2/2]

static vtkSmartPointer< vtkURI > vtkURI::Parse ( const char *  uri,
std::size_t  size 
)
static

Create a new URI from a string.

Parameters
urithe URI string representation, must not be nullptr if size > 0
sizethe URI string representation size, may be 0
Returns
nullptr if URI syntax checks do not pass, otherwise a new vtkURI.

◆ Resolve()

static vtkSmartPointer< vtkURI > vtkURI::Resolve ( const vtkURI baseURI,
const vtkURI uri 
)
static

Resolve an URI from a base URI.

This implements RFC3986. Base URI are used to compose absolute URIs from relative reference.

Parameters
baseURIthe base URI, if nullptr, this function only checks if uri is a complete URI
urirelative reference that needs to be resolved from baseURI
Returns
nullptr if URI syntax checks do not pass, otherwise a new vtkURI.

◆ GetScheme()

const vtkURIComponent & vtkURI::GetScheme ( ) const
inline

URI scheme.

Definition at line 266 of file vtkURI.h.

◆ GetAuthority()

const vtkURIComponent & vtkURI::GetAuthority ( ) const
inline

URI authority.

Definition at line 271 of file vtkURI.h.

◆ GetPath()

const vtkURIComponent & vtkURI::GetPath ( ) const
inline

URI path.

Definition at line 276 of file vtkURI.h.

◆ GetQuery()

const vtkURIComponent & vtkURI::GetQuery ( ) const
inline

URI query.

Definition at line 281 of file vtkURI.h.

◆ GetFragment()

const vtkURIComponent & vtkURI::GetFragment ( ) const
inline

URI fragment.

Definition at line 286 of file vtkURI.h.

◆ IsReference()

bool vtkURI::IsReference ( ) const
inline

URI types determination.

URI can be either:

  • A full URI: It has a scheme.
  • an URI reference: an URI that is either a relative reference or a full URI.
  • a relative reference, an URI that refers to data that has to be resolved from a base URI prior to loading. It does not define a scheme but defines at least one other component.
  • an absolute URI, an URI that can be used as a base URI. It defines a scheme and no fragment. It may define other components.
  • a same-document reference: an URI that defines only a fragment.
  • An empty URI

Definition at line 307 of file vtkURI.h.

◆ IsRelative()

bool vtkURI::IsRelative ( ) const
inline

URI types determination.

URI can be either:

  • A full URI: It has a scheme.
  • an URI reference: an URI that is either a relative reference or a full URI.
  • a relative reference, an URI that refers to data that has to be resolved from a base URI prior to loading. It does not define a scheme but defines at least one other component.
  • an absolute URI, an URI that can be used as a base URI. It defines a scheme and no fragment. It may define other components.
  • a same-document reference: an URI that defines only a fragment.
  • An empty URI

Definition at line 309 of file vtkURI.h.

◆ IsAbsolute()

bool vtkURI::IsAbsolute ( ) const
inline

URI types determination.

URI can be either:

  • A full URI: It has a scheme.
  • an URI reference: an URI that is either a relative reference or a full URI.
  • a relative reference, an URI that refers to data that has to be resolved from a base URI prior to loading. It does not define a scheme but defines at least one other component.
  • an absolute URI, an URI that can be used as a base URI. It defines a scheme and no fragment. It may define other components.
  • a same-document reference: an URI that defines only a fragment.
  • An empty URI

Definition at line 311 of file vtkURI.h.

◆ IsFull()

bool vtkURI::IsFull ( ) const
inline

URI types determination.

URI can be either:

  • A full URI: It has a scheme.
  • an URI reference: an URI that is either a relative reference or a full URI.
  • a relative reference, an URI that refers to data that has to be resolved from a base URI prior to loading. It does not define a scheme but defines at least one other component.
  • an absolute URI, an URI that can be used as a base URI. It defines a scheme and no fragment. It may define other components.
  • a same-document reference: an URI that defines only a fragment.
  • An empty URI

Definition at line 313 of file vtkURI.h.

◆ IsSameDocRef()

bool vtkURI::IsSameDocRef ( ) const
inline

URI types determination.

URI can be either:

  • A full URI: It has a scheme.
  • an URI reference: an URI that is either a relative reference or a full URI.
  • a relative reference, an URI that refers to data that has to be resolved from a base URI prior to loading. It does not define a scheme but defines at least one other component.
  • an absolute URI, an URI that can be used as a base URI. It defines a scheme and no fragment. It may define other components.
  • a same-document reference: an URI that defines only a fragment.
  • An empty URI

Definition at line 315 of file vtkURI.h.

◆ IsEmpty()

bool vtkURI::IsEmpty ( ) const
inline

URI types determination.

URI can be either:

  • A full URI: It has a scheme.
  • an URI reference: an URI that is either a relative reference or a full URI.
  • a relative reference, an URI that refers to data that has to be resolved from a base URI prior to loading. It does not define a scheme but defines at least one other component.
  • an absolute URI, an URI that can be used as a base URI. It defines a scheme and no fragment. It may define other components.
  • a same-document reference: an URI that defines only a fragment.
  • An empty URI

Definition at line 321 of file vtkURI.h.

◆ Clone() [2/2]

vtkSmartPointer< vtkURI > vtkURI::Clone ( ) const
inline
Returns
vtkURI::Clone(this)

Definition at line 331 of file vtkURI.h.

◆ ToString()

std::string vtkURI::ToString ( ) const

Construct the string representation of the URI.

Returns
a string representing the URI

Friends And Related Symbol Documentation

◆ MakeUnchecked

vtkSmartPointer< vtkURI > MakeUnchecked ( vtkURIComponent  scheme,
vtkURIComponent  authority,
vtkURIComponent  path,
vtkURIComponent  query,
vtkURIComponent  fragment 
)
friend

◆ Clone

vtkSmartPointer< vtkURI > Clone ( const vtkURI other)
friend

The documentation for this class was generated from the following file: