ApiEntry

Description

sealed class Tinman.Core.Util.ApiEntry

Derived from

ICodeOutput

The ApiEntry class represents a node in a tree which describes the structure of an API, using a textual format that is both machine-readable and human-understandable.

This is the Grammar of the textual format used by the ApiEntry class:

root       := entry ;

children   := '{' (entry .. ',') '}' ;
entry      := name tags? types? value? children? ;

name       := name-parts ('.(' name-parts ')')? ('.#' digit+)? ;
tags       := '@' tag+ ;

name-parts := id .. '.' ;
tag        := '[' id ']' | id ;
types      := ':' (id .. ',') ;

id         := letter (letter | digit)* ;

digit      := '0'..'9' ;
letter     := 'a'..'z' | 'A'..'Z' | '_' ;
value      := '=' ]\r\n[+ ;

The Tinman 3D SDK uses the ApiEntry class to document the changes between releases of the Config API (see ConfigType) and the Native API (see CxCodeUnit).

Public / Constructors

Api​Entry


public constructor ApiEntry → (3)

nameSuffix in : string

[not-empty]
See NameSuffix.

namePrefix opt : string = null

See NamePrefix.

nameOrdinal opt : int32 = 0

[>=0]
See NameOrdinal.

Creates a new instance of ApiEntry.

From​Source


public static method FromSource → (1)

source in : string

[not-empty]
The source to parse.

returns → ApiEntry

The built ApiEntry object.

Parses the given source in and builds a ApiEntry object.

ValidatingException

If source in is malformed.

Public / Methods

Child


public method Child → (1)

child in : ApiEntry

[not-null]
The child to add.

returns → ApiEntry

this

Adds an element to Children.

Tag


public method Tag → (1)

tag in : string

[not-empty]
The tag to add.

returns → ApiEntry

this

Adds an element to Tags.

Type


public method Type → (1)

type in : string

[not-empty]
The type to add.

returns → ApiEntry

this

Adds an element to Types.

Public / Attributes

Children


public attribute Children → (get)

value : IVectorConst<ApiEntry>

[not-null]
The list of child entries.

Returns the children of this API entry.

Name


public attribute Name → (get)

value : string

[not-empty]
The full name.

Returns the full name of this API entry.

The full name of an API entry is composed of the prefix part, the suffix part and the ordinal number:

NamePart1.(NamePart2.NamePart3)-#123
\_______/  \_________________/   \_/
 prefix     suffix                ordinal

If there is no prefix part, the full name looks like this:

NamePart1.NamePart2.NamePart3-#123
\___________________________/  \_/
 suffix                         ordinal

The ordinal number part is omitted if it is equal to zero:

NamePart1.NamePart2.NamePart3
\___________________________/
 suffix

Name​Ordinal


public attribute NameOrdinal → (get)

value : int32

[>=0]
The ordinal number.

Returns the ordinal number of this API entry which is used to resolve ambiguities with other entries that have the same name prefix and suffix.

See also

ApiEntry.Name

Name​Plain


public attribute NamePlain → (get)

value : string

[not-empty]
The plain name.

Returns the plain name of this API entry which neither includes braces to indicate the name suffix nor the name ordinal.

Name​Prefix


public attribute NamePrefix → (get)

value : string

The prefix name part of null if none.

Returns the prefix part of the full name of this API entry.

See also

ApiEntry.Name

Name​Suffix


public attribute NameSuffix → (get)

value : string

[not-empty]
The suffix name part.

Returns the suffix part of the full name of this API entry.

See also

ApiEntry.Name

Parent


public attribute Parent → (get)

value : ApiEntry

The parent API entry or null.

Returns the parent of this API entry.

See also

ApiEntry.Child

Tags


public attribute Tags → (get)

value : ISortedSetConst<string>

[not-null]
The API entry tags.

Returns the tags of this API entry.

Tags usually represent modifier keywords (e.g. public, class), code annotations (e.g. [Owner]) and preconditions (e.g. [not-empty]).

See also

ApiEntry.Tag

Types


public attribute Types → (get)

value : ISortedSetConst<string>

[not-null]
The API entry types.

Returns the types of this API entry.

See also

ApiEntry.Type

Value


public attribute Value → (get,set)

value : string

The API entry value or null.

The value that is associated with this API entry.