Represents a complete NBT file.
More...
|
| void | RenameRootTag (string newTagName) |
| | Renames the root tag.
|
| |
| | NbtFile ([NotNull] NbtCompound rootTag) |
| | Creates a new NBT file with the given root tag.
|
| |
| | NbtFile ([NotNull] string fileName) |
| | Loads NBT data from a file. Automatically detects compression.
|
| |
| | NbtFile ([NotNull] string fileName, NbtCompression compression,[CanBeNull] TagSelector selector) |
| | Loads NBT data from a file.
|
| |
| | NbtFile ([NotNull] Stream stream, NbtCompression compression,[CanBeNull] TagSelector selector) |
| | Loads NBT data from a stream.
|
| |
| void | LoadFromFile ([NotNull] string fileName) |
| | Loads NBT data from a file. Existing RootTag will be replaced. Compression will be auto-detected.
|
| |
| void | LoadFromFile ([NotNull] string fileName, NbtCompression compression,[CanBeNull] TagSelector selector) |
| | Loads NBT data from a file. Existing RootTag will be replaced.
|
| |
| void | LoadFromStream ([NotNull] Stream stream, NbtCompression compression,[CanBeNull] TagSelector selector) |
| | Loads NBT data from a stream. Existing RootTag will be replaced
|
| |
| void | SaveToFile ([NotNull] string fileName, NbtCompression compression) |
| | Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.
|
| |
| void | SaveToStream ([NotNull] Stream stream, NbtCompression compression) |
| | Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.
|
| |
|
| static string | ReadRootTagName ([NotNull] string fileName) |
| | Reads the root name from the given NBT file. Automatically detects compression.
|
| |
| static string | ReadRootTagName ([NotNull] string fileName, NbtCompression compression) |
| | Reads the root name from the given NBT file.
|
| |
| static string | ReadRootTagName ([NotNull] Stream stream, NbtCompression compression) |
| | Reads the root name from the given stream of NBT data.
|
| |
|
| string | FileName [get, set] |
| | Gets the file name used for most recent loading/saving of this file. May be null, if this NbtFile instance has not been loaded from, or saved to, a file.
|
| |
| NbtCompression | FileCompression [get, set] |
| | Gets the compression method used for most recent loading/saving of this file. Defaults to AutoDetect.
|
| |
| NbtCompound | RootTag [get, set] |
| | Root tag of this file. Must be a named CompoundTag. Defaults to null.
|
| |
Represents a complete NBT file.
| LibNbt.NbtFile.NbtFile |
( |
[NotNull] NbtCompound |
rootTag | ) |
|
Creates a new NBT file with the given root tag.
- Parameters
-
| rootTag | Compound tag to set as the root tag. May be null. |
- Exceptions
-
| ArgumentException | If given rootTag is unnamed. |
| LibNbt.NbtFile.NbtFile |
( |
[NotNull] string |
fileName | ) |
|
Loads NBT data from a file. Automatically detects compression.
- Parameters
-
| fileName | Name of the file from which data will be loaded. |
- Exceptions
-
| ArgumentNullException | fileName is null. |
| FileNotFoundException | If given file was not found. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, or decompressing failed. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| IOException | If an I/O error occurred while reading the file. |
Loads NBT data from a file.
- Parameters
-
| fileName | Name of the file from which data will be loaded. |
| compression | Compression method to use for loading/saving this file. |
| selector | Optional callback to select which tags to load into memory. Root may not be skipped. May be null. |
- Exceptions
-
| ArgumentNullException | fileName is null. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression . |
| FileNotFoundException | If given file was not found. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, or decompressing failed. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| IOException | If an I/O error occurred while reading the file. |
Loads NBT data from a stream.
- Parameters
-
| stream | Stream from which data will be loaded. If compression is set to AutoDetect, this stream must support seeking. |
| compression | Compression method to use for loading/saving this file. |
| selector | Optional callback to select which tags to load into memory. Root may not be skipped. May be null. |
- Exceptions
-
| ArgumentNullException | stream is null. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression . |
| FileNotFoundException | If given file was not found. |
| NotSupportedException | If compression is set to AutoDetect, but the stream is not seekable. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, decompressing failed, or given stream does not support reading. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| void LibNbt.NbtFile.LoadFromFile |
( |
[NotNull] string |
fileName | ) |
|
Loads NBT data from a file. Existing RootTag will be replaced. Compression will be auto-detected.
- Parameters
-
| fileName | Name of the file from which data will be loaded. |
- Exceptions
-
| ArgumentNullException | fileName is null. |
| FileNotFoundException | If given file was not found. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, or decompressing failed. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| IOException | If an I/O error occurred while reading the file. |
Loads NBT data from a file. Existing RootTag will be replaced.
- Parameters
-
| fileName | Name of the file from which data will be loaded. |
| compression | Compression method to use for loading/saving this file. |
| selector | Optional callback to select which tags to load into memory. Root may not be skipped. No reference is stored to this callback after loading (don't worry about implicitly captured closures). May be null. |
- Exceptions
-
| ArgumentNullException | fileName is null. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression . |
| FileNotFoundException | If given file was not found. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, or decompressing failed. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| IOException | If an I/O error occurred while reading the file. |
Loads NBT data from a stream. Existing RootTag will be replaced
- Parameters
-
| stream | Stream from which data will be loaded. If compression is set to AutoDetect, this stream must support seeking. |
| compression | Compression method to use for loading/saving this file. |
| selector | Optional callback to select which tags to load into memory. Root may not be skipped. No reference is stored to this callback after loading (don't worry about implicitly captured closures). May be null. |
- Exceptions
-
| ArgumentNullException | stream is null. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression . |
| NotSupportedException | If compression is set to AutoDetect, but the stream is not seekable. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, decompressing failed, or given stream does not support reading. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| static string LibNbt.NbtFile.ReadRootTagName |
( |
[NotNull] string |
fileName | ) |
|
|
static |
Reads the root name from the given NBT file. Automatically detects compression.
- Parameters
-
| fileName | Name of the file from which first tag will be read. |
- Exceptions
-
| ArgumentNullException | fileName is null. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression. |
| FileNotFoundException | If given file was not found. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, or decompressing failed. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| IOException | If an I/O error occurred while reading the file. |
| static string LibNbt.NbtFile.ReadRootTagName |
( |
[NotNull] string |
fileName, |
|
|
NbtCompression |
compression |
|
) |
| |
|
static |
Reads the root name from the given NBT file.
- Parameters
-
| fileName | Name of the file from which data will be loaded. |
| compression | Format in which the given file is compressed. |
- Exceptions
-
| ArgumentNullException | fileName is null. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression. |
| FileNotFoundException | If given file was not found. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, or decompressing failed. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| IOException | If an I/O error occurred while reading the file. |
| static string LibNbt.NbtFile.ReadRootTagName |
( |
[NotNull] Stream |
stream, |
|
|
NbtCompression |
compression |
|
) |
| |
|
static |
Reads the root name from the given stream of NBT data.
- Parameters
-
| stream | Stream from which data will be loaded. If compression is set to AutoDetect, this stream must support seeking. |
| compression | Compression method to use for loading/saving this file. |
- Exceptions
-
| ArgumentNullException | stream is null. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression. |
| NotSupportedException | If compression is set to AutoDetect, but the stream is not seekable. |
| EndOfStreamException | If file ended earlier than expected. |
| InvalidDataException | If file compression could not be detected, decompressing failed, or given stream does not support reading. |
| NbtFormatException | If an error occured while parsing data in NBT format. |
| void LibNbt.NbtFile.RenameRootTag |
( |
string |
newTagName | ) |
|
Renames the root tag.
- Parameters
-
| newTagName | New name to give to the root tag. May be null. |
| void LibNbt.NbtFile.SaveToFile |
( |
[NotNull] string |
fileName, |
|
|
NbtCompression |
compression |
|
) |
| |
Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.
- Parameters
-
| fileName | File to write data to. May not be null. |
| compression | Compression mode to use for saving. May not be AutoDetect. |
- Exceptions
-
| ArgumentNullException | fileName is null. |
| ArgumentException | If AutoDetect was given as the compression mode. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression. |
| InvalidDataException | If given stream does not support writing. |
| IOException | If an I/O error occurred while creating the file. |
| UnauthorizedAccessException | Specified file is read-only, or a permission issue occurred. |
| NbtFormatException | If one of the NbtCompound tags contained unnamed tags; or if an NbtList tag had Unknown list type and no elements. |
| void LibNbt.NbtFile.SaveToStream |
( |
[NotNull] Stream |
stream, |
|
|
NbtCompression |
compression |
|
) |
| |
Saves this NBT file to a stream. Nothing is written to stream if RootTag is null.
- Parameters
-
| stream | Stream to write data to. May not be null. |
| compression | Compression mode to use for saving. May not be AutoDetect. |
- Exceptions
-
| ArgumentNullException | stream is null. |
| ArgumentException | If AutoDetect was given as the compression mode. |
| ArgumentOutOfRangeException | If an unrecognized/unsupported value was given for compression. |
| InvalidDataException | If given stream does not support writing. |
| NbtFormatException | If one of the NbtCompound tags contained unnamed tags; or if an NbtList tag had Unknown list type and no elements. |
Gets the compression method used for most recent loading/saving of this file. Defaults to AutoDetect.
| string LibNbt.NbtFile.FileName |
|
getset |
Gets the file name used for most recent loading/saving of this file. May be null, if this NbtFile instance has not been loaded from, or saved to, a file.
Root tag of this file. Must be a named CompoundTag. Defaults to null.
- Exceptions
-
| ArgumentException | If given tag is unnamed. |
The documentation for this class was generated from the following file:
- C:/Users/fragmer/Desktop/Minecraft/libnbt/LibNbt/NbtFile.cs