ConfigUtil

Description

static class Tinman.Core.Config.ConfigUtil

Helper class for this namespace.

Public / Methods

ExpectedType

2 overloads


public static method ExpectedType1 → (1)

context in : Context

[not-null]
The context.

returns → ConfigType

The expected type or null if not present.

Fetches and removes the expected type from the given context.


public static method ExpectedType2 → (2)

context in : Context

[not-null]
The context.

expectedType in : ConfigType

The value to store.

Stores the expected type in the given context.

IsSetOpType


public static method IsSetOpType → (1)

type in : ConfigType

The config type.

returns → bool

true if type in can be used for set operations, false if not.

Can the given config type be used as an argument to a set operation?

Name


[Pure]
public static method Name → (2)

in : string

First name part.

in : string

Second name part.

returns → string

The concatenated name or null if in and in are null.

Concatenates the given name parts: 'a::b'.

NameCutLast


[Pure]
public static method NameCutLast → (1)

name in : string

The qualified name or null.

returns → string

The resulting name or null if there are no name parts left.

Removes the last part of a qualified name.

'Some.Name.With.Parts' => 'Some.Name.With'
'NoParts' => null
null => null

NameGetLast


[Pure]
public static method NameGetLast → (1)

name in : string

The qualified name or null.

returns → string

The resulting name or null iff name in is null.

Returns the last part of a qualified name.

'Some.Name.With.Parts' => 'Parts'
'NoParts' => 'NoParts'
null => null

Resolver

2 overloads


[Pure]
public static method Resolver1 → (1)

context in : Context

[not-null]
The context object.

returns → Path

The resolver directory or null.

Returns the resolver directory from the given context.

Optional directory to use for resolving relative path values that start with a '.' (e.g. <./a/b.txt>). All other relative paths (e.g. <a/b.txt>) will remain unchanged.


public static method Resolver2 → (2)

context in : Context

[not-null]
The context.

resolver in : Path

The value to store or null to clear.

Stores the resolver directory in the given context.

Optional directory to use for resolving relative path values that start with a '.' (e.g. <./a/b.txt>). All other relative paths (e.g. <a/b.txt>) will remain unchanged.

Scope

2 overloads


[Pure]
public static method Scope1 → (1)

context in : Context

[not-null]
The context object.

returns → IConfigScope

The config scope.

Returns the config scope from the given context.


public static method Scope2 → (2)

context in : Context

[not-null]
The context.

scope in : IConfigScope

The value to store or null to clear.

Stores a config scope in the given context.

Script

2 overloads


[Pure]
public static method Script1 → (1)

context in : Context

[not-null]
The context object.

returns → ConfigScript

The config script or null.

Returns the config script from the given context.


public static method Script2 → (2)

context in : Context

[not-null]
The context.

script in : ConfigScript

The value to store or null to clear.

Stores a config script in the given context.

WriteNode


public static method WriteNode → (4)

writer in : SourceCodeWriter

The code writer to use.

node in : ICodeOutput

The node to write.

expected in : ConfigType

The expected type or null.

context in : Context

The context object.

Writes the given node, using the given expected type.

IOException

If an I/O error has occurred while writing to writer in.

WriteType


public static method WriteType → (4)

writer in : SourceCodeWriter

The code writer to use.

type in : ConfigType

The type to write.

expected in : ConfigType

The expected type or null.

context in : Context

The context object.

returns → bool

true if the type name has been written, false if not.

Conditionally writes the name of the given type.

Depending on type in and expected in, either the full name or the short name is written. In either case, true is returned. If type in and expected in are equal, no type name is written and the method returns false.

IOException

If an I/O error has occurred while writing to writer in.

Public / Attributes

GrammarRuleIdentifier


public static attribute GrammarRuleIdentifier → (get)

value : IGrammarRule

[not-null]
The grammar rule.

Returns the config script grammar rule: identifier.