Class Url
An url is the internal type used to address any resource on the controller.
Implements
Namespace: ABB.Robotics
Assembly: ABB.Robotics.Controllers.PC.dll
Syntax
public class Url : IEnumerable
Remarks
Only for internal use.
Constructors
Url(String, Int32)
Private constructor to avoid external object construction.
Declaration
protected Url(string url, int padding)
Parameters
Type | Name | Description |
---|---|---|
System. |
url | The url. |
System. |
padding | The padding. |
Url(String, Int32, Boolean)
Private constructor to avoid external object construction.
Declaration
protected Url(string url, int padding, bool incompleteUrl)
Parameters
Type | Name | Description |
---|---|---|
System. |
url | The url to create object for. |
System. |
padding | The padding of url object. |
System. |
incompleteUrl | Flag to determine if incomplete urls are allowed. |
Fields
DefaultPadding
The default padding size.
Declaration
protected const int DefaultPadding = 3
Field Value
Type | Description |
---|---|
System. |
Remarks
Only for internal use.
DefaultResizeValue
The default resize value.
Declaration
protected const int DefaultResizeValue = 3
Field Value
Type | Description |
---|---|
System. |
Remarks
Only for internal use.
Separator
The separator used within a url.
Declaration
protected const char Separator = '/'
Field Value
Type | Description |
---|---|
System. |
Remarks
Only for internal use.
SeparatorString
The separator as string.
Declaration
protected const string SeparatorString = "/"
Field Value
Type | Description |
---|---|
System. |
Remarks
Only for internal use.
Properties
InternalInsertAt
internal .
Declaration
protected int InternalInsertAt { get; set; }
Property Value
Type | Description |
---|---|
System. |
InternalUrl
internal .
Declaration
protected string InternalUrl { get; }
Property Value
Type | Description |
---|---|
System. |
Item[Int32]
indexer for url to get the corresponding level in the url
Declaration
public string this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System. |
index |
Property Value
Type | Description |
---|---|
System. |
LastPart
gets the LastPart of the url
Declaration
public string LastPart { get; }
Property Value
Type | Description |
---|---|
System. |
LastPartAsName
Returns the last part of the Url as a name, ie without the preceding /
Declaration
public string LastPartAsName { get; }
Property Value
Type | Description |
---|---|
System. |
Length
the length of the url
Declaration
public int Length { get; }
Property Value
Type | Description |
---|---|
System. |
RelativeSystemId
Returns the URL relative to the sytem id. I.e "/RAPID" instead of "{systemId}/RAPID"
Declaration
public string RelativeSystemId { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
Append(Url, String)
Appends a single string to current url.
Declaration
public static Url Append(Url root, string part1)
Parameters
Type | Name | Description |
---|---|---|
Url | root | Root url. |
System. |
part1 | New part to add, must be prefixed with / |
Returns
Type | Description |
---|---|
Url | The new url. |
Append(Url, String, Boolean)
Appends a single string to current url.
Declaration
public static Url Append(Url root, string part1, bool appendSlash)
Parameters
Type | Name | Description |
---|---|---|
Url | root | Root url. |
System. |
part1 | New part to add, must be prefixed with / |
System. |
appendSlash | True to append slash. |
Returns
Type | Description |
---|---|
Url | The new url. |
Append(Url, String, String, Boolean)
Appends a single string to current url.
Declaration
public static Url Append(Url root, string part1, string part2, bool appendSlash)
Parameters
Type | Name | Description |
---|---|---|
Url | root | Root url. |
System. |
part1 | New part to add, must be prefixed with / |
System. |
part2 | New part to add, must be prefixed with / |
System. |
appendSlash | True to append slash. |
Returns
Type | Description |
---|---|
Url | The new url. |
Append(Url, String, String, String, Boolean)
Appends a single string to current url.
Declaration
public static Url Append(Url root, string part1, string part2, string part3, bool appendSlash)
Parameters
Type | Name | Description |
---|---|---|
Url | root | Root url. |
System. |
part1 | New part to add, must be prefixed with / |
System. |
part2 | New part to add, must be prefixed with / |
System. |
part3 | New part to add, must be prefixed with / |
System. |
appendSlash | True to append slash. |
Returns
Type | Description |
---|---|
Url | The new url. |
Append(Url, String, String, String, String, Boolean)
Appends a single string to current url.
Declaration
public static Url Append(Url root, string part1, string part2, string part3, string part4, bool appendSlash)
Parameters
Type | Name | Description |
---|---|---|
Url | root | Root url. |
System. |
part1 | New part to add, must be prefixed with / |
System. |
part2 | New part to add, must be prefixed with / |
System. |
part3 | New part to add, must be prefixed with / |
System. |
part4 | New part to add, must be prefixed with / |
System. |
appendSlash | True to append slash. |
Returns
Type | Description |
---|---|
Url | The new url. |
Append(Url, String[])
Appends the content to the url, all items will get an appended slash.
Declaration
public static Url Append(Url root, params string[] parts)
Parameters
Type | Name | Description |
---|---|---|
Url | root | Root url. |
System. |
parts | Parameter list. |
Returns
Type | Description |
---|---|
Url | The complete url. |
Build(String, String)
Appends two strings into a correct url object.
Declaration
public static string Build(string s1, string s2)
Parameters
Type | Name | Description |
---|---|---|
System. |
s1 | String one. |
System. |
s2 | String two. |
Returns
Type | Description |
---|---|
System. |
The url from the combined strings. |
Create(String)
Creates a new url from a string.
Declaration
public static Url Create(string url)
Parameters
Type | Name | Description |
---|---|---|
System. |
url | The string. |
Returns
Type | Description |
---|---|
Url | The url object. |
CreateChild(Url)
Creates a "child" url object.
Declaration
public static Url CreateChild(Url parent)
Parameters
Type | Name | Description |
---|---|---|
Url | parent | The parent url object. |
Returns
Type | Description |
---|---|
Url | The new Url object. |
CreateEmpty()
Creates a new empty url object.
Declaration
public static Url CreateEmpty()
Returns
Type | Description |
---|---|
Url | The empty url object. |
CreateEmpty(Int32)
Creates a new empty url object.
Declaration
protected static Url CreateEmpty(int padding)
Parameters
Type | Name | Description |
---|---|---|
System. |
padding | The padding. |
Returns
Type | Description |
---|---|
Url |
Equals(Object)
Checks if this instance is equal to the supplied object instance that is passed to this method.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System. |
obj | The object to compare this instance with. |
Returns
Type | Description |
---|---|
System. |
True if the objects are considered equal. |
Overrides
Extract(String)
This method extracts the formatted controller Url from any url string.
Declaration
public static string Extract(string url)
Parameters
Type | Name | Description |
---|---|---|
System. |
url | Url to extract controller Url from- |
Returns
Type | Description |
---|---|
System. |
The url of the controller. |
GetEnumerator()
IEnumerable implementation for Url.
Declaration
public IEnumerator GetEnumerator()
Returns
Type | Description |
---|---|
System. |
The enumerator object. |
GetHashCode()
Gets the hash code of the url, this is the same as the hash code for a string with the same content, ie we use the GetHashCode() method on the build _url field to get this value.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System. |
The hash code for the url. |
Overrides
GetInternalParts()
Gets the internal parts of the url as a string array.
Declaration
protected string[] GetInternalParts()
Returns
Type | Description |
---|---|
System. |
The internal parts. |
GetParent()
Gets the parent url.
Declaration
public Url GetParent()
Returns
Type | Description |
---|---|
Url | The parent url. |
GetParent(Int32)
Gets the parent url at specified level.
Declaration
public Url GetParent(int level)
Parameters
Type | Name | Description |
---|---|---|
System. |
level | Level or parent, 1 is immediate parent. |
Returns
Type | Description |
---|---|
Url | The parent url. |
ToString()
\Returns the Url in string form.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System. |
The url as string. |
Overrides
ToString(Int32)
\Returns the Url in string form.
Declaration
public string ToString(int startIndex)
Parameters
Type | Name | Description |
---|---|---|
System. |
startIndex | The index to start at. |
Returns
Type | Description |
---|---|
System. |
The url as string. |
ToString(Int32, Int32)
\Returns the Url in string form.
Declaration
public string ToString(int startIndex, int stopIndex)
Parameters
Type | Name | Description |
---|---|---|
System. |
startIndex | The index to start extraction from. |
System. |
stopIndex | The index to stop extraction from. |
Returns
Type | Description |
---|---|
System. |
The url as string. |
Operators
Addition(Url, String)
Add operator between a url and a string.
Declaration
public static Url operator +(Url url1, string url2)
Parameters
Type | Name | Description |
---|---|---|
Url | url1 | The url object. |
System. |
url2 | The string. |
Returns
Type | Description |
---|---|
Url | The new url with the string appended. |
Equality(Url, Url)
Equality operator between two urls.
Declaration
public static bool operator ==(Url x, Url y)
Parameters
Returns
Type | Description |
---|---|
System. |
True if the urls are considered equal. |
Equality(Url, String)
Equality operator between two urls.
Declaration
public static bool operator ==(Url x, string y)
Parameters
Type | Name | Description |
---|---|---|
Url | x | The url object. |
System. |
y | The string object. |
Returns
Type | Description |
---|---|
System. |
True if the string and url are considered equal. |
Equality(String, Url)
Equality operator between two urls.
Declaration
public static bool operator ==(string x, Url y)
Parameters
Type | Name | Description |
---|---|---|
System. |
x | The url object. |
Url | y | The string object. |
Returns
Type | Description |
---|---|
System. |
True if the string and url are considered equal. |
Implicit(Url to String)
implicit conversions from url to string handled by this method
Declaration
public static implicit operator string (Url url)
Parameters
Type | Name | Description |
---|---|---|
Url | url | url to convert into a string |
Returns
Type | Description |
---|---|
System. |
the corresponding string |
Inequality(Url, Url)
Inequality operator between two urls.
Declaration
public static bool operator !=(Url x, Url y)
Parameters
Returns
Type | Description |
---|---|
System. |
True if objects are not equal. |
Inequality(Url, String)
Inequality operator between a url and a string.
Declaration
public static bool operator !=(Url x, string y)
Parameters
Type | Name | Description |
---|---|---|
Url | x | The url object. |
System. |
y | The string object. |
Returns
Type | Description |
---|---|
System. |
True if the string and the url isn't considered equal. |
Inequality(String, Url)
Inequality operator between a url and a string.
Declaration
public static bool operator !=(string x, Url y)
Parameters
Type | Name | Description |
---|---|---|
System. |
x | The url object. |
Url | y | The string object. |
Returns
Type | Description |
---|---|
System. |
True if the string and the url isn't considered equal. |