Skip to content

Commit 9f4b278

Browse files
Copilotpetesramek
andauthored
docs: update README code examples after IPolylineWriter/IPolylineReader removal
Agent-Logs-Url: https://github.com/petesramek/polyline-algorithm-csharp/sessions/8085d58f-4c97-4a7a-a577-f078ff234b2a Co-authored-by: petesramek <2333452+petesramek@users.noreply.github.com>
1 parent fc751ae commit 9f4b278

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/PolylineAlgorithm/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ The library provides abstract base classes to build your own encoder and decoder
3838
```csharp
3939
using PolylineAlgorithm;
4040
using PolylineAlgorithm.Abstraction;
41+
using PolylineAlgorithm.Internal;
4142

4243
public sealed class MyPolylineEncoder : AbstractPolylineEncoder<(double Latitude, double Longitude), string> {
43-
protected override void Write((double Latitude, double Longitude) item, IPolylineWriter writer) {
44+
protected override void Write((double Latitude, double Longitude) item, ref PolylineWriter writer) {
4445
writer.Write(item.Latitude); // field 0
4546
writer.Write(item.Longitude); // field 1
4647
}
47-
protected override string CreatePolyline(ReadOnlyMemory<char> polyline) => polyline.ToString();
48+
protected override string CreatePolyline(ReadOnlySpan<char> polyline) => polyline.ToString();
4849
}
4950
```
5051

@@ -71,9 +72,10 @@ Console.WriteLine(encoded);
7172
```csharp
7273
using PolylineAlgorithm;
7374
using PolylineAlgorithm.Abstraction;
75+
using PolylineAlgorithm.Internal;
7476

7577
public sealed class MyPolylineDecoder : AbstractPolylineDecoder<string, (double Latitude, double Longitude)> {
76-
protected override (double Latitude, double Longitude) Read(IPolylineReader reader) =>
78+
protected override (double Latitude, double Longitude) Read(PolylineReader reader) =>
7779
(reader.Read(), reader.Read()); // field 0, field 1
7880
protected override ReadOnlyMemory<char> GetReadOnlyMemory(in string polyline) => polyline.AsMemory();
7981
}

0 commit comments

Comments
 (0)