From ef6c5e1ed093f762e0924fcde38ff0c1ccc8ccbb Mon Sep 17 00:00:00 2001 From: ForeverZer0 Date: Wed, 25 Aug 2021 19:38:41 -0400 Subject: [PATCH] Added missing XML documentation for publicly visible members --- SharpNBT/BufferedTagWriter.cs | 3 +++ SharpNBT/SharpNBT.csproj | 4 +++- SharpNBT/TagIO.cs | 6 ++++++ SharpNBT/Tags/EndTag.cs | 1 + SharpNBT/Tags/Tag.cs | 24 ++++++++++++++++++++++++ SharpNBT/Tags/TagContainer.cs | 7 +++++++ SharpNBT/ZLib/ZLibStream.cs | 7 +++++++ 7 files changed, 51 insertions(+), 1 deletion(-) diff --git a/SharpNBT/BufferedTagWriter.cs b/SharpNBT/BufferedTagWriter.cs index 5f24104..99564e1 100644 --- a/SharpNBT/BufferedTagWriter.cs +++ b/SharpNBT/BufferedTagWriter.cs @@ -106,6 +106,9 @@ public async Task CopyToAsync([NotNull] Stream stream) await buffer.CopyToAsync(stream); } + /// + /// Implicit conversion of to a . + /// public static implicit operator ReadOnlySpan(BufferedTagWriter writer) { writer.BaseStream.Flush(); diff --git a/SharpNBT/SharpNBT.csproj b/SharpNBT/SharpNBT.csproj index 66b79ad..8174966 100644 --- a/SharpNBT/SharpNBT.csproj +++ b/SharpNBT/SharpNBT.csproj @@ -10,7 +10,9 @@ https://github.com/ForeverZer0/SharpNBT git icon.png - nbt;named binary tag;minecraft;serialization;java;bedrock;pocket edition;varint;varlong + nbt;named binary tag;minecraft;serialization;java;bedrock;pocket edition;varint;varlong;zlib + Copyright © Eric Freed 2021 + true diff --git a/SharpNBT/TagIO.cs b/SharpNBT/TagIO.cs index 8d02311..537071a 100644 --- a/SharpNBT/TagIO.cs +++ b/SharpNBT/TagIO.cs @@ -39,6 +39,12 @@ public abstract class TagIO : IDisposable /// public FormatOptions FormatOptions { get; } + /// + /// Initializes a new instance of the class. + /// + /// A instance that the writer will be writing to. + /// Bitwise flags to configure how data should be handled for compatibility between different specifications. + /// Thrown when is protected TagIO([NotNull] Stream stream, FormatOptions options) { BaseStream = stream ?? throw new ArgumentNullException(nameof(stream)); diff --git a/SharpNBT/Tags/EndTag.cs b/SharpNBT/Tags/EndTag.cs index ffec1f9..e1089e3 100644 --- a/SharpNBT/Tags/EndTag.cs +++ b/SharpNBT/Tags/EndTag.cs @@ -19,6 +19,7 @@ public EndTag() : base(TagType.End, null) /// public override string ToString() => $"TAG_End"; + /// protected internal override void PrettyPrinted(StringBuilder buffer, int level, string indent) { // Do nothing diff --git a/SharpNBT/Tags/Tag.cs b/SharpNBT/Tags/Tag.cs index 0a61ca5..9d58b59 100644 --- a/SharpNBT/Tags/Tag.cs +++ b/SharpNBT/Tags/Tag.cs @@ -193,8 +193,20 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte info.AddValue("name", Name); } + /// + /// Tests for equality of this object with another instance. + /// + /// First value to compare. + /// Second value to compare. + /// Result of comparison. public static bool operator ==(Tag left, Tag right) => Equals(left, right); + /// + /// Tests for inequality of this object with another instance. + /// + /// First value to compare. + /// Second value to compare. + /// Result of comparison. public static bool operator !=(Tag left, Tag right) => !Equals(left, right); } @@ -287,8 +299,20 @@ public override int GetHashCode() } } + /// + /// Tests for equality of this object with another instance. + /// + /// First value to compare. + /// Second value to compare. + /// Result of comparison. public static bool operator ==(Tag left, Tag right) => Equals(left, right); + /// + /// Tests for inequality of this object with another instance. + /// + /// First value to compare. + /// Second value to compare. + /// Result of comparison. public static bool operator !=(Tag left, Tag right) => !Equals(left, right); } } \ No newline at end of file diff --git a/SharpNBT/Tags/TagContainer.cs b/SharpNBT/Tags/TagContainer.cs index 5c87130..8b2bfd0 100644 --- a/SharpNBT/Tags/TagContainer.cs +++ b/SharpNBT/Tags/TagContainer.cs @@ -13,7 +13,14 @@ namespace SharpNBT [PublicAPI][Serializable] public abstract class TagContainer : EnumerableTag { + /// + /// A value indicating if children of this container are required to have be named. + /// protected bool NamedChildren; + + /// + /// When not , indicates that a child must be of a specific type to be added. + /// protected TagType? RequiredType; /// diff --git a/SharpNBT/ZLib/ZLibStream.cs b/SharpNBT/ZLib/ZLibStream.cs index 2257229..692e5c3 100644 --- a/SharpNBT/ZLib/ZLibStream.cs +++ b/SharpNBT/ZLib/ZLibStream.cs @@ -16,7 +16,14 @@ namespace SharpNBT.ZLib [PublicAPI] public class ZLibStream : Stream { + /// + /// The internal DEFLATE stream used for compression/decompression. + /// protected readonly DeflateStream DeflateStream; + + /// + /// The base stream the ZlibStream is wrapping. + /// protected readonly Stream BaseStream; private readonly CompressionMode compressionMode;