Skip to content

Commit 03dde7c

Browse files
committed
Enable GenerateDocumentationFile, add missing xmldocs
1 parent 680a5cf commit 03dde7c

File tree

11 files changed

+135
-19
lines changed

11 files changed

+135
-19
lines changed

ValveKeyValue/ValveKeyValue/Deserialization/KeyValues1/KV1BinaryReader.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ void DetectMagicHeader()
186186
{
187187
stream.Position += 4; // Skip crc32
188188

189-
// There is likely to reason to handle this separately
189+
// There is likely no reason to handle this separately
190190
// as the types do not conflict between Steam or Dota 2
191191
endMarker = KV1BinaryNodeType.AlternateEnd;
192192
}

ValveKeyValue/ValveKeyValue/KVArrayValue.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,37 @@
22

33
namespace ValveKeyValue
44
{
5+
/// <summary>
6+
/// Represents an array of KeyValue values.
7+
/// </summary>
58
public class KVArrayValue : KVValue, IEnumerable<KVValue>, ICollection<KVValue>, IList<KVValue>
69
{
10+
/// <summary>
11+
/// Initializes a new instance of the <see cref="KVArrayValue"/> class.
12+
/// </summary>
713
public KVArrayValue()
814
{
915
children = new List<KVValue>();
1016
}
1117

1218
readonly List<KVValue> children;
1319

20+
/// <inheritdoc/>
1421
public override KVValueType ValueType => KVValueType.Array;
1522

23+
/// <inheritdoc/>
1624
public int Count => children.Count;
1725

26+
/// <inheritdoc/>
1827
public bool IsReadOnly => false;
1928

29+
/// <inheritdoc/>
2030
public override KVValue this[string key]
2131
{
2232
get { throw new NotSupportedException($"The indexer on a {nameof(KVArrayValue)} can only be used on integer keys, not strings."); }
2333
}
2434

35+
/// <inheritdoc/>
2536
public KVValue this[int key]
2637
{
2738
get
@@ -34,12 +45,17 @@ public KVValue this[int key]
3445
}
3546
}
3647

48+
/// <inheritdoc/>
3749
public void Add(KVValue value)
3850
{
3951
ArgumentNullException.ThrowIfNull(value);
4052
children.Add(value);
4153
}
4254

55+
/// <summary>
56+
/// Adds multiple values to the array.
57+
/// </summary>
58+
/// <param name="values">The values to add.</param>
4359
public void AddRange(IEnumerable<KVValue> values)
4460
{
4561
ArgumentNullException.ThrowIfNull(values);
@@ -48,90 +64,108 @@ public void AddRange(IEnumerable<KVValue> values)
4864

4965
#region IEnumerable<KVValue>
5066

67+
/// <inheritdoc/>
5168
public IEnumerator<KVValue> GetEnumerator() => children.GetEnumerator();
5269

5370
#endregion
5471

5572
#region IConvertible
5673

74+
/// <inheritdoc/>
5775
public override TypeCode GetTypeCode()
5876
{
5977
throw new NotSupportedException();
6078
}
6179

80+
/// <inheritdoc/>
6281
public override bool ToBoolean(IFormatProvider provider)
6382
{
6483
throw new NotSupportedException();
6584
}
6685

86+
/// <inheritdoc/>
6787
public override byte ToByte(IFormatProvider provider)
6888
{
6989
throw new NotSupportedException();
7090
}
7191

92+
/// <inheritdoc/>
7293
public override char ToChar(IFormatProvider provider)
7394
{
7495
throw new NotSupportedException();
7596
}
7697

98+
/// <inheritdoc/>
7799
public override DateTime ToDateTime(IFormatProvider provider)
78100
{
79101
throw new NotSupportedException();
80102
}
81103

104+
/// <inheritdoc/>
82105
public override decimal ToDecimal(IFormatProvider provider)
83106
{
84107
throw new NotSupportedException();
85108
}
86109

110+
/// <inheritdoc/>
87111
public override double ToDouble(IFormatProvider provider)
88112
{
89113
throw new NotSupportedException();
90114
}
91115

116+
/// <inheritdoc/>
92117
public override short ToInt16(IFormatProvider provider)
93118
{
94119
throw new NotSupportedException();
95120
}
96121

122+
/// <inheritdoc/>
97123
public override int ToInt32(IFormatProvider provider)
98124
{
99125
throw new NotSupportedException();
100126
}
101127

128+
/// <inheritdoc/>
102129
public override long ToInt64(IFormatProvider provider)
103130
{
104131
throw new NotSupportedException();
105132
}
106133

134+
/// <inheritdoc/>
107135
public override sbyte ToSByte(IFormatProvider provider)
108136
{
109137
throw new NotSupportedException();
110138
}
111139

140+
/// <inheritdoc/>
112141
public override float ToSingle(IFormatProvider provider)
113142
{
114143
throw new NotSupportedException();
115144
}
116145

146+
/// <inheritdoc/>
117147
public override string ToString(IFormatProvider provider)
118148
=> ToString();
119149

150+
/// <inheritdoc/>
120151
public override object ToType(Type conversionType, IFormatProvider provider)
121152
{
122153
throw new NotSupportedException();
123154
}
124155

156+
/// <inheritdoc/>
125157
public override ushort ToUInt16(IFormatProvider provider)
126158
{
127159
throw new NotSupportedException();
128160
}
129161

162+
/// <inheritdoc/>
130163
public override uint ToUInt32(IFormatProvider provider)
131164
{
132165
throw new NotSupportedException();
133166
}
134167

168+
/// <inheritdoc/>
135169
public override ulong ToUInt64(IFormatProvider provider)
136170
{
137171
throw new NotSupportedException();
@@ -145,40 +179,48 @@ public override ulong ToUInt64(IFormatProvider provider)
145179

146180
#endregion
147181

182+
/// <inheritdoc/>
148183
public override string ToString() => "[Array]";
149184

185+
/// <inheritdoc/>
150186
public void Clear() => children.Clear();
151187

188+
/// <inheritdoc/>
152189
public bool Contains(KVValue item)
153190
{
154191
ArgumentNullException.ThrowIfNull(item);
155192
return children.Contains(item);
156193
}
157194

195+
/// <inheritdoc/>
158196
public void CopyTo(KVValue[] array, int arrayIndex)
159197
{
160198
ArgumentNullException.ThrowIfNull(array);
161199
children.CopyTo(array, arrayIndex);
162200
}
163201

202+
/// <inheritdoc/>
164203
public bool Remove(KVValue item)
165204
{
166205
ArgumentNullException.ThrowIfNull(item);
167206
return children.Remove(item);
168207
}
169208

209+
/// <inheritdoc/>
170210
public int IndexOf(KVValue item)
171211
{
172212
ArgumentNullException.ThrowIfNull(item);
173213
return children.IndexOf(item);
174214
}
175215

216+
/// <inheritdoc/>
176217
public void Insert(int index, KVValue item)
177218
{
178219
ArgumentNullException.ThrowIfNull(item);
179220
children.Insert(index, item);
180221
}
181222

223+
/// <inheritdoc/>
182224
public void RemoveAt(int index) => children.RemoveAt(index);
183225
}
184226
}

ValveKeyValue/ValveKeyValue/KVBinaryBlob.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,109 +2,142 @@
22

33
namespace ValveKeyValue
44
{
5+
/// <summary>
6+
/// Represents a binary blob value.
7+
/// </summary>
58
public class KVBinaryBlob : KVValue
69
{
10+
/// <summary>
11+
/// Gets the binary data.
12+
/// </summary>
713
public Memory<byte> Bytes { get; }
814

15+
/// <inheritdoc/>
916
public override KVValueType ValueType => KVValueType.BinaryBlob;
1017

18+
/// <summary>
19+
/// Initializes a new instance of the <see cref="KVBinaryBlob"/> class.
20+
/// </summary>
21+
/// <param name="value">The binary data.</param>
1122
public KVBinaryBlob(byte[] value)
1223
{
1324
Bytes = value;
1425
}
1526

27+
/// <summary>
28+
/// Initializes a new instance of the <see cref="KVBinaryBlob"/> class.
29+
/// </summary>
30+
/// <param name="value">The binary data.</param>
1631
public KVBinaryBlob(Memory<byte> value)
1732
{
1833
Bytes = value;
1934
}
2035

2136
#region IConvertible
2237

38+
/// <inheritdoc/>
2339
public override TypeCode GetTypeCode()
2440
{
2541
throw new NotSupportedException();
2642
}
2743

44+
/// <inheritdoc/>
2845
public override bool ToBoolean(IFormatProvider provider)
2946
{
3047
throw new NotSupportedException();
3148
}
3249

50+
/// <inheritdoc/>
3351
public override byte ToByte(IFormatProvider provider)
3452
{
3553
throw new NotSupportedException();
3654
}
3755

56+
/// <inheritdoc/>
3857
public override char ToChar(IFormatProvider provider)
3958
{
4059
throw new NotSupportedException();
4160
}
4261

62+
/// <inheritdoc/>
4363
public override DateTime ToDateTime(IFormatProvider provider)
4464
{
4565
throw new NotSupportedException();
4666
}
4767

68+
/// <inheritdoc/>
4869
public override decimal ToDecimal(IFormatProvider provider)
4970
{
5071
throw new NotSupportedException();
5172
}
5273

74+
/// <inheritdoc/>
5375
public override double ToDouble(IFormatProvider provider)
5476
{
5577
throw new NotSupportedException();
5678
}
5779

80+
/// <inheritdoc/>
5881
public override short ToInt16(IFormatProvider provider)
5982
{
6083
throw new NotSupportedException();
6184
}
6285

86+
/// <inheritdoc/>
6387
public override int ToInt32(IFormatProvider provider)
6488
{
6589
throw new NotSupportedException();
6690
}
6791

92+
/// <inheritdoc/>
6893
public override long ToInt64(IFormatProvider provider)
6994
{
7095
throw new NotSupportedException();
7196
}
7297

98+
/// <inheritdoc/>
7399
public override sbyte ToSByte(IFormatProvider provider)
74100
{
75101
throw new NotSupportedException();
76102
}
77103

104+
/// <inheritdoc/>
78105
public override float ToSingle(IFormatProvider provider)
79106
{
80107
throw new NotSupportedException();
81108
}
82109

110+
/// <inheritdoc/>
83111
public override string ToString(IFormatProvider provider)
84112
=> ToString();
85113

114+
/// <inheritdoc/>
86115
public override object ToType(Type conversionType, IFormatProvider provider)
87116
{
88117
throw new NotSupportedException();
89118
}
90119

120+
/// <inheritdoc/>
91121
public override ushort ToUInt16(IFormatProvider provider)
92122
{
93123
throw new NotSupportedException();
94124
}
95125

126+
/// <inheritdoc/>
96127
public override uint ToUInt32(IFormatProvider provider)
97128
{
98129
throw new NotSupportedException();
99130
}
100131

132+
/// <inheritdoc/>
101133
public override ulong ToUInt64(IFormatProvider provider)
102134
{
103135
throw new NotSupportedException();
104136
}
105137

106138
#endregion
107139

140+
/// <inheritdoc/>
108141
public override string ToString()
109142
{
110143
var bytes = Bytes.Span;

ValveKeyValue/ValveKeyValue/KVDocument.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
namespace ValveKeyValue
22
{
3+
/// <summary>
4+
/// Represents a KeyValue document.
5+
/// </summary>
36
public class KVDocument : KVObject
47
{
8+
/// <summary>
9+
/// Initializes a new instance of the <see cref="KVDocument"/> class.
10+
/// </summary>
11+
/// <param name="name">Name of the document.</param>
12+
/// <param name="value">Root value of the document.</param>
513
public KVDocument(string name, KVValue value) : base(name, value)
614
{
715
// KV3 will require a header field that contains format/encoding here.

ValveKeyValue/ValveKeyValue/KVObject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public KVObject(string name, IEnumerable<KVObject> items)
5353
/// <summary>
5454
/// Indexer to find a child item by name.
5555
/// </summary>
56-
/// <param name="key">Key of the child object to find</param>
57-
/// <returns>A <see cref="KVObject"/> if the child item exists, otherwise <c>null</c>.</returns>
56+
/// <param name="key">Key of the child object to find.</param>
57+
/// <returns>A <see cref="KVValue"/> if the child item exists, otherwise <c>null</c>.</returns>
5858
public KVValue this[string key]
5959
{
6060
get

0 commit comments

Comments
 (0)