ArcGIS Procedural Runtime  3.2.10650
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions
prtx::URI Class Referenceabstract

#include <URI.h>

Public Member Functions

virtual std::wstring getBaseName () const =0
 
virtual const std::wstring & getExtension () const =0
 
virtual const std::wstring & getFragment () const =0
 
virtual std::wstring getFragment (const std::wstring &key) const =0
 
virtual const std::wstring & getHost () const =0
 
virtual std::wstring getNativeFormat () const =0
 
virtual URIPtr getNestedURI () const =0
 
virtual std::wstring getPath () const =0
 
virtual const std::wstring & getQuery () const =0
 
virtual std::wstring getQuery (const std::wstring &key) const =0
 
virtual const std::wstring & getScheme () const =0
 
virtual bool hasFragment () const =0
 
virtual bool hasQuery () const =0
 
virtual bool isComposite () const =0
 
virtual bool isFilePath () const =0
 
virtual bool isValid () const =0
 
virtual std::string string () const =0
 
virtual const std::wstring & wstring () const =0
 

Static Public Member Functions

static URIPtr create ()
 
static URIPtr create (const std::wstring &fullURI)
 

Static Public Attributes

static const std::wstring DELIM_ENTRY
 composite/nested URI delimiting character '!'
 
static const std::wstring DELIM_FRAGMENT
 fragment delimiting character '#'
 
static const std::wstring DELIM_FRAGMENT_ITEM
 fragment item delimiting character '&'
 
static const std::wstring DELIM_QUERY
 query delimiting character '?'
 
static const std::wstring DELIM_QUERY_ITEM
 query item delimiting character '&'
 
static const std::wstring DELIM_SCHEME
 scheme delimiting character ':'
 
static const std::wstring QUERY_TEXTURE_FORMAT
 
static const std::wstring QUERY_TEXTURE_HEIGHT
 
static const std::wstring QUERY_TEXTURE_NAME
 
static const std::wstring QUERY_TEXTURE_WIDTH
 
static const std::wstring SCHEME_BUILTIN
 "builtin" scheme
 
static const std::wstring SCHEME_DATA
 "data" scheme, see http://tools.ietf.org/html/rfc2397
 
static const std::wstring SCHEME_FILE
 "file" scheme, e.g. file:/local/file/system/file.ext
 
static const std::wstring SCHEME_MEMORY
 "memory" scheme, see prtx::URIUtils::createMemoryURI()
 
static const std::wstring SCHEME_RPK
 rule package "rpk" scheme, see prtx::URIUtils::createCompositeURI()
 
static const std::wstring SCHEME_SAMBA
 samba "smb" scheme, e.g. smb://host/share syntax
 
static const std::wstring SCHEME_UNC
 UNC scheme, e.g. \ syntax.
 
static const std::wstring SCHEME_ZIP
 "zip" scheme
 

Protected Member Functions

 URI (const URI &)=default
 

Detailed Description

URI class based on RFC 3986. URI instances are immutable. See prtx::URIUtils namespace for factory member functions and operations on URI.

The observer member functions return UTF-16 strings without percent-encoding if not stated otherwise. Additionally, all wchar_t/std::wstring arguments are encoded as UTF-16 if not stated otherwise.

This class supports URI nesting inspired by the Java JAR syntax defined in: https://www.iana.org/assignments/uri-schemes/prov/jar

Definitions:

Member Function Documentation

◆ create() [1/2]

static URIPtr prtx::URI::create ( )
static

Factory member function to create an empty URI. Note: an empty URI will return false for isValid().

◆ create() [2/2]

static URIPtr prtx::URI::create ( const std::wstring &  fullURI)
static

Factory member function to create an absolute URI.

Parameters
fullURIfullURI is expected to be a percent-encoded UTF8 string.

◆ getBaseName()

virtual std::wstring prtx::URI::getBaseName ( ) const
pure virtual

Returns a copy of the base name part of the path component in UTF-16. Note: Result is undefined for non-file schemes.

◆ getExtension()

virtual const std::wstring& prtx::URI::getExtension ( ) const
pure virtual

Returns the path extension, i.e. the remainder of the path component including the last '.'

◆ getFragment() [1/2]

virtual const std::wstring& prtx::URI::getFragment ( ) const
pure virtual

Returns the fragment part (potentially an empty string).

◆ getFragment() [2/2]

virtual std::wstring prtx::URI::getFragment ( const std::wstring &  key) const
pure virtual

Returns the fragment component specified by key or an empty string.

Parameters
keyIf key is not empty, look for key=val part in fragment component and return val, else return empty string. Note: key must not contain percent-encoded characters.

◆ getHost()

virtual const std::wstring& prtx::URI::getHost ( ) const
pure virtual

Returns a reference to the hostname in UTF-16 (potentially an empty string).

◆ getNativeFormat()

virtual std::wstring prtx::URI::getNativeFormat ( ) const
pure virtual

Get a platform-dependent representation of the URI based on scheme, e.g. on windows, the uri "unc://host/share/path" will be returned as "\\host\share\path"

◆ getNestedURI()

virtual URIPtr prtx::URI::getNestedURI ( ) const
pure virtual

Returns the nested URI or URIPtr() if there is no nested URI. For example, for the URI "rpk:file:/path/to/package.rpk!/data/file.txt", it returns an URI object for "file:/path/to/package.rpk".

◆ getPath()

virtual std::wstring prtx::URI::getPath ( ) const
pure virtual

Returns a copy to the path component in UTF-16. Note: omits the leading slash on windows if path starts with a drive letter.

◆ getQuery() [1/2]

virtual const std::wstring& prtx::URI::getQuery ( ) const
pure virtual

Returns the whole query component or an empty string.

◆ getQuery() [2/2]

virtual std::wstring prtx::URI::getQuery ( const std::wstring &  key) const
pure virtual

Returns the query component specified by key or an empty string.

Parameters
keyIf key is not empty, look for key=val part in query component and return val, else return empty string. Note: key must not contain percent-encoded characters.

◆ getScheme()

virtual const std::wstring& prtx::URI::getScheme ( ) const
pure virtual

Returns a reference to the URI scheme in UTF-16. (e.g. "builtin", "file", "memory", "rpk", "zip", "http", ...)

◆ hasFragment()

virtual bool prtx::URI::hasFragment ( ) const
pure virtual

Returns true if the fragment part has non-zero length.

◆ hasQuery()

virtual bool prtx::URI::hasQuery ( ) const
pure virtual

Returns true if the query part has non-zero length.

◆ isComposite()

virtual bool prtx::URI::isComposite ( ) const
pure virtual

Returns true, if this URI contains a valid nested URI. Else, returns false.

◆ isFilePath()

virtual bool prtx::URI::isFilePath ( ) const
pure virtual

Returns true, if this URI is pointing to a file i.e. "file:/path/to/ff.ext"

◆ isValid()

virtual bool prtx::URI::isValid ( ) const
pure virtual

Returns false, if parsing failed and/or RFC is violated by the input at construction time.

◆ string()

virtual std::string prtx::URI::string ( ) const
pure virtual

Returns a copy of the full URI string in UTF-8. NOTE: only contains characters from the allowed set defined by RFC 3986, other characters are percent-encoded.

◆ wstring()

virtual const std::wstring& prtx::URI::wstring ( ) const
pure virtual

Returns a reference to the full URI string in UTF-16. NOTE: only contains characters from the allowed set defined by RFC 3986, other characters are percent-encoded.


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