|
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 list of unnamed tags, all of the same kind. More...


Public Member Functions | |
| NbtList () | |
| Creates an unnamed NbtList with empty contents and undefined ListType. | |
| NbtList ([CanBeNull] string tagName) | |
| Creates an NbtList with given name, empty contents, and undefined ListType. | |
| NbtList ([NotNull] IEnumerable< NbtTag > tags) | |
| Creates an unnamed NbtList with the given contents, and inferred ListType. If given tag array is empty, NbtTagType remains Unknown. | |
| NbtList (NbtTagType givenListType) | |
| Creates an unnamed NbtList with empty contents and an explicitly specified ListType. If ListType is Unknown, it will be inferred from the type of the first added tag. Otherwise, all tags added to this list are expected to be of the given type. | |
| NbtList ([CanBeNull] string tagName,[NotNull] IEnumerable< NbtTag > tags) | |
| Creates an NbtList with the given name and contents, and inferred ListType. If given tag array is empty, NbtTagType remains Unknown. | |
| NbtList ([NotNull] IEnumerable< NbtTag > tags, NbtTagType givenListType) | |
| Creates an unnamed NbtList with the given contents, and an explicitly specified ListType. | |
| NbtList ([CanBeNull] string tagName, NbtTagType givenListType) | |
| Creates an NbtList with the given name, empty contents, and an explicitly specified ListType. | |
| NbtList ([CanBeNull] string tagName,[CanBeNull] IEnumerable< NbtTag > tags, NbtTagType givenListType) | |
| Creates an NbtList with the given name and contents, and an explicitly specified ListType. | |
| T | Get< T > (int tagIndex) |
| Gets or sets the tag with the specified name. | |
| void | AddRange ([NotNull] IEnumerable< NbtTag > newTags) |
| Adds all tags from the specified collection to the end of this NbtList. | |
| NbtTag[] | ToArray () |
| Copies all tags in this NbtList to an array. | |
| T[] | ToArray< T > () |
| Copies all tags in this NbtList to an array, and casts it to the desired type. | |
| IEnumerator< NbtTag > | GetEnumerator () |
| Returns an enumerator that iterates through all tags in this NbtList. | |
| int | IndexOf ([NotNull] NbtTag tag) |
| Determines the index of a specific tag in this NbtList | |
| void | Insert (int tagIndex,[NotNull] NbtTag newTag) |
| Inserts an item to this NbtList at the specified index. | |
| void | RemoveAt (int index) |
| Removes a tag at the specified index from this NbtList. | |
| void | Add ([NotNull] NbtTag newTag) |
| Adds a tag to this NbtList. | |
| void | Clear () |
| Removes all tags from this NbtList. | |
| bool | Contains ([NotNull] NbtTag item) |
| Determines whether this NbtList contains a specific tag. | |
| void | CopyTo (NbtTag[] array, int arrayIndex) |
| Copies the tags of this NbtList 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 NbtList object and its contents. Format: TAG_List("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 (List). | |
| NbtTagType | ListType [get, set] |
| Gets or sets the tag type of this list. All tags in this NbtTag must be of the same type. | |
| override NbtTag | this[int tagIndex] [get, set] |
| Gets or sets the tag at the specified index. | |
| int | Count [get] |
| Gets the number of tags contained in the NbtList. | |
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 list of unnamed tags, all of the same kind.
| LibNbt.NbtList.NbtList | ( | ) |
Creates an unnamed NbtList with empty contents and undefined ListType.
| LibNbt.NbtList.NbtList | ( | [CanBeNull] string | tagName | ) |
Creates an NbtList with given name, empty contents, and undefined ListType.
| tagName | Name to assign to this tag. May be null. |
| LibNbt.NbtList.NbtList | ( | [NotNull] IEnumerable< NbtTag > | tags | ) |
Creates an unnamed NbtList with the given contents, and inferred ListType. If given tag array is empty, NbtTagType remains Unknown.
| tags | Collection of tags to insert into the list. All tags are expected to be of the same type. ListType is inferred from the first tag. List may be empty, but may not be null. |
| ArgumentNullException | tags is null. |
| ArgumentException | If given tags are of mixed types. |
| LibNbt.NbtList.NbtList | ( | NbtTagType | givenListType | ) |
Creates an unnamed NbtList with empty contents and an explicitly specified ListType. If ListType is Unknown, it will be inferred from the type of the first added tag. Otherwise, all tags added to this list are expected to be of the given type.
| givenListType | Name to assign to this tag. May be Unknown. |
| ArgumentOutOfRangeException | givenListType is not a recognized tag type. |
| LibNbt.NbtList.NbtList | ( | [CanBeNull] string | tagName, |
| [NotNull] IEnumerable< NbtTag > | tags | ||
| ) |
Creates an NbtList with the given name and contents, and inferred ListType. If given tag array is empty, NbtTagType remains Unknown.
| tagName | Name to assign to this tag. May be null. |
| tags | Collection of tags to insert into the list. All tags are expected to be of the same type. ListType is inferred from the first tag. List may be empty, but may not be null. |
| ArgumentNullException | tags is null. |
| ArgumentException | If given tags are of mixed types. |
| LibNbt.NbtList.NbtList | ( | [NotNull] IEnumerable< NbtTag > | tags, |
| NbtTagType | givenListType | ||
| ) |
Creates an unnamed NbtList with the given contents, and an explicitly specified ListType.
| tags | Collection of tags to insert into the list. All tags are expected to be of the same type (matching givenListType). List may be empty, but may not be null. |
| givenListType | Name to assign to this tag. May be Unknown (to infer type from the first element of tags). |
| ArgumentNullException | tags is null. |
| ArgumentOutOfRangeException | givenListType is not a recognized tag type. |
| ArgumentException | If given tags do not match givenListType , or are of mixed types. |
| LibNbt.NbtList.NbtList | ( | [CanBeNull] string | tagName, |
| NbtTagType | givenListType | ||
| ) |
Creates an NbtList with the given name, empty contents, and an explicitly specified ListType.
| tagName | Name to assign to this tag. May be null. |
| givenListType | Name to assign to this tag. If givenListType is Unknown, ListType will be infered from the first tag added to this NbtList. |
| ArgumentOutOfRangeException | givenListType is not a recognized tag type. |
| LibNbt.NbtList.NbtList | ( | [CanBeNull] string | tagName, |
| [CanBeNull] IEnumerable< NbtTag > | tags, | ||
| NbtTagType | givenListType | ||
| ) |
Creates an NbtList with the given name and contents, and an explicitly specified ListType.
| tagName | Name to assign to this tag. May be null. |
| tags | Collection of tags to insert into the list. All tags are expected to be of the same type (matching givenListType). May be empty or null. |
| givenListType | Name to assign to this tag. May be Unknown (to infer type from the first element of tags). |
| ArgumentOutOfRangeException | givenListType is not a recognized tag type. |
| ArgumentException | If given tags do not match givenListType , or are of mixed types. |
| void LibNbt.NbtList.Add | ( | [NotNull] NbtTag | newTag | ) |
| void LibNbt.NbtList.AddRange | ( | [NotNull] IEnumerable< NbtTag > | newTags | ) |
| void LibNbt.NbtList.Clear | ( | ) |
Removes all tags from this NbtList.
| bool LibNbt.NbtList.Contains | ( | [NotNull] NbtTag | item | ) |
| void LibNbt.NbtList.CopyTo | ( | NbtTag[] | array, |
| int | arrayIndex | ||
| ) |
Copies the tags of this NbtList to an array, starting at a particular array index.
| array | The one-dimensional array that is the destination of the tag copied from NbtList. 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 NbtList 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.NbtList.Get< T > | ( | int | tagIndex | ) |
Gets or sets the tag with the specified name.
| tagIndex | The zero-based index of the tag to get or set. |
| T | Type to cast the result to. Must derive from NbtTag. |
| ArgumentOutOfRangeException | tagIndex is not a valid index in the NbtList. |
| InvalidCastException | If tag could not be cast to the desired tag. |
| T | : | NbtTag |
| IEnumerator<NbtTag> LibNbt.NbtList.GetEnumerator | ( | ) |
| int LibNbt.NbtList.IndexOf | ( | [NotNull] NbtTag | tag | ) |
| void LibNbt.NbtList.Insert | ( | int | tagIndex, |
| [NotNull] NbtTag | newTag | ||
| ) |
| bool LibNbt.NbtList.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 this NbtList. |
| ArgumentNullException | tag is null. |
| void LibNbt.NbtList.RemoveAt | ( | int | index | ) |
| NbtTag [] LibNbt.NbtList.ToArray | ( | ) |
Copies all tags in this NbtList to an array.
| T [] LibNbt.NbtList.ToArray< T > | ( | ) |
Copies all tags in this NbtList to an array, and casts it to the desired type.
| InvalidCastException | If contents of this list cannot be cast to the given type. |
| T | : | NbtTag |
| override string LibNbt.NbtList.ToString | ( | ) |
|
get |
|
getset |
Gets or sets the tag type of this list. All tags in this NbtTag must be of the same type.
| ArgumentException | If the given NbtTagType does not match the type of existing list items (for non-empty lists). |
| ArgumentOutOfRangeException | If the given NbtTagType is not among recognized tag types. |
|
get |
Type of this tag (List).
|
getset |
Gets or sets the tag at the specified index.
| tagIndex | The zero-based index of the tag to get or set. |
| ArgumentOutOfRangeException | tagIndex is not a valid index in the NbtList. |
| ArgumentNullException | value is null. |
| ArgumentException | Given tag's type does not match ListType. |