static class
|
ConfigUtil
|
Returns
the
config
script
grammar
rule:
identifier
.
public
static
property
|
GrammarRuleIdentifier
{
get
}
|
||
type
|
IGrammarRule
|
||
value
|
|
The grammar rule. |
Fetches and removes the expected type from the given context.
public
static
method
|
ExpectedType
(Context context)
|
||
type
|
ConfigType
|
||
params
|
context
|
[not-null]
|
The context. |
returns
|
The
expected
type
or
null
if
not
present. |
Stores the expected type in the given context.
public
static
method
|
ExpectedType
(Context context,
ConfigType expectedType)
|
||
params
|
context
|
[not-null]
|
The context. |
expectedType
|
The value to store. |
Can the given config type be used as an argument to a set operation?
public
static
method
|
IsSetOpType
(ConfigType type)
|
||
type
|
bool
|
||
params
|
type
|
The config type. | |
returns
|
true
if
type
can
be
used
for
set
operations,
false
if
not.
|
Concatenates
the
given
name
parts:
'a::b'
.
[Pure]
|
||||
public
static
method
|
Name
(string a,
string b)
|
|||
type
|
string
|
|||
params
|
a
|
First name part. | ||
b
|
Second name part. | |||
returns
|
The
concatenated
name
or
null
if
a
and
b
are
null .
|
Removes the last part of a qualified name.
[Pure]
|
||||
public
static
method
|
NameCutLast
(string name)
|
|||
type
|
string
|
|||
params
|
name
|
The
qualified
name
or
null . |
||
returns
|
The
resulting
name
or
null
if
there
are
no
name
parts
left. |
Remarks:
'Some.Name.With.Parts'
=>'Some.Name.With'
'NoParts'
=>null
null
=>null
Returns the last part of a qualified name.
[Pure]
|
||||
public
static
method
|
NameGetLast
(string name)
|
|||
type
|
string
|
|||
params
|
name
|
The
qualified
name
or
null . |
||
returns
|
The
resulting
name
or
null
iff
name
is
null .
|
Remarks:
'Some.Name.With.Parts'
=>'Parts'
'NoParts'
=>'NoParts'
null
=>null
Returns the resolver directory from the given context.
[Pure]
|
||||
public
static
method
|
Resolver
(Context context)
|
|||
type
|
Path
|
|||
params
|
context
|
[not-null]
|
The context object. | |
returns
|
The
resolver
directory
or
null . |
Remarks:
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.
Stores the resolver directory in the given context.
public
static
method
|
Resolver
(Context context,
Path resolver)
|
||
params
|
context
|
[not-null]
|
The context. |
resolver
|
The
value
to
store
or
null
to
clear. |
Remarks:
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.
Returns the config scope from the given context.
[Pure]
|
||||
public
static
method
|
Scope
(Context context)
|
|||
type
|
IConfigScope
|
|||
params
|
context
|
[not-null]
|
The context object. | |
returns
|
|
The config scope. |
Stores a config scope in the given context.
public
static
method
|
Scope
(Context context,
IConfigScope scope)
|
||
params
|
context
|
[not-null]
|
The context. |
scope
|
The
value
to
store
or
null
to
clear. |
Returns the config script from the given context.
[Pure]
|
||||
public
static
method
|
Script
(Context context)
|
|||
type
|
ConfigScript
|
|||
params
|
context
|
[not-null]
|
The context object. | |
returns
|
The
config
script
or
null . |
Stores a config script in the given context.
public
static
method
|
Script
(Context context,
ConfigScript script)
|
||
params
|
context
|
[not-null]
|
The context. |
script
|
The
value
to
store
or
null
to
clear. |
Writes the given node, using the given expected type.
public
static
method
|
WriteNode
(SourceCodeWriter writer,
ICodeOutput node,
ConfigType expected,
Context context)
|
||
params
|
writer
|
The code writer to use. | |
node
|
The node to write. | ||
expected
|
The
expected
type
or
null . |
||
context
|
The context object. |
Conditionally writes the name of the given type.
public
static
method
|
WriteType
(SourceCodeWriter writer,
ConfigType type,
ConfigType expected,
Context context)
|
||
type
|
bool
|
||
params
|
writer
|
The code writer to use. | |
type
|
The type to write. | ||
expected
|
The
expected
type
or
null . |
||
context
|
The context object. | ||
returns
|
true
if
the
type
name
has
been
written,
false
if
not. |
Remarks:
Depending
on
type
and
expected,
either
the
full
name
or
the
short
name
is
written.
In
either
case,
true
is
returned.
If
type
and
expected
are
equal,
no
type
name
is
written
and
the
method
returns
false
.