|
NbtLib2012
0.3.4
A continuation of libnbt project, originally by Erik Davidson (aphistic). A C# library for reading and writing Named Binary Tag (NBT) format files.
|
A tag containing a set of other named tags. Order is not guaranteed. More...


Public Member Functions | |
| NbtCompound () | |
| Creates an empty unnamed NbtByte tag. | |
| NbtCompound ([CanBeNull] string tagName) | |
| Creates an empty NbtByte tag with the given name. | |
| NbtCompound ([NotNull] IEnumerable< NbtTag > tags) | |
| Creates an unnamed NbtByte tag, containing the given tags. | |
| NbtCompound ([CanBeNull] string tagName,[NotNull] IEnumerable< NbtTag > tags) | |
| Creates an NbtByte tag with the given name, containing the given tags. | |
| T | Get< T > ([NotNull] string tagName) |
Gets or sets the tag with the specified name. May return null. | |
| NbtTag[] | ToArray () |
| Copies all tags in this NbtCompound to an array. | |
| string[] | ToNameArray () |
| Copies names of all tags in this NbtCompound to an array. | |
| void | AddRange ([NotNull] IEnumerable< NbtTag > newTags) |
| Adds all tags from the specified collection to this NbtCompound. | |
| bool | Contains ([NotNull] string tagName) |
| Determines whether this NbtCompound contains a tag with a specific name. | |
| bool | Remove ([NotNull] string tagName) |
| Removes the tag with the specified name from this NbtCompound. | |
| void | RenameTag ([NotNull] string oldName,[NotNull] string newName) |
| Renames a child tags. | |
| IEnumerator< NbtTag > | GetEnumerator () |
| Returns an enumerator that iterates through all tags in this NbtCompound. | |
| void | Add ([NotNull] NbtTag newTag) |
| Adds a tag to this NbtCompound. | |
| void | Clear () |
| Removes all tags from this NbtCompound. | |
| bool | Contains ([NotNull] NbtTag tag) |
| Determines whether this NbtCompound contains a specific NbtTag. Looks for exact object matches, not name matches. | |
| void | CopyTo (NbtTag[] array, int arrayIndex) |
| Copies the tags of the NbtCompound to an array, starting at a particular array index. | |
| bool | Remove ([NotNull] NbtTag tag) |
| Removes the first occurrence of a specific NbtTag from the NbtCompound. Looks for exact object matches, not name matches. | |
| override string | ToString () |
| Returns a String that represents the current NbtCompound object and its contents. Format: TAG_Compound("Name"): { ...contents... } | |
Public Member Functions inherited from LibNbt.NbtTag | |
| string | ToString ([NotNull] string indentString) |
| Prints contents of this tag, and any child tags, to a string. Indents the string using multiples of the given indentation string. | |
Properties | |
| override NbtTagType | TagType [get] |
| Type of this tag (Compound). | |
| override NbtTag this[[NotNull] string | tagName [get, set] |
Gets or sets the tag with the specified name. May return null. | |
| IEnumerable< string > | Names [get] |
| Gets a collection containing all tag names in this NbtCompound. | |
| IEnumerable< NbtTag > | Tags [get] |
| Gets a collection containing all tags in this NbtCompound. | |
| int | Count [get] |
| Gets the number of tags contained in the NbtCompound. | |
Properties inherited from LibNbt.NbtTag | |
| NbtTag | Parent [get, set] |
| Parent compound tag, either NbtList or NbtCompound, if any. | |
| virtual NbtTagType | TagType [get] |
| Type of this tag. | |
| string | Name [get, set] |
Name of this tag. Immutable, and set by the constructor. May be null. | |
| string | Path [get] |
| Gets the full name of this tag, including all parent tag names, separated by dots. Unnamed tags show up as empty strings. | |
| virtual NbtTag | this[string tagName] [get, set] |
Gets or sets the tag with the specified name. May return null. | |
| virtual NbtTag | this[int tagIndex] [get, set] |
| Gets or sets the tag at the specified index. | |
| byte | ByteValue [get] |
| Returns the value of this tag, cast as a byte. Only supported by NbtByte tags. | |
| short | ShortValue [get] |
| Returns the value of this tag, cast as a short (16-bit signed integer). Only supported by NbtByte and NbtShort. | |
| int | IntValue [get] |
| Returns the value of this tag, cast as an int (32-bit signed integer). Only supported by NbtByte, NbtShort, and NbtInt. | |
| long | LongValue [get] |
| Returns the value of this tag, cast as a long (64-bit signed integer). Only supported by NbtByte, NbtShort, NbtInt, and NbtLong. | |
| float | FloatValue [get] |
| Returns the value of this tag, cast as a long (64-bit signed integer). Only supported by NbtFloat and, with loss of precision, by NbtDouble, NbtByte, NbtShort, NbtInt, and NbtLong. | |
| double | DoubleValue [get] |
| Returns the value of this tag, cast as a long (64-bit signed integer). Only supported by NbtFloat, NbtDouble, and, with loss of precision, by NbtByte, NbtShort, NbtInt, and NbtLong. | |
| byte[] | ByteArrayValue [get] |
| Returns the value of this tag, cast as a byte array. Only supported by NbtByteArray tags. | |
| int[] | IntArrayValue [get] |
| Returns the value of this tag, cast as an int array. Only supported by NbtIntArray tags. | |
| string | StringValue [get] |
| Returns the value of this tag, cast as a string. Returns exact value for NbtString, and stringified (using InvariantCulture) value for NbtByte, NbtDouble, NbtFloat, NbtInt, NbtLong, and NbtShort. Not supported by NbtCompound, NbtList, NbtByteArray, or NbtIntArray. | |
Additional Inherited Members | |
Static Public Member Functions inherited from LibNbt.NbtTag | |
| static string | GetCanonicalTagName (NbtTagType type) |
| Returns a canonical (Notchy) name for the given NbtTagType, e.g. "TAG_Byte_Array" for NbtTagType.ByteArray | |
A tag containing a set of other named tags. Order is not guaranteed.
| LibNbt.NbtCompound.NbtCompound | ( | ) |
Creates an empty unnamed NbtByte tag.
| LibNbt.NbtCompound.NbtCompound | ( | [CanBeNull] string | tagName | ) |
Creates an empty NbtByte tag with the given name.
| tagName | Name to assign to this tag. May be null. |
| LibNbt.NbtCompound.NbtCompound | ( | [NotNull] IEnumerable< NbtTag > | tags | ) |
Creates an unnamed NbtByte tag, containing the given tags.
| tags | Collection of tags to assign to this tag's Value. May not be null |
| ArgumentNullException | tags is null, or one of the tags is null. |
| ArgumentException | If some of the given tags were not named, or two tags with the same name were given. |
| LibNbt.NbtCompound.NbtCompound | ( | [CanBeNull] string | tagName, |
| [NotNull] IEnumerable< NbtTag > | tags | ||
| ) |
Creates an NbtByte tag with the given name, containing the given tags.
| tagName | Name to assign to this tag. May be null. |
| tags | Collection of tags to assign to this tag's Value. May not be null |
| ArgumentNullException | tags is null, or one of the tags is null. |
| ArgumentException | If some of the given tags were not named, or two tags with the same name were given. |
| void LibNbt.NbtCompound.Add | ( | [NotNull] NbtTag | newTag | ) |
Adds a tag to this NbtCompound.
| newTag | The object to add to this NbtCompound. |
| ArgumentNullException | newTag is null. |
| ArgumentException | If the given tag is unnamed; or if a tag with the given name already exists in this NbtCompound. |
| void LibNbt.NbtCompound.AddRange | ( | [NotNull] IEnumerable< NbtTag > | newTags | ) |
Adds all tags from the specified collection to this NbtCompound.
| newTags | The collection whose elements should be added to this NbtCompound. |
| ArgumentNullException | newTags is null, or one of the tags in newTags is null. |
| ArgumentException | If one of the given tags was unnamed, or if a tag with the given name already exists in this NbtCompound. |
| void LibNbt.NbtCompound.Clear | ( | ) |
Removes all tags from this NbtCompound.
| bool LibNbt.NbtCompound.Contains | ( | [NotNull] string | tagName | ) |
Determines whether this NbtCompound contains a tag with a specific name.
| tagName | Tag name to search for. May not be null. |
| ArgumentNullException | tagName is null. |
| bool LibNbt.NbtCompound.Contains | ( | [NotNull] NbtTag | tag | ) |
Determines whether this NbtCompound contains a specific NbtTag. Looks for exact object matches, not name matches.
| tag | The object to locate in this NbtCompound. May not be null. |
| ArgumentNullException | tag is null. |
| void LibNbt.NbtCompound.CopyTo | ( | NbtTag[] | array, |
| int | arrayIndex | ||
| ) |
Copies the tags of the NbtCompound to an array, starting at a particular array index.
| array | The one-dimensional array that is the destination of the tag copied from NbtCompound. The array must have zero-based indexing. |
| arrayIndex | The zero-based index in array at which copying begins. |
| ArgumentNullException | array is null. |
| ArgumentOutOfRangeException | arrayIndex is less than 0. |
| ArgumentException | Given array is multidimensional; arrayIndex is equal to or greater than the length of array; the number of tags in this NbtCompound is greater than the available space from arrayIndex to the end of the destination array; or type NbtTag cannot be cast automatically to the type of the destination array. |
| T LibNbt.NbtCompound.Get< T > | ( | [NotNull] string | tagName | ) |
Gets or sets the tag with the specified name. May return null.
| tagName | The name of the tag to get. |
| T | Type to cast the result to. Must derive from NbtTag. |
| ArgumentNullException | tagName is null. |
| InvalidCastException | If tag could not be cast to the desired tag. |
| T | : | NbtTag |
| IEnumerator<NbtTag> LibNbt.NbtCompound.GetEnumerator | ( | ) |
Returns an enumerator that iterates through all tags in this NbtCompound.
| bool LibNbt.NbtCompound.Remove | ( | [NotNull] string | tagName | ) |
Removes the tag with the specified name from this NbtCompound.
| tagName | The name of the tag to remove. |
| ArgumentNullException | tagName is null. |
| bool LibNbt.NbtCompound.Remove | ( | [NotNull] NbtTag | tag | ) |
Removes the first occurrence of a specific NbtTag from the NbtCompound. Looks for exact object matches, not name matches.
| tag | The tag to remove from the NbtCompound. |
| ArgumentNullException | tag is null. |
| ArgumentException | If the given tag is unnamed |
| void LibNbt.NbtCompound.RenameTag | ( | [NotNull] string | oldName, |
| [NotNull] string | newName | ||
| ) |
Renames a child tags.
| oldName | Current name of the tag that's being renamed. |
| newName | Desired new name for the renamed tag. |
| ArgumentNullException | oldName or newName is null. |
| ArgumentException | No tag found for oldName ; or tag with the same name as newName already exists in this compound. |
| NbtTag [] LibNbt.NbtCompound.ToArray | ( | ) |
Copies all tags in this NbtCompound to an array.
| string [] LibNbt.NbtCompound.ToNameArray | ( | ) |
Copies names of all tags in this NbtCompound to an array.
| override string LibNbt.NbtCompound.ToString | ( | ) |
Returns a String that represents the current NbtCompound object and its contents. Format: TAG_Compound("Name"): { ...contents... }
|
get |
Gets the number of tags contained in the NbtCompound.
|
get |
Gets a collection containing all tag names in this NbtCompound.
|
getset |
Gets or sets the tag with the specified name. May return null.
| tagName | The name of the tag to get or set. Must match tag's actual name. |
| ArgumentNullException | tagName is null; or if trying to assign null value. |
| ArgumentException | tagName does not match the given tag's actual name; or given tag already has a Parent. |
|
get |
Gets a collection containing all tags in this NbtCompound.
|
get |
Type of this tag (Compound).