User Tools

Site Tools


DzUri

Represents a Uniform Resource Indicator as used for Scene Asset I/O.

More...

Inherits :

Enumerations

Properties

Static Methods

DAZ Script
Stringescape ( String str, ByteArray exclude, ByteArray closer )
StringescapedPath ( Array list, ByteArray exclude, ByteArray include )
BooleanfromLocalFilename ( String filePath )
Stringunescape ( String str )
ArrayunescapePath ( String path )

Constructors

DAZ Script
DzUri ()
DzUri ( DzUri uri )
DzUri ( String uri )

Methods

DAZ Script
voidclear ()
voidclearFoundLocalFilename ()
voiddetach ()
BooleanisEmpty ()
BooleanisNull ()
voidsetUri ( String uri )
StringtoLocalFilename ( String preferredPath )
StringtoLocalFilename ()
StringtoPath ( String preferredPath=“” )
StringtoString ( PartFlags flags )

Detailed Description

Represents a URI as it is used for the DSON file format. DzUri provides functionality in addition to standard URI/URL representations that is specific to the DSON file format.

DzUri provides for a traditional URI with path and fragment portions. In addition, it further divides the fragment into 1 to 3 parts for ease of use in the DSON file format. The following is an example of a URI as represented by the DzURI class:

/Converted/Victoria4/Victoria4.dsf::rCollar?rotation/x

The file path portion of this URI is: “/Converted/Victoria4/Victoria4.dsf”

The fragment portion of this URI is: “rCollar?rotation/x”

The fragment is further divided into an identifier and a property path. In this case the identifier is “rCollar” and the property path is “rotation/x”.

All the sections of the fragment are optional, however, to be valid, each section in the fragment requires the preceding section to also be valid. So, the following URIs are valid:

  • /Converted/Victoria4/Victoria4.dsf::rCollar
  • /Converted/Victoria4/Victoria4.dsf::rCollar?rotation
  • /Converted/Victoria4/Victoria4.dsf::rCollar?rotation/x

And the following URIs are not valid:

  • /Converted/Victoria4/Victoria4.dsf#?rotation/x
  • /Converted/Victoria4/Victoria4.dsf#?/x
  • /Converted/Victoria4/Victoria4.dsf#?rotation

Since:

  • 4.8.1.18

Enumerations


: PartFlag

TODO: Add description.

  • NoPart - TODO: Add description.
  • Scheme - TODO: Add description.
  • NodePath - TODO: Add description.
  • ModifierPath - TODO: Add description.
  • PropertyPath - TODO: Add description.
  • IDPart - TODO: Add description.
  • FilePath - TODO: Add description.
  • AllParts - TODO: Add description.

—–

: SchemeType

TODO: Add description.

  • NoScheme - TODO: Add description.
  • ID - TODO: Add description.
  • Name - TODO: Add description.

Properties


String : filePath

Holds the file path portion of the URI, if any.


DzVersion : fileVersion

Holds the file version of this URI, as a 64 bit unsigned integer. If not read from a file, this will be invalid.


String : id

Holds the identifier portion of this URI's fragment, if any.


Array : modifierPath

Holds the modifier path portion of the URI, if any.


Array : nodePath

Holds the node path portion of this URI, if any.


Array : propertyPath

Holds the property portion of the URI, if any.


SchemeType : schemeType

Holds the scheme type for this URI. Default is SchemeType::ID.

Static Methods


String : escape( String str, ByteArray exclude, ByteArray closer )

Escapes any reserved characters in the in the given string.

Parameter(s):

  • str - The string to replace reserved characters in.
  • exclude - The list of characters to not be escaped from the resultant string
  • include - The list of characters to be escaped from the resultant string

Return Value:

  • URI escape sequences.

String : escapedPath( Array list, ByteArray exclude, ByteArray include )

Converts the string list into an escaped path string.

Parameter(s):

  • list - The string list to replace reserved characters in.
  • exclude - The list of characters to not be escaped from the resultant string
  • include - The list of characters to be escaped from the resultant string

Return Value:

  • URI path escape sequences.

Boolean : fromLocalFilename( String filePath )

Holds wether or not this uri was points to a cloud asset.

Creates a new URI using the path of a local file.

Parameter(s):

  • filePath - A local file path.

String : unescape( String str )

Converts any escape sequences in the given string back to the corresponding character.

Parameter(s):

  • str - The string to convert escape sequences in.

Return Value:

  • The given string with any escape sequences replaced with the appropriate character.

Array : unescapePath( String path )

Converts the string into a string list of unescaped path pieces.

Constructors


DzUri()

Default constructor. Creates an empty URI.


DzUri( DzUri uri )

Copy constructor. Creates a URI as a copy of another URI.


DzUri( String uri )

Constructor. Creates a URI from its string representation.

Methods


void : clear()

Clears the current values of this URI.


void : clearFoundLocalFilename()

TODO: Add description.


void : detach()

Detaches this URI from any shared data. Makes the underlying data in this URI unique from all other URIs.


Boolean : isEmpty()

Return Value:

  • true if this URI is empty, otherwise false.

Boolean : isNull()

Return Value:

  • true if this URI is null, otherwise false. A DzUri may be empty without being Null, but a Null uri is always empty

Since:

  • 4.9.2.12

void : setUri( String uri )

Sets the value of this URI from a string representation of the full URI.

Parameter(s):

  • uri - The string containing the full URI.

String : toLocalFilename( String preferredPath )

Attempts to convert the URI to the path of a local file.

Parameter(s):

  • preferredPath - The path to attempt resolving against before other local drive paths are checked.

Return Value:

  • A string representation of the URI converted to a local file path.

String : toLocalFilename()

Attempts to convert the URI to the path of a local file.

Return Value:

  • A string representation of the path of the URI converted to a local file path.

String : toPath( String preferredPath=“” )

Attempts to convert the URI to the path of a local file.

Parameter(s):

  • preferredPath - The path to attempt resolving against before other local drive paths are checked.

Return Value:

  • A string representation of the URI converted to a file path. If the file represented by the URI exists, the string will be an absolute file path. If the file represented by the URI does not exist, the string will be a relative path.

Since:

  • 4.9.1.26

String : toString( PartFlags flags )

Return Value:

  • A string representation of the URI containing the parts specified by flags.