Class Tag

Inherits from

Constructors

Name Description
this
this
this

Fields

Name Type Description
location Location
values Value[]

Methods

Name Description
parent Get parent tag. To set a parent, attach this Tag to its intended parent tag by calling 'Tag.add(...)', or by passing it to the parent tag's constructor.
namespace
namespace Not particularly efficient, but it works.
name Not including namespace. Use 'fullName' if you want the namespace included.
name Not the most efficient, but it works.
fullName This tag's name, including namespace if one exists.
add Adds a Value, Attribute, Tag (or array of such) as a member/child of this Tag. Returns 'this' for chaining. Throws 'SDLangValidationException' if trying to add an Attribute or Tag that already has a parent.
remove Removes 'this' from its parent, if any. Returns 'this' for chaining. Inefficient ATM, but it works.
attributes Access all attributes that don't have a namespace
tags Access all direct-child tags that don't have a namespace
namespaces Access all namespaces in this tag, and the attributes/tags within them.
all Access all attributes and tags regardless of namespace.
maybe Access 'attributes', 'tags', 'namespaces' and 'all' like normal, except that looking up a non-existant name/namespace with opIndex(string) results in an empty array instead of a thrown SDLangRangeException.
opEquals
toSDLDocument Treats 'this' as the root tag. Note that root tags cannot have values or attributes, and cannot be part of a namespace. If this isn't a valid root tag, 'SDLangValidationException' will be thrown.
toSDLString Output this entire tag in SDL format. Does *not* treat 'this' as a root tag. If you intend this to be the root of a standard SDL document, use 'toSDLDocument' instead.
toDebugString Not the most efficient, but it works.

Inner structs

Name Description
NamedMemberRange
MemberRange
NamespaceRange
NamespaceAccess
MaybeAccess

Aliases

Name Description
AttributeRange
TagRange

Authors

Copyright

License