Skip to content

Commit 0c7694d

Browse files
committed
Improve xmldocs
1 parent f5c8972 commit 0c7694d

5 files changed

Lines changed: 26 additions & 12 deletions

File tree

ValvePak/ValvePak/ArchiveMD5SectionEntry.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
namespace SteamDatabase.ValvePak
22
{
33
/// <summary>
4-
/// VPK_ArchiveMD5SectionEntry
4+
/// Represents an entry in the VPK archive MD5 section, containing checksum information for a chunk of archive data.
55
/// </summary>
66
public class ArchiveMD5SectionEntry
77
{
88
/// <summary>
9-
/// Gets or sets the CRC32 checksum of this entry.
9+
/// Gets or sets the archive index.
1010
/// </summary>
1111
public required uint ArchiveIndex { get; set; }
1212

@@ -21,7 +21,7 @@ public class ArchiveMD5SectionEntry
2121
public required uint Length { get; set; }
2222

2323
/// <summary>
24-
/// Gets or sets the expected Checksum checksum.
24+
/// Gets or sets the expected checksum.
2525
/// </summary>
2626
public required byte[] Checksum { get; set; }
2727
}

ValvePak/ValvePak/CaseInsensitivePackageEntryComparer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ sealed class CaseInsensitivePackageEntryComparer(StringComparison comparison) :
99
public StringComparison Comparison { get; } = comparison;
1010

1111
/// <remarks>
12-
/// Intentionally not comparing TypeName because this comparer is used on Entries which is split by extension already.
12+
/// Intentionally not comparing <see cref="PackageEntry.TypeName"/> because this comparer is used on <see cref="Package.Entries"/> which is split by extension already.
1313
/// </remarks>
1414
public int Compare(PackageEntry? x, PackageEntry? y)
1515
{

ValvePak/ValvePak/Package.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ namespace SteamDatabase.ValvePak
1010
/// </summary>
1111
public partial class Package : IDisposable
1212
{
13+
/// <summary>
14+
/// The VPK file signature magic number.
15+
/// </summary>
1316
public const int MAGIC = 0x55AA1234;
1417

1518
internal const string Space = " ";
@@ -116,6 +119,9 @@ public void Dispose()
116119
GC.SuppressFinalize(this);
117120
}
118121

122+
/// <summary>
123+
/// Releases binary reader.
124+
/// </summary>
119125
protected virtual void Dispose(bool disposing)
120126
{
121127
if (disposing)
@@ -220,11 +226,11 @@ public void SetFileName(string fileName)
220226
return default;
221227
}
222228

223-
/// Searches for a given file entry in the file list after it has been optimized with <see cref="OptimizeEntriesForBinarySearch"/>.
224-
/// This also supports case insensitive search by using a different <see cref="StringComparison"/>.
225-
///
226-
/// Manually implement binary search to avoid allocating new strings for file and directory names.
227-
/// See <see cref="MemoryExtensions.BinarySearch{T}(ReadOnlySpan{T}, IComparable{T})"/> for reference.
229+
// Searches for a given file entry in the file list after it has been optimized with <see cref="OptimizeEntriesForBinarySearch"/>.
230+
// This also supports case insensitive search by using a different <see cref="StringComparison"/>.
231+
//
232+
// Manually implement binary search to avoid allocating new strings for file and directory names.
233+
// See <see cref="MemoryExtensions.BinarySearch{T}(ReadOnlySpan{T}, IComparable{T})"/> for reference.
228234

229235
int lo = 0;
230236

@@ -233,7 +239,7 @@ public void SetFileName(string fileName)
233239
var i = (int)(((uint)hi + (uint)lo) >> 1);
234240
var entry = entriesForExtension[i];
235241

236-
/// This code must match <see cref="CaseInsensitivePackageEntryComparer.Compare(PackageEntry, PackageEntry)"/>
242+
// This code must match <see cref="CaseInsensitivePackageEntryComparer.Compare(PackageEntry, PackageEntry)"/>
237243
var comp = fileName.Length.CompareTo(entry.FileName.Length);
238244

239245
if (comp == 0)

ValvePak/ValvePak/PackageEntry.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
namespace SteamDatabase.ValvePak
22
{
3+
/// <summary>
4+
/// Represents a file entry in a VPK package.
5+
/// </summary>
36
public class PackageEntry
47
{
58
/// <summary>
@@ -12,7 +15,7 @@ public class PackageEntry
1215

1316
/// <summary>
1417
/// Gets or sets the name of the directory this file is in.
15-
/// '/' is always used as a dictionary separator in Valve's implementation.
18+
/// '/' is always used as a directory separator in Valve's implementation.
1619
/// Directory names are also always lower cased in Valve's implementation.
1720
/// </summary>
1821
public required string DirectoryName { get; set; }
@@ -44,7 +47,7 @@ public class PackageEntry
4447
public ushort ArchiveIndex { get; set; }
4548

4649
/// <summary>
47-
/// Gets the length in bytes by adding Length and length of SmallData.
50+
/// Gets the length in bytes by adding <see cref="Length"/> and length of <see cref="SmallData"/>.
4851
/// </summary>
4952
public uint TotalLength
5053
{
@@ -96,6 +99,10 @@ public string GetFullPath()
9699
return string.Concat(DirectoryName, Package.DirectorySeparator, GetFileName());
97100
}
98101

102+
/// <summary>
103+
/// Returns a string representation of this package entry.
104+
/// </summary>
105+
/// <returns>A string that represents the current package entry.</returns>
99106
public override string ToString()
100107
{
101108
return $"{GetFullPath()} crc=0x{CRC32:x2} metadatasz={SmallData.Length} fnumber={ArchiveIndex} ofs=0x{Offset:x2} sz={Length}";

ValvePak/ValvePak/ValvePak.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<AssemblyOriginatorKeyFile>ValvePak.snk</AssemblyOriginatorKeyFile>
1515
<IsAotCompatible>True</IsAotCompatible>
1616
<Nullable>enable</Nullable>
17+
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1718
</PropertyGroup>
1819

1920
<ItemGroup>

0 commit comments

Comments
 (0)