Added missing XML documentation for publicly visible members

This commit is contained in:
ForeverZer0 2021-08-25 19:38:41 -04:00
parent 1aee10f0ad
commit ef6c5e1ed0
7 changed files with 51 additions and 1 deletions

View File

@ -106,6 +106,9 @@ namespace SharpNBT
await buffer.CopyToAsync(stream); await buffer.CopyToAsync(stream);
} }
/// <summary>
/// Implicit conversion of <see cref="BufferedTagWriter"/> to a <see cref="ReadOnlySpan{T}"/>.
/// </summary>
public static implicit operator ReadOnlySpan<byte>(BufferedTagWriter writer) public static implicit operator ReadOnlySpan<byte>(BufferedTagWriter writer)
{ {
writer.BaseStream.Flush(); writer.BaseStream.Flush();

View File

@ -10,7 +10,9 @@
<RepositoryUrl>https://github.com/ForeverZer0/SharpNBT</RepositoryUrl> <RepositoryUrl>https://github.com/ForeverZer0/SharpNBT</RepositoryUrl>
<RepositoryType>git</RepositoryType> <RepositoryType>git</RepositoryType>
<PackageIcon>icon.png</PackageIcon> <PackageIcon>icon.png</PackageIcon>
<PackageTags>nbt;named binary tag;minecraft;serialization;java;bedrock;pocket edition;varint;varlong</PackageTags> <PackageTags>nbt;named binary tag;minecraft;serialization;java;bedrock;pocket edition;varint;varlong;zlib</PackageTags>
<Copyright>Copyright © Eric Freed 2021</Copyright>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">

View File

@ -39,6 +39,12 @@ namespace SharpNBT
/// </summary> /// </summary>
public FormatOptions FormatOptions { get; } public FormatOptions FormatOptions { get; }
/// <summary>
/// Initializes a new instance of the <see cref="TagIO"/> class.
/// </summary>
/// <param name="stream">A <see cref="Stream"/> instance that the writer will be writing to.</param>
/// <param name="options">Bitwise flags to configure how data should be handled for compatibility between different specifications.</param>
/// <exception cref="ArgumentNullException">Thrown when <paramref name="stream"/> is <see langword="null"/></exception>
protected TagIO([NotNull] Stream stream, FormatOptions options) protected TagIO([NotNull] Stream stream, FormatOptions options)
{ {
BaseStream = stream ?? throw new ArgumentNullException(nameof(stream)); BaseStream = stream ?? throw new ArgumentNullException(nameof(stream));

View File

@ -19,6 +19,7 @@ namespace SharpNBT
/// <inheritdoc cref="object.ToString"/> /// <inheritdoc cref="object.ToString"/>
public override string ToString() => $"TAG_End"; public override string ToString() => $"TAG_End";
/// <inheritdoc />
protected internal override void PrettyPrinted(StringBuilder buffer, int level, string indent) protected internal override void PrettyPrinted(StringBuilder buffer, int level, string indent)
{ {
// Do nothing // Do nothing

View File

@ -193,8 +193,20 @@ namespace SharpNBT
info.AddValue("name", Name); info.AddValue("name", Name);
} }
/// <summary>
/// Tests for equality of this object with another <see cref="Tag"/> instance.
/// </summary>
/// <param name="left">First value to compare.</param>
/// <param name="right">Second value to compare.</param>
/// <returns>Result of comparison.</returns>
public static bool operator ==(Tag left, Tag right) => Equals(left, right); public static bool operator ==(Tag left, Tag right) => Equals(left, right);
/// <summary>
/// Tests for inequality of this object with another <see cref="Tag"/> instance.
/// </summary>
/// <param name="left">First value to compare.</param>
/// <param name="right">Second value to compare.</param>
/// <returns>Result of comparison.</returns>
public static bool operator !=(Tag left, Tag right) => !Equals(left, right); public static bool operator !=(Tag left, Tag right) => !Equals(left, right);
} }
@ -287,8 +299,20 @@ namespace SharpNBT
} }
} }
/// <summary>
/// Tests for equality of this object with another <see cref="Tag"/> instance.
/// </summary>
/// <param name="left">First value to compare.</param>
/// <param name="right">Second value to compare.</param>
/// <returns>Result of comparison.</returns>
public static bool operator ==(Tag<T> left, Tag<T> right) => Equals(left, right); public static bool operator ==(Tag<T> left, Tag<T> right) => Equals(left, right);
/// <summary>
/// Tests for inequality of this object with another <see cref="Tag"/> instance.
/// </summary>
/// <param name="left">First value to compare.</param>
/// <param name="right">Second value to compare.</param>
/// <returns>Result of comparison.</returns>
public static bool operator !=(Tag<T> left, Tag<T> right) => !Equals(left, right); public static bool operator !=(Tag<T> left, Tag<T> right) => !Equals(left, right);
} }
} }

View File

@ -13,7 +13,14 @@ namespace SharpNBT
[PublicAPI][Serializable] [PublicAPI][Serializable]
public abstract class TagContainer : EnumerableTag<Tag> public abstract class TagContainer : EnumerableTag<Tag>
{ {
/// <summary>
/// A value indicating if children of this container are required to have be named.
/// </summary>
protected bool NamedChildren; protected bool NamedChildren;
/// <summary>
/// When not <see langword="null"/>, indicates that a child must be of a specific type to be added.
/// </summary>
protected TagType? RequiredType; protected TagType? RequiredType;
/// <summary> /// <summary>

View File

@ -16,7 +16,14 @@ namespace SharpNBT.ZLib
[PublicAPI] [PublicAPI]
public class ZLibStream : Stream public class ZLibStream : Stream
{ {
/// <summary>
/// The internal DEFLATE stream used for compression/decompression.
/// </summary>
protected readonly DeflateStream DeflateStream; protected readonly DeflateStream DeflateStream;
/// <summary>
/// The base stream the ZlibStream is wrapping.
/// </summary>
protected readonly Stream BaseStream; protected readonly Stream BaseStream;
private readonly CompressionMode compressionMode; private readonly CompressionMode compressionMode;