CxName

Description

struct Tinman.Core.Cx.CxName

Represents a qualified name, which may be a simple name (e.g. Path), a partially-qualified name (e.g. IO.Path), a fully-qualified name (e.g. Tinman.Core.IO.Path) or a global name (e.g. global::System.IO.Path).

See also

CxId

Public / Constants

Invalid


public static readonly attribute Invalid → (CxName)

The CxName that represents the invalid empty name.

Invalid names have the string representation ? and are thus not parsable.

See also

CxName.IsInvalid

Public / Constructors

From​Source


public static method FromSource → (1)

source in : string

[not-null]
The source code.

returns → CxName

The parsed name.

Parses the given name.

ValidatingException

If the syntax of source in is invalid.

See also

CxCodeUnit

Public / Methods

Append

2 overloads


[Pure]
public method Append1 → (1)

part in : CxId

The part to add.

returns → CxName

The resulting name. Will be invalid if this name or the given part in is invalid.

Appends the given part to this name.


[Pure]
public method Append2 → (1)

other in : CxName

The part to add.

returns → CxName

The resulting name. Will be invalid if this name or the given other in name is invalid.

Appends the given part to this name.

Part


[Pure]
public method Part → (1)

index in : int32

[0..CxName.Count-1]
The part index.

returns → CxId

The part identifier.

Returns the index in-th part.

Starts​With


[Pure]
public method StartsWith → (1)

other in : CxName

The other name.

returns → bool

true if this name starts with other in,
false if not.

Checks if this name starts with the given other in name.

To​Global


[Pure]
public method ToGlobal → ()

returns → CxName

The global name.

Converts this name to a global one.

To​Local


[Pure]
public method ToLocal → ()

returns → CxName

The local name.

Converts this name to a local one.

Public / Attributes

Count


public attribute Count → (get)

value : int32

[>=1]
The number of parts.

Returns the number of parts.

Is​Global


public attribute IsGlobal → (get)

value : bool

true if this is a global name,
false if not.

Returns whether this is a global name.

Is​Invalid


public attribute IsInvalid → (get)

value : bool

true if this name is equal to Invalid,
false if not.

Returns whether this is the invalid empty name.

Last


public attribute Last → (get)

value : CxId

The last name part.

Returns the last part of this name.

Parent


public attribute Parent → (get)

value : CxName

The parent name or Invalid if this name has only one part.

Returns the parent name, i.e. the name without the last name part.

Serialization

Serializer


public static readonly attribute Serializer → (ITypeSerializer<CxName>)

The serialization helper object for values of CxName.