Skip to content

Commit 33643e2

Browse files
Merge pull request #13 from christophhagen/update-docs
- Updates the HTML documentation in docs to match the current state - Improves the bash script to generate the documentation
2 parents 8291948 + fd9f77e commit 33643e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+833
-787
lines changed

docs/Classes.html

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
<li class="nav-group-name">
8080
<a href="Enums.html">Enumerations</a>
8181
<ul class="nav-group-tasks">
82-
<li class="nav-group-task">
83-
<a href="Enums/BinaryDecodingError.html">BinaryDecodingError</a>
84-
</li>
85-
<li class="nav-group-task">
86-
<a href="Enums/BinaryEncodingError.html">BinaryEncodingError</a>
87-
</li>
8882
<li class="nav-group-task">
8983
<a href="Enums/DataType.html">DataType</a>
9084
</li>
@@ -373,11 +367,8 @@ <h4>Declaration</h4>
373367
or when the binary data should not be loaded into memory all at once (e.g. when parsing a file).</p>
374368

375369
<p>Each stream decoder handles only elements of a single type.
376-
The elements are handed to a handler passed to the decoder upon initialization.
377-
The byte stream is managed by a provider also specified on object creation.
378-
The decoder can then attempt to read elements by reading bytes from the provider, until a complete element can be decoded.
379-
Buffering is handled internally, freeing the stream provider from this responsibility.
380-
Each completely decoded element is immediatelly passed to handler for further processing.</p>
370+
The decoder can then attempt to read elements whenever new data is received, until a complete element can be decoded.
371+
Buffering is handled internally, freeing the stream provider from this responsibility.</p>
381372

382373
<a href="Classes/BinaryStreamDecoder.html" class="slightly-smaller">See more</a>
383374
</div>
@@ -464,7 +455,7 @@ <h4>Declaration</h4>
464455
<div class="abstract">
465456
<p>An encoder to convert protobuf binary data back to <code>Codable</code> objects.</p>
466457

467-
<p>Decoding unsupported data types causes <code>BinaryDecodingError.notProtobufCompatible</code> errors.</p>
458+
<p>Decoding unsupported data types causes <code>DecodingError</code> or <code><a href="Enums/ProtobufDecodingError.html">ProtobufDecodingError</a></code> errors.</p>
468459

469460
<p>To decode from data, instantiate a decoder and specify the type:</p>
470461
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">decoder</span> <span class="o">=</span> <span class="kt">BinaryDecoder</span><span class="p">()</span>
@@ -516,7 +507,7 @@ <h4>Declaration</h4>
516507

517508
<p>The encoder provides only limited compatibility with Google&rsquo;s Protocol Buffers.</p>
518509

519-
<p>Encoding unsupported data types causes <code>BinaryEncodingError.notProtobufCompatible</code> errors.</p>
510+
<p>Encoding unsupported data types causes <code><a href="Enums/ProtobufEncodingError.html">ProtobufEncodingError</a></code> errors.</p>
520511

521512
<p>Construct an encoder when converting instances to binary data, and feed the message(s) into it:</p>
522513
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">message</span><span class="p">:</span> <span class="kt">Message</span> <span class="o">=</span> <span class="o">...</span>
@@ -548,8 +539,8 @@ <h4>Declaration</h4>
548539
</section>
549540
</section>
550541
<section id="footer">
551-
<p>&copy; 2022 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2022-11-08)</p>
552-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
542+
<p>&copy; 2024 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2024-01-11)</p>
543+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
553544
</section>
554545
</article>
555546
</div>

docs/Classes/BinaryDecoder.html

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
<li class="nav-group-name">
8080
<a href="../Enums.html">Enumerations</a>
8181
<ul class="nav-group-tasks">
82-
<li class="nav-group-task">
83-
<a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a>
84-
</li>
85-
<li class="nav-group-task">
86-
<a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a>
87-
</li>
8882
<li class="nav-group-task">
8983
<a href="../Enums/DataType.html">DataType</a>
9084
</li>
@@ -255,7 +249,7 @@ <h4>Declaration</h4>
255249
for more information about the binary data format in both cases.</p>
256250
<div class="aside aside-note">
257251
<p class="aside-title">Note</p>
258-
This option defaults to <code>true</code>
252+
This option defaults to <code>false</code>
259253

260254
</div><div class="aside aside-note">
261255
<p class="aside-title">Note</p>
@@ -323,7 +317,7 @@ <h4>Declaration</h4>
323317
<p>Decode a type from binary data.</p>
324318
<div class="aside aside-throws">
325319
<p class="aside-title">Throws</p>
326-
Errors of type <code><a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a></code>
320+
Errors of type <code>DecodingError</code>
327321

328322
</div>
329323

@@ -390,7 +384,7 @@ <h4>Return Value</h4>
390384
<p>Decode a single value from binary data using a default decoder.</p>
391385
<div class="aside aside-throws">
392386
<p class="aside-title">Throws</p>
393-
Errors of type <code><a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a></code>
387+
Errors of type <code>DecodingError</code>
394388

395389
</div>
396390

@@ -446,8 +440,8 @@ <h4>Return Value</h4>
446440
</section>
447441
</section>
448442
<section id="footer">
449-
<p>&copy; 2022 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2022-11-08)</p>
450-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
443+
<p>&copy; 2024 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2024-01-11)</p>
444+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
451445
</section>
452446
</article>
453447
</div>

docs/Classes/BinaryEncoder.html

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
<li class="nav-group-name">
8080
<a href="../Enums.html">Enumerations</a>
8181
<ul class="nav-group-tasks">
82-
<li class="nav-group-task">
83-
<a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a>
84-
</li>
85-
<li class="nav-group-task">
86-
<a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a>
87-
</li>
8882
<li class="nav-group-task">
8983
<a href="../Enums/DataType.html">DataType</a>
9084
</li>
@@ -260,24 +254,27 @@ <h4>Declaration</h4>
260254
<div class="abstract">
261255
<p>Add a set of indices for <code>nil</code> values in unkeyed containers.</p>
262256

263-
<p>This option changes the encoding of unkeyed sequences like arrays with optional values.</p>
257+
<p>This option is only necessary for custom implementations of <code>func encode(to:)</code>, when using <code>encodeNil()</code> on <code>UnkeyedEncodingContainer</code>.</p>
264258

265259
<p>If this option is set to <code>true</code>, then the encoded binary data first contains a list of indexes for each position where <code>nil</code> is encoded.
266260
After this data the remaining (non-nil) values are added.
267261
If this option is <code>false</code>, then each value is prepended with a byte <code>1</code> for non-nil values, and a byte <code>0</code> for <code>nil</code> values.</p>
268262

269-
<p>Using an index set is generally more efficient, expect for large sequences with many <code>nil</code> values.
270-
An index set is encoded using first the number of elements, and then each element, all encoded as var-ints.</p>
263+
<p>An index set is encoded using first the number of elements, and then each element, all encoded as var-ints.</p>
271264

272265
<p>One benefit of this option is that top-level sequences can be joined using their binary data, where <code>encoded([a,b]) | encoded([c,d]) == encoded([a,b,c,d])</code>.</p>
273266
<div class="aside aside-note">
274267
<p class="aside-title">Note</p>
275-
This option defaults to <code>true</code>
268+
This option defaults to <code>false</code>
276269

277270
</div><div class="aside aside-note">
278271
<p class="aside-title">Note</p>
279272
To decode successfully, the decoder must use the same setting for <code>containsNilIndexSetForUnkeyedContainers</code>.
280273

274+
</div><div class="aside aside-note">
275+
<p class="aside-title">Note</p>
276+
Using <code>encodeNil()</code> on <code>UnkeyedEncodingContainer</code> without this option results in a fatal error.
277+
281278
</div>
282279

283280
</div>
@@ -372,7 +369,7 @@ <h4>Declaration</h4>
372369
<p>Encode a value to binary data.</p>
373370
<div class="aside aside-throws">
374371
<p class="aside-title">Throws</p>
375-
Errors of type <code><a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a></code>
372+
Errors of type <code>EncodingError</code>
376373

377374
</div>
378375

@@ -427,7 +424,7 @@ <h4>Return Value</h4>
427424
<p>Encode a single value to binary data using a default encoder.</p>
428425
<div class="aside aside-throws">
429426
<p class="aside-title">Throws</p>
430-
Errors of type <code><a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a></code>
427+
Errors of type <code>EncodingError</code>
431428

432429
</div>
433430

@@ -471,8 +468,8 @@ <h4>Return Value</h4>
471468
</section>
472469
</section>
473470
<section id="footer">
474-
<p>&copy; 2022 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2022-11-08)</p>
475-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
471+
<p>&copy; 2024 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2024-01-11)</p>
472+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
476473
</section>
477474
</article>
478475
</div>

docs/Classes/BinaryFileDecoder.html

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
<li class="nav-group-name">
8080
<a href="../Enums.html">Enumerations</a>
8181
<ul class="nav-group-tasks">
82-
<li class="nav-group-task">
83-
<a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a>
84-
</li>
85-
<li class="nav-group-task">
86-
<a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a>
87-
</li>
8882
<li class="nav-group-task">
8983
<a href="../Enums/DataType.html">DataType</a>
9084
</li>
@@ -333,9 +327,9 @@ <h3 class="section-name"><span>Decoding</span>
333327
<li class="item">
334328
<div>
335329
<code>
336-
<a name="/s:13BinaryCodable0A11FileDecoderC4readyyyxXEKF"></a>
330+
<a name="/s:13BinaryCodable0A11FileDecoderC4readyyyxKXEKF"></a>
337331
<a name="//apple_ref/swift/Method/read(_:)" class="dashAnchor"></a>
338-
<a class="token" href="#/s:13BinaryCodable0A11FileDecoderC4readyyyxXEKF">read(_:<wbr>)</a>
332+
<a class="token" href="#/s:13BinaryCodable0A11FileDecoderC4readyyyxKXEKF">read(_:<wbr>)</a>
339333
</code>
340334
</div>
341335
<div class="height-container">
@@ -346,7 +340,7 @@ <h3 class="section-name"><span>Decoding</span>
346340
<p>Read all elements in the file, and handle each element using a closure.</p>
347341
<div class="aside aside-throws">
348342
<p class="aside-title">Throws</p>
349-
Decoding errors of type <code><a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a></code>.
343+
Decoding errors of type <code>DecodingError</code>.
350344

351345
</div>
352346

@@ -355,7 +349,7 @@ <h3 class="section-name"><span>Decoding</span>
355349
<h4>Declaration</h4>
356350
<div class="language">
357351
<p class="aside-title">Swift</p>
358-
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">read</span><span class="p">(</span><span class="n">_</span> <span class="nv">elementHandler</span><span class="p">:</span> <span class="p">(</span><span class="kt">Element</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">throws</span></code></pre>
352+
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">read</span><span class="p">(</span><span class="n">_</span> <span class="nv">elementHandler</span><span class="p">:</span> <span class="p">(</span><span class="kt">Element</span><span class="p">)</span> <span class="k">throws</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span> <span class="k">throws</span></code></pre>
359353

360354
</div>
361355
</div>
@@ -397,7 +391,7 @@ <h4>Parameters</h4>
397391
<p>Read all elements at once.</p>
398392
<div class="aside aside-throws">
399393
<p class="aside-title">Throws</p>
400-
Errors of type <code><a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a></code>
394+
Errors of type <code>DecodingError</code>
401395

402396
</div>
403397

@@ -467,7 +461,7 @@ <h4>Return Value</h4>
467461
<p>Read a single elements from the current position in the file.</p>
468462
<div class="aside aside-throws">
469463
<p class="aside-title">Throws</p>
470-
Errors of type <code><a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a></code>
464+
Errors of type <code>DecodingError</code>
471465

472466
</div>
473467

@@ -492,8 +486,8 @@ <h4>Return Value</h4>
492486
</section>
493487
</section>
494488
<section id="footer">
495-
<p>&copy; 2022 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2022-11-08)</p>
496-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
489+
<p>&copy; 2024 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2024-01-11)</p>
490+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
497491
</section>
498492
</article>
499493
</div>

docs/Classes/BinaryFileEncoder.html

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,6 @@
7979
<li class="nav-group-name">
8080
<a href="../Enums.html">Enumerations</a>
8181
<ul class="nav-group-tasks">
82-
<li class="nav-group-task">
83-
<a href="../Enums/BinaryDecodingError.html">BinaryDecodingError</a>
84-
</li>
85-
<li class="nav-group-task">
86-
<a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a>
87-
</li>
8882
<li class="nav-group-task">
8983
<a href="../Enums/DataType.html">DataType</a>
9084
</li>
@@ -314,7 +308,7 @@ <h4>Declaration</h4>
314308

315309
</div><div class="aside aside-throws">
316310
<p class="aside-title">Throws</p>
317-
Errors of type <code><a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a></code>
311+
Errors of type <code>EncodingError</code>
318312

319313
</div>
320314

@@ -367,7 +361,7 @@ <h4>Parameters</h4>
367361
<p>This is a convenience function calling <code>write(_ element:)</code> for each element of the sequence in order.</p>
368362
<div class="aside aside-throws">
369363
<p class="aside-title">Throws</p>
370-
Errors of type <code><a href="../Enums/BinaryEncodingError.html">BinaryEncodingError</a></code>
364+
Errors of type <code>EncodingError</code>
371365

372366
</div>
373367

@@ -407,8 +401,8 @@ <h4>Parameters</h4>
407401
</section>
408402
</section>
409403
<section id="footer">
410-
<p>&copy; 2022 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2022-11-08)</p>
411-
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.2</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
404+
<p>&copy; 2024 <a class="link" href="https://christophhagen.de" target="_blank" rel="external noopener">Christoph Hagen</a>. All rights reserved. (Last updated: 2024-01-11)</p>
405+
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external noopener">jazzy ♪♫ v0.14.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external noopener">Realm</a> project.</p>
412406
</section>
413407
</article>
414408
</div>

0 commit comments

Comments
 (0)