Url
Overview
URL is an URI with a schema, like file:// or http://
Location
-
Reference:
- Elements.dll .NET, .NET Core 6.0, .NET Standard 2.0
- elements.jar Cooper
- Elements.fx Island, ToffeeV2
- libElements.fx Toffee
- Namespace: RemObjects.Elements.RTL
- Platforms: .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island, Toffee, ToffeeV2
- Ancestry: Uri | Url
AddPercentEncodingsToPath
Use % encodings to encode the input string.
class method AddPercentEncodingsToPath(aString: String): String
static String AddPercentEncodingsToPath(String aString)
static func AddPercentEncodingsToPath(_ aString: String) -> String
static String AddPercentEncodingsToPath(String aString)
Shared Function AddPercentEncodingsToPath(aString As String) As String
Parameters:
- aString:
CanGetPathRelativeToUrl
Returns true if a path relative to the given url can be found.
method CanGetPathRelativeToUrl(aUrl: not nullable Url): Boolean
Boolean CanGetPathRelativeToUrl(Url! aUrl)
func CanGetPathRelativeToUrl(_ aUrl: Url) -> Boolean
Boolean CanGetPathRelativeToUrl(Url aUrl)
Function CanGetPathRelativeToUrl(aUrl As Url) As Boolean
Parameters:
- aUrl:
CanonicalVersion
Fixes an url to have no ../ and ./ in them, and encodes the parts with % encoding, where needed.
property CanonicalVersion: not nullable Url read;
Url! CanonicalVersion { get; }
var CanonicalVersion: Url { get{} }
Url CanonicalVersion { __get; }
ReadOnly Property CanonicalVersion() As Url
compare (declared in Uri) Toffee, ToffeeV2
func compare(_ rhs: Uri) -> NSComparisonResult
Parameters:
- rhs:
CompareTo (declared in Uri)
method CompareTo(rhs: Uri): Int32
Int32 CompareTo(Uri rhs)
func CompareTo(_ rhs: Uri) -> Int32
Integer CompareTo(Uri rhs)
Function CompareTo(rhs As Uri) As Int32
Parameters:
- rhs:
CopyWithQueryString
Copy this url, with a different query string.
method CopyWithQueryString(aQueryString: nullable String): not nullable Url
Url! CopyWithQueryString(String? aQueryString)
// Toffee
func CopyWithQueryString(_ aQueryString: String) -> Url
// ToffeeV2
func CopyWithQueryString(_ aQueryString: String?) -> Url
Url CopyWithQueryString(String aQueryString)
Function CopyWithQueryString(aQueryString As String?) As Url
Parameters:
- aQueryString:
description override Toffee, ToffeeV2
func description() -> NSString
Equals virtual
Returns true if this is equivalent with the passed argument.
method Equals(obj: Object): Boolean
Boolean Equals(Object obj)
func Equals(_ obj: Object) -> Boolean
Boolean Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters:
- obj:
FileExists .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-visionOS, Island-visionOS Simulator, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2
True if this url is a file url and it exists.
property FileExists: Boolean read;
Boolean FileExists { get; }
var FileExists: Boolean { get{} }
Boolean FileExists { __get; }
ReadOnly Property FileExists() As Boolean
FilePath
Returns the file path for this url (or nil if not a path)
property FilePath: String read;
String FilePath { get; }
var FilePath: String { get{} }
String FilePath { __get; }
ReadOnly Property FilePath() As String
Returns the file path, relative to an url, so adds ../ and ., if always is true, else goes to a maximum of 3.
method FilePathRelativeToUrl(aUrl: not nullable Url) Always(aAlways: Boolean): String
String FilePathRelativeToUrl(Url! aUrl) Always(Boolean aAlways)
func FilePathRelativeToUrl(_ aUrl: Url, Always aAlways: Boolean) -> String
String FilePathRelativeToUrl(Url aUrl) Always(Boolean aAlways)
Function FilePathRelativeToUrl(aUrl As Url) Always(aAlways As Boolean) As String
Parameters:
- aUrl:
- aAlways:
Returns the file path, relative to an url, so adds ../ and ., if always is true, else goes to a maximum of 3.
method FilePathRelativeToUrl(aUrl: not nullable Url) Threshold(aThreshold: Int32 := 3): nullable String
String? FilePathRelativeToUrl(Url! aUrl) Threshold(Int32 aThreshold = 3)
// Toffee
func FilePathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String
// ToffeeV2
func FilePathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String?
String FilePathRelativeToUrl(Url aUrl) Threshold(Integer aThreshold)
Function FilePathRelativeToUrl(aUrl As Url) Threshold(aThreshold As Int32 = 3) As String?
Parameters:
- aUrl:
- aThreshold:
FilePathRelativeToUrlIfPossible
method FilePathRelativeToUrlIfPossible(aUrl: not nullable Url): nullable String
String? FilePathRelativeToUrlIfPossible(Url! aUrl)
// Toffee
func FilePathRelativeToUrlIfPossible(_ aUrl: Url) -> String
// ToffeeV2
func FilePathRelativeToUrlIfPossible(_ aUrl: Url) -> String?
String FilePathRelativeToUrlIfPossible(Url aUrl)
Function FilePathRelativeToUrlIfPossible(aUrl As Url) As String?
Parameters:
- aUrl:
FilePathWithoutLastComponent
Returns the filepath, with the last component removed.
property FilePathWithoutLastComponent: String read;
String FilePathWithoutLastComponent { get; }
var FilePathWithoutLastComponent: String { get{} }
String FilePathWithoutLastComponent { __get; }
ReadOnly Property FilePathWithoutLastComponent() As String
FolderExists .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-visionOS, Island-visionOS Simulator, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2
True if this points to a folder and the folder exists.
property FolderExists: Boolean read;
Boolean FolderExists { get; }
var FolderExists: Boolean { get{} }
Boolean FolderExists { __get; }
ReadOnly Property FolderExists() As Boolean
Fragment
Returns the part after the #.
property Fragment: String read;
String Fragment { get; }
var Fragment: String { get{} }
String Fragment { __get; }
ReadOnly Property Fragment() As String
GetParentUrl
Returns this url with the last component stripped.
method GetParentUrl: nullable Url
Url? GetParentUrl()
// Toffee
func GetParentUrl() -> Url
// ToffeeV2
func GetParentUrl() -> Url?
Url GetParentUrl()
Function GetParentUrl() As Url?
hash override Toffee, ToffeeV2
// Toffee-iOS, Toffee-iOS Simulator, Toffee-Mac Catalyst, Toffee-macOS, Toffee-tvOS, Toffee-tvOS Simulator, Toffee-visionOS, Toffee-visionOS Simulator, Toffee-watchOS Simulator
func hash() -> UInt64
// ToffeeV2
func hash() -> NativeUInt
// Toffee-watchOS
func hash() -> UInt32
hashCode Cooper
method hashCode: Integer
Integer hashCode()
func hashCode() -> Integer
Integer hashCode()
Function hashCode() As Integer
Host
Return the hostname part, of an url with server.
property Host: String read;
String Host { get; }
var Host: String { get{} }
String Host { __get; }
ReadOnly Property Host() As String
HostAndPort
Return the hostname and port part, of an url with server.
property HostAndPort: nullable String read;
String? HostAndPort { get; }
// .NET, .NET Core 6.0, .NET Standard 2.0, Island, ToffeeV2
var HostAndPort: String? { get{} }
// Toffee
var HostAndPort: String { get{} }
String HostAndPort { __get; }
ReadOnly Property HostAndPort() As String?
IsAbsoluteWindowsDriveLetterFileURL
True if this url is an absolute windows path with drive letter.
property IsAbsoluteWindowsDriveLetterFileURL: Boolean read;
Boolean IsAbsoluteWindowsDriveLetterFileURL { get; }
var IsAbsoluteWindowsDriveLetterFileURL: Boolean { get{} }
Boolean IsAbsoluteWindowsDriveLetterFileURL { __get; }
ReadOnly Property IsAbsoluteWindowsDriveLetterFileURL() As Boolean
IsAbsoluteWindowsFileURL
True if this url is an absolute windows path .
property IsAbsoluteWindowsFileURL: Boolean read;
Boolean IsAbsoluteWindowsFileURL { get; }
var IsAbsoluteWindowsFileURL: Boolean { get{} }
Boolean IsAbsoluteWindowsFileURL { __get; }
ReadOnly Property IsAbsoluteWindowsFileURL() As Boolean
IsAbsoluteWindowsNetworkDriveFileURL
True if this url is an absolute windows path with network share.
property IsAbsoluteWindowsNetworkDriveFileURL: Boolean read;
Boolean IsAbsoluteWindowsNetworkDriveFileURL { get; }
var IsAbsoluteWindowsNetworkDriveFileURL: Boolean { get{} }
Boolean IsAbsoluteWindowsNetworkDriveFileURL { __get; }
ReadOnly Property IsAbsoluteWindowsNetworkDriveFileURL() As Boolean
IsFileUrl
True if this url points to a file:// url.
property IsFileUrl: Boolean read;
Boolean IsFileUrl { get; }
var IsFileUrl: Boolean { get{} }
Boolean IsFileUrl { __get; }
ReadOnly Property IsFileUrl() As Boolean
IsUnderneath
Returns true if this url is underneat the base url passed.
method IsUnderneath(aPotentialBaseUrl: not nullable Url): Boolean
Boolean IsUnderneath(Url! aPotentialBaseUrl)
func IsUnderneath(_ aPotentialBaseUrl: Url) -> Boolean
Boolean IsUnderneath(Url aPotentialBaseUrl)
Function IsUnderneath(aPotentialBaseUrl As Url) As Boolean
Parameters:
- aPotentialBaseUrl:
LastPathComponent
Returns the last path component of this url.
property LastPathComponent: String read;
String LastPathComponent { get; }
var LastPathComponent: String { get{} }
String LastPathComponent { __get; }
ReadOnly Property LastPathComponent() As String
LastPathComponentWithoutExtension
Returns the last path component of this url, removing the extension if any.
property LastPathComponentWithoutExtension: String read;
String LastPathComponentWithoutExtension { get; }
var LastPathComponentWithoutExtension: String { get{} }
String LastPathComponentWithoutExtension { __get; }
ReadOnly Property LastPathComponentWithoutExtension() As String
Password
property Password: String read;
String Password { get; }
var Password: String { get{} }
String Password { __get; }
ReadOnly Property Password() As String
Path
Returns the path without query string, host, protocol and fragment.
property Path: String read;
String Path { get; }
var Path: String { get{} }
String Path { __get; }
ReadOnly Property Path() As String
PathAndQueryString
Returns the path with query string without host, protocol and fragment.
property PathAndQueryString: nullable String read;
String? PathAndQueryString { get; }
// .NET, .NET Core 6.0, .NET Standard 2.0, Island, ToffeeV2
var PathAndQueryString: String? { get{} }
// Toffee
var PathAndQueryString: String { get{} }
String PathAndQueryString { __get; }
ReadOnly Property PathAndQueryString() As String?
PathExtension
Returns the extension of the last part of this url.
property PathExtension: String read;
String PathExtension { get; }
var PathExtension: String { get{} }
String PathExtension { __get; }
ReadOnly Property PathExtension() As String
Port
Returns the port in this url (or none if empty)
property Port: nullable Int32 read;
Int32? Port { get; }
var Port: Int32! { get{} }
Integer Port { __get; }
ReadOnly Property Port() As Int32?
QueryString
returns the query string part of this url, without ?
property QueryString: String read;
String QueryString { get; }
var QueryString: String { get{} }
String QueryString { __get; }
ReadOnly Property QueryString() As String
RemovePercentEncodingsFromPath
Decodes a % encoding path.
class method RemovePercentEncodingsFromPath(aString: String; aAlsoRemovePlusCharacter: Boolean := false): String
static String RemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter = false)
static func RemovePercentEncodingsFromPath(_ aString: String, _ aAlsoRemovePlusCharacter: Boolean = false) -> String
static String RemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter)
Shared Function RemovePercentEncodingsFromPath(aString As String, aAlsoRemovePlusCharacter As Boolean = false) As String
Parameters:
- aString:
- aAlsoRemovePlusCharacter:
Scheme
Returns the URL schema (first part of the url)
property Scheme: String read;
String Scheme { get; }
var Scheme: String { get{} }
String Scheme { __get; }
ReadOnly Property Scheme() As String
Create an url with the parameters as sub path relative to this. Optionally adds a slash at the end.
method SubUrl(params aComponents: array of String) isDirectory(aIsDirectory: Boolean): not nullable Url
Url! SubUrl(params String[] aComponents) isDirectory(Boolean aIsDirectory)
func SubUrl(_ aComponents: String..., isDirectory aIsDirectory: Boolean) -> Url
Url SubUrl(String[]... aComponents) isDirectory(Boolean aIsDirectory)
Function SubUrl(ParamArray aComponents As String()) isDirectory(aIsDirectory As Boolean) As Url
Parameters:
- aComponents:
- aIsDirectory:
Create an url with the parameters as sub path relative to this. O
method SubUrl(params aComponents: array of String): not nullable Url
Url! SubUrl(params String[] aComponents)
func SubUrl(_ aComponents: String...) -> Url
Url SubUrl(String[]... aComponents)
Function SubUrl(ParamArray aComponents As String()) As Url
Parameters:
- aComponents:
Create an url with the parameters as sub path relative to this. Optionally adds a slash at the end. Expects the subpath to be in the current systems path's format.
method SubUrlWithFilePath(aSubPath: String) isDirectory(aIsDirectory: Boolean): not nullable Url
Url! SubUrlWithFilePath(String aSubPath) isDirectory(Boolean aIsDirectory)
func SubUrlWithFilePath(_ aSubPath: String, isDirectory aIsDirectory: Boolean) -> Url
Url SubUrlWithFilePath(String aSubPath) isDirectory(Boolean aIsDirectory)
Function SubUrlWithFilePath(aSubPath As String) isDirectory(aIsDirectory As Boolean) As Url
Parameters:
- aSubPath:
- aIsDirectory:
Create an url with the parameters as sub path relative to this. Expects the subpath to be in the current systems path's format.
method SubUrlWithFilePath(aSubPath: String): not nullable Url
Url! SubUrlWithFilePath(String aSubPath)
func SubUrlWithFilePath(_ aSubPath: String) -> Url
Url SubUrlWithFilePath(String aSubPath)
Function SubUrlWithFilePath(aSubPath As String) As Url
Parameters:
- aSubPath:
ToAbsoluteString
Returns the full url.
method ToAbsoluteString: String
String ToAbsoluteString()
func ToAbsoluteString() -> String
String ToAbsoluteString()
Function ToAbsoluteString() As String
toString Cooper
method toString: PlatformString
PlatformString toString()
func toString() -> PlatformString
PlatformString toString()
Function toString() As PlatformString
ToString virtual .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2
Returns the full url.
method ToString: PlatformString
PlatformString ToString()
func ToString() -> String
Function ToString() As PlatformString
TryRemovePercentEncodingsFromPath
Try parse % encoding.
class method TryRemovePercentEncodingsFromPath(aString: String; aAlsoRemovePlusCharacter: Boolean := false): nullable String
static String? TryRemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter = false)
// Toffee
static func TryRemovePercentEncodingsFromPath(_ aString: String, _ aAlsoRemovePlusCharacter: Boolean = false) -> String
// ToffeeV2
static func TryRemovePercentEncodingsFromPath(_ aString: String, _ aAlsoRemovePlusCharacter: Boolean = false) -> String?
static String TryRemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter)
Shared Function TryRemovePercentEncodingsFromPath(aString As String, aAlsoRemovePlusCharacter As Boolean = false) As String?
Parameters:
- aString:
- aAlsoRemovePlusCharacter:
TryUriWithString (declared in Uri)
Try parse an URL, returns null on failure.
class method TryUriWithString(aUriString: nullable String): Uri
static Uri TryUriWithString(String? aUriString)
// Toffee
static func TryUriWithString(_ aUriString: String) -> Uri
// ToffeeV2
static func TryUriWithString(_ aUriString: String?) -> Uri
static Uri TryUriWithString(String aUriString)
Shared Function TryUriWithString(aUriString As String?) As Uri
Parameters:
- aUriString:
TryUrlWithString
Try parse an url.
class method TryUrlWithString(aUrlString: nullable String): nullable Url
static Url? TryUrlWithString(String? aUrlString)
// Toffee
static func TryUrlWithString(_ aUrlString: String) -> Url
// ToffeeV2
static func TryUrlWithString(_ aUrlString: String?) -> Url?
static Url TryUrlWithString(String aUrlString)
Shared Function TryUrlWithString(aUrlString As String?) As Url?
Parameters:
- aUrlString:
UnixPath
Returns the path as unix path.
property UnixPath: String read;
String UnixPath { get; }
var UnixPath: String { get{} }
String UnixPath { __get; }
ReadOnly Property UnixPath() As String
Returns the path as unix path, relative to another url.
method UnixPathRelativeToUrl(aUrl: not nullable Url) Always(aAlways: Boolean): String
String UnixPathRelativeToUrl(Url! aUrl) Always(Boolean aAlways)
func UnixPathRelativeToUrl(_ aUrl: Url, Always aAlways: Boolean) -> String
String UnixPathRelativeToUrl(Url aUrl) Always(Boolean aAlways)
Function UnixPathRelativeToUrl(aUrl As Url) Always(aAlways As Boolean) As String
Parameters:
- aUrl:
- aAlways:
Returns the path as unix path, relative to another url.
method UnixPathRelativeToUrl(aUrl: not nullable Url) Threshold(aThreshold: Int32 := 3): nullable String
String? UnixPathRelativeToUrl(Url! aUrl) Threshold(Int32 aThreshold = 3)
// Toffee
func UnixPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String
// ToffeeV2
func UnixPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String?
String UnixPathRelativeToUrl(Url aUrl) Threshold(Integer aThreshold)
Function UnixPathRelativeToUrl(aUrl As Url) Threshold(aThreshold As Int32 = 3) As String?
Parameters:
- aUrl:
- aThreshold:
UnixPathWithoutLastComponent
Returns the path as unix path, with the last part removed.
property UnixPathWithoutLastComponent: String read;
String UnixPathWithoutLastComponent { get; }
var UnixPathWithoutLastComponent: String { get{} }
String UnixPathWithoutLastComponent { __get; }
ReadOnly Property UnixPathWithoutLastComponent() As String
UriWithString (declared in Uri)
Parse an URL, throws an exception on failure.
class method UriWithString(aUriString: not nullable String): Uri
static Uri UriWithString(String! aUriString)
static func UriWithString(_ aUriString: String) -> Uri
static Uri UriWithString(String aUriString)
Shared Function UriWithString(aUriString As String) As Uri
Parameters:
- aUriString:
UrlWithAddedPathExtension
Retursn an url wih a different extension.
method UrlWithAddedPathExtension(aNewExtension: not nullable String): nullable Url
Url? UrlWithAddedPathExtension(String! aNewExtension)
// Toffee
func UrlWithAddedPathExtension(_ aNewExtension: String) -> Url
// ToffeeV2
func UrlWithAddedPathExtension(_ aNewExtension: String) -> Url?
Url UrlWithAddedPathExtension(String aNewExtension)
Function UrlWithAddedPathExtension(aNewExtension As String) As Url?
Parameters:
- aNewExtension:
UrlWithChangedLastPathComponent
Returns an url with the last path component replaced.
method UrlWithChangedLastPathComponent(aNewLastPathComponent: not nullable String): nullable Url
Url? UrlWithChangedLastPathComponent(String! aNewLastPathComponent)
// Toffee
func UrlWithChangedLastPathComponent(_ aNewLastPathComponent: String) -> Url
// ToffeeV2
func UrlWithChangedLastPathComponent(_ aNewLastPathComponent: String) -> Url?
Url UrlWithChangedLastPathComponent(String aNewLastPathComponent)
Function UrlWithChangedLastPathComponent(aNewLastPathComponent As String) As Url?
Parameters:
- aNewLastPathComponent:
UrlWithChangedPathExtension
Change an url's last part extension.
method UrlWithChangedPathExtension(aNewExtension: nullable String): nullable Url
Url? UrlWithChangedPathExtension(String? aNewExtension)
// Toffee
func UrlWithChangedPathExtension(_ aNewExtension: String) -> Url
// ToffeeV2
func UrlWithChangedPathExtension(_ aNewExtension: String?) -> Url?
Url UrlWithChangedPathExtension(String aNewExtension)
Function UrlWithChangedPathExtension(aNewExtension As String?) As Url?
Parameters:
- aNewExtension:
UrlWithComponents
Create an url from it's components.
class method UrlWithComponents(aScheme: String; aHost: String; aPort: Int32; aPath: String; aQueryString: String; aFragment: String; aUser: String): not nullable Url
static Url! UrlWithComponents(String aScheme, String aHost, Int32 aPort, String aPath, String aQueryString, String aFragment, String aUser)
static func UrlWithComponents(_ aScheme: String, _ aHost: String, _ aPort: Int32, _ aPath: String, _ aQueryString: String, _ aFragment: String, _ aUser: String) -> Url
static Url UrlWithComponents(String aScheme, String aHost, Integer aPort, String aPath, String aQueryString, String aFragment, String aUser)
Shared Function UrlWithComponents(aScheme As String, aHost As String, aPort As Int32, aPath As String, aQueryString As String, aFragment As String, aUser As String) As Url
Parameters:
- aScheme:
- aHost:
- aPort:
- aPath:
- aQueryString:
- aFragment:
- aUser:
Create an url from a file path.
class method UrlWithFilePath(aPath: not nullable String) isDirectory(aIsDirectory: Boolean): not nullable Url
static Url! UrlWithFilePath(String! aPath) isDirectory(Boolean aIsDirectory)
static func UrlWithFilePath(_ aPath: String, isDirectory aIsDirectory: Boolean) -> Url
static Url UrlWithFilePath(String aPath) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithFilePath(aPath As String) isDirectory(aIsDirectory As Boolean) As Url
Parameters:
- aPath:
- aIsDirectory:
UrlWithFilePath (not nullable String) relativeToUrl(not nullable Url) isDirectory(Boolean): not nullable Url
Create an url from a file path.
class method UrlWithFilePath(aPath: not nullable String) relativeToUrl(aUrl: not nullable Url) isDirectory(aIsDirectory: Boolean := false): not nullable Url
static Url! UrlWithFilePath(String! aPath) relativeToUrl(Url! aUrl) isDirectory(Boolean aIsDirectory = false)
static func UrlWithFilePath(_ aPath: String, relativeToUrl aUrl: Url, isDirectory aIsDirectory: Boolean = false) -> Url
static Url UrlWithFilePath(String aPath) relativeToUrl(Url aUrl) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithFilePath(aPath As String) relativeToUrl(aUrl As Url) isDirectory(aIsDirectory As Boolean = false) As Url
Parameters:
- aPath:
- aUrl:
- aIsDirectory:
class method UrlWithFilePath(aPath: not nullable String): not nullable Url
static Url! UrlWithFilePath(String! aPath)
static func UrlWithFilePath(_ aPath: String) -> Url
static Url UrlWithFilePath(String aPath)
Shared Function UrlWithFilePath(aPath As String) As Url
Parameters:
- aPath:
UrlWithFragment
Create an url with just a fragment.
method UrlWithFragment(aFragment: nullable String): not nullable Url
Url! UrlWithFragment(String? aFragment)
// Toffee
func UrlWithFragment(_ aFragment: String) -> Url
// ToffeeV2
func UrlWithFragment(_ aFragment: String?) -> Url
Url UrlWithFragment(String aFragment)
Function UrlWithFragment(aFragment As String?) As Url
Parameters:
- aFragment:
UrlWithoutFragment
Remove the fragment from an url.
method UrlWithoutFragment: not nullable Url
Url! UrlWithoutFragment()
func UrlWithoutFragment() -> Url
Url UrlWithoutFragment()
Function UrlWithoutFragment() As Url
UrlWithoutLastComponent
remove the last component from an url.
property UrlWithoutLastComponent: Url read;
Url UrlWithoutLastComponent { get; }
var UrlWithoutLastComponent: Url { get{} }
Url UrlWithoutLastComponent { __get; }
ReadOnly Property UrlWithoutLastComponent() As Url
UrlWithRelativeOrAbsoluteFileSubPath
Create an url with aSubPath added or if it's a full path, replaced.
method UrlWithRelativeOrAbsoluteFileSubPath(aSubPath: not nullable String): nullable Url
Url? UrlWithRelativeOrAbsoluteFileSubPath(String! aSubPath)
// Toffee
func UrlWithRelativeOrAbsoluteFileSubPath(_ aSubPath: String) -> Url
// ToffeeV2
func UrlWithRelativeOrAbsoluteFileSubPath(_ aSubPath: String) -> Url?
Url UrlWithRelativeOrAbsoluteFileSubPath(String aSubPath)
Function UrlWithRelativeOrAbsoluteFileSubPath(aSubPath As String) As Url?
Parameters:
- aSubPath:
UrlWithRelativeOrAbsoluteWindowsSubPath
Create an url with aSubPath as a windows path added or if it's a full path, replaced.
method UrlWithRelativeOrAbsoluteWindowsSubPath(aSubPath: not nullable String): nullable Url
Url? UrlWithRelativeOrAbsoluteWindowsSubPath(String! aSubPath)
// Toffee
func UrlWithRelativeOrAbsoluteWindowsSubPath(_ aSubPath: String) -> Url
// ToffeeV2
func UrlWithRelativeOrAbsoluteWindowsSubPath(_ aSubPath: String) -> Url?
Url UrlWithRelativeOrAbsoluteWindowsSubPath(String aSubPath)
Function UrlWithRelativeOrAbsoluteWindowsSubPath(aSubPath As String) As Url?
Parameters:
- aSubPath:
UrlWithString
Create an url from a string.
class method UrlWithString(aUrlString: not nullable String): not nullable Url
static Url! UrlWithString(String! aUrlString)
static func UrlWithString(_ aUrlString: String) -> Url
static Url UrlWithString(String aUrlString)
Shared Function UrlWithString(aUrlString As String) As Url
Parameters:
- aUrlString:
UrlWithUnixPath
Create an url from a unix path.
class method UrlWithUnixPath(aPath: not nullable String) isDirectory(aIsDirectory: Boolean := false): not nullable Url
static Url! UrlWithUnixPath(String! aPath) isDirectory(Boolean aIsDirectory = false)
static func UrlWithUnixPath(_ aPath: String, isDirectory aIsDirectory: Boolean = false) -> Url
static Url UrlWithUnixPath(String aPath) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithUnixPath(aPath As String) isDirectory(aIsDirectory As Boolean = false) As Url
Parameters:
- aPath:
- aIsDirectory:
UrlWithWindowsPath
Create an url from a windows path.
class method UrlWithWindowsPath(aPath: not nullable String) isDirectory(aIsDirectory: Boolean := false): not nullable Url
static Url! UrlWithWindowsPath(String! aPath) isDirectory(Boolean aIsDirectory = false)
static func UrlWithWindowsPath(_ aPath: String, isDirectory aIsDirectory: Boolean = false) -> Url
static Url UrlWithWindowsPath(String aPath) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithWindowsPath(aPath As String) isDirectory(aIsDirectory As Boolean = false) As Url
Parameters:
- aPath:
- aIsDirectory:
User
Returns the user part of the url.
property User: String read;
String User { get; }
var User: String { get{} }
String User { __get; }
ReadOnly Property User() As String
WindowsPath
Returns the windows path from this url, or nil.
property WindowsPath: String read;
String WindowsPath { get; }
var WindowsPath: String { get{} }
String WindowsPath { __get; }
ReadOnly Property WindowsPath() As String
Returns the path as windows path, relative to another url.
method WindowsPathRelativeToUrl(aUrl: not nullable Url) Always(aAlways: Boolean): String
String WindowsPathRelativeToUrl(Url! aUrl) Always(Boolean aAlways)
func WindowsPathRelativeToUrl(_ aUrl: Url, Always aAlways: Boolean) -> String
String WindowsPathRelativeToUrl(Url aUrl) Always(Boolean aAlways)
Function WindowsPathRelativeToUrl(aUrl As Url) Always(aAlways As Boolean) As String
Parameters:
- aUrl:
- aAlways:
Returns the path as windows path, relative to another url.
method WindowsPathRelativeToUrl(aUrl: not nullable Url) Threshold(aThreshold: Int32 := 3): nullable String
String? WindowsPathRelativeToUrl(Url! aUrl) Threshold(Int32 aThreshold = 3)
// Toffee
func WindowsPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String
// ToffeeV2
func WindowsPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String?
String WindowsPathRelativeToUrl(Url aUrl) Threshold(Integer aThreshold)
Function WindowsPathRelativeToUrl(aUrl As Url) Threshold(aThreshold As Int32 = 3) As String?
Parameters:
- aUrl:
- aThreshold:
WindowsPathWithoutLastComponent
Returns the path as windows path, with the last part removed.
property WindowsPathWithoutLastComponent: String read;
String WindowsPathWithoutLastComponent { get; }
var WindowsPathWithoutLastComponent: String { get{} }
String WindowsPathWithoutLastComponent { __get; }
ReadOnly Property WindowsPathWithoutLastComponent() As String
CanonicalVersion
Fixes an url to have no ../ and ./ in them, and encodes the parts with % encoding, where needed.
property CanonicalVersion: not nullable Url read;
Url! CanonicalVersion { get; }
var CanonicalVersion: Url { get{} }
Url CanonicalVersion { __get; }
ReadOnly Property CanonicalVersion() As Url
FileExists .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-visionOS, Island-visionOS Simulator, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2
True if this url is a file url and it exists.
property FileExists: Boolean read;
Boolean FileExists { get; }
var FileExists: Boolean { get{} }
Boolean FileExists { __get; }
ReadOnly Property FileExists() As Boolean
FilePath
Returns the file path for this url (or nil if not a path)
property FilePath: String read;
String FilePath { get; }
var FilePath: String { get{} }
String FilePath { __get; }
ReadOnly Property FilePath() As String
FilePathWithoutLastComponent
Returns the filepath, with the last component removed.
property FilePathWithoutLastComponent: String read;
String FilePathWithoutLastComponent { get; }
var FilePathWithoutLastComponent: String { get{} }
String FilePathWithoutLastComponent { __get; }
ReadOnly Property FilePathWithoutLastComponent() As String
FolderExists .NET, .NET Core 6.0, .NET Standard 2.0, Cooper, Island-Android, Island-iOS, Island-iOS Simulator, Island-Mac Catalyst, Island-macOS, Island-tvOS, Island-tvOS Simulator, Island-Ubuntu, Island-visionOS, Island-visionOS Simulator, Island-watchOS, Island-watchOS Simulator, Island-Windows, Toffee, ToffeeV2
True if this points to a folder and the folder exists.
property FolderExists: Boolean read;
Boolean FolderExists { get; }
var FolderExists: Boolean { get{} }
Boolean FolderExists { __get; }
ReadOnly Property FolderExists() As Boolean
Fragment
Returns the part after the #.
property Fragment: String read;
String Fragment { get; }
var Fragment: String { get{} }
String Fragment { __get; }
ReadOnly Property Fragment() As String
Host
Return the hostname part, of an url with server.
property Host: String read;
String Host { get; }
var Host: String { get{} }
String Host { __get; }
ReadOnly Property Host() As String
HostAndPort
Return the hostname and port part, of an url with server.
property HostAndPort: nullable String read;
String? HostAndPort { get; }
// .NET, .NET Core 6.0, .NET Standard 2.0, Island, ToffeeV2
var HostAndPort: String? { get{} }
// Toffee
var HostAndPort: String { get{} }
String HostAndPort { __get; }
ReadOnly Property HostAndPort() As String?
IsAbsoluteWindowsDriveLetterFileURL
True if this url is an absolute windows path with drive letter.
property IsAbsoluteWindowsDriveLetterFileURL: Boolean read;
Boolean IsAbsoluteWindowsDriveLetterFileURL { get; }
var IsAbsoluteWindowsDriveLetterFileURL: Boolean { get{} }
Boolean IsAbsoluteWindowsDriveLetterFileURL { __get; }
ReadOnly Property IsAbsoluteWindowsDriveLetterFileURL() As Boolean
IsAbsoluteWindowsFileURL
True if this url is an absolute windows path .
property IsAbsoluteWindowsFileURL: Boolean read;
Boolean IsAbsoluteWindowsFileURL { get; }
var IsAbsoluteWindowsFileURL: Boolean { get{} }
Boolean IsAbsoluteWindowsFileURL { __get; }
ReadOnly Property IsAbsoluteWindowsFileURL() As Boolean
IsAbsoluteWindowsNetworkDriveFileURL
True if this url is an absolute windows path with network share.
property IsAbsoluteWindowsNetworkDriveFileURL: Boolean read;
Boolean IsAbsoluteWindowsNetworkDriveFileURL { get; }
var IsAbsoluteWindowsNetworkDriveFileURL: Boolean { get{} }
Boolean IsAbsoluteWindowsNetworkDriveFileURL { __get; }
ReadOnly Property IsAbsoluteWindowsNetworkDriveFileURL() As Boolean
IsFileUrl
True if this url points to a file:// url.
property IsFileUrl: Boolean read;
Boolean IsFileUrl { get; }
var IsFileUrl: Boolean { get{} }
Boolean IsFileUrl { __get; }
ReadOnly Property IsFileUrl() As Boolean
LastPathComponent
Returns the last path component of this url.
property LastPathComponent: String read;
String LastPathComponent { get; }
var LastPathComponent: String { get{} }
String LastPathComponent { __get; }
ReadOnly Property LastPathComponent() As String
LastPathComponentWithoutExtension
Returns the last path component of this url, removing the extension if any.
property LastPathComponentWithoutExtension: String read;
String LastPathComponentWithoutExtension { get; }
var LastPathComponentWithoutExtension: String { get{} }
String LastPathComponentWithoutExtension { __get; }
ReadOnly Property LastPathComponentWithoutExtension() As String
Password
property Password: String read;
String Password { get; }
var Password: String { get{} }
String Password { __get; }
ReadOnly Property Password() As String
Path
Returns the path without query string, host, protocol and fragment.
property Path: String read;
String Path { get; }
var Path: String { get{} }
String Path { __get; }
ReadOnly Property Path() As String
PathAndQueryString
Returns the path with query string without host, protocol and fragment.
property PathAndQueryString: nullable String read;
String? PathAndQueryString { get; }
// .NET, .NET Core 6.0, .NET Standard 2.0, Island, ToffeeV2
var PathAndQueryString: String? { get{} }
// Toffee
var PathAndQueryString: String { get{} }
String PathAndQueryString { __get; }
ReadOnly Property PathAndQueryString() As String?
PathExtension
Returns the extension of the last part of this url.
property PathExtension: String read;
String PathExtension { get; }
var PathExtension: String { get{} }
String PathExtension { __get; }
ReadOnly Property PathExtension() As String
Port
Returns the port in this url (or none if empty)
property Port: nullable Int32 read;
Int32? Port { get; }
var Port: Int32! { get{} }
Integer Port { __get; }
ReadOnly Property Port() As Int32?
QueryString
returns the query string part of this url, without ?
property QueryString: String read;
String QueryString { get; }
var QueryString: String { get{} }
String QueryString { __get; }
ReadOnly Property QueryString() As String
Scheme
Returns the URL schema (first part of the url)
property Scheme: String read;
String Scheme { get; }
var Scheme: String { get{} }
String Scheme { __get; }
ReadOnly Property Scheme() As String
UnixPath
Returns the path as unix path.
property UnixPath: String read;
String UnixPath { get; }
var UnixPath: String { get{} }
String UnixPath { __get; }
ReadOnly Property UnixPath() As String
UnixPathWithoutLastComponent
Returns the path as unix path, with the last part removed.
property UnixPathWithoutLastComponent: String read;
String UnixPathWithoutLastComponent { get; }
var UnixPathWithoutLastComponent: String { get{} }
String UnixPathWithoutLastComponent { __get; }
ReadOnly Property UnixPathWithoutLastComponent() As String
UrlWithoutLastComponent
remove the last component from an url.
property UrlWithoutLastComponent: Url read;
Url UrlWithoutLastComponent { get; }
var UrlWithoutLastComponent: Url { get{} }
Url UrlWithoutLastComponent { __get; }
ReadOnly Property UrlWithoutLastComponent() As Url
User
Returns the user part of the url.
property User: String read;
String User { get; }
var User: String { get{} }
String User { __get; }
ReadOnly Property User() As String
WindowsPath
Returns the windows path from this url, or nil.
property WindowsPath: String read;
String WindowsPath { get; }
var WindowsPath: String { get{} }
String WindowsPath { __get; }
ReadOnly Property WindowsPath() As String
WindowsPathWithoutLastComponent
Returns the path as windows path, with the last part removed.
property WindowsPathWithoutLastComponent: String read;
String WindowsPathWithoutLastComponent { get; }
var WindowsPathWithoutLastComponent: String { get{} }
String WindowsPathWithoutLastComponent { __get; }
ReadOnly Property WindowsPathWithoutLastComponent() As String
AddPercentEncodingsToPath
Use % encodings to encode the input string.
class method AddPercentEncodingsToPath(aString: String): String
static String AddPercentEncodingsToPath(String aString)
static func AddPercentEncodingsToPath(_ aString: String) -> String
static String AddPercentEncodingsToPath(String aString)
Shared Function AddPercentEncodingsToPath(aString As String) As String
Parameters:
- aString:
RemovePercentEncodingsFromPath
Decodes a % encoding path.
class method RemovePercentEncodingsFromPath(aString: String; aAlsoRemovePlusCharacter: Boolean := false): String
static String RemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter = false)
static func RemovePercentEncodingsFromPath(_ aString: String, _ aAlsoRemovePlusCharacter: Boolean = false) -> String
static String RemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter)
Shared Function RemovePercentEncodingsFromPath(aString As String, aAlsoRemovePlusCharacter As Boolean = false) As String
Parameters:
- aString:
- aAlsoRemovePlusCharacter:
TryRemovePercentEncodingsFromPath
Try parse % encoding.
class method TryRemovePercentEncodingsFromPath(aString: String; aAlsoRemovePlusCharacter: Boolean := false): nullable String
static String? TryRemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter = false)
// Toffee
static func TryRemovePercentEncodingsFromPath(_ aString: String, _ aAlsoRemovePlusCharacter: Boolean = false) -> String
// ToffeeV2
static func TryRemovePercentEncodingsFromPath(_ aString: String, _ aAlsoRemovePlusCharacter: Boolean = false) -> String?
static String TryRemovePercentEncodingsFromPath(String aString, Boolean aAlsoRemovePlusCharacter)
Shared Function TryRemovePercentEncodingsFromPath(aString As String, aAlsoRemovePlusCharacter As Boolean = false) As String?
Parameters:
- aString:
- aAlsoRemovePlusCharacter:
TryUriWithString (declared in Uri)
Try parse an URL, returns null on failure.
class method TryUriWithString(aUriString: nullable String): Uri
static Uri TryUriWithString(String? aUriString)
// Toffee
static func TryUriWithString(_ aUriString: String) -> Uri
// ToffeeV2
static func TryUriWithString(_ aUriString: String?) -> Uri
static Uri TryUriWithString(String aUriString)
Shared Function TryUriWithString(aUriString As String?) As Uri
Parameters:
- aUriString:
TryUrlWithString
Try parse an url.
class method TryUrlWithString(aUrlString: nullable String): nullable Url
static Url? TryUrlWithString(String? aUrlString)
// Toffee
static func TryUrlWithString(_ aUrlString: String) -> Url
// ToffeeV2
static func TryUrlWithString(_ aUrlString: String?) -> Url?
static Url TryUrlWithString(String aUrlString)
Shared Function TryUrlWithString(aUrlString As String?) As Url?
Parameters:
- aUrlString:
UriWithString (declared in Uri)
Parse an URL, throws an exception on failure.
class method UriWithString(aUriString: not nullable String): Uri
static Uri UriWithString(String! aUriString)
static func UriWithString(_ aUriString: String) -> Uri
static Uri UriWithString(String aUriString)
Shared Function UriWithString(aUriString As String) As Uri
Parameters:
- aUriString:
UrlWithComponents
Create an url from it's components.
class method UrlWithComponents(aScheme: String; aHost: String; aPort: Int32; aPath: String; aQueryString: String; aFragment: String; aUser: String): not nullable Url
static Url! UrlWithComponents(String aScheme, String aHost, Int32 aPort, String aPath, String aQueryString, String aFragment, String aUser)
static func UrlWithComponents(_ aScheme: String, _ aHost: String, _ aPort: Int32, _ aPath: String, _ aQueryString: String, _ aFragment: String, _ aUser: String) -> Url
static Url UrlWithComponents(String aScheme, String aHost, Integer aPort, String aPath, String aQueryString, String aFragment, String aUser)
Shared Function UrlWithComponents(aScheme As String, aHost As String, aPort As Int32, aPath As String, aQueryString As String, aFragment As String, aUser As String) As Url
Parameters:
- aScheme:
- aHost:
- aPort:
- aPath:
- aQueryString:
- aFragment:
- aUser:
Create an url from a file path.
class method UrlWithFilePath(aPath: not nullable String) isDirectory(aIsDirectory: Boolean): not nullable Url
static Url! UrlWithFilePath(String! aPath) isDirectory(Boolean aIsDirectory)
static func UrlWithFilePath(_ aPath: String, isDirectory aIsDirectory: Boolean) -> Url
static Url UrlWithFilePath(String aPath) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithFilePath(aPath As String) isDirectory(aIsDirectory As Boolean) As Url
Parameters:
- aPath:
- aIsDirectory:
UrlWithFilePath (not nullable String) relativeToUrl(not nullable Url) isDirectory(Boolean): not nullable Url
Create an url from a file path.
class method UrlWithFilePath(aPath: not nullable String) relativeToUrl(aUrl: not nullable Url) isDirectory(aIsDirectory: Boolean := false): not nullable Url
static Url! UrlWithFilePath(String! aPath) relativeToUrl(Url! aUrl) isDirectory(Boolean aIsDirectory = false)
static func UrlWithFilePath(_ aPath: String, relativeToUrl aUrl: Url, isDirectory aIsDirectory: Boolean = false) -> Url
static Url UrlWithFilePath(String aPath) relativeToUrl(Url aUrl) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithFilePath(aPath As String) relativeToUrl(aUrl As Url) isDirectory(aIsDirectory As Boolean = false) As Url
Parameters:
- aPath:
- aUrl:
- aIsDirectory:
class method UrlWithFilePath(aPath: not nullable String): not nullable Url
static Url! UrlWithFilePath(String! aPath)
static func UrlWithFilePath(_ aPath: String) -> Url
static Url UrlWithFilePath(String aPath)
Shared Function UrlWithFilePath(aPath As String) As Url
Parameters:
- aPath:
UrlWithString
Create an url from a string.
class method UrlWithString(aUrlString: not nullable String): not nullable Url
static Url! UrlWithString(String! aUrlString)
static func UrlWithString(_ aUrlString: String) -> Url
static Url UrlWithString(String aUrlString)
Shared Function UrlWithString(aUrlString As String) As Url
Parameters:
- aUrlString:
UrlWithUnixPath
Create an url from a unix path.
class method UrlWithUnixPath(aPath: not nullable String) isDirectory(aIsDirectory: Boolean := false): not nullable Url
static Url! UrlWithUnixPath(String! aPath) isDirectory(Boolean aIsDirectory = false)
static func UrlWithUnixPath(_ aPath: String, isDirectory aIsDirectory: Boolean = false) -> Url
static Url UrlWithUnixPath(String aPath) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithUnixPath(aPath As String) isDirectory(aIsDirectory As Boolean = false) As Url
Parameters:
- aPath:
- aIsDirectory:
UrlWithWindowsPath
Create an url from a windows path.
class method UrlWithWindowsPath(aPath: not nullable String) isDirectory(aIsDirectory: Boolean := false): not nullable Url
static Url! UrlWithWindowsPath(String! aPath) isDirectory(Boolean aIsDirectory = false)
static func UrlWithWindowsPath(_ aPath: String, isDirectory aIsDirectory: Boolean = false) -> Url
static Url UrlWithWindowsPath(String aPath) isDirectory(Boolean aIsDirectory)
Shared Function UrlWithWindowsPath(aPath As String) isDirectory(aIsDirectory As Boolean = false) As Url
Parameters:
- aPath:
- aIsDirectory:
CanGetPathRelativeToUrl
Returns true if a path relative to the given url can be found.
method CanGetPathRelativeToUrl(aUrl: not nullable Url): Boolean
Boolean CanGetPathRelativeToUrl(Url! aUrl)
func CanGetPathRelativeToUrl(_ aUrl: Url) -> Boolean
Boolean CanGetPathRelativeToUrl(Url aUrl)
Function CanGetPathRelativeToUrl(aUrl As Url) As Boolean
Parameters:
- aUrl:
compare (declared in Uri) Toffee, ToffeeV2
func compare(_ rhs: Uri) -> NSComparisonResult
Parameters:
- rhs:
CompareTo (declared in Uri)
method CompareTo(rhs: Uri): Int32
Int32 CompareTo(Uri rhs)
func CompareTo(_ rhs: Uri) -> Int32
Integer CompareTo(Uri rhs)
Function CompareTo(rhs As Uri) As Int32
Parameters:
- rhs:
CopyWithQueryString
Copy this url, with a different query string.
method CopyWithQueryString(aQueryString: nullable String): not nullable Url
Url! CopyWithQueryString(String? aQueryString)
// Toffee
func CopyWithQueryString(_ aQueryString: String) -> Url
// ToffeeV2
func CopyWithQueryString(_ aQueryString: String?) -> Url
Url CopyWithQueryString(String aQueryString)
Function CopyWithQueryString(aQueryString As String?) As Url
Parameters:
- aQueryString:
description override Toffee, ToffeeV2
func description() -> NSString
Equals virtual
Returns true if this is equivalent with the passed argument.
method Equals(obj: Object): Boolean
Boolean Equals(Object obj)
func Equals(_ obj: Object) -> Boolean
Boolean Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters:
- obj:
Returns the file path, relative to an url, so adds ../ and ., if always is true, else goes to a maximum of 3.
method FilePathRelativeToUrl(aUrl: not nullable Url) Always(aAlways: Boolean): String
String FilePathRelativeToUrl(Url! aUrl) Always(Boolean aAlways)
func FilePathRelativeToUrl(_ aUrl: Url, Always aAlways: Boolean) -> String
String FilePathRelativeToUrl(Url aUrl) Always(Boolean aAlways)
Function FilePathRelativeToUrl(aUrl As Url) Always(aAlways As Boolean) As String
Parameters:
- aUrl:
- aAlways:
Returns the file path, relative to an url, so adds ../ and ., if always is true, else goes to a maximum of 3.
method FilePathRelativeToUrl(aUrl: not nullable Url) Threshold(aThreshold: Int32 := 3): nullable String
String? FilePathRelativeToUrl(Url! aUrl) Threshold(Int32 aThreshold = 3)
// Toffee
func FilePathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String
// ToffeeV2
func FilePathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String?
String FilePathRelativeToUrl(Url aUrl) Threshold(Integer aThreshold)
Function FilePathRelativeToUrl(aUrl As Url) Threshold(aThreshold As Int32 = 3) As String?
Parameters:
- aUrl:
- aThreshold:
FilePathRelativeToUrlIfPossible
method FilePathRelativeToUrlIfPossible(aUrl: not nullable Url): nullable String
String? FilePathRelativeToUrlIfPossible(Url! aUrl)
// Toffee
func FilePathRelativeToUrlIfPossible(_ aUrl: Url) -> String
// ToffeeV2
func FilePathRelativeToUrlIfPossible(_ aUrl: Url) -> String?
String FilePathRelativeToUrlIfPossible(Url aUrl)
Function FilePathRelativeToUrlIfPossible(aUrl As Url) As String?
Parameters:
- aUrl:
GetParentUrl
Returns this url with the last component stripped.
method GetParentUrl: nullable Url
Url? GetParentUrl()
// Toffee
func GetParentUrl() -> Url
// ToffeeV2
func GetParentUrl() -> Url?
Url GetParentUrl()
Function GetParentUrl() As Url?
hash override Toffee, ToffeeV2
// Toffee-iOS, Toffee-iOS Simulator, Toffee-Mac Catalyst, Toffee-macOS, Toffee-tvOS, Toffee-tvOS Simulator, Toffee-visionOS, Toffee-visionOS Simulator, Toffee-watchOS Simulator
func hash() -> UInt64
// ToffeeV2
func hash() -> NativeUInt
// Toffee-watchOS
func hash() -> UInt32
hashCode Cooper
method hashCode: Integer
Integer hashCode()
func hashCode() -> Integer
Integer hashCode()
Function hashCode() As Integer
IsUnderneath
Returns true if this url is underneat the base url passed.
method IsUnderneath(aPotentialBaseUrl: not nullable Url): Boolean
Boolean IsUnderneath(Url! aPotentialBaseUrl)
func IsUnderneath(_ aPotentialBaseUrl: Url) -> Boolean
Boolean IsUnderneath(Url aPotentialBaseUrl)
Function IsUnderneath(aPotentialBaseUrl As Url) As Boolean
Parameters:
- aPotentialBaseUrl:
Create an url with the parameters as sub path relative to this. Optionally adds a slash at the end.
method SubUrl(params aComponents: array of String) isDirectory(aIsDirectory: Boolean): not nullable Url
Url! SubUrl(params String[] aComponents) isDirectory(Boolean aIsDirectory)
func SubUrl(_ aComponents: String..., isDirectory aIsDirectory: Boolean) -> Url
Url SubUrl(String[]... aComponents) isDirectory(Boolean aIsDirectory)
Function SubUrl(ParamArray aComponents As String()) isDirectory(aIsDirectory As Boolean) As Url
Parameters:
- aComponents:
- aIsDirectory:
Create an url with the parameters as sub path relative to this. O
method SubUrl(params aComponents: array of String): not nullable Url
Url! SubUrl(params String[] aComponents)
func SubUrl(_ aComponents: String...) -> Url
Url SubUrl(String[]... aComponents)
Function SubUrl(ParamArray aComponents As String()) As Url
Parameters:
- aComponents:
Create an url with the parameters as sub path relative to this. Optionally adds a slash at the end. Expects the subpath to be in the current systems path's format.
method SubUrlWithFilePath(aSubPath: String) isDirectory(aIsDirectory: Boolean): not nullable Url
Url! SubUrlWithFilePath(String aSubPath) isDirectory(Boolean aIsDirectory)
func SubUrlWithFilePath(_ aSubPath: String, isDirectory aIsDirectory: Boolean) -> Url
Url SubUrlWithFilePath(String aSubPath) isDirectory(Boolean aIsDirectory)
Function SubUrlWithFilePath(aSubPath As String) isDirectory(aIsDirectory As Boolean) As Url
Parameters:
- aSubPath:
- aIsDirectory:
Create an url with the parameters as sub path relative to this. Expects the subpath to be in the current systems path's format.
method SubUrlWithFilePath(aSubPath: String): not nullable Url
Url! SubUrlWithFilePath(String aSubPath)
func SubUrlWithFilePath(_ aSubPath: String) -> Url
Url SubUrlWithFilePath(String aSubPath)
Function SubUrlWithFilePath(aSubPath As String) As Url
Parameters:
- aSubPath:
ToAbsoluteString
Returns the full url.
method ToAbsoluteString: String
String ToAbsoluteString()
func ToAbsoluteString() -> String
String ToAbsoluteString()
Function ToAbsoluteString() As String
toString Cooper
method toString: PlatformString
PlatformString toString()
func toString() -> PlatformString
PlatformString toString()
Function toString() As PlatformString
ToString virtual .NET, .NET Core 6.0, .NET Standard 2.0, Island, Toffee, ToffeeV2
Returns the full url.
method ToString: PlatformString
PlatformString ToString()
func ToString() -> String
Function ToString() As PlatformString
Returns the path as unix path, relative to another url.
method UnixPathRelativeToUrl(aUrl: not nullable Url) Always(aAlways: Boolean): String
String UnixPathRelativeToUrl(Url! aUrl) Always(Boolean aAlways)
func UnixPathRelativeToUrl(_ aUrl: Url, Always aAlways: Boolean) -> String
String UnixPathRelativeToUrl(Url aUrl) Always(Boolean aAlways)
Function UnixPathRelativeToUrl(aUrl As Url) Always(aAlways As Boolean) As String
Parameters:
- aUrl:
- aAlways:
Returns the path as unix path, relative to another url.
method UnixPathRelativeToUrl(aUrl: not nullable Url) Threshold(aThreshold: Int32 := 3): nullable String
String? UnixPathRelativeToUrl(Url! aUrl) Threshold(Int32 aThreshold = 3)
// Toffee
func UnixPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String
// ToffeeV2
func UnixPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String?
String UnixPathRelativeToUrl(Url aUrl) Threshold(Integer aThreshold)
Function UnixPathRelativeToUrl(aUrl As Url) Threshold(aThreshold As Int32 = 3) As String?
Parameters:
- aUrl:
- aThreshold:
UrlWithAddedPathExtension
Retursn an url wih a different extension.
method UrlWithAddedPathExtension(aNewExtension: not nullable String): nullable Url
Url? UrlWithAddedPathExtension(String! aNewExtension)
// Toffee
func UrlWithAddedPathExtension(_ aNewExtension: String) -> Url
// ToffeeV2
func UrlWithAddedPathExtension(_ aNewExtension: String) -> Url?
Url UrlWithAddedPathExtension(String aNewExtension)
Function UrlWithAddedPathExtension(aNewExtension As String) As Url?
Parameters:
- aNewExtension:
UrlWithChangedLastPathComponent
Returns an url with the last path component replaced.
method UrlWithChangedLastPathComponent(aNewLastPathComponent: not nullable String): nullable Url
Url? UrlWithChangedLastPathComponent(String! aNewLastPathComponent)
// Toffee
func UrlWithChangedLastPathComponent(_ aNewLastPathComponent: String) -> Url
// ToffeeV2
func UrlWithChangedLastPathComponent(_ aNewLastPathComponent: String) -> Url?
Url UrlWithChangedLastPathComponent(String aNewLastPathComponent)
Function UrlWithChangedLastPathComponent(aNewLastPathComponent As String) As Url?
Parameters:
- aNewLastPathComponent:
UrlWithChangedPathExtension
Change an url's last part extension.
method UrlWithChangedPathExtension(aNewExtension: nullable String): nullable Url
Url? UrlWithChangedPathExtension(String? aNewExtension)
// Toffee
func UrlWithChangedPathExtension(_ aNewExtension: String) -> Url
// ToffeeV2
func UrlWithChangedPathExtension(_ aNewExtension: String?) -> Url?
Url UrlWithChangedPathExtension(String aNewExtension)
Function UrlWithChangedPathExtension(aNewExtension As String?) As Url?
Parameters:
- aNewExtension:
UrlWithFragment
Create an url with just a fragment.
method UrlWithFragment(aFragment: nullable String): not nullable Url
Url! UrlWithFragment(String? aFragment)
// Toffee
func UrlWithFragment(_ aFragment: String) -> Url
// ToffeeV2
func UrlWithFragment(_ aFragment: String?) -> Url
Url UrlWithFragment(String aFragment)
Function UrlWithFragment(aFragment As String?) As Url
Parameters:
- aFragment:
UrlWithoutFragment
Remove the fragment from an url.
method UrlWithoutFragment: not nullable Url
Url! UrlWithoutFragment()
func UrlWithoutFragment() -> Url
Url UrlWithoutFragment()
Function UrlWithoutFragment() As Url
UrlWithRelativeOrAbsoluteFileSubPath
Create an url with aSubPath added or if it's a full path, replaced.
method UrlWithRelativeOrAbsoluteFileSubPath(aSubPath: not nullable String): nullable Url
Url? UrlWithRelativeOrAbsoluteFileSubPath(String! aSubPath)
// Toffee
func UrlWithRelativeOrAbsoluteFileSubPath(_ aSubPath: String) -> Url
// ToffeeV2
func UrlWithRelativeOrAbsoluteFileSubPath(_ aSubPath: String) -> Url?
Url UrlWithRelativeOrAbsoluteFileSubPath(String aSubPath)
Function UrlWithRelativeOrAbsoluteFileSubPath(aSubPath As String) As Url?
Parameters:
- aSubPath:
UrlWithRelativeOrAbsoluteWindowsSubPath
Create an url with aSubPath as a windows path added or if it's a full path, replaced.
method UrlWithRelativeOrAbsoluteWindowsSubPath(aSubPath: not nullable String): nullable Url
Url? UrlWithRelativeOrAbsoluteWindowsSubPath(String! aSubPath)
// Toffee
func UrlWithRelativeOrAbsoluteWindowsSubPath(_ aSubPath: String) -> Url
// ToffeeV2
func UrlWithRelativeOrAbsoluteWindowsSubPath(_ aSubPath: String) -> Url?
Url UrlWithRelativeOrAbsoluteWindowsSubPath(String aSubPath)
Function UrlWithRelativeOrAbsoluteWindowsSubPath(aSubPath As String) As Url?
Parameters:
- aSubPath:
Returns the path as windows path, relative to another url.
method WindowsPathRelativeToUrl(aUrl: not nullable Url) Always(aAlways: Boolean): String
String WindowsPathRelativeToUrl(Url! aUrl) Always(Boolean aAlways)
func WindowsPathRelativeToUrl(_ aUrl: Url, Always aAlways: Boolean) -> String
String WindowsPathRelativeToUrl(Url aUrl) Always(Boolean aAlways)
Function WindowsPathRelativeToUrl(aUrl As Url) Always(aAlways As Boolean) As String
Parameters:
- aUrl:
- aAlways:
Returns the path as windows path, relative to another url.
method WindowsPathRelativeToUrl(aUrl: not nullable Url) Threshold(aThreshold: Int32 := 3): nullable String
String? WindowsPathRelativeToUrl(Url! aUrl) Threshold(Int32 aThreshold = 3)
// Toffee
func WindowsPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String
// ToffeeV2
func WindowsPathRelativeToUrl(_ aUrl: Url, Threshold aThreshold: Int32 = 3) -> String?
String WindowsPathRelativeToUrl(Url aUrl) Threshold(Integer aThreshold)
Function WindowsPathRelativeToUrl(aUrl As Url) Threshold(aThreshold As Int32 = 3) As String?
Parameters:
- aUrl:
- aThreshold: