Detailed Description

Represents a path to a file with a protocol. e.g. http://www.site.com/aFile.png The path may also be relative to some other path (aFile.png relative to http://www.site.com).

Public Member Functions

 FilePath (string url)
 Creates a new filepath from the given url. More...
 
 FilePath (string url, string relativeTo)
 Creates a new filepath from the given url. More...
 
 FilePath (string url, string relativeTo, bool useResolution)
 Creates a new filepath from the given url. More...
 
FileProtocol GetProtocol ()
 Gets the file protocol for this location. Default is resources://. More...
 
override string ToString ()
 Gets the full path as a string. More...
 

Public Attributes

string Url
 The raw Url/Path More...
 
string Protocol
 The protocol to use when accessing this file. More...
 
string[] Segments
 The pieces of the path split up by /. More...
 
string RelativeTo
 The raw Url that this path is relative to. More...
 
bool UsedResolution
 True if this path was extended with a resolution specific name. More...
 
string Hash
 The hash section of the URL, if there is one. Separated here because it should not be sent to the server. More...
 

Properties

FileProtocol Handler [get]
 The protocol which will handle this URL. More...
 
string Filename [get]
 Gets the filename without the filetype. More...
 
string File [get, set]
 Gets the full filename with the type included. More...
 
string Filetype [get]
 Gets the type of file this path points to. More...
 
string Directory [get]
 Gets the full directory path this file is in. More...
 
string Path [get]
 Gets the url of this file without the protocol. More...
 
string host [get]
 The host name of this path. More...
 
string hostname [get]
 The hostname with no port number. More...
 
string port [get]
 The port number, if there is one. More...
 
string href [get]
 The full path. More...
 
string basepath [get, set]
 The directory which anything relative to this path is relative to. Also see the html 'base' tag. More...
 
string target [get, set]
 Changes the documents target override. Any links with no target use this; Also see the html 'base' tag. Default is null. More...
 
string protocol [get]
 This locations protocol, including the trailing colon (":"). More...
 
string hash [get]
 The hash section of the URL, if there is one. More...
 
string pathname [get]
 Gets everything between host and the search string. More...
 
string file [get]
 The file without a query string. More...
 
string search [get]
 Gets the query string, if there is one. More...
 
bool fullAccess [get]
 Does this location have full access to the game? Depends on the protocol. E.g. http does not. More...
 
bool web [get]
 Is this a web location? More...
 

Private Member Functions

void SetPath (string url, string relativeTo)
 Applies the given url to this filepath object. More...
 
void SetPath (string url, string relativeTo, bool useResolution)
 Applies the given url to this filepath object. More...
 

Private Attributes

string Base
 An overriding base path which relative URLs will be relative to. See the HTML 'base' tag. More...
 
string Target
 An overriding base target which any links will use if they have no target defined. See the HTML 'base' tag. More...
 

Constructor & Destructor Documentation

PowerUI.FilePath.FilePath ( string  url)
inline

Creates a new filepath from the given url.

Parameters
urlThe url of the file.
PowerUI.FilePath.FilePath ( string  url,
string  relativeTo 
)
inline

Creates a new filepath from the given url.

Parameters
urlThe url of the file.
relativeToThe path that url is relative to.
PowerUI.FilePath.FilePath ( string  url,
string  relativeTo,
bool  useResolution 
)
inline

Creates a new filepath from the given url.

Parameters
urlThe url of the file.
relativeToThe path that url is relative to.
useResolutionTrue if the resolution string should be appended to the name.

Member Function Documentation

FileProtocol PowerUI.FilePath.GetProtocol ( )
inline

Gets the file protocol for this location. Default is resources://.

void PowerUI.FilePath.SetPath ( string  url,
string  relativeTo 
)
inlineprivate

Applies the given url to this filepath object.

Parameters
urlThe url of the file.
relativeToThe path that url is relative to.
void PowerUI.FilePath.SetPath ( string  url,
string  relativeTo,
bool  useResolution 
)
inlineprivate

Applies the given url to this filepath object.

Parameters
urlThe url of the file.
relativeToThe path that url is relative to.
override string PowerUI.FilePath.ToString ( )
inline

Gets the full path as a string.

Member Data Documentation

string PowerUI.FilePath.Base
private

An overriding base path which relative URLs will be relative to. See the HTML 'base' tag.

string PowerUI.FilePath.Hash

The hash section of the URL, if there is one. Separated here because it should not be sent to the server.

string PowerUI.FilePath.Protocol

The protocol to use when accessing this file.

string PowerUI.FilePath.RelativeTo

The raw Url that this path is relative to.

string [] PowerUI.FilePath.Segments

The pieces of the path split up by /.

string PowerUI.FilePath.Target
private

An overriding base target which any links will use if they have no target defined. See the HTML 'base' tag.

string PowerUI.FilePath.Url

The raw Url/Path

bool PowerUI.FilePath.UsedResolution

True if this path was extended with a resolution specific name.

Property Documentation

string PowerUI.FilePath.basepath
getset

The directory which anything relative to this path is relative to. Also see the html 'base' tag.

string PowerUI.FilePath.Directory
get

Gets the full directory path this file is in.

string PowerUI.FilePath.File
getset

Gets the full filename with the type included.

string PowerUI.FilePath.file
get

The file without a query string.

string PowerUI.FilePath.Filename
get

Gets the filename without the filetype.

string PowerUI.FilePath.Filetype
get

Gets the type of file this path points to.

bool PowerUI.FilePath.fullAccess
get

Does this location have full access to the game? Depends on the protocol. E.g. http does not.

FileProtocol PowerUI.FilePath.Handler
get

The protocol which will handle this URL.

string PowerUI.FilePath.hash
get

The hash section of the URL, if there is one.

string PowerUI.FilePath.host
get

The host name of this path.

string PowerUI.FilePath.hostname
get

The hostname with no port number.

string PowerUI.FilePath.href
get

The full path.

string PowerUI.FilePath.Path
get

Gets the url of this file without the protocol.

string PowerUI.FilePath.pathname
get

Gets everything between host and the search string.

string PowerUI.FilePath.port
get

The port number, if there is one.

string PowerUI.FilePath.protocol
get

This locations protocol, including the trailing colon (":").

string PowerUI.FilePath.search
get

Gets the query string, if there is one.

string PowerUI.FilePath.target
getset

Changes the documents target override. Any links with no target use this; Also see the html 'base' tag. Default is null.

bool PowerUI.FilePath.web
get

Is this a web location?