Skip to content

Commit 9709806

Browse files
committed
Updated docs for version 0.0
1 parent a377784 commit 9709806

20 files changed

Lines changed: 1391 additions & 61 deletions

api-reference/0.0/PolylineAlgorithm.Abstraction.AbstractPolylineDecoder-2.yml

Lines changed: 93 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Class AbstractPolylineDecoder<TPolyline, TCoordinate>
33
body:
44
- api1: Class AbstractPolylineDecoder<TPolyline, TCoordinate>
55
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2
6-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L22
6+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L31
77
metadata:
88
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2
99
commentId: T:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2
@@ -15,7 +15,7 @@ body:
1515
- name: Assembly
1616
value: PolylineAlgorithm.dll
1717
- markdown: Provides a base implementation for decoding encoded polyline strings into sequences of geographic coordinates.
18-
- code: 'public abstract class AbstractPolylineDecoder<TPolyline, TCoordinate> : IPolylineDecoder<TPolyline, TCoordinate>'
18+
- code: 'public class AbstractPolylineDecoder<TPolyline, TCoordinate> : IPolylineDecoder<TPolyline, TCoordinate>'
1919
- h4: Type Parameters
2020
- parameters:
2121
- name: TPolyline
@@ -50,21 +50,39 @@ body:
5050
url: https://learn.microsoft.com/dotnet/api/system.object.tostring
5151
- h2: Remarks
5252
- markdown: >-
53-
Derive from this class to implement a decoder for a specific polyline type. Override <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.GetReadOnlyMemory(%600%40)" data-throw-if-not-resolved="false"></xref>
53+
<p>
5454
55-
and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.CreateCoordinate(System.Double%2cSystem.Double)" data-throw-if-not-resolved="false"></xref> to provide type-specific behavior.
55+
<b>Formatter-based use (no subclassing required):</b>
56+
57+
Supply a <xref href="PolylineAlgorithm.PolylineOptions%602" data-throw-if-not-resolved="false"></xref> via the
58+
59+
<xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.%23ctor(PolylineAlgorithm.PolylineOptions%7b%601%2c%600%7d)" data-throw-if-not-resolved="false"></xref>
60+
61+
constructor. The formatters handle all type-specific concerns; override nothing.
62+
63+
</p>
64+
65+
<p>
66+
67+
<b>Legacy override-based use:</b>
68+
69+
Derive from this class and override <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.GetReadOnlyMemory(%600%40)" data-throw-if-not-resolved="false"></xref> and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.CreateCoordinate(System.Double%2cSystem.Double)" data-throw-if-not-resolved="false"></xref>
70+
71+
to provide type-specific behaviour. These overrides take priority over any registered formatter.
72+
73+
</p>
5674
- h2: Constructors
5775
- api3: AbstractPolylineDecoder()
5876
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor
59-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L28
77+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L39
6078
metadata:
6179
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor
6280
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor
6381
- markdown: Initializes a new instance of the <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602" data-throw-if-not-resolved="false"></xref> class with default encoding options.
6482
- code: protected AbstractPolylineDecoder()
6583
- api3: AbstractPolylineDecoder(PolylineEncodingOptions)
6684
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor_PolylineAlgorithm_PolylineEncodingOptions_
67-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L40
85+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L51
6886
metadata:
6987
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions)
7088
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineEncodingOptions)
@@ -78,6 +96,46 @@ body:
7896
url: PolylineAlgorithm.PolylineEncodingOptions.html
7997
description: The <xref href="PolylineAlgorithm.PolylineEncodingOptions" data-throw-if-not-resolved="false"></xref> to use for encoding operations.
8098
- h4: Exceptions
99+
- parameters:
100+
- type:
101+
- text: ArgumentNullException
102+
url: https://learn.microsoft.com/dotnet/api/system.argumentnullexception
103+
description: Thrown when <code class="paramref">options</code> is <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
104+
- api3: AbstractPolylineDecoder(PolylineOptions<TCoordinate, TPolyline>)
105+
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2__ctor_PolylineAlgorithm_PolylineOptions__1__0__
106+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L78
107+
metadata:
108+
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineOptions{`1,`0})
109+
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.#ctor(PolylineAlgorithm.PolylineOptions{`1,`0})
110+
- markdown: >-
111+
Initializes a new instance of the <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602" data-throw-if-not-resolved="false"></xref> class
112+
113+
using the supplied <xref href="PolylineAlgorithm.PolylineOptions%602" data-throw-if-not-resolved="false"></xref>.
114+
- code: public AbstractPolylineDecoder(PolylineOptions<TCoordinate, TPolyline> options)
115+
- h4: Parameters
116+
- parameters:
117+
- name: options
118+
type:
119+
- text: PolylineOptions
120+
url: PolylineAlgorithm.PolylineOptions-2.html
121+
- <
122+
- TCoordinate
123+
- ','
124+
- " "
125+
- TPolyline
126+
- '>'
127+
description: >-
128+
A <xref href="PolylineAlgorithm.PolylineOptions%602" data-throw-if-not-resolved="false"></xref> that carries both the value formatter and
129+
130+
the polyline formatter together with the underlying <xref href="PolylineAlgorithm.PolylineEncodingOptions" data-throw-if-not-resolved="false"></xref>.
131+
- h4: Remarks
132+
- markdown: >-
133+
Use this constructor when you want formatter-driven decoding without subclassing.
134+
135+
The <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.GetReadOnlyMemory(%600%40)" data-throw-if-not-resolved="false"></xref> and <xref href="PolylineAlgorithm.Abstraction.AbstractPolylineDecoder%602.CreateCoordinate(System.Double%2cSystem.Double)" data-throw-if-not-resolved="false"></xref> hooks are not called;
136+
137+
all type-specific logic is delegated to the formatters.
138+
- h4: Exceptions
81139
- parameters:
82140
- type:
83141
- text: ArgumentNullException
@@ -86,7 +144,7 @@ body:
86144
- h2: Properties
87145
- api3: Options
88146
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Options
89-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L54
147+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L94
90148
metadata:
91149
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options
92150
commentId: P:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Options
@@ -100,12 +158,12 @@ body:
100158
- h2: Methods
101159
- api3: CreateCoordinate(double, double)
102160
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_CreateCoordinate_System_Double_System_Double_
103-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L202
161+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L286
104162
metadata:
105163
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double)
106164
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.CreateCoordinate(System.Double,System.Double)
107165
- markdown: Creates a <code class="typeparamref">TCoordinate</code> instance from the specified latitude and longitude values.
108-
- code: protected abstract TCoordinate CreateCoordinate(double latitude, double longitude)
166+
- code: protected virtual TCoordinate CreateCoordinate(double latitude, double longitude)
109167
- h4: Parameters
110168
- parameters:
111169
- name: latitude
@@ -123,17 +181,29 @@ body:
123181
- type:
124182
- TCoordinate
125183
description: A <code class="typeparamref">TCoordinate</code> instance representing the specified geographic coordinate.
184+
- h4: Exceptions
185+
- parameters:
186+
- type:
187+
- text: NotSupportedException
188+
url: https://learn.microsoft.com/dotnet/api/system.notsupportedexception
189+
description: >-
190+
Thrown by the default implementation when no value formatter is registered and the method
191+
192+
has not been overridden in a derived class.
126193
- api3: Decode(TPolyline, CancellationToken)
127194
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_Decode__0_System_Threading_CancellationToken_
128-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L81
195+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L121
129196
metadata:
130197
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
131198
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.Decode(`0,System.Threading.CancellationToken)
132199
- markdown: >-
133200
Decodes an encoded <code class="typeparamref">TPolyline</code> into a sequence of <code class="typeparamref">TCoordinate</code> instances,
134201
135202
with support for cancellation.
136-
- code: public IEnumerable<TCoordinate> Decode(TPolyline polyline, CancellationToken cancellationToken = default)
203+
- code: >-
204+
[SuppressMessage("Design", "MA0051:Method is too long", Justification = "Method contains two path implementations.")]
205+
206+
public IEnumerable<TCoordinate> Decode(TPolyline polyline, CancellationToken cancellationToken = default)
137207
- h4: Parameters
138208
- parameters:
139209
- name: polyline
@@ -175,12 +245,12 @@ body:
175245
description: Thrown when <code class="paramref">cancellationToken</code> is canceled during decoding.
176246
- api3: GetReadOnlyMemory(in TPolyline)
177247
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_GetReadOnlyMemory__0__
178-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L187
248+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L263
179249
metadata:
180250
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
181251
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.GetReadOnlyMemory(`0@)
182252
- markdown: Extracts the underlying read-only memory region of characters from the specified polyline instance.
183-
- code: protected abstract ReadOnlyMemory<char> GetReadOnlyMemory(in TPolyline polyline)
253+
- code: protected virtual ReadOnlyMemory<char> GetReadOnlyMemory(in TPolyline polyline)
184254
- h4: Parameters
185255
- parameters:
186256
- name: polyline
@@ -197,9 +267,18 @@ body:
197267
url: https://learn.microsoft.com/dotnet/api/system.char
198268
- '>'
199269
description: A <xref href="System.ReadOnlyMemory%601" data-throw-if-not-resolved="false"></xref> of <xref href="System.Char" data-throw-if-not-resolved="false"></xref> representing the encoded polyline characters.
270+
- h4: Exceptions
271+
- parameters:
272+
- type:
273+
- text: NotSupportedException
274+
url: https://learn.microsoft.com/dotnet/api/system.notsupportedexception
275+
description: >-
276+
Thrown by the default implementation when no polyline formatter is registered and the method
277+
278+
has not been overridden in a derived class.
200279
- api3: ValidateFormat(ReadOnlyMemory<char>, ILogger?)
201280
id: PolylineAlgorithm_Abstraction_AbstractPolylineDecoder_2_ValidateFormat_System_ReadOnlyMemory_System_Char__Microsoft_Extensions_Logging_ILogger_
202-
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/review-github-templates/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L167
281+
src: https://github.com/petesramek/polyline-algorithm-csharp/blob/copilot/extend-polylinealgorithm-multi-dimensional-support/src/PolylineAlgorithm/Abstraction/AbstractPolylineDecoder.cs#L239
203282
metadata:
204283
uid: PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)
205284
commentId: M:PolylineAlgorithm.Abstraction.AbstractPolylineDecoder`2.ValidateFormat(System.ReadOnlyMemory{System.Char},Microsoft.Extensions.Logging.ILogger)

0 commit comments

Comments
 (0)