Skip to content

Commit

Permalink
Added missing XML documentation for publicly visible members
Browse files Browse the repository at this point in the history
  • Loading branch information
ForeverZer0 authored and ForeverZer0 committed Aug 25, 2021
1 parent 1aee10f commit ef6c5e1
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 1 deletion.
3 changes: 3 additions & 0 deletions SharpNBT/BufferedTagWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public async Task CopyToAsync([NotNull] Stream 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)
{
writer.BaseStream.Flush();
Expand Down
4 changes: 3 additions & 1 deletion SharpNBT/SharpNBT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
<RepositoryUrl>https://github.com/ForeverZer0/SharpNBT</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<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 Condition=" '$(Configuration)' == 'Release' ">
Expand Down
6 changes: 6 additions & 0 deletions SharpNBT/TagIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ public abstract class TagIO : IDisposable
/// </summary>
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)
{
BaseStream = stream ?? throw new ArgumentNullException(nameof(stream));
Expand Down
1 change: 1 addition & 0 deletions SharpNBT/Tags/EndTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public EndTag() : base(TagType.End, null)
/// <inheritdoc cref="object.ToString"/>
public override string ToString() => $"TAG_End";

/// <inheritdoc />
protected internal override void PrettyPrinted(StringBuilder buffer, int level, string indent)
{
// Do nothing
Expand Down
24 changes: 24 additions & 0 deletions SharpNBT/Tags/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,20 @@ public virtual void GetObjectData(SerializationInfo info, StreamingContext conte
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);

/// <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);
}

Expand Down Expand Up @@ -287,8 +299,20 @@ public override int GetHashCode()
}
}

/// <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);

/// <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);
}
}
7 changes: 7 additions & 0 deletions SharpNBT/Tags/TagContainer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,14 @@ namespace SharpNBT
[PublicAPI][Serializable]
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;

/// <summary>
/// When not <see langword="null"/>, indicates that a child must be of a specific type to be added.
/// </summary>
protected TagType? RequiredType;

/// <summary>
Expand Down
7 changes: 7 additions & 0 deletions SharpNBT/ZLib/ZLibStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ namespace SharpNBT.ZLib
[PublicAPI]
public class ZLibStream : Stream
{
/// <summary>
/// The internal DEFLATE stream used for compression/decompression.
/// </summary>
protected readonly DeflateStream DeflateStream;

/// <summary>
/// The base stream the ZlibStream is wrapping.
/// </summary>
protected readonly Stream BaseStream;

private readonly CompressionMode compressionMode;
Expand Down

0 comments on commit ef6c5e1

Please sign in to comment.