From d7c74127eb989c7dc96a506555e65275989da09e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Thu, 12 Nov 2026 18:05:32 +0100 Subject: [PATCH] Name each reader and writer of the object layer by its portable format The object layer gives no method the role name In or Out: a reader or writer the object model calls by its role (ooName in or out) is emitted under the portable name of the format the catalog's typeEncodings says it reads or writes, .From static and As instance, or leaves the object layer when typeEncodings names it for no format, its function staying in the flat Meos layer. tools/objectgen.py reads both facts from the catalog in #portable_format and #take_portable_names, which mirror the routines of the same name in GoMEOS's tools/objectgen.py: tgeompoint_in is TGeomPoint.FromText, set_out Set.AsText, temporal_out Temporal.AsText and stbox_out STBox.AsEWKT. The method keeps its body, so the portable reader or writer that forwarded to it is not emitted beside it, and a portable name the class already declares with the same parameters would leave the method out as its duplicate. ToString calls AsText, and for Text, whose text_out serves no format, Meos.TextOut. Why. A binding reads and writes a type through From and As alone (rules 1 and 2 of the bindings in the I/O plan, MobilityDB #3353, row IO-B19), so no reader or writer is named by its role beside the portable one it duplicates. Each class carried both: FloatSpan.In beside FloatSpan.FromText, which called it, and Span.Out beside the AsText of every span. Witness. Against the catalog of MobilityDB master c5174b8af1 and MEOS-API master cf4d124e6f, 88 methods were named In or Out. 74 take their portable name: FromText for the 61 readers of the sets, spans, span sets, temporal types, boxes, CBuffer, NPoint, NSegment, PoseChain, H3Index, Quadbin, S2Cell, Jsonb, JsonPath and Numeric; AsText for the 11 writers set_out, span_out, spanset_out, temporal_out, tbox_out, h3index_out, quadbin_out, s2cell_out, jsonb_out, jsonpath_out and numeric_out; AsEWKT for stbox_out and tpcbox_out. 14 leave the object layer, typeEncodings naming them for no format: cbuffer_out, npoint_out, nsegment_out, pose_in, pose_out, posechain_out, trgeometry_out, raquet_in, raquet_out, geo_out, geom_in, geog_in, text_in and text_out. None is a duplicate: Jsonb.FromText(string) over jsonb_in stands beside Jsonb.FromText(Text, bool) over jsonb_from_text. The object layer goes from 5262 to 5158 methods over 155 classes, the 14 left out and 90 forwarding readers and writers, and two runs of the generator write the same tree. Against the libmeos of that master with every family, dotnet build passes with 0 warnings and dotnet test passes 106 of 106 with none skipped, 3 of them reading sets, spans, span sets, temporal values, boxes, Jsonb, JsonPath and Numeric with FromText and writing them back with AsText or AsEWKT; the test floor of the CI goes from 103 to 106. MEOS.NET has no active committer: this needs another committer of the ecosystem to review and merge it. --- .github/workflows/ci.yml | 2 +- ExampleApp/Program.cs | 6 +- MEOS.NET.Tests/ArrayArgumentTests.cs | 6 +- MEOS.NET.Tests/BorrowedStringTests.cs | 10 +-- MEOS.NET.Tests/ByteBufferTests.cs | 6 +- MEOS.NET.Tests/CatalogTypedefTests.cs | 10 +-- MEOS.NET.Tests/CatalogValueTypeTests.cs | 2 +- MEOS.NET.Tests/CountedArrayTests.cs | 18 ++-- MEOS.NET.Tests/ExtendedWkbTests.cs | 6 +- MEOS.NET.Tests/GeneratedObjectLayerTests.cs | 26 +++--- MEOS.NET.Tests/MultipleAnswerTests.cs | 6 +- MEOS.NET.Tests/OperatorTests.cs | 26 +++--- MEOS.NET.Tests/OutParameterTests.cs | 18 ++-- MEOS.NET.Tests/OutputPointerTests.cs | 8 +- MEOS.NET.Tests/ParallelArrayTests.cs | 2 +- MEOS.NET.Tests/PortableIoTests.cs | 51 +++++++++++ MEOS.NET.Tests/ScalarArrayTests.cs | 4 +- MEOS.NET.Tests/TextOutputTests.cs | 8 +- MEOS.NET.Tests/UntypedAndVoidTests.cs | 4 +- MEOS.NET.Tests/ValueArrayTests.cs | 6 +- MEOS.NET.Tests/ValueClassTests.cs | 6 +- MEOS.NET.Tests/ValueStructTests.cs | 8 +- MEOS.NET.Tests/WrappedOutParameterTests.cs | 4 +- MEOS.NET/Types/BigIntSet.g.cs | 8 +- MEOS.NET/Types/BigIntSpan.g.cs | 8 +- MEOS.NET/Types/BigIntSpanSet.g.cs | 6 -- MEOS.NET/Types/CBuffer.g.cs | 10 +-- MEOS.NET/Types/CBufferSet.g.cs | 5 +- MEOS.NET/Types/DateSet.g.cs | 8 +- MEOS.NET/Types/DateSpan.g.cs | 8 +- MEOS.NET/Types/DateSpanSet.g.cs | 6 -- MEOS.NET/Types/FloatSet.g.cs | 8 +- MEOS.NET/Types/FloatSpan.g.cs | 8 +- MEOS.NET/Types/FloatSpanSet.g.cs | 6 -- MEOS.NET/Types/Geo.g.cs | 3 - MEOS.NET/Types/GeogSet.g.cs | 5 +- MEOS.NET/Types/Geography.g.cs | 3 - MEOS.NET/Types/GeomSet.g.cs | 5 +- MEOS.NET/Types/Geometry.g.cs | 3 - MEOS.NET/Types/H3Index.g.cs | 12 +-- MEOS.NET/Types/H3IndexSet.g.cs | 7 +- MEOS.NET/Types/IntSet.g.cs | 8 +- MEOS.NET/Types/IntSpan.g.cs | 8 +- MEOS.NET/Types/IntSpanSet.g.cs | 6 -- MEOS.NET/Types/JsonPath.g.cs | 10 +-- MEOS.NET/Types/Jsonb.g.cs | 9 +- MEOS.NET/Types/JsonbSet.g.cs | 8 +- MEOS.NET/Types/NPoint.g.cs | 10 +-- MEOS.NET/Types/NPointSet.g.cs | 5 +- MEOS.NET/Types/NSegment.g.cs | 10 +-- MEOS.NET/Types/Numeric.g.cs | 6 +- MEOS.NET/Types/PCPatchSet.g.cs | 5 +- MEOS.NET/Types/PCPointSet.g.cs | 5 +- MEOS.NET/Types/Pose.g.cs | 6 -- MEOS.NET/Types/PoseChain.g.cs | 10 +-- MEOS.NET/Types/PoseChainSet.g.cs | 5 +- MEOS.NET/Types/PoseSet.g.cs | 5 +- MEOS.NET/Types/Quadbin.g.cs | 12 +-- MEOS.NET/Types/QuadbinSet.g.cs | 7 +- MEOS.NET/Types/RaQuet.g.cs | 6 -- MEOS.NET/Types/S2Cell.g.cs | 12 +-- MEOS.NET/Types/S2CellSet.g.cs | 7 +- MEOS.NET/Types/STBox.g.cs | 12 +-- MEOS.NET/Types/Set.g.cs | 6 +- MEOS.NET/Types/Span.g.cs | 8 +- MEOS.NET/Types/SpanSet.g.cs | 8 +- MEOS.NET/Types/SpatialSet.g.cs | 2 +- MEOS.NET/Types/TBigInt.g.cs | 8 +- MEOS.NET/Types/TBool.g.cs | 8 +- MEOS.NET/Types/TBox.g.cs | 12 +-- MEOS.NET/Types/TCBuffer.g.cs | 5 +- MEOS.NET/Types/TFloat.g.cs | 8 +- MEOS.NET/Types/TGeogPoint.g.cs | 5 +- MEOS.NET/Types/TGeography.g.cs | 5 +- MEOS.NET/Types/TGeomPoint.g.cs | 5 +- MEOS.NET/Types/TGeometry.g.cs | 5 +- MEOS.NET/Types/TH3Index.g.cs | 7 +- MEOS.NET/Types/TInt.g.cs | 8 +- MEOS.NET/Types/TJsonb.g.cs | 8 +- MEOS.NET/Types/TNPoint.g.cs | 5 +- MEOS.NET/Types/TPCBox.g.cs | 12 +-- MEOS.NET/Types/TPCPatch.g.cs | 7 +- MEOS.NET/Types/TPCPoint.g.cs | 7 +- MEOS.NET/Types/TPose.g.cs | 5 +- MEOS.NET/Types/TPoseChain.g.cs | 5 +- MEOS.NET/Types/TQuadbin.g.cs | 7 +- MEOS.NET/Types/TRGeometry.g.cs | 8 +- MEOS.NET/Types/TS2Cell.g.cs | 7 +- MEOS.NET/Types/TSpatial.g.cs | 2 +- MEOS.NET/Types/TText.g.cs | 8 +- MEOS.NET/Types/Temporal.g.cs | 6 +- MEOS.NET/Types/Text.g.cs | 8 +- MEOS.NET/Types/TextSet.g.cs | 8 +- MEOS.NET/Types/TsTzSet.g.cs | 10 +-- MEOS.NET/Types/TsTzSpan.g.cs | 8 +- MEOS.NET/Types/TsTzSpanSet.g.cs | 8 +- tools/objectgen.py | 95 +++++++++++++++++++-- 97 files changed, 341 insertions(+), 517 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f82891..03392ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,7 +70,7 @@ jobs: uses: MobilityDB/MEOS-API/.github/actions/check-test-outcome@master with: log: test.log - min-tests: "103" + min-tests: "106" - name: Smoke-test the FFI run: dotnet run --project ExampleApp/ExampleApp.csproj -c Release --no-build diff --git a/ExampleApp/Program.cs b/ExampleApp/Program.cs index f0ceb20..d525969 100644 --- a/ExampleApp/Program.cs +++ b/ExampleApp/Program.cs @@ -8,7 +8,7 @@ try { Console.WriteLine("Reading a temporal float instant from \"25.0@2024-12-06\""); - Temporal tfi = TFloat.In("25.0@2024-12-06")!; + Temporal tfi = TFloat.FromText("25.0@2024-12-06")!; Console.WriteLine($" class : {tfi.GetType().Name}"); Console.WriteLine($" text : {tfi}"); Console.WriteLine($" start timestamp : {tfi.StartTimestamptz():u}"); @@ -24,7 +24,7 @@ Console.WriteLine($" always <= 30.0? : {Meos.AlwaysLeTfloatFloat(sum.Ptr, 30.0) == 1}\n"); Console.WriteLine("Reading a float span set from \"{[8, 10], [11, 12]}\""); - SpanSet spanset = FloatSpanSet.In("{[8, 10], [11, 12]}")!; + SpanSet spanset = FloatSpanSet.FromText("{[8, 10], [11, 12]}")!; Console.WriteLine($" class : {spanset.GetType().Name}"); Console.WriteLine($" spans : {spanset.NumSpans()}"); foreach (Span? span in spanset.Spanarr()) @@ -36,7 +36,7 @@ Console.WriteLine($" width : {((FloatSpanSet)spanset).Width(false)}\n"); Console.WriteLine("Reading a temporal float instant from \"e25.0@2024-12-06\""); - TFloat.In("e25.0@2024-12-06"); + TFloat.FromText("e25.0@2024-12-06"); } catch (MEOSException e) { diff --git a/MEOS.NET.Tests/ArrayArgumentTests.cs b/MEOS.NET.Tests/ArrayArgumentTests.cs index c7fa52f..3fb685f 100644 --- a/MEOS.NET.Tests/ArrayArgumentTests.cs +++ b/MEOS.NET.Tests/ArrayArgumentTests.cs @@ -30,13 +30,13 @@ public void AJsonbIsQueriedWithAnArrayOfKeysWhoseLengthIsNotNamedCount() { // `jsonb_exists_array(jb, text **keys_elems, int keys_len, bool any)` // — the length is `keys_len`, and the catalog is what says so. - Jsonb jb = Jsonb.In("{\"a\": 1, \"b\": 2}")!; - Text[] keys = { Text.In("a")!, Text.In("z")! }; + Jsonb jb = Jsonb.FromText("{\"a\": 1, \"b\": 2}")!; + Text[] keys = { Text.FromCstring("a")!, Text.FromCstring("z")! }; Assert.IsTrue(jb.ExistsArray(keys, true)); Assert.IsFalse(jb.ExistsArray(keys, false)); - Text[] missing = { Text.In("y")!, Text.In("z")! }; + Text[] missing = { Text.FromCstring("y")!, Text.FromCstring("z")! }; Assert.IsFalse(jb.ExistsArray(missing, true)); } diff --git a/MEOS.NET.Tests/BorrowedStringTests.cs b/MEOS.NET.Tests/BorrowedStringTests.cs index 904a48c..5a064de 100644 --- a/MEOS.NET.Tests/BorrowedStringTests.cs +++ b/MEOS.NET.Tests/BorrowedStringTests.cs @@ -13,7 +13,7 @@ public class BorrowedStringTests : MeosTest [TestMethod] public void InterpolationOfALinearSequenceIsRead() { - Temporal temp = TFloat.In("[25.0@2024-12-06, 27.0@2024-12-07]")!; + Temporal temp = TFloat.FromText("[25.0@2024-12-06, 27.0@2024-12-07]")!; Assert.AreEqual("Linear", temp.Interp()); } @@ -21,7 +21,7 @@ public void InterpolationOfALinearSequenceIsRead() [TestMethod] public void InterpolationOfADiscreteSequenceIsRead() { - Temporal temp = TFloat.In("{25.0@2024-12-06, 27.0@2024-12-07}")!; + Temporal temp = TFloat.FromText("{25.0@2024-12-06, 27.0@2024-12-07}")!; Assert.AreEqual("Discrete", temp.Interp()); } @@ -29,8 +29,8 @@ public void InterpolationOfADiscreteSequenceIsRead() [TestMethod] public void TheSameBorrowedNameIsReadableTwice() { - Temporal first = TFloat.In("[25.0@2024-12-06, 27.0@2024-12-07]")!; - Temporal second = TFloat.In("[1.0@2024-12-06, 2.0@2024-12-07]")!; + Temporal first = TFloat.FromText("[25.0@2024-12-06, 27.0@2024-12-07]")!; + Temporal second = TFloat.FromText("[1.0@2024-12-06, 2.0@2024-12-07]")!; Assert.AreEqual(first.Interp(), second.Interp()); } @@ -38,7 +38,7 @@ public void TheSameBorrowedNameIsReadableTwice() [TestMethod] public void SubtypeOfASequenceIsRead() { - Temporal temp = TFloat.In("[25.0@2024-12-06, 27.0@2024-12-07]")!; + Temporal temp = TFloat.FromText("[25.0@2024-12-06, 27.0@2024-12-07]")!; Assert.AreEqual("Sequence", temp.Subtype()); } diff --git a/MEOS.NET.Tests/ByteBufferTests.cs b/MEOS.NET.Tests/ByteBufferTests.cs index a2f5132..8fbdada 100644 --- a/MEOS.NET.Tests/ByteBufferTests.cs +++ b/MEOS.NET.Tests/ByteBufferTests.cs @@ -12,7 +12,7 @@ public class ByteBufferTests : MeosTest [TestMethod] public void ASpanRoundTripsThroughItsOwnWKB() { - Span span = FloatSpan.In("[8, 10]")!; + Span span = FloatSpan.FromText("[8, 10]")!; byte[]? wkb = span.AsWKB(0); @@ -28,7 +28,7 @@ public void ASpanRoundTripsThroughItsOwnWKB() [TestMethod] public void ATemporalValueRoundTripsThroughItsOwnWKB() { - Temporal temp = TFloat.In("[25.5@2024-12-06, 27.5@2024-12-08]")!; + Temporal temp = TFloat.FromText("[25.5@2024-12-06, 27.5@2024-12-08]")!; byte[]? wkb = temp.AsWKB(0); @@ -43,7 +43,7 @@ public void ATemporalValueRoundTripsThroughItsOwnWKB() [TestMethod] public void TheHexFormNeedsNoLengthOfItsOwn() { - Span span = FloatSpan.In("[8, 10]")!; + Span span = FloatSpan.FromText("[8, 10]")!; string hex = span.AsHexWKB(0); diff --git a/MEOS.NET.Tests/CatalogTypedefTests.cs b/MEOS.NET.Tests/CatalogTypedefTests.cs index e453525..4104566 100644 --- a/MEOS.NET.Tests/CatalogTypedefTests.cs +++ b/MEOS.NET.Tests/CatalogTypedefTests.cs @@ -16,7 +16,7 @@ public class CatalogTypedefTests : MeosTest [TestMethod] public void ADatumCrossesAsAnUnsignedWord() { - Set set = BigIntSet.In("{-1, 7}")!; + Set set = BigIntSet.FromText("{-1, 7}")!; ulong[] values = Meos.SetValues(set.Ptr); @@ -26,18 +26,18 @@ public void ADatumCrossesAsAnUnsignedWord() [TestMethod] public void AnOidCrossesAsAnUnsignedInt() { - Text a = Text.In("abc")!; - Text b = Text.In("abd")!; + Text a = Text.FromCstring("abc")!; + Text b = Text.FromCstring("abd")!; // 100 is DEFAULT_COLLATION_OID. Assert.IsTrue(Meos.TextCmp(a.Ptr, b.Ptr, 100u) < 0); - Assert.AreEqual(a.Hash(100u), Text.In("abc")!.Hash(100u)); + Assert.AreEqual(a.Hash(100u), Text.FromCstring("abc")!.Hash(100u)); } [TestMethod] public void AStructFieldTypedThroughATypedefIsLaidOut() { - STBox box = STBox.In("STBOX X((1.0,2.0),(3.0,4.0))")!; + STBox box = STBox.FromText("STBOX X((1.0,2.0),(3.0,4.0))")!; GBOX gbox = box.ToGbox()!.Value; diff --git a/MEOS.NET.Tests/CatalogValueTypeTests.cs b/MEOS.NET.Tests/CatalogValueTypeTests.cs index 0b6db81..3d8374c 100644 --- a/MEOS.NET.Tests/CatalogValueTypeTests.cs +++ b/MEOS.NET.Tests/CatalogValueTypeTests.cs @@ -15,7 +15,7 @@ public class CatalogValueTypeTests : MeosTest [TestMethod] public void AnEnumArgumentIsTheTextMeosReadsThroughItsPair() { - TJsonb temp = (TJsonb)TJsonb.In( + TJsonb temp = (TJsonb)TJsonb.FromText( "[{\"a\": [1, 2]}@2024-12-06, {\"a\": [1, 2]}@2024-12-08]")!; // The handling of a SQL NULL is passed as the SQL functions take it, diff --git a/MEOS.NET.Tests/CountedArrayTests.cs b/MEOS.NET.Tests/CountedArrayTests.cs index f29aa42..fff7a62 100644 --- a/MEOS.NET.Tests/CountedArrayTests.cs +++ b/MEOS.NET.Tests/CountedArrayTests.cs @@ -15,9 +15,9 @@ public void ASequenceIsMadeOfItsInstants() { Temporal[] instants = [ - TFloat.In("25.0@2024-12-06")!, - TFloat.In("27.0@2024-12-07")!, - TFloat.In("30.0@2024-12-09")!, + TFloat.FromText("25.0@2024-12-06")!, + TFloat.FromText("27.0@2024-12-07")!, + TFloat.FromText("30.0@2024-12-09")!, ]; // The interpolation is passed as text, which interptype_from_string reads. @@ -36,8 +36,8 @@ public void ASpanSetIsMadeOfItsSpans() // as pointers to them. Span[] spans = [ - FloatSpan.In("[1.0, 2.0]")!, - FloatSpan.In("[3.0, 4.0]")!, + FloatSpan.FromText("[1.0, 2.0]")!, + FloatSpan.FromText("[3.0, 4.0]")!, ]; SpanSet set = SpanSet.Make(spans)!; @@ -53,8 +53,8 @@ public void ACbufferSetIsMadeOfItsCircularBuffers() // another. CBuffer[] values = [ - CBuffer.In("Cbuffer(Point(1 1),0.5)")!, - CBuffer.In("Cbuffer(Point(2 2),1.5)")!, + CBuffer.FromText("Cbuffer(Point(1 1),0.5)")!, + CBuffer.FromText("Cbuffer(Point(2 2),1.5)")!, ]; Set set = CBufferSet.Make(values)!; @@ -69,8 +69,8 @@ public void MergingAnArrayOfTemporalValuesJoinsThem() { Temporal[] parts = [ - TFloat.In("[25.0@2024-12-06, 27.0@2024-12-07]")!, - TFloat.In("[30.0@2024-12-09, 32.0@2024-12-10]")!, + TFloat.FromText("[25.0@2024-12-06, 27.0@2024-12-07]")!, + TFloat.FromText("[30.0@2024-12-09, 32.0@2024-12-10]")!, ]; Temporal merged = Temporal.MergeArray(parts)!; diff --git a/MEOS.NET.Tests/ExtendedWkbTests.cs b/MEOS.NET.Tests/ExtendedWkbTests.cs index 3c35418..7233ded 100644 --- a/MEOS.NET.Tests/ExtendedWkbTests.cs +++ b/MEOS.NET.Tests/ExtendedWkbTests.cs @@ -10,12 +10,12 @@ namespace MEOS.NET.Tests [TestClass] public class ExtendedWkbTests : MeosTest { - private const string Line = "SRID=4326;LINESTRING(1 1, 2 2, 3 4)"; + private const string Line = "LINESTRING(1 1, 2 2, 3 4)"; [TestMethod] public void TheBufferIsAsLongAsTheHexFormSays() { - Geo line = Geometry.In(Line, -1)!; + Geo line = Geo.FromText(Line, 4326)!; byte[]? ewkb = line.AsEWKB("ndr"); string hex = line.AsHexEWKB("ndr"); @@ -28,7 +28,7 @@ public void TheBufferIsAsLongAsTheHexFormSays() [TestMethod] public void AGeometryRoundTripsThroughItsOwnEWKB() { - Geo line = Geometry.In(Line, -1)!; + Geo line = Geo.FromText(Line, 4326)!; Geo? read = Geo.FromEWKB(line.AsEWKB("ndr")!, 4326); diff --git a/MEOS.NET.Tests/GeneratedObjectLayerTests.cs b/MEOS.NET.Tests/GeneratedObjectLayerTests.cs index 4b33cca..ea5ec33 100644 --- a/MEOS.NET.Tests/GeneratedObjectLayerTests.cs +++ b/MEOS.NET.Tests/GeneratedObjectLayerTests.cs @@ -19,7 +19,7 @@ public class GeneratedObjectLayerTests : MeosTest [TestMethod] public void InstantTextGivesTheConcreteInstantClass() { - Temporal? temp = TFloat.In(Instant); + Temporal? temp = TFloat.FromText(Instant); Assert.IsInstanceOfType(temp, typeof(TFloatInst)); } @@ -27,7 +27,7 @@ public void InstantTextGivesTheConcreteInstantClass() [TestMethod] public void SequenceTextGivesTheConcreteSequenceClass() { - Temporal? temp = TFloat.In(Sequence); + Temporal? temp = TFloat.FromText(Sequence); Assert.IsInstanceOfType(temp, typeof(TFloatSeq)); } @@ -35,7 +35,7 @@ public void SequenceTextGivesTheConcreteSequenceClass() [TestMethod] public void SequenceHoldsItsTwoInstants() { - Temporal temp = TFloat.In(Sequence)!; + Temporal temp = TFloat.FromText(Sequence)!; Assert.AreEqual(2, temp.NumInstants()); Assert.AreEqual("Linear", temp.Interp()); @@ -44,7 +44,7 @@ public void SequenceHoldsItsTwoInstants() [TestMethod] public void StartTimestamptzIsTheMomentTheTextNames() { - Temporal temp = TFloat.In(Sequence)!; + Temporal temp = TFloat.FromText(Sequence)!; Assert.AreEqual(new DateTime(2024, 12, 6, 0, 0, 0, DateTimeKind.Utc), temp.StartTimestamptz().ToUniversalTime()); @@ -53,7 +53,7 @@ public void StartTimestamptzIsTheMomentTheTextNames() [TestMethod] public void RestrictingToAnInstantGivesThatInstant() { - Temporal temp = TFloat.In(Sequence)!; + Temporal temp = TFloat.FromText(Sequence)!; DateTime start = temp.StartTimestamptz(); Temporal? at = temp.AtTimestamptz(start); @@ -65,7 +65,7 @@ public void RestrictingToAnInstantGivesThatInstant() [TestMethod] public void ValueSpanOfTheSequenceIsItsFloatExtent() { - TNumber temp = (TNumber)TFloat.In(Sequence)!; + TNumber temp = (TNumber)TFloat.FromText(Sequence)!; Span span = temp.ToSpan()!; @@ -77,7 +77,7 @@ public void ValueSpanOfTheSequenceIsItsFloatExtent() [TestMethod] public void SpanSetTextGivesTheConcreteFloatSpanSet() { - SpanSet? spanset = FloatSpanSet.In(SpanSetText); + SpanSet? spanset = FloatSpanSet.FromText(SpanSetText); Assert.IsInstanceOfType(spanset, typeof(FloatSpanSet)); Assert.AreEqual(2, spanset!.NumSpans()); @@ -86,7 +86,7 @@ public void SpanSetTextGivesTheConcreteFloatSpanSet() [TestMethod] public void EachSpanOfTheSetIsTheSpanTheTextNames() { - SpanSet spanset = FloatSpanSet.In(SpanSetText)!; + SpanSet spanset = FloatSpanSet.FromText(SpanSetText)!; Span?[] spans = spanset.Spanarr(); @@ -100,16 +100,16 @@ public void EachSpanOfTheSetIsTheSpanTheTextNames() [TestMethod] public void SpanTextIsWhatTheSpanHolds() { - SpanSet spanset = FloatSpanSet.In(SpanSetText)!; + SpanSet spanset = FloatSpanSet.FromText(SpanSetText)!; - Assert.AreEqual("[8, 10]", ((FloatSpan)spanset.StartSpan()!).Out(15)); - Assert.AreEqual("[11, 12]", ((FloatSpan)spanset.EndSpan()!).Out(15)); + Assert.AreEqual("[8, 10]", ((FloatSpan)spanset.StartSpan()!).AsText(15)); + Assert.AreEqual("[11, 12]", ((FloatSpan)spanset.EndSpan()!).AsText(15)); } [TestMethod] public void TimeDomainOfTheSequenceIsATstzSpanSet() { - Temporal temp = TFloat.In(Sequence)!; + Temporal temp = TFloat.FromText(Sequence)!; SpanSet time = temp.Time()!; @@ -132,7 +132,7 @@ public void MakingAnInstantFromAValueAndAMomentReadsBack() public void MalformedTextRaisesTheMeosError() { MEOSException raised = Assert.ThrowsException( - () => TFloat.In("e" + Instant)); + () => TFloat.FromText("e" + Instant)); StringAssert.Contains(raised.Message, "e25.0"); } diff --git a/MEOS.NET.Tests/MultipleAnswerTests.cs b/MEOS.NET.Tests/MultipleAnswerTests.cs index e882caf..8c5e280 100644 --- a/MEOS.NET.Tests/MultipleAnswerTests.cs +++ b/MEOS.NET.Tests/MultipleAnswerTests.cs @@ -18,7 +18,7 @@ public class MultipleAnswerTests : MeosTest [TestMethod] public void SplittingByTimeAnswersThePiecesAndTheirBins() { - Temporal trip = TFloat.In( + Temporal trip = TFloat.FromText( "[1@2024-12-06, 2@2024-12-07, 3@2024-12-08]")!; (Temporal?[] pieces, DateTime[] bins) = trip.TimeSplit( @@ -35,7 +35,7 @@ public void SplittingByTimeAnswersThePiecesAndTheirBins() [TestMethod] public void SplittingBySpaceAnswersThePiecesAndTheirBins() { - Temporal trip = TGeomPoint.In(Trip)!; + Temporal trip = TGeomPoint.FromText(Trip)!; IntPtr origin = Meos.GeomIn("POINT(0 0)", -1); (IntPtr[] fragments, IntPtr[] bins) = Meos.TgeoSpaceSplit( @@ -55,7 +55,7 @@ public void SplittingBySpaceAnswersThePiecesAndTheirBins() [TestMethod] public void EachAnswersTheKeysAndTheirValues() { - Jsonb jb = Jsonb.In("{\"a\": 1, \"b\": \"two\"}")!; + Jsonb jb = Jsonb.FromText("{\"a\": 1, \"b\": \"two\"}")!; (IntPtr[] keys, IntPtr[] values) = Meos.JsonbEach(jb.Ptr); diff --git a/MEOS.NET.Tests/OperatorTests.cs b/MEOS.NET.Tests/OperatorTests.cs index 470f447..0ac3a2a 100644 --- a/MEOS.NET.Tests/OperatorTests.cs +++ b/MEOS.NET.Tests/OperatorTests.cs @@ -14,7 +14,7 @@ public class OperatorTests : MeosTest { private const string Sequence = "[1.0@2024-12-06, 3.0@2024-12-07]"; - private static TFloat Rising() => (TFloat)TFloat.In(Sequence)!; + private static TFloat Rising() => (TFloat)TFloat.FromText(Sequence)!; [TestMethod] public void EverEqualToAScalarIsTheOverloadTakingThatScalar() @@ -37,9 +37,9 @@ public void AddingATemporalNumberIsTheOverloadTakingTheClass() [TestMethod] public void LeftOfABoxAndLeftOfATemporalNumberAreOverloadsOfOneName() { - TBox low = TBox.In("TBOXFLOAT X([1.0, 2.0])")!; - TBox high = TBox.In("TBOXFLOAT X([5.0, 6.0])")!; - TNumber temp = (TNumber)TFloat.In("[7.0@2024-12-06, 8.0@2024-12-07]")!; + TBox low = TBox.FromText("TBOXFLOAT X([1.0, 2.0])")!; + TBox high = TBox.FromText("TBOXFLOAT X([5.0, 6.0])")!; + TNumber temp = (TNumber)TFloat.FromText("[7.0@2024-12-06, 8.0@2024-12-07]")!; // left_tbox_tbox and left_tbox_tnumber. Assert.IsTrue(low.Left(high)); @@ -60,7 +60,7 @@ public void ReflectedSubtractionIsCalledOnTheRightOperand() public void ContainsOnAnIntSetTakesAnInt() { // contains_set_int, instantiated onto IntSet from the template Set. - IntSet set = (IntSet)IntSet.In("{1, 3, 5}")!; + IntSet set = (IntSet)IntSet.FromText("{1, 3, 5}")!; Assert.IsTrue(set.Contains(3)); Assert.IsFalse(set.Contains(4)); @@ -71,8 +71,8 @@ public void ContainsOnATemporalFloatTakesAFloatSpan() { // contains_tnumber_numspan, a member of TNumber whose SQL signatures // pair a tfloat with a floatspan, instantiated onto TFloat. - FloatSpan inside = (FloatSpan)FloatSpan.In("[1.5, 2.5]")!; - FloatSpan outside = (FloatSpan)FloatSpan.In("[5.0, 6.0]")!; + FloatSpan inside = (FloatSpan)FloatSpan.FromText("[1.5, 2.5]")!; + FloatSpan outside = (FloatSpan)FloatSpan.FromText("[5.0, 6.0]")!; Assert.IsTrue(Rising().Contains(inside)); Assert.IsFalse(Rising().Contains(outside)); @@ -85,10 +85,10 @@ public void ContainsOnATemporalNumberTakesANumberSpanAndATimeSpan() // span, and the time span still reaches contains_temporal_tstzspan, // the Temporal member TNumber declares again beside it. TNumber temp = Rising(); - Span values = FloatSpan.In("[1.5, 2.5]")!; - Span far = FloatSpan.In("[5.0, 6.0]")!; - TsTzSpan period = (TsTzSpan)TsTzSpan.In("[2024-12-06, 2024-12-07]")!; - TsTzSpan later = (TsTzSpan)TsTzSpan.In("[2025-01-01, 2025-01-02]")!; + Span values = FloatSpan.FromText("[1.5, 2.5]")!; + Span far = FloatSpan.FromText("[5.0, 6.0]")!; + TsTzSpan period = (TsTzSpan)TsTzSpan.FromText("[2024-12-06, 2024-12-07]")!; + TsTzSpan later = (TsTzSpan)TsTzSpan.FromText("[2025-01-01, 2025-01-02]")!; Assert.IsTrue(temp.Contains(values)); Assert.IsFalse(temp.Contains(far)); @@ -101,9 +101,9 @@ public void TemporalEqualityOfTwoH3IndexesTakesAnH3Index() { // teq_th3index_th3index, which SQL does not declare: its other // operand is the TH3Index its type token names. - TH3Index cells = (TH3Index)TH3Index.In( + TH3Index cells = (TH3Index)TH3Index.FromText( "[831c02fffffffff@2001-01-01, 831c00fffffffff@2001-01-02]")!; - TH3Index first = (TH3Index)TH3Index.In("831c02fffffffff@2001-01-01")!; + TH3Index first = (TH3Index)TH3Index.FromText("831c02fffffffff@2001-01-01")!; // The overload is TH3Index's own, not the inherited Teq(Temporal). Assert.AreEqual(typeof(TH3Index), diff --git a/MEOS.NET.Tests/OutParameterTests.cs b/MEOS.NET.Tests/OutParameterTests.cs index ead717c..a29f98b 100644 --- a/MEOS.NET.Tests/OutParameterTests.cs +++ b/MEOS.NET.Tests/OutParameterTests.cs @@ -12,7 +12,7 @@ public class OutParameterTests : MeosTest [TestMethod] public void ABoxAnswersTheBoundsItHas() { - TBox box = TBox.In("TBOXFLOAT XT([1.0, 3.0],[2024-12-06, 2024-12-08])")!; + TBox box = TBox.FromText("TBOXFLOAT XT([1.0, 3.0],[2024-12-06, 2024-12-08])")!; Assert.AreEqual(1.0, box.Xmin()); Assert.AreEqual(3.0, box.Xmax()); @@ -25,7 +25,7 @@ public void ATemporalH3IndexAnswersTheCellsItHolds() // th3index_value_n and th3index_value_at_timestamptz write an // H3Index, a uint64_t, through their result pointer, and the // method answers it as the H3Index it is. - TH3Index cells = (TH3Index)TH3Index.In( + TH3Index cells = (TH3Index)TH3Index.FromText( "[831c02fffffffff@2001-01-01, 831c00fffffffff@2001-01-02]")!; DateTime second = new DateTime(2001, 1, 2, 0, 0, 0, DateTimeKind.Utc); @@ -40,7 +40,7 @@ public void ATemporalH3IndexAnswersTheCellsItHolds() public void AnH3IndexSetAnswersTheCellsItHolds() { // h3indexset_value_n, over a set MEOS keeps in ascending order. - H3IndexSet set = (H3IndexSet)H3IndexSet.In("{831c02fffffffff, 831c00fffffffff}")!; + H3IndexSet set = (H3IndexSet)H3IndexSet.FromText("{831c02fffffffff, 831c00fffffffff}")!; Assert.AreEqual(new H3Index(0x831c00fffffffffUL), set.ValueN(1)); Assert.AreEqual(new H3Index(0x831c02fffffffffUL), set.ValueN(2)); @@ -49,7 +49,7 @@ public void AnH3IndexSetAnswersTheCellsItHolds() [TestMethod] public void ABoxAnswersNullForABoundItDoesNotHave() { - TBox box = TBox.In("TBOX T([2024-12-06, 2024-12-08])")!; + TBox box = TBox.FromText("TBOX T([2024-12-06, 2024-12-08])")!; Assert.IsNull(box.Xmin()); Assert.IsNull(box.Xmax()); @@ -59,7 +59,7 @@ public void ABoxAnswersNullForABoundItDoesNotHave() [TestMethod] public void ASetAnswersTheValueAtAnIndex() { - Set set = FloatSet.In("{1.5, 2.5, 3.5}")!; + Set set = FloatSet.FromText("{1.5, 2.5, 3.5}")!; Assert.AreEqual(1.5, ((FloatSet)set).ValueN(1)); Assert.AreEqual(3.5, ((FloatSet)set).ValueN(3)); @@ -69,7 +69,7 @@ public void ASetAnswersTheValueAtAnIndex() [TestMethod] public void ATemporalFloatAnswersItsValueAtAMoment() { - TFloat temp = (TFloat)TFloat.In("[25.0@2024-12-06, 27.0@2024-12-08]")!; + TFloat temp = (TFloat)TFloat.FromText("[25.0@2024-12-06, 27.0@2024-12-08]")!; Assert.AreEqual(25.0, temp.ValueAtTimestamptz(new DateTime(2024, 12, 6, 0, 0, 0, DateTimeKind.Utc), true)); @@ -81,12 +81,12 @@ public void ATemporalFloatAnswersItsValueAtAMoment() public void ANearestNeighbourStepAnswersTheEntryAndItsDistance() { RTree tree = RTree.CreateStbox()!; - STBox near = STBox.In("STBOX X((1,1),(2,2))")!; - STBox far = STBox.In("STBOX X((9,9),(10,10))")!; + STBox near = STBox.FromText("STBOX X((1,1),(2,2))")!; + STBox far = STBox.FromText("STBOX X((9,9),(10,10))")!; Assert.IsTrue(tree.Insert(near.Ptr, 1)); Assert.IsTrue(tree.Insert(far.Ptr, 2)); - STBox query = STBox.In("STBOX X((0,0),(0,0))")!; + STBox query = STBox.FromText("STBOX X((0,0),(0,0))")!; RTreeNNCursor walk = RTreeNNCursor.Open(tree, query.Ptr)!; try { diff --git a/MEOS.NET.Tests/OutputPointerTests.cs b/MEOS.NET.Tests/OutputPointerTests.cs index 7c3d29b..f5b2aa3 100644 --- a/MEOS.NET.Tests/OutputPointerTests.cs +++ b/MEOS.NET.Tests/OutputPointerTests.cs @@ -17,8 +17,8 @@ public class OutputPointerTests : MeosTest [TestMethod] public void AnMvtGeometryAnswersItsGeometryAndItsTimesInOrder() { - TPoint trip = (TPoint)TGeomPoint.In(Trip)!; - STBox bounds = STBox.In("STBOX XT(((0,0),(10,10)),[2000-01-01, 2000-01-04])")!; + TPoint trip = (TPoint)TGeomPoint.FromText(Trip)!; + STBox bounds = STBox.FromText("STBOX XT(((0,0),(10,10)),[2000-01-01, 2000-01-04])")!; (Geo? geom, long[] times)? answer = trip.AsMVTGeom(bounds, 4096, 0, true); @@ -41,8 +41,8 @@ public void AnMvtGeometryOutsideTheTileIsNull() { // tpoint_as_mvtgeom answers NULL for a trip with no representation // in the tile, and writes no times. - TPoint trip = (TPoint)TGeomPoint.In(Trip)!; - STBox bounds = STBox.In("STBOX XT(((100,100),(110,110)),[2000-01-01, 2000-01-04])")!; + TPoint trip = (TPoint)TGeomPoint.FromText(Trip)!; + STBox bounds = STBox.FromText("STBOX XT(((100,100),(110,110)),[2000-01-01, 2000-01-04])")!; Assert.IsNull(trip.AsMVTGeom(bounds, 4096, 0, true)); } diff --git a/MEOS.NET.Tests/ParallelArrayTests.cs b/MEOS.NET.Tests/ParallelArrayTests.cs index 8d8853a..58d3cb6 100644 --- a/MEOS.NET.Tests/ParallelArrayTests.cs +++ b/MEOS.NET.Tests/ParallelArrayTests.cs @@ -15,7 +15,7 @@ private static Text[] Texts(params string[] parts) Text[] texts = new Text[parts.Length]; for (int i = 0; i < parts.Length; i++) { - texts[i] = Text.In(parts[i])!; + texts[i] = Text.FromCstring(parts[i])!; } return texts; diff --git a/MEOS.NET.Tests/PortableIoTests.cs b/MEOS.NET.Tests/PortableIoTests.cs index a2a3e2a..bdbb39c 100644 --- a/MEOS.NET.Tests/PortableIoTests.cs +++ b/MEOS.NET.Tests/PortableIoTests.cs @@ -122,6 +122,57 @@ public void AJsonbSetAndATemporalPoseChainHaveTheirClasses() "PoseChain(Pose(POINT(1 1),0.5))@2024-12-06 00:00:00+00", chain.ToString()); } + [TestMethod] + public void ASetASpanASpanSetATemporalValueAndABoxRoundTripThroughTheirText() + { + string[] texts = + { + IntSet.FromText("{1, 3, 5}")!.AsText(15), + FloatSpan.FromText("[8, 10]")!.AsText(15), + FloatSpanSet.FromText("{[8, 10], [11, 12]}")!.AsText(15), + TFloat.FromText("[25.5@2024-12-06, 27.5@2024-12-07]")!.AsText(15), + TBox.FromText("TBOXFLOAT XT([1, 3),[2024-12-06, 2024-12-08])")!.AsText(15), + }; + + Assert.AreEqual("{1, 3, 5}", texts[0]); + Assert.AreEqual("[8, 10]", texts[1]); + Assert.AreEqual("{[8, 10], [11, 12]}", texts[2]); + Assert.AreEqual( + "[25.5@2024-12-06 00:00:00+00, 27.5@2024-12-07 00:00:00+00]", texts[3]); + Assert.AreEqual(texts[0], IntSet.FromText(texts[0])!.AsText(15)); + Assert.AreEqual(texts[1], FloatSpan.FromText(texts[1])!.AsText(15)); + Assert.AreEqual(texts[2], FloatSpanSet.FromText(texts[2])!.AsText(15)); + Assert.AreEqual(texts[3], TFloat.FromText(texts[3])!.AsText(15)); + Assert.AreEqual(texts[4], TBox.FromText(texts[4])!.AsText(15)); + } + + [TestMethod] + public void ABoxRoundTripsThroughItsExtendedText() + { + const string Box = "SRID=4326;STBOX X((1,1),(2,2))"; + + STBox box = STBox.FromText(Box)!; + + Assert.AreEqual(Box, box.AsEWKT(15)); + Assert.AreEqual(Box, STBox.FromEWKT(box.AsEWKT(15))!.AsEWKT(15)); + Assert.AreEqual("STBOX X((1,1),(2,2))", box.AsText(15)); + } + + [TestMethod] + public void AJsonbAJsonPathAndANumericRoundTripThroughTheirText() + { + Jsonb jb = Jsonb.FromText("{\"a\": 1, \"b\": \"two\"}")!; + JsonPath path = JsonPath.FromText("$.a")!; + Numeric num = Numeric.FromText("12.50", -1)!; + + Assert.AreEqual("{\"a\": 1, \"b\": \"two\"}", jb.AsText()); + Assert.AreEqual(jb.AsText(), Jsonb.FromText(jb.AsText())!.AsText()); + Assert.AreEqual("$.\"a\"", path.AsText()); + Assert.AreEqual(path.AsText(), JsonPath.FromText(path.AsText())!.AsText()); + Assert.AreEqual("12.50", num.AsText()); + Assert.AreEqual(num.AsText(), Numeric.FromText(num.AsText(), -1)!.AsText()); + } + [TestMethod] public void ASpanReadsItsTextUnderThePortableName() { diff --git a/MEOS.NET.Tests/ScalarArrayTests.cs b/MEOS.NET.Tests/ScalarArrayTests.cs index b80e2e0..e6010b6 100644 --- a/MEOS.NET.Tests/ScalarArrayTests.cs +++ b/MEOS.NET.Tests/ScalarArrayTests.cs @@ -13,7 +13,7 @@ public class ScalarArrayTests : MeosTest [TestMethod] public void ATemporalBooleanAnswersItsValuesAsBooleans() { - TBool temp = (TBool)TBool.In( + TBool temp = (TBool)TBool.FromText( "{true@2024-12-06, false@2024-12-07, true@2024-12-08}")!; bool[] values = temp.Values(); @@ -25,7 +25,7 @@ public void ATemporalBooleanAnswersItsValuesAsBooleans() [TestMethod] public void ATemporalFloatAnswersItsValuesAsDoubles() { - TFloat temp = (TFloat)TFloat.In( + TFloat temp = (TFloat)TFloat.FromText( "{1.5@2024-12-06, 2.5@2024-12-07}")!; double[] values = temp.Values(); diff --git a/MEOS.NET.Tests/TextOutputTests.cs b/MEOS.NET.Tests/TextOutputTests.cs index 10820b1..f83ebbc 100644 --- a/MEOS.NET.Tests/TextOutputTests.cs +++ b/MEOS.NET.Tests/TextOutputTests.cs @@ -13,7 +13,7 @@ public class TextOutputTests : MeosTest [TestMethod] public void ATemporalFloatPrintsAsMeosWritesIt() { - Temporal temp = TFloat.In("[25.5@2024-12-06, 27.5@2024-12-07]")!; + Temporal temp = TFloat.FromText("[25.5@2024-12-06, 27.5@2024-12-07]")!; Assert.AreEqual( "[25.5@2024-12-06 00:00:00+00, 27.5@2024-12-07 00:00:00+00]", @@ -23,7 +23,7 @@ public void ATemporalFloatPrintsAsMeosWritesIt() [TestMethod] public void ASpanPrintsAsMeosWritesIt() { - SpanSet spanset = FloatSpanSet.In("{[8, 10], [11, 12]}")!; + SpanSet spanset = FloatSpanSet.FromText("{[8, 10], [11, 12]}")!; Assert.AreEqual("[8, 10]", spanset.StartSpan()!.ToString()); Assert.AreEqual("{[8, 10], [11, 12]}", spanset.ToString()); @@ -32,7 +32,7 @@ public void ASpanPrintsAsMeosWritesIt() [TestMethod] public void ABoxPrintsAsMeosWritesIt() { - STBox box = STBox.In("STBOX X((1,1),(2,2))")!; + STBox box = STBox.FromText("STBOX X((1,1),(2,2))")!; Assert.AreEqual("STBOX X((1,1),(2,2))", box.ToString()); } @@ -41,7 +41,7 @@ public void ABoxPrintsAsMeosWritesIt() public void TheTextComesFromTheClassOfTheValue() { // Wrapping answers the concrete class, so the text is that class's. - Temporal instant = TFloat.In("25.5@2024-12-06")!; + Temporal instant = TFloat.FromText("25.5@2024-12-06")!; Assert.IsInstanceOfType(instant, typeof(TFloatInst)); Assert.AreEqual("25.5@2024-12-06 00:00:00+00", instant.ToString()); diff --git a/MEOS.NET.Tests/UntypedAndVoidTests.cs b/MEOS.NET.Tests/UntypedAndVoidTests.cs index c4ef9af..9b6f5f6 100644 --- a/MEOS.NET.Tests/UntypedAndVoidTests.cs +++ b/MEOS.NET.Tests/UntypedAndVoidTests.cs @@ -17,8 +17,8 @@ public void AnIndexTakesTheSpansItIsGivenAsPointers() Assert.IsNotNull(tree); - Span first = FloatSpan.In("[1, 3]")!; - Span second = FloatSpan.In("[8, 10]")!; + Span first = FloatSpan.FromText("[1, 3]")!; + Span second = FloatSpan.FromText("[8, 10]")!; Assert.IsTrue(tree!.Insert(first.Ptr, 1)); Assert.IsTrue(tree.Insert(second.Ptr, 2)); diff --git a/MEOS.NET.Tests/ValueArrayTests.cs b/MEOS.NET.Tests/ValueArrayTests.cs index 29c51ae..9f3b221 100644 --- a/MEOS.NET.Tests/ValueArrayTests.cs +++ b/MEOS.NET.Tests/ValueArrayTests.cs @@ -13,7 +13,7 @@ public class ValueArrayTests : MeosTest [TestMethod] public void TheSpansOfASpanSetComeBackAsSpans() { - SpanSet spanset = FloatSpanSet.In("{[8, 10], [11, 12]}")!; + SpanSet spanset = FloatSpanSet.FromText("{[8, 10], [11, 12]}")!; Span?[] spans = spanset.Spans(); @@ -26,7 +26,7 @@ public void TheSpansOfASpanSetComeBackAsSpans() [TestMethod] public void TheQuadrantsOfABoxComeBackAsBoxes() { - STBox box = STBox.In("STBOX X((0,0),(4,4))")!; + STBox box = STBox.FromText("STBOX X((0,0),(4,4))")!; STBox?[] quadrants = box.QuadSplit(); @@ -40,7 +40,7 @@ public void TheQuadrantsOfABoxComeBackAsBoxes() [TestMethod] public void TheInstantsOfASequenceComeBackAsTemporalValues() { - Temporal temp = TFloat.In("[25.0@2024-12-06, 27.0@2024-12-07]")!; + Temporal temp = TFloat.FromText("[25.0@2024-12-06, 27.0@2024-12-07]")!; Temporal?[] instants = temp.Instants(); diff --git a/MEOS.NET.Tests/ValueClassTests.cs b/MEOS.NET.Tests/ValueClassTests.cs index acc659d..0d50721 100644 --- a/MEOS.NET.Tests/ValueClassTests.cs +++ b/MEOS.NET.Tests/ValueClassTests.cs @@ -13,7 +13,7 @@ public class ValueClassTests : MeosTest [TestMethod] public void ATextAnswersTheTextMeosWritesItAs() { - Text text = Text.In("mobility")!; + Text text = Text.FromCstring("mobility")!; Assert.AreEqual("mobility", text.ToString()); Assert.AreEqual("MOBILITY", text.Upper()!.ToString()); @@ -33,7 +33,7 @@ public void AGeometryIsAGeoAndAnswersItsOwnMeasures() [TestMethod] public void ACbufferAnswersItsCentreAsAGeometry() { - CBuffer buffer = CBuffer.In("Cbuffer(Point(1 1),5)")!; + CBuffer buffer = CBuffer.FromText("Cbuffer(Point(1 1),5)")!; Assert.AreEqual(5.0, buffer.Radius()); @@ -46,7 +46,7 @@ public void ACbufferAnswersItsCentreAsAGeometry() [TestMethod] public void ATemporalGeoIsRestrictedByAGeometry() { - Temporal trip = TGeomPoint.In( + Temporal trip = TGeomPoint.FromText( "[POINT(0 0)@2024-12-06, POINT(4 4)@2024-12-08]")!; Geo half = Geo.FromText("POLYGON((0 0,0 2,2 2,2 0,0 0))", 0)!; diff --git a/MEOS.NET.Tests/ValueStructTests.cs b/MEOS.NET.Tests/ValueStructTests.cs index fbf61f3..dfa70c7 100644 --- a/MEOS.NET.Tests/ValueStructTests.cs +++ b/MEOS.NET.Tests/ValueStructTests.cs @@ -14,7 +14,7 @@ public class ValueStructTests : MeosTest [TestMethod] public void ASpanAnswersItsDurationAsAnInterval() { - TsTzSpan span = (TsTzSpan)TsTzSpan.In("[2024-12-06, 2024-12-08]")!; + TsTzSpan span = (TsTzSpan)TsTzSpan.FromText("[2024-12-06, 2024-12-08]")!; Interval? duration = span.Duration(); @@ -40,7 +40,7 @@ public void AnIntervalReadsAndWritesTheTextMeosDoes() [TestMethod] public void ASpanIsShiftedByAnIntervalItIsGivenAsAValue() { - TsTzSpan span = (TsTzSpan)TsTzSpan.In("[2024-12-06, 2024-12-08]")!; + TsTzSpan span = (TsTzSpan)TsTzSpan.FromText("[2024-12-06, 2024-12-08]")!; Span? shifted = span.ShiftScale(Interval.In("1 day")!.Value, Interval.In("4 days")!.Value); @@ -53,8 +53,8 @@ public void ASpanIsShiftedByAnIntervalItIsGivenAsAValue() [TestMethod] public void AFrechetPathComesBackAsTheMatchesThemselves() { - Temporal trip = TFloat.In("[1@2024-12-06, 3@2024-12-08]")!; - Temporal other = TFloat.In("[2@2024-12-06, 4@2024-12-08]")!; + Temporal trip = TFloat.FromText("[1@2024-12-06, 3@2024-12-08]")!; + Temporal other = TFloat.FromText("[2@2024-12-06, 4@2024-12-08]")!; Match[] path = trip.FrechetPath(other, true); diff --git a/MEOS.NET.Tests/WrappedOutParameterTests.cs b/MEOS.NET.Tests/WrappedOutParameterTests.cs index 530e625..2ff5ac2 100644 --- a/MEOS.NET.Tests/WrappedOutParameterTests.cs +++ b/MEOS.NET.Tests/WrappedOutParameterTests.cs @@ -13,7 +13,7 @@ public class WrappedOutParameterTests : MeosTest [TestMethod] public void AGeometrySetAnswersTheGeometryAtAnIndex() { - GeomSet set = (GeomSet)GeomSet.In("{POINT(1 1), POINT(2 2)}")!; + GeomSet set = (GeomSet)GeomSet.FromText("{POINT(1 1), POINT(2 2)}")!; Geo? first = set.ValueN(1); @@ -25,7 +25,7 @@ public void AGeometrySetAnswersTheGeometryAtAnIndex() [TestMethod] public void ATemporalTextAnswersItsValueAtAMoment() { - TText temp = (TText)TText.In("[AA@2024-12-06, AA@2024-12-08]")!; + TText temp = (TText)TText.FromText("[AA@2024-12-06, AA@2024-12-08]")!; Text? inside = temp.ValueAtTimestamptz( new DateTime(2024, 12, 7, 0, 0, 0, DateTimeKind.Utc), true); diff --git a/MEOS.NET/Types/BigIntSet.g.cs b/MEOS.NET/Types/BigIntSet.g.cs index 747d95e..4b69702 100644 --- a/MEOS.NET/Types/BigIntSet.g.cs +++ b/MEOS.NET/Types/BigIntSet.g.cs @@ -16,10 +16,7 @@ internal BigIntSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); - - public string AsText(int maxdd) - => this.Out(maxdd); + => this.AsText(15); public bool Contained(BigIntSet s2) => Meos.ContainedSetSet(this.Ptr, s2.Ptr); @@ -151,9 +148,6 @@ public long[] Values() => MEOSFactory.WrapSet(Meos.BigintToSet(i)); public static Set? FromText(string str) - => BigIntSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.BigintsetIn(str)); public static Set? Make(long[] values) diff --git a/MEOS.NET/Types/BigIntSpan.g.cs b/MEOS.NET/Types/BigIntSpan.g.cs index b10c2a8..73739c6 100644 --- a/MEOS.NET/Types/BigIntSpan.g.cs +++ b/MEOS.NET/Types/BigIntSpan.g.cs @@ -23,9 +23,6 @@ public bool Adjacent(BigIntSpan s2) public bool Adjacent(BigIntSpanSet ss) => Meos.AdjacentSpanSpanset(this.Ptr, ss.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Span?[] Bins(long vsize, long vorigin, bool border_inc) => MEOSFactory.WrapSpanArray(Meos.BigintspanBins(this.Ptr, vsize, vorigin, border_inc)); @@ -174,14 +171,11 @@ public long Width() => MEOSFactory.WrapSpan(Meos.BigintToSpan(i)); public static Span? FromText(string str) - => BigIntSpan.In(str); + => MEOSFactory.WrapSpan(Meos.BigintspanIn(str)); public static Span? GetBin(long value, long vsize, long vorigin) => MEOSFactory.WrapSpan(Meos.BigintspanGetBin(value, vsize, vorigin)); - public static Span? In(string str) - => MEOSFactory.WrapSpan(Meos.BigintspanIn(str)); - public static Span? Make(long lower, long upper, bool lower_inc, bool upper_inc) => MEOSFactory.WrapSpan(Meos.BigintspanMake(lower, upper, lower_inc, upper_inc)); diff --git a/MEOS.NET/Types/BigIntSpanSet.g.cs b/MEOS.NET/Types/BigIntSpanSet.g.cs index ae0dc16..439183e 100644 --- a/MEOS.NET/Types/BigIntSpanSet.g.cs +++ b/MEOS.NET/Types/BigIntSpanSet.g.cs @@ -23,9 +23,6 @@ public bool Adjacent(BigIntSpan s) public bool Adjacent(BigIntSpanSet ss2) => Meos.AdjacentSpansetSpanset(this.Ptr, ss2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Span?[] Bins(long vsize, long vorigin, bool border_inc) => MEOSFactory.WrapSpanArray(Meos.BigintspansetBins(this.Ptr, vsize, vorigin, border_inc)); @@ -165,9 +162,6 @@ public long Width(bool boundspan) => MEOSFactory.WrapSpanSet(Meos.BigintToSpanset(i)); public static SpanSet? FromText(string str) - => BigIntSpanSet.In(str); - - public static SpanSet? In(string str) => MEOSFactory.WrapSpanSet(Meos.BigintspansetIn(str)); } diff --git a/MEOS.NET/Types/CBuffer.g.cs b/MEOS.NET/Types/CBuffer.g.cs index e7dfc4d..82a121a 100644 --- a/MEOS.NET/Types/CBuffer.g.cs +++ b/MEOS.NET/Types/CBuffer.g.cs @@ -189,9 +189,6 @@ public double Nad(STBox box) public bool Ne(CBuffer cb2) => Meos.CbufferNe(this.Ptr, cb2.Ptr); - public string Out(int maxdd) - => Meos.CbufferOut(this.Ptr, maxdd); - public Geo? Point() => MEOSFactory.WrapGeo(Meos.CbufferPoint(this.Ptr)); @@ -265,7 +262,7 @@ public int Touches(CBuffer cb2) => CBuffer.FromWKB(wkb); public static CBuffer? FromEWKT(string str) - => CBuffer.In(str); + => CBuffer.FromText(str); public static CBuffer? FromHexEWKB(string hexwkb) => CBuffer.FromHexWKB(hexwkb); @@ -274,7 +271,7 @@ public int Touches(CBuffer cb2) => MEOSFactory.WrapCBuffer(Meos.CbufferFromHexwkb(hexwkb)); public static CBuffer? FromText(string str) - => CBuffer.In(str); + => MEOSFactory.WrapCBuffer(Meos.CbufferIn(str)); public static CBuffer? FromWKB(byte[] wkb) { @@ -289,9 +286,6 @@ public int Touches(CBuffer cb2) } } - public static CBuffer? In(string str) - => MEOSFactory.WrapCBuffer(Meos.CbufferIn(str)); - public static CBuffer? Make(Geo point, double radius) => MEOSFactory.WrapCBuffer(Meos.CbufferMake(point.Ptr, radius)); diff --git a/MEOS.NET/Types/CBufferSet.g.cs b/MEOS.NET/Types/CBufferSet.g.cs index 8dee147..274f97b 100644 --- a/MEOS.NET/Types/CBufferSet.g.cs +++ b/MEOS.NET/Types/CBufferSet.g.cs @@ -82,15 +82,12 @@ public bool Overlaps(CBufferSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => CBufferSet.In(str); + => CBufferSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => CBufferSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.CbuffersetIn(str)); public static Set? Make(CBuffer[] values) diff --git a/MEOS.NET/Types/DateSet.g.cs b/MEOS.NET/Types/DateSet.g.cs index 20c2857..59e204c 100644 --- a/MEOS.NET/Types/DateSet.g.cs +++ b/MEOS.NET/Types/DateSet.g.cs @@ -16,14 +16,11 @@ internal DateSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool After(DateOnly d) => Meos.AfterSetDate(this.Ptr, MEOSConvert.ToDateADT(d)); - public string AsText(int maxdd) - => this.Out(maxdd); - public bool Before(DateOnly d) => Meos.BeforeSetDate(this.Ptr, MEOSConvert.ToDateADT(d)); @@ -142,9 +139,6 @@ public int[] Values() => MEOSFactory.WrapSet(Meos.DateToSet(MEOSConvert.ToDateADT(d))); public static Set? FromText(string str) - => DateSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.DatesetIn(str)); public static Set? Make(int[] values) diff --git a/MEOS.NET/Types/DateSpan.g.cs b/MEOS.NET/Types/DateSpan.g.cs index 0d75c05..d90e3d5 100644 --- a/MEOS.NET/Types/DateSpan.g.cs +++ b/MEOS.NET/Types/DateSpan.g.cs @@ -26,9 +26,6 @@ public bool Adjacent(DateSpanSet ss) public bool After(DateOnly d) => Meos.AfterSpanDate(this.Ptr, MEOSConvert.ToDateADT(d)); - public string AsText(int maxdd) - => this.Out(maxdd); - public bool Before(DateOnly d) => Meos.BeforeSpanDate(this.Ptr, MEOSConvert.ToDateADT(d)); @@ -176,7 +173,7 @@ public DateOnly Upper() => MEOSFactory.WrapSpan(Meos.DateToSpan(MEOSConvert.ToDateADT(d))); public static Span? FromText(string str) - => DateSpan.In(str); + => MEOSFactory.WrapSpan(Meos.DatespanIn(str)); public static Span? GetBin(DateOnly d, Interval duration, DateOnly torigin) { @@ -192,9 +189,6 @@ public DateOnly Upper() } } - public static Span? In(string str) - => MEOSFactory.WrapSpan(Meos.DatespanIn(str)); - public static Span? Make(DateOnly lower, DateOnly upper, bool lower_inc, bool upper_inc) => MEOSFactory.WrapSpan(Meos.DatespanMake(MEOSConvert.ToDateADT(lower), MEOSConvert.ToDateADT(upper), lower_inc, upper_inc)); diff --git a/MEOS.NET/Types/DateSpanSet.g.cs b/MEOS.NET/Types/DateSpanSet.g.cs index 5ed7ee0..1edae86 100644 --- a/MEOS.NET/Types/DateSpanSet.g.cs +++ b/MEOS.NET/Types/DateSpanSet.g.cs @@ -26,9 +26,6 @@ public bool Adjacent(DateSpanSet ss2) public bool After(DateOnly d) => Meos.AfterSpansetDate(this.Ptr, MEOSConvert.ToDateADT(d)); - public string AsText(int maxdd) - => this.Out(maxdd); - public bool Before(DateOnly d) => Meos.BeforeSpansetDate(this.Ptr, MEOSConvert.ToDateADT(d)); @@ -209,9 +206,6 @@ public DateOnly Upper() => MEOSFactory.WrapSpanSet(Meos.DateToSpanset(MEOSConvert.ToDateADT(d))); public static SpanSet? FromText(string str) - => DateSpanSet.In(str); - - public static SpanSet? In(string str) => MEOSFactory.WrapSpanSet(Meos.DatespansetIn(str)); } diff --git a/MEOS.NET/Types/FloatSet.g.cs b/MEOS.NET/Types/FloatSet.g.cs index d662cfc..90701de 100644 --- a/MEOS.NET/Types/FloatSet.g.cs +++ b/MEOS.NET/Types/FloatSet.g.cs @@ -16,10 +16,7 @@ internal FloatSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); - - public string AsText(int maxdd) - => this.Out(maxdd); + => this.AsText(15); public Set? Ceil() => MEOSFactory.WrapSet(Meos.FloatsetCeil(this.Ptr)); @@ -154,9 +151,6 @@ public double[] Values() => MEOSFactory.WrapSet(Meos.FloatToSet(d)); public static Set? FromText(string str) - => FloatSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.FloatsetIn(str)); public static Set? Make(double[] values) diff --git a/MEOS.NET/Types/FloatSpan.g.cs b/MEOS.NET/Types/FloatSpan.g.cs index ee2fb8c..b72e194 100644 --- a/MEOS.NET/Types/FloatSpan.g.cs +++ b/MEOS.NET/Types/FloatSpan.g.cs @@ -23,9 +23,6 @@ public bool Adjacent(FloatSpan s2) public bool Adjacent(FloatSpanSet ss) => Meos.AdjacentSpanSpanset(this.Ptr, ss.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Span?[] Bins(double vsize, double vorigin, bool border_inc) => MEOSFactory.WrapSpanArray(Meos.FloatspanBins(this.Ptr, vsize, vorigin, border_inc)); @@ -189,14 +186,11 @@ public double Width() => MEOSFactory.WrapSpan(Meos.FloatToSpan(d)); public static Span? FromText(string str) - => FloatSpan.In(str); + => MEOSFactory.WrapSpan(Meos.FloatspanIn(str)); public static Span? GetBin(double value, double vsize, double vorigin) => MEOSFactory.WrapSpan(Meos.FloatspanGetBin(value, vsize, vorigin)); - public static Span? In(string str) - => MEOSFactory.WrapSpan(Meos.FloatspanIn(str)); - public static Span? Make(double lower, double upper, bool lower_inc, bool upper_inc) => MEOSFactory.WrapSpan(Meos.FloatspanMake(lower, upper, lower_inc, upper_inc)); diff --git a/MEOS.NET/Types/FloatSpanSet.g.cs b/MEOS.NET/Types/FloatSpanSet.g.cs index 089886f..033581a 100644 --- a/MEOS.NET/Types/FloatSpanSet.g.cs +++ b/MEOS.NET/Types/FloatSpanSet.g.cs @@ -23,9 +23,6 @@ public bool Adjacent(FloatSpan s) public bool Adjacent(FloatSpanSet ss2) => Meos.AdjacentSpansetSpanset(this.Ptr, ss2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Span?[] Bins(double vsize, double vorigin, bool border_inc) => MEOSFactory.WrapSpanArray(Meos.FloatspansetBins(this.Ptr, vsize, vorigin, border_inc)); @@ -183,9 +180,6 @@ public double Width(bool boundspan) => MEOSFactory.WrapSpanSet(Meos.FloatToSpanset(d)); public static SpanSet? FromText(string str) - => FloatSpanSet.In(str); - - public static SpanSet? In(string str) => MEOSFactory.WrapSpanSet(Meos.FloatspansetIn(str)); } diff --git a/MEOS.NET/Types/Geo.g.cs b/MEOS.NET/Types/Geo.g.cs index 03f1c8d..23019e2 100644 --- a/MEOS.NET/Types/Geo.g.cs +++ b/MEOS.NET/Types/Geo.g.cs @@ -150,9 +150,6 @@ public int NumGeos() public int NumPoints() => Meos.GeoNumPoints(this.Ptr); - public string Out() - => Meos.GeoOut(this.Ptr); - public double Perimeter(bool spheroid) => Meos.GeoPerimeter(this.Ptr, spheroid); diff --git a/MEOS.NET/Types/GeogSet.g.cs b/MEOS.NET/Types/GeogSet.g.cs index 2b4a077..11feabb 100644 --- a/MEOS.NET/Types/GeogSet.g.cs +++ b/MEOS.NET/Types/GeogSet.g.cs @@ -61,15 +61,12 @@ public bool Overlaps(GeogSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => GeogSet.In(str); + => GeogSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => GeogSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.GeogsetIn(str)); } diff --git a/MEOS.NET/Types/Geography.g.cs b/MEOS.NET/Types/Geography.g.cs index 2064e46..d67d862 100644 --- a/MEOS.NET/Types/Geography.g.cs +++ b/MEOS.NET/Types/Geography.g.cs @@ -192,8 +192,5 @@ public bool Intersects(Geo gs2, bool use_spheroid) public static Geo? FromMFJSON(string geojson) => Geo.FromGeoJSON(geojson); - public static Geo? In(string str, int typmod) - => MEOSFactory.WrapGeo(Meos.GeogIn(str, typmod)); - } } diff --git a/MEOS.NET/Types/GeomSet.g.cs b/MEOS.NET/Types/GeomSet.g.cs index bdc6ec7..7a5ca5f 100644 --- a/MEOS.NET/Types/GeomSet.g.cs +++ b/MEOS.NET/Types/GeomSet.g.cs @@ -61,15 +61,12 @@ public bool Overlaps(GeomSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => GeomSet.In(str); + => GeomSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => GeomSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.GeomsetIn(str)); } diff --git a/MEOS.NET/Types/Geometry.g.cs b/MEOS.NET/Types/Geometry.g.cs index b73bf52..5d54d9f 100644 --- a/MEOS.NET/Types/Geometry.g.cs +++ b/MEOS.NET/Types/Geometry.g.cs @@ -499,8 +499,5 @@ public bool Touches(Geo gs2) public static Geo? FromMFJSON(string geojson) => Geo.FromGeoJSON(geojson); - public static Geo? In(string str, int typmod) - => MEOSFactory.WrapGeo(Meos.GeomIn(str, typmod)); - } } diff --git a/MEOS.NET/Types/H3Index.g.cs b/MEOS.NET/Types/H3Index.g.cs index 8cffe15..b68fbf4 100644 --- a/MEOS.NET/Types/H3Index.g.cs +++ b/MEOS.NET/Types/H3Index.g.cs @@ -26,13 +26,13 @@ public readonly record struct H3Index /// The text MEOS writes this value as. public override string ToString() - => this.Out(); + => this.AsText(); public string AsHexWKB(byte variant) => Meos.H3indexAsHexwkb(this.value, variant); public string AsText() - => this.Out(); + => Meos.H3indexOut(this.value); public byte[]? AsWKB(byte variant) { @@ -100,9 +100,6 @@ public bool Lt(H3Index b) public bool Ne(H3Index b) => Meos.H3indexNe(this.value, b.value); - public string Out() - => Meos.H3indexOut(this.value); - public STBox? TimestamptzToStbox(DateTime t) => MEOSFactory.WrapSTBox(Meos.H3indexTimestamptzToStbox(this.value, MEOSConvert.ToTimestampTz(t))); @@ -119,7 +116,7 @@ public static H3Index FromHexWKB(string hexwkb) => new H3Index(Meos.H3indexFromHexwkb(hexwkb)); public static H3Index FromText(string str) - => H3Index.In(str); + => new H3Index(Meos.H3indexIn(str)); public static H3Index FromWKB(byte[] wkb) { @@ -134,8 +131,5 @@ public static H3Index FromWKB(byte[] wkb) } } - public static H3Index In(string str) - => new H3Index(Meos.H3indexIn(str)); - } } diff --git a/MEOS.NET/Types/H3IndexSet.g.cs b/MEOS.NET/Types/H3IndexSet.g.cs index b1890cc..c252155 100644 --- a/MEOS.NET/Types/H3IndexSet.g.cs +++ b/MEOS.NET/Types/H3IndexSet.g.cs @@ -16,7 +16,7 @@ internal H3IndexSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Contained(H3IndexSet s2) => Meos.ContainedSetSet(this.Ptr, s2.Ptr); @@ -100,15 +100,12 @@ public H3Index[] Values() => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => H3IndexSet.In(str); + => H3IndexSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => H3IndexSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.H3indexsetIn(str)); public static Set? Make(H3Index[] values) diff --git a/MEOS.NET/Types/IntSet.g.cs b/MEOS.NET/Types/IntSet.g.cs index d44011e..e496c8e 100644 --- a/MEOS.NET/Types/IntSet.g.cs +++ b/MEOS.NET/Types/IntSet.g.cs @@ -16,10 +16,7 @@ internal IntSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); - - public string AsText(int maxdd) - => this.Out(maxdd); + => this.AsText(15); public bool Contained(IntSet s2) => Meos.ContainedSetSet(this.Ptr, s2.Ptr); @@ -142,9 +139,6 @@ public int[] Values() => MEOSFactory.WrapSet(Meos.IntToSet(i)); public static Set? FromText(string str) - => IntSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.IntsetIn(str)); public static Set? Make(int[] values) diff --git a/MEOS.NET/Types/IntSpan.g.cs b/MEOS.NET/Types/IntSpan.g.cs index fcb7bd2..c1324bc 100644 --- a/MEOS.NET/Types/IntSpan.g.cs +++ b/MEOS.NET/Types/IntSpan.g.cs @@ -23,9 +23,6 @@ public bool Adjacent(IntSpan s2) public bool Adjacent(IntSpanSet ss) => Meos.AdjacentSpanSpanset(this.Ptr, ss.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Span?[] Bins(int vsize, int vorigin, bool border_inc) => MEOSFactory.WrapSpanArray(Meos.IntspanBins(this.Ptr, vsize, vorigin, border_inc)); @@ -174,14 +171,11 @@ public int Width() => MEOSFactory.WrapSpan(Meos.IntToSpan(i)); public static Span? FromText(string str) - => IntSpan.In(str); + => MEOSFactory.WrapSpan(Meos.IntspanIn(str)); public static Span? GetBin(int value, int vsize, int vorigin) => MEOSFactory.WrapSpan(Meos.IntspanGetBin(value, vsize, vorigin)); - public static Span? In(string str) - => MEOSFactory.WrapSpan(Meos.IntspanIn(str)); - public static Span? Make(int lower, int upper, bool lower_inc, bool upper_inc) => MEOSFactory.WrapSpan(Meos.IntspanMake(lower, upper, lower_inc, upper_inc)); diff --git a/MEOS.NET/Types/IntSpanSet.g.cs b/MEOS.NET/Types/IntSpanSet.g.cs index a2032d3..07750d1 100644 --- a/MEOS.NET/Types/IntSpanSet.g.cs +++ b/MEOS.NET/Types/IntSpanSet.g.cs @@ -23,9 +23,6 @@ public bool Adjacent(IntSpan s) public bool Adjacent(IntSpanSet ss2) => Meos.AdjacentSpansetSpanset(this.Ptr, ss2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Span?[] Bins(int vsize, int vorigin, bool border_inc) => MEOSFactory.WrapSpanArray(Meos.IntspansetBins(this.Ptr, vsize, vorigin, border_inc)); @@ -168,9 +165,6 @@ public int Width(bool boundspan) => MEOSFactory.WrapSpanSet(Meos.IntToSpanset(i)); public static SpanSet? FromText(string str) - => IntSpanSet.In(str); - - public static SpanSet? In(string str) => MEOSFactory.WrapSpanSet(Meos.IntspansetIn(str)); } diff --git a/MEOS.NET/Types/JsonPath.g.cs b/MEOS.NET/Types/JsonPath.g.cs index 2980854..4a7bb5c 100644 --- a/MEOS.NET/Types/JsonPath.g.cs +++ b/MEOS.NET/Types/JsonPath.g.cs @@ -16,10 +16,10 @@ internal JsonPath(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(); + => this.AsText(); public string AsText() - => this.Out(); + => Meos.JsonpathOut(this.Ptr); public JsonPath? Copy() => MEOSFactory.WrapJsonPath(Meos.JsonpathCopy(this.Ptr)); @@ -27,13 +27,7 @@ public string AsText() public int MemSize() => Meos.JsonpathMemSize(this.Ptr); - public string Out() - => Meos.JsonpathOut(this.Ptr); - public static JsonPath? FromText(string str) - => JsonPath.In(str); - - public static JsonPath? In(string str) => MEOSFactory.WrapJsonPath(Meos.JsonpathIn(str)); } diff --git a/MEOS.NET/Types/Jsonb.g.cs b/MEOS.NET/Types/Jsonb.g.cs index 9c1f204..145416a 100644 --- a/MEOS.NET/Types/Jsonb.g.cs +++ b/MEOS.NET/Types/Jsonb.g.cs @@ -16,7 +16,7 @@ internal Jsonb(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(); + => this.AsText(); public int AlwaysEq(TJsonb temp) => Meos.AlwaysEqJsonbTjsonb(this.Ptr, temp.Ptr); @@ -40,7 +40,7 @@ public int ArrayLength() => Meos.JsonbArrayLength(this.Ptr); public string AsText() - => this.Out(); + => Meos.JsonbOut(this.Ptr); public int Cmp(Jsonb jb2) => Meos.JsonbCmp(this.Ptr, jb2.Ptr); @@ -245,9 +245,6 @@ public bool Ne(Jsonb jb2) public Text?[] ObjectKeys() => MEOSFactory.WrapTextArray(Meos.JsonbObjectKeys(this.Ptr)); - public string Out() - => Meos.JsonbOut(this.Ptr); - public int PathExists(JsonPath jp, Jsonb vars, bool silent, bool tz) => Meos.JsonbPathExists(this.Ptr, jp.Ptr, vars.Ptr, silent, tz); @@ -361,7 +358,7 @@ public long ToInt64() public static Jsonb? FromText(Text txt, bool unique_keys) => MEOSFactory.WrapJsonb(Meos.JsonbFromText(txt.Ptr, unique_keys)); - public static Jsonb? In(string str) + public static Jsonb? FromText(string str) => MEOSFactory.WrapJsonb(Meos.JsonbIn(str)); public static Jsonb? Make(Text[] keys_vals) diff --git a/MEOS.NET/Types/JsonbSet.g.cs b/MEOS.NET/Types/JsonbSet.g.cs index fd02b8c..34174ce 100644 --- a/MEOS.NET/Types/JsonbSet.g.cs +++ b/MEOS.NET/Types/JsonbSet.g.cs @@ -16,7 +16,7 @@ internal JsonbSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public Set? ArrayElement(int idx, string null_handle) => MEOSFactory.WrapSet(Meos.JsonbsetArrayElement(this.Ptr, idx, Meos.NullhandletypeFromString(null_handle))); @@ -27,9 +27,6 @@ public override string ToString() public Set? ArrayLength() => MEOSFactory.WrapSet(Meos.JsonbsetArrayLength(this.Ptr)); - public string AsText(int maxdd) - => this.Out(maxdd); - public Set? Concat(Jsonb jb) => MEOSFactory.WrapSet(Meos.ConcatJsonbsetJsonb(this.Ptr, jb.Ptr)); @@ -294,9 +291,6 @@ public bool[] PathMatch(JsonPath jp, Jsonb vars, bool silent, bool tz) => MEOSFactory.WrapJsonbArray(Meos.JsonbsetValues(this.Ptr)); public static Set? FromText(string str) - => JsonbSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.JsonbsetIn(str)); public static Set? Make(Jsonb[] values) diff --git a/MEOS.NET/Types/NPoint.g.cs b/MEOS.NET/Types/NPoint.g.cs index 1786f6f..7c95d1b 100644 --- a/MEOS.NET/Types/NPoint.g.cs +++ b/MEOS.NET/Types/NPoint.g.cs @@ -126,9 +126,6 @@ public bool Lt(NPoint np2) public bool Ne(NPoint np2) => Meos.NpointNe(this.Ptr, np2.Ptr); - public string Out(int maxdd) - => Meos.NpointOut(this.Ptr, maxdd); - public double Position() => Meos.NpointPosition(this.Ptr); @@ -172,7 +169,7 @@ public bool SameRid(TNPoint temp) => NPoint.FromWKB(wkb); public static NPoint? FromEWKT(string str) - => NPoint.In(str); + => NPoint.FromText(str); public static NPoint? FromGeompoint(Geo gs, double tolerance) => MEOSFactory.WrapNPoint(Meos.GeompointToNpoint(gs.Ptr, tolerance)); @@ -184,7 +181,7 @@ public bool SameRid(TNPoint temp) => MEOSFactory.WrapNPoint(Meos.NpointFromHexwkb(hexwkb)); public static NPoint? FromText(string str) - => NPoint.In(str); + => MEOSFactory.WrapNPoint(Meos.NpointIn(str)); public static NPoint? FromWKB(byte[] wkb) { @@ -199,9 +196,6 @@ public bool SameRid(TNPoint temp) } } - public static NPoint? In(string str) - => MEOSFactory.WrapNPoint(Meos.NpointIn(str)); - public static NPoint? Make(long rid, double pos) => MEOSFactory.WrapNPoint(Meos.NpointMake(rid, pos)); diff --git a/MEOS.NET/Types/NPointSet.g.cs b/MEOS.NET/Types/NPointSet.g.cs index de7bcf7..5dadf99 100644 --- a/MEOS.NET/Types/NPointSet.g.cs +++ b/MEOS.NET/Types/NPointSet.g.cs @@ -85,15 +85,12 @@ public bool Overlaps(NPointSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => NPointSet.In(str); + => NPointSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => NPointSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.NpointsetIn(str)); public static Set? Make(NPoint[] values) diff --git a/MEOS.NET/Types/NSegment.g.cs b/MEOS.NET/Types/NSegment.g.cs index 0752040..f1ed450 100644 --- a/MEOS.NET/Types/NSegment.g.cs +++ b/MEOS.NET/Types/NSegment.g.cs @@ -99,9 +99,6 @@ public bool Lt(NSegment ns2) public bool Ne(NSegment ns2) => Meos.NsegmentNe(this.Ptr, ns2.Ptr); - public string Out(int maxdd) - => Meos.NsegmentOut(this.Ptr, maxdd); - public NSegment? Round(int maxdd) => MEOSFactory.WrapNSegment(Meos.NsegmentRound(this.Ptr, maxdd)); @@ -127,7 +124,7 @@ public double StartPosition() => NSegment.FromWKB(wkb); public static NSegment? FromEWKT(string str) - => NSegment.In(str); + => NSegment.FromText(str); public static NSegment? FromHexEWKB(string hexwkb) => NSegment.FromHexWKB(hexwkb); @@ -136,7 +133,7 @@ public double StartPosition() => MEOSFactory.WrapNSegment(Meos.NsegmentFromHexwkb(hexwkb)); public static NSegment? FromText(string str) - => NSegment.In(str); + => MEOSFactory.WrapNSegment(Meos.NsegmentIn(str)); public static NSegment? FromWKB(byte[] wkb) { @@ -151,9 +148,6 @@ public double StartPosition() } } - public static NSegment? In(string str) - => MEOSFactory.WrapNSegment(Meos.NsegmentIn(str)); - public static NSegment? Make(long rid, double pos1, double pos2) => MEOSFactory.WrapNSegment(Meos.NsegmentMake(rid, pos1, pos2)); diff --git a/MEOS.NET/Types/Numeric.g.cs b/MEOS.NET/Types/Numeric.g.cs index 52b5574..1e91680 100644 --- a/MEOS.NET/Types/Numeric.g.cs +++ b/MEOS.NET/Types/Numeric.g.cs @@ -16,12 +16,12 @@ internal Numeric(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(); + => this.AsText(); - public string Out() + public string AsText() => Meos.NumericOut(this.Ptr); - public static Numeric? In(string str, int typmod) + public static Numeric? FromText(string str, int typmod) => MEOSFactory.WrapNumeric(Meos.NumericIn(str, typmod)); } diff --git a/MEOS.NET/Types/PCPatchSet.g.cs b/MEOS.NET/Types/PCPatchSet.g.cs index 2fd752b..08145e1 100644 --- a/MEOS.NET/Types/PCPatchSet.g.cs +++ b/MEOS.NET/Types/PCPatchSet.g.cs @@ -79,15 +79,12 @@ public bool Overlaps(PCPatchSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => PCPatchSet.In(str); + => PCPatchSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => PCPatchSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.PcpatchsetIn(str)); public static Set? Make(PCPatch[] values) diff --git a/MEOS.NET/Types/PCPointSet.g.cs b/MEOS.NET/Types/PCPointSet.g.cs index 55b219a..9233a02 100644 --- a/MEOS.NET/Types/PCPointSet.g.cs +++ b/MEOS.NET/Types/PCPointSet.g.cs @@ -79,15 +79,12 @@ public bool Overlaps(PCPointSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => PCPointSet.In(str); + => PCPointSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => PCPointSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.PcpointsetIn(str)); public static Set? Make(PCPoint[] values) diff --git a/MEOS.NET/Types/Pose.g.cs b/MEOS.NET/Types/Pose.g.cs index 0e2e9c9..def305f 100644 --- a/MEOS.NET/Types/Pose.g.cs +++ b/MEOS.NET/Types/Pose.g.cs @@ -162,9 +162,6 @@ public bool Ne(Pose pose2) public Pose? Normalize() => MEOSFactory.WrapPose(Meos.PoseNormalize(this.Ptr)); - public string Out(int maxdd) - => Meos.PoseOut(this.Ptr, maxdd); - public double Pitch() => Meos.PosePitch(this.Ptr); @@ -256,9 +253,6 @@ public double[] Ypr() } } - public static Pose? In(string str) - => MEOSFactory.WrapPose(Meos.PoseIn(str)); - public static Pose? Make2d(double x, double y, double theta, bool geodetic, int srid) => MEOSFactory.WrapPose(Meos.PoseMake2d(x, y, theta, geodetic, srid)); diff --git a/MEOS.NET/Types/PoseChain.g.cs b/MEOS.NET/Types/PoseChain.g.cs index 11f3d80..66773be 100644 --- a/MEOS.NET/Types/PoseChain.g.cs +++ b/MEOS.NET/Types/PoseChain.g.cs @@ -150,9 +150,6 @@ public bool Ne(PoseChain pc2) public int NumPoses() => Meos.PosechainNumPoses(this.Ptr); - public string Out(int maxdd) - => Meos.PosechainOut(this.Ptr, maxdd); - public Pose? PoseN(int n) => MEOSFactory.WrapPose(Meos.PosechainPoseN(this.Ptr, n)); @@ -214,7 +211,7 @@ public int SRID() => PoseChain.FromWKB(wkb); public static PoseChain? FromEWKT(string str) - => PoseChain.In(str); + => PoseChain.FromText(str); public static PoseChain? FromHexEWKB(string hexwkb) => PoseChain.FromHexWKB(hexwkb); @@ -223,7 +220,7 @@ public int SRID() => MEOSFactory.WrapPoseChain(Meos.PosechainFromHexwkb(hexwkb)); public static PoseChain? FromText(string str) - => PoseChain.In(str); + => MEOSFactory.WrapPoseChain(Meos.PosechainIn(str)); public static PoseChain? FromWKB(byte[] wkb) { @@ -238,9 +235,6 @@ public int SRID() } } - public static PoseChain? In(string str) - => MEOSFactory.WrapPoseChain(Meos.PosechainIn(str)); - public static PoseChain? Make(Pose[] poses) { IntPtr[] _posesValues = new IntPtr[poses.Length]; diff --git a/MEOS.NET/Types/PoseChainSet.g.cs b/MEOS.NET/Types/PoseChainSet.g.cs index 7f7fa03..850ee4a 100644 --- a/MEOS.NET/Types/PoseChainSet.g.cs +++ b/MEOS.NET/Types/PoseChainSet.g.cs @@ -82,15 +82,12 @@ public bool Overlaps(PoseChainSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => PoseChainSet.In(str); + => PoseChainSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => PoseChainSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.PosechainsetIn(str)); public static Set? Make(PoseChain[] values) diff --git a/MEOS.NET/Types/PoseSet.g.cs b/MEOS.NET/Types/PoseSet.g.cs index 26610f1..70da3db 100644 --- a/MEOS.NET/Types/PoseSet.g.cs +++ b/MEOS.NET/Types/PoseSet.g.cs @@ -82,15 +82,12 @@ public bool Overlaps(PoseSet s2) => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => PoseSet.In(str); + => PoseSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => PoseSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.PosesetIn(str)); public static Set? Make(Pose[] values) diff --git a/MEOS.NET/Types/Quadbin.g.cs b/MEOS.NET/Types/Quadbin.g.cs index 0850c7e..1eef83d 100644 --- a/MEOS.NET/Types/Quadbin.g.cs +++ b/MEOS.NET/Types/Quadbin.g.cs @@ -26,13 +26,13 @@ public readonly record struct Quadbin /// The text MEOS writes this value as. public override string ToString() - => this.Out(); + => this.AsText(); public string AsHexWKB(byte variant) => Meos.QuadbinAsHexwkb(this.value, variant); public string AsText() - => this.Out(); + => Meos.QuadbinOut(this.value); public byte[]? AsWKB(byte variant) { @@ -130,9 +130,6 @@ public bool Lt(Quadbin b) public bool Ne(Quadbin b) => Meos.QuadbinNe(this.value, b.value); - public string Out() - => Meos.QuadbinOut(this.value); - public STBox? TimestamptzToStbox(DateTime t) => MEOSFactory.WrapSTBox(Meos.QuadbinTimestamptzToStbox(this.value, MEOSConvert.ToTimestampTz(t))); @@ -149,7 +146,7 @@ public static Quadbin FromHexWKB(string hexwkb) => new Quadbin(Meos.QuadbinFromHexwkb(hexwkb)); public static Quadbin FromText(string str) - => Quadbin.In(str); + => new Quadbin(Meos.QuadbinIn(str)); public static Quadbin FromWKB(byte[] wkb) { @@ -164,9 +161,6 @@ public static Quadbin FromWKB(byte[] wkb) } } - public static Quadbin In(string str) - => new Quadbin(Meos.QuadbinIn(str)); - public static Quadbin PointToCell(double longitude, double latitude, uint resolution) => new Quadbin(Meos.QuadbinPointToCell(longitude, latitude, resolution)); diff --git a/MEOS.NET/Types/QuadbinSet.g.cs b/MEOS.NET/Types/QuadbinSet.g.cs index 3a4db0d..f86ee31 100644 --- a/MEOS.NET/Types/QuadbinSet.g.cs +++ b/MEOS.NET/Types/QuadbinSet.g.cs @@ -16,7 +16,7 @@ internal QuadbinSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public Set? CompactCells() => MEOSFactory.WrapSet(Meos.QuadbinsetCompactCells(this.Ptr)); @@ -106,15 +106,12 @@ public Quadbin[] Values() => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => QuadbinSet.In(str); + => QuadbinSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => QuadbinSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.QuadbinsetIn(str)); public static Set? Make(Quadbin[] values) diff --git a/MEOS.NET/Types/RaQuet.g.cs b/MEOS.NET/Types/RaQuet.g.cs index 5298d69..faa5332 100644 --- a/MEOS.NET/Types/RaQuet.g.cs +++ b/MEOS.NET/Types/RaQuet.g.cs @@ -98,9 +98,6 @@ public int MemSize() public bool Ne(RaQuet rq2) => Meos.RaquetNe(this.Ptr, rq2.Ptr); - public string Out() - => Meos.RaquetOut(this.Ptr); - public byte[]? Pixels() { IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); @@ -147,9 +144,6 @@ public int Width() } } - public static RaQuet? In(string str) - => MEOSFactory.WrapRaQuet(Meos.RaquetIn(str)); - public static RaQuet? Make(Quadbin quadbin, int width, int height, string pixtype, double nodata, bool has_nodata, byte[] pixels) { GCHandle _pixels = GCHandle.Alloc(pixels, GCHandleType.Pinned); diff --git a/MEOS.NET/Types/S2Cell.g.cs b/MEOS.NET/Types/S2Cell.g.cs index 98127af..bc192ff 100644 --- a/MEOS.NET/Types/S2Cell.g.cs +++ b/MEOS.NET/Types/S2Cell.g.cs @@ -26,13 +26,13 @@ public readonly record struct S2Cell /// The text MEOS writes this value as. public override string ToString() - => this.Out(); + => this.AsText(); public string AsHexWKB(byte variant) => Meos.S2cellAsHexwkb(this.value, variant); public string AsText() - => this.Out(); + => Meos.S2cellOut(this.value); public byte[]? AsWKB(byte variant) { @@ -133,9 +133,6 @@ public bool Lt(S2Cell b) public bool Ne(S2Cell b) => Meos.S2cellNe(this.value, b.value); - public string Out() - => Meos.S2cellOut(this.value); - public S2Cell RangeMax() => new S2Cell(Meos.S2cellRangeMax(this.value)); @@ -158,7 +155,7 @@ public static S2Cell FromHexWKB(string hexwkb) => new S2Cell(Meos.S2cellFromHexwkb(hexwkb)); public static S2Cell FromText(string str) - => S2Cell.In(str); + => new S2Cell(Meos.S2cellIn(str)); public static S2Cell FromWKB(byte[] wkb) { @@ -173,9 +170,6 @@ public static S2Cell FromWKB(byte[] wkb) } } - public static S2Cell In(string str) - => new S2Cell(Meos.S2cellIn(str)); - public static S2Cell PointToCell(double longitude, double latitude, uint level) => new S2Cell(Meos.S2cellPointToCell(longitude, latitude, level)); diff --git a/MEOS.NET/Types/S2CellSet.g.cs b/MEOS.NET/Types/S2CellSet.g.cs index 602864e..9580927 100644 --- a/MEOS.NET/Types/S2CellSet.g.cs +++ b/MEOS.NET/Types/S2CellSet.g.cs @@ -16,7 +16,7 @@ internal S2CellSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public Set? CompactCells() => MEOSFactory.WrapSet(Meos.S2cellsetCompactCells(this.Ptr)); @@ -103,15 +103,12 @@ public S2Cell[] Values() => Set.FromWKB(wkb); public static Set? FromEWKT(string str) - => S2CellSet.In(str); + => S2CellSet.FromText(str); public static Set? FromHexEWKB(string hexwkb) => Set.FromHexWKB(hexwkb); public static Set? FromText(string str) - => S2CellSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.S2cellsetIn(str)); public static Set? Make(S2Cell[] values) diff --git a/MEOS.NET/Types/STBox.g.cs b/MEOS.NET/Types/STBox.g.cs index 688aa94..82c002a 100644 --- a/MEOS.NET/Types/STBox.g.cs +++ b/MEOS.NET/Types/STBox.g.cs @@ -190,7 +190,7 @@ public double Area(bool spheroid) } public string AsEWKT(int maxdd) - => this.Out(maxdd); + => Meos.StboxOut(this.Ptr, maxdd); public string AsHexEWKB(byte variant) => Meos.StboxAsHexewkb(this.Ptr, variant); @@ -569,9 +569,6 @@ public double Nad(Geometry gs, bool spheroid) public bool Ne(STBox box2) => Meos.StboxNe(this.Ptr, box2.Ptr); - public string Out(int maxdd) - => Meos.StboxOut(this.Ptr, maxdd); - public bool Overabove(STBox box2) => Meos.OveraboveStboxStbox(this.Ptr, box2.Ptr); @@ -1305,7 +1302,7 @@ public double Volume() => STBox.FromWKB(wkb); public static STBox? FromEWKT(string str) - => STBox.In(str); + => STBox.FromText(str); public static STBox? FromGbox(GBOX box) { @@ -1328,7 +1325,7 @@ public double Volume() => MEOSFactory.WrapSTBox(Meos.StboxFromHexwkb(hexwkb)); public static STBox? FromText(string str) - => STBox.In(str); + => MEOSFactory.WrapSTBox(Meos.StboxIn(str)); public static STBox? FromTimestamptz(DateTime t) => MEOSFactory.WrapSTBox(Meos.TimestamptzToStbox(MEOSConvert.ToTimestampTz(t))); @@ -1377,9 +1374,6 @@ public double Volume() } } - public static STBox? In(string str) - => MEOSFactory.WrapSTBox(Meos.StboxIn(str)); - public static STBox? Make(bool hasx, bool hasz, bool geodetic, int srid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, Span s) => MEOSFactory.WrapSTBox(Meos.StboxMake(hasx, hasz, geodetic, srid, xmin, xmax, ymin, ymax, zmin, zmax, s.Ptr)); diff --git a/MEOS.NET/Types/Set.g.cs b/MEOS.NET/Types/Set.g.cs index 90fae03..a6a1f15 100644 --- a/MEOS.NET/Types/Set.g.cs +++ b/MEOS.NET/Types/Set.g.cs @@ -17,6 +17,9 @@ internal Set(IntPtr ptr) : base(ptr) { } public string AsHexWKB(byte variant) => Meos.SetAsHexwkb(this.Ptr, variant); + public string AsText(int maxdd) + => Meos.SetOut(this.Ptr, maxdd); + public byte[]? AsWKB(byte variant) { IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); @@ -89,9 +92,6 @@ public bool Ne(Set s2) public int NumValues() => Meos.SetNumValues(this.Ptr); - public string Out(int maxdd) - => Meos.SetOut(this.Ptr, maxdd); - public bool Overlaps(Set s2) => Meos.OverlapsSetSet(this.Ptr, s2.Ptr); diff --git a/MEOS.NET/Types/Span.g.cs b/MEOS.NET/Types/Span.g.cs index 296e7b0..32a35b8 100644 --- a/MEOS.NET/Types/Span.g.cs +++ b/MEOS.NET/Types/Span.g.cs @@ -16,7 +16,7 @@ internal Span(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Adjacent(Span s2) => Meos.AdjacentSpanSpan(this.Ptr, s2.Ptr); @@ -27,6 +27,9 @@ public bool Adjacent(SpanSet ss) public string AsHexWKB(byte variant) => Meos.SpanAsHexwkb(this.Ptr, variant); + public string AsText(int maxdd) + => Meos.SpanOut(this.Ptr, maxdd); + public byte[]? AsWKB(byte variant) { IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); @@ -111,9 +114,6 @@ public bool Lt(Span s2) public bool Ne(Span s2) => Meos.SpanNe(this.Ptr, s2.Ptr); - public string Out(int maxdd) - => Meos.SpanOut(this.Ptr, maxdd); - public bool Overlaps(Span s2) => Meos.OverlapsSpanSpan(this.Ptr, s2.Ptr); diff --git a/MEOS.NET/Types/SpanSet.g.cs b/MEOS.NET/Types/SpanSet.g.cs index 430a1ad..2556e65 100644 --- a/MEOS.NET/Types/SpanSet.g.cs +++ b/MEOS.NET/Types/SpanSet.g.cs @@ -16,7 +16,7 @@ internal SpanSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Adjacent(Span s) => Meos.AdjacentSpansetSpan(this.Ptr, s.Ptr); @@ -27,6 +27,9 @@ public bool Adjacent(SpanSet ss2) public string AsHexWKB(byte variant) => Meos.SpansetAsHexwkb(this.Ptr, variant); + public string AsText(int maxdd) + => Meos.SpansetOut(this.Ptr, maxdd); + public byte[]? AsWKB(byte variant) { IntPtr _size_out = Marshal.AllocHGlobal(sizeof(long)); @@ -120,9 +123,6 @@ public bool Ne(SpanSet ss2) public int NumSpans() => Meos.SpansetNumSpans(this.Ptr); - public string Out(int maxdd) - => Meos.SpansetOut(this.Ptr, maxdd); - public bool Overlaps(Span s) => Meos.OverlapsSpansetSpan(this.Ptr, s.Ptr); diff --git a/MEOS.NET/Types/SpatialSet.g.cs b/MEOS.NET/Types/SpatialSet.g.cs index 189bb32..5ff09fa 100644 --- a/MEOS.NET/Types/SpatialSet.g.cs +++ b/MEOS.NET/Types/SpatialSet.g.cs @@ -41,7 +41,7 @@ public string AsEWKT(int maxdd) public string AsHexEWKB(byte variant) => Meos.SpatialsetAsHexewkb(this.Ptr, variant); - public string AsText(int maxdd) + public new string AsText(int maxdd) => Meos.SpatialsetAsText(this.Ptr, maxdd); public int SRID() diff --git a/MEOS.NET/Types/TBigInt.g.cs b/MEOS.NET/Types/TBigInt.g.cs index 9e0fb32..3ff7427 100644 --- a/MEOS.NET/Types/TBigInt.g.cs +++ b/MEOS.NET/Types/TBigInt.g.cs @@ -16,7 +16,7 @@ internal TBigInt(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public Temporal? Add(long i) => MEOSFactory.WrapTemporal(Meos.AddTbigintBigint(this.Ptr, i)); @@ -72,9 +72,6 @@ public int AlwaysNe(TBigInt temp2) public int AlwaysOverlaps(TBigInt temp2) => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Temporal? AtValue(long i) => MEOSFactory.WrapTemporal(Meos.TbigintAtValue(this.Ptr, i)); @@ -461,9 +458,6 @@ public long[] Values() => MEOSFactory.WrapTemporal(Meos.TbigintFromMfjson(str)); public static Temporal? FromText(string str) - => TBigInt.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TbigintIn(str)); } diff --git a/MEOS.NET/Types/TBool.g.cs b/MEOS.NET/Types/TBool.g.cs index f6442bc..d68b6c5 100644 --- a/MEOS.NET/Types/TBool.g.cs +++ b/MEOS.NET/Types/TBool.g.cs @@ -16,7 +16,7 @@ internal TBool(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Adjacent(TBool temp2) => Meos.AdjacentTemporalTemporal(this.Ptr, temp2.Ptr); @@ -39,9 +39,6 @@ public int AlwaysNe(TBool temp2) public int AlwaysOverlaps(TBool temp2) => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Temporal? AtValue(bool b) => MEOSFactory.WrapTemporal(Meos.TboolAtValue(this.Ptr, b)); @@ -203,9 +200,6 @@ public bool[] Values() => MEOSFactory.WrapTemporal(Meos.TboolFromMfjson(str)); public static Temporal? FromText(string str) - => TBool.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TboolIn(str)); } diff --git a/MEOS.NET/Types/TBox.g.cs b/MEOS.NET/Types/TBox.g.cs index f9045ba..e1938d9 100644 --- a/MEOS.NET/Types/TBox.g.cs +++ b/MEOS.NET/Types/TBox.g.cs @@ -16,7 +16,7 @@ internal TBox(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Adjacent(TBox box2) => Meos.AdjacentTboxTbox(this.Ptr, box2.Ptr); @@ -82,7 +82,7 @@ public string AsHexWKB(byte variant) => Meos.TboxAsHexwkb(this.Ptr, variant); public string AsText(int maxdd) - => this.Out(maxdd); + => Meos.TboxOut(this.Ptr, maxdd); public byte[]? AsWKB(byte variant) { @@ -287,9 +287,6 @@ public double Nad(TBox box2) public bool Ne(TBox box2) => Meos.TboxNe(this.Ptr, box2.Ptr); - public string Out(int maxdd) - => Meos.TboxOut(this.Ptr, maxdd); - public bool Overafter(TBox box2) => Meos.OverafterTboxTbox(this.Ptr, box2.Ptr); @@ -848,7 +845,7 @@ public bool Same(TInt temp) => MEOSFactory.WrapTBox(Meos.NumspanTstzspanToTbox(s.Ptr, p.Ptr)); public static TBox? FromText(string str) - => TBox.In(str); + => MEOSFactory.WrapTBox(Meos.TboxIn(str)); public static TBox? FromTimestamptz(DateTime t) => MEOSFactory.WrapTBox(Meos.TimestamptzToTbox(MEOSConvert.ToTimestampTz(t))); @@ -897,9 +894,6 @@ public bool Same(TInt temp) } } - public static TBox? In(string str) - => MEOSFactory.WrapTBox(Meos.TboxIn(str)); - public static TBox? Make(Span s, Span p) => MEOSFactory.WrapTBox(Meos.TboxMake(s.Ptr, p.Ptr)); diff --git a/MEOS.NET/Types/TCBuffer.g.cs b/MEOS.NET/Types/TCBuffer.g.cs index 9ad7349..f3f7617 100644 --- a/MEOS.NET/Types/TCBuffer.g.cs +++ b/MEOS.NET/Types/TCBuffer.g.cs @@ -431,7 +431,7 @@ public bool Same(TCBuffer temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TCBuffer.In(str); + => TCBuffer.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -440,9 +440,6 @@ public bool Same(TCBuffer temp2) => MEOSFactory.WrapTemporal(Meos.TcbufferFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TCBuffer.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TcbufferIn(str)); } diff --git a/MEOS.NET/Types/TFloat.g.cs b/MEOS.NET/Types/TFloat.g.cs index 80427b7..01b8e70 100644 --- a/MEOS.NET/Types/TFloat.g.cs +++ b/MEOS.NET/Types/TFloat.g.cs @@ -16,7 +16,7 @@ internal TFloat(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public Temporal? Add(double d) => MEOSFactory.WrapTemporal(Meos.AddTfloatFloat(this.Ptr, d)); @@ -72,9 +72,6 @@ public int AlwaysNe(TFloat temp2) public int AlwaysOverlaps(TFloat temp2) => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Temporal? AtValue(double d) => MEOSFactory.WrapTemporal(Meos.TfloatAtValue(this.Ptr, d)); @@ -485,9 +482,6 @@ public double[] Values() => MEOSFactory.WrapTemporal(Meos.TfloatFromMfjson(str)); public static Temporal? FromText(string str) - => TFloat.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TfloatIn(str)); } diff --git a/MEOS.NET/Types/TGeogPoint.g.cs b/MEOS.NET/Types/TGeogPoint.g.cs index df7a8ed..4b872de 100644 --- a/MEOS.NET/Types/TGeogPoint.g.cs +++ b/MEOS.NET/Types/TGeogPoint.g.cs @@ -211,7 +211,7 @@ public bool Same(TGeogPoint temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TGeogPoint.In(str); + => TGeogPoint.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -220,9 +220,6 @@ public bool Same(TGeogPoint temp2) => MEOSFactory.WrapTemporal(Meos.TgeogpointFromMfjson(str)); public static Temporal? FromText(string str) - => TGeogPoint.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TgeogpointIn(str)); } diff --git a/MEOS.NET/Types/TGeography.g.cs b/MEOS.NET/Types/TGeography.g.cs index da1a23e..957d8e4 100644 --- a/MEOS.NET/Types/TGeography.g.cs +++ b/MEOS.NET/Types/TGeography.g.cs @@ -175,7 +175,7 @@ public bool Same(TGeography temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TGeography.In(str); + => TGeography.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -184,9 +184,6 @@ public bool Same(TGeography temp2) => MEOSFactory.WrapTemporal(Meos.TgeographyFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TGeography.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TgeographyIn(str)); } diff --git a/MEOS.NET/Types/TGeomPoint.g.cs b/MEOS.NET/Types/TGeomPoint.g.cs index 300d147..1947b0e 100644 --- a/MEOS.NET/Types/TGeomPoint.g.cs +++ b/MEOS.NET/Types/TGeomPoint.g.cs @@ -256,7 +256,7 @@ public bool Same(TGeomPoint temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TGeomPoint.In(str); + => TGeomPoint.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -265,9 +265,6 @@ public bool Same(TGeomPoint temp2) => MEOSFactory.WrapTemporal(Meos.TgeompointFromMfjson(str)); public static Temporal? FromText(string str) - => TGeomPoint.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TgeompointIn(str)); } diff --git a/MEOS.NET/Types/TGeometry.g.cs b/MEOS.NET/Types/TGeometry.g.cs index ff81e43..7a31796 100644 --- a/MEOS.NET/Types/TGeometry.g.cs +++ b/MEOS.NET/Types/TGeometry.g.cs @@ -265,7 +265,7 @@ public bool Same(TGeometry temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TGeometry.In(str); + => TGeometry.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -274,9 +274,6 @@ public bool Same(TGeometry temp2) => MEOSFactory.WrapTemporal(Meos.TgeometryFromMfjson(str)); public static Temporal? FromText(string str) - => TGeometry.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TgeometryIn(str)); } diff --git a/MEOS.NET/Types/TH3Index.g.cs b/MEOS.NET/Types/TH3Index.g.cs index 08f67df..885f2b1 100644 --- a/MEOS.NET/Types/TH3Index.g.cs +++ b/MEOS.NET/Types/TH3Index.g.cs @@ -16,7 +16,7 @@ internal TH3Index(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Above(TH3Index temp2) => Meos.AboveTspatialTspatial(this.Ptr, temp2.Ptr); @@ -266,7 +266,7 @@ public H3Index[] Values() => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TH3Index.In(str); + => TH3Index.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -275,9 +275,6 @@ public H3Index[] Values() => MEOSFactory.WrapTemporal(Meos.Th3indexFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TH3Index.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.Th3indexIn(str)); } diff --git a/MEOS.NET/Types/TInt.g.cs b/MEOS.NET/Types/TInt.g.cs index e074e8f..f2f94c6 100644 --- a/MEOS.NET/Types/TInt.g.cs +++ b/MEOS.NET/Types/TInt.g.cs @@ -16,7 +16,7 @@ internal TInt(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public Temporal? Add(int i) => MEOSFactory.WrapTemporal(Meos.AddTintInt(this.Ptr, i)); @@ -72,9 +72,6 @@ public int AlwaysNe(TInt temp2) public int AlwaysOverlaps(TInt temp2) => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Temporal? AtValue(int i) => MEOSFactory.WrapTemporal(Meos.TintAtValue(this.Ptr, i)); @@ -455,9 +452,6 @@ public int[] Values() => MEOSFactory.WrapTemporal(Meos.TintFromMfjson(str)); public static Temporal? FromText(string str) - => TInt.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TintIn(str)); } diff --git a/MEOS.NET/Types/TJsonb.g.cs b/MEOS.NET/Types/TJsonb.g.cs index 00738a3..046293a 100644 --- a/MEOS.NET/Types/TJsonb.g.cs +++ b/MEOS.NET/Types/TJsonb.g.cs @@ -16,7 +16,7 @@ internal TJsonb(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Adjacent(TJsonb temp2) => Meos.AdjacentTemporalTemporal(this.Ptr, temp2.Ptr); @@ -45,9 +45,6 @@ public int AlwaysNe(TJsonb temp2) public Temporal? ArrayLength() => MEOSFactory.WrapTemporal(Meos.TjsonbArrayLength(this.Ptr)); - public string AsText(int maxdd) - => this.Out(maxdd); - public Temporal? AtValue(Jsonb jsb) => MEOSFactory.WrapTemporal(Meos.TjsonbAtValue(this.Ptr, jsb.Ptr)); @@ -432,9 +429,6 @@ public bool Same(TJsonb temp2) => MEOSFactory.WrapTemporal(Meos.TjsonbFromMfjson(str)); public static Temporal? FromText(string str) - => TJsonb.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TjsonbIn(str)); } diff --git a/MEOS.NET/Types/TNPoint.g.cs b/MEOS.NET/Types/TNPoint.g.cs index 76f0d3d..146f995 100644 --- a/MEOS.NET/Types/TNPoint.g.cs +++ b/MEOS.NET/Types/TNPoint.g.cs @@ -320,7 +320,7 @@ public bool SameRid(TNPoint temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TNPoint.In(str); + => TNPoint.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -329,9 +329,6 @@ public bool SameRid(TNPoint temp2) => MEOSFactory.WrapTemporal(Meos.TnpointFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TNPoint.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TnpointIn(str)); } diff --git a/MEOS.NET/Types/TPCBox.g.cs b/MEOS.NET/Types/TPCBox.g.cs index 99ae23e..3968880 100644 --- a/MEOS.NET/Types/TPCBox.g.cs +++ b/MEOS.NET/Types/TPCBox.g.cs @@ -76,7 +76,7 @@ public bool After(TPCPoint temp) } public string AsEWKT(int maxdd) - => this.Out(maxdd); + => Meos.TpcboxOut(this.Ptr, maxdd); public string AsHexEWKB(byte variant) => Meos.TpcboxAsHexewkb(this.Ptr, variant); @@ -234,9 +234,6 @@ public double Nad(TPCBox box2) public bool Ne(TPCBox box2) => Meos.TpcboxNe(this.Ptr, box2.Ptr); - public string Out(int maxdd) - => Meos.TpcboxOut(this.Ptr, maxdd); - public bool Overabove(TPCBox box2) => Meos.OveraboveTpcboxTpcbox(this.Ptr, box2.Ptr); @@ -592,7 +589,7 @@ public bool Same(TPCPoint temp) => TPCBox.FromWKB(wkb); public static TPCBox? FromEWKT(string str) - => TPCBox.In(str); + => TPCBox.FromText(str); public static TPCBox? FromHexEWKB(string hexwkb) => TPCBox.FromHexWKB(hexwkb); @@ -601,7 +598,7 @@ public bool Same(TPCPoint temp) => MEOSFactory.WrapTPCBox(Meos.TpcboxFromHexwkb(hexwkb)); public static TPCBox? FromText(string str) - => TPCBox.In(str); + => MEOSFactory.WrapTPCBox(Meos.TpcboxIn(str)); public static TPCBox? FromTpointcloud(Temporal temp) => MEOSFactory.WrapTPCBox(Meos.TpointcloudToTpcbox(temp.Ptr)); @@ -619,9 +616,6 @@ public bool Same(TPCPoint temp) } } - public static TPCBox? In(string str) - => MEOSFactory.WrapTPCBox(Meos.TpcboxIn(str)); - public static TPCBox? Make(bool hasx, bool hasz, bool geodetic, uint pcid, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, Span period) => MEOSFactory.WrapTPCBox(Meos.TpcboxMake(hasx, hasz, geodetic, pcid, xmin, xmax, ymin, ymax, zmin, zmax, period.Ptr)); diff --git a/MEOS.NET/Types/TPCPatch.g.cs b/MEOS.NET/Types/TPCPatch.g.cs index b8b52e2..b4ecc4d 100644 --- a/MEOS.NET/Types/TPCPatch.g.cs +++ b/MEOS.NET/Types/TPCPatch.g.cs @@ -16,7 +16,7 @@ internal TPCPatch(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public int AlwaysEq(PCPatch pa) => Meos.AlwaysEqTpcpatchPcpatch(this.Ptr, pa.Ptr); @@ -160,7 +160,7 @@ public uint StartNpoints() => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TPCPatch.In(str); + => TPCPatch.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -169,9 +169,6 @@ public uint StartNpoints() => MEOSFactory.WrapTemporal(Meos.TpcpatchFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TPCPatch.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TpcpatchIn(str)); } diff --git a/MEOS.NET/Types/TPCPoint.g.cs b/MEOS.NET/Types/TPCPoint.g.cs index 0261c9d..7e0b5da 100644 --- a/MEOS.NET/Types/TPCPoint.g.cs +++ b/MEOS.NET/Types/TPCPoint.g.cs @@ -16,7 +16,7 @@ internal TPCPoint(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public int AlwaysEq(PCPoint pt) => Meos.AlwaysEqTpcpointPcpoint(this.Ptr, pt.Ptr); @@ -143,7 +143,7 @@ public uint Pcid() => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TPCPoint.In(str); + => TPCPoint.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -152,9 +152,6 @@ public uint Pcid() => MEOSFactory.WrapTemporal(Meos.TpcpointFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TPCPoint.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TpcpointIn(str)); } diff --git a/MEOS.NET/Types/TPose.g.cs b/MEOS.NET/Types/TPose.g.cs index cafc915..35bccb8 100644 --- a/MEOS.NET/Types/TPose.g.cs +++ b/MEOS.NET/Types/TPose.g.cs @@ -371,7 +371,7 @@ public bool Same(TPose temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TPose.In(str); + => TPose.FromText(str); public static Temporal? FromGeopose(string json) => MEOSFactory.WrapTemporal(Meos.TposeFromGeopose(json)); @@ -383,9 +383,6 @@ public bool Same(TPose temp2) => MEOSFactory.WrapTemporal(Meos.TposeFromMfjson(str)); public static Temporal? FromText(string str) - => TPose.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TposeIn(str)); } diff --git a/MEOS.NET/Types/TPoseChain.g.cs b/MEOS.NET/Types/TPoseChain.g.cs index db6d44b..ba327a4 100644 --- a/MEOS.NET/Types/TPoseChain.g.cs +++ b/MEOS.NET/Types/TPoseChain.g.cs @@ -296,7 +296,7 @@ public bool Same(TPoseChain temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TPoseChain.In(str); + => TPoseChain.FromText(str); public static Temporal? FromGeopose(string json) => MEOSFactory.WrapTemporal(Meos.TposechainFromGeopose(json)); @@ -308,9 +308,6 @@ public bool Same(TPoseChain temp2) => MEOSFactory.WrapTemporal(Meos.TposechainFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TPoseChain.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TposechainIn(str)); } diff --git a/MEOS.NET/Types/TQuadbin.g.cs b/MEOS.NET/Types/TQuadbin.g.cs index f5d5a8e..ced5d20 100644 --- a/MEOS.NET/Types/TQuadbin.g.cs +++ b/MEOS.NET/Types/TQuadbin.g.cs @@ -16,7 +16,7 @@ internal TQuadbin(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Above(TQuadbin temp2) => Meos.AboveTspatialTspatial(this.Ptr, temp2.Ptr); @@ -218,7 +218,7 @@ public Quadbin[] Values() => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TQuadbin.In(str); + => TQuadbin.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -227,9 +227,6 @@ public Quadbin[] Values() => MEOSFactory.WrapTemporal(Meos.TquadbinFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TQuadbin.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TquadbinIn(str)); } diff --git a/MEOS.NET/Types/TRGeometry.g.cs b/MEOS.NET/Types/TRGeometry.g.cs index c263b93..d7f1ec4 100644 --- a/MEOS.NET/Types/TRGeometry.g.cs +++ b/MEOS.NET/Types/TRGeometry.g.cs @@ -207,9 +207,6 @@ public double Nad(TRGeometry temp2) public Temporal? Nai(TRGeometry temp2) => MEOSFactory.WrapTemporal(Meos.NaiTrgeometryTrgeometry(this.Ptr, temp2.Ptr)); - public string Out() - => Meos.TrgeometryOut(this.Ptr); - public bool Overabove(TRGeometry temp2) => Meos.OveraboveTspatialTspatial(this.Ptr, temp2.Ptr); @@ -438,7 +435,7 @@ public bool Same(TRGeometry temp2) => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TRGeometry.In(str); + => TRGeometry.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -447,9 +444,6 @@ public bool Same(TRGeometry temp2) => MEOSFactory.WrapTemporal(Meos.TrgeometryFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TRGeometry.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TrgeometryIn(str)); } diff --git a/MEOS.NET/Types/TS2Cell.g.cs b/MEOS.NET/Types/TS2Cell.g.cs index 62a11dd..092e42d 100644 --- a/MEOS.NET/Types/TS2Cell.g.cs +++ b/MEOS.NET/Types/TS2Cell.g.cs @@ -16,7 +16,7 @@ internal TS2Cell(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Above(TS2Cell temp2) => Meos.AboveTspatialTspatial(this.Ptr, temp2.Ptr); @@ -206,7 +206,7 @@ public S2Cell[] Values() => Temporal.FromWKB(wkb); public static Temporal? FromEWKT(string str) - => TS2Cell.In(str); + => TS2Cell.FromText(str); public static Temporal? FromHexEWKB(string hexwkb) => Temporal.FromHexWKB(hexwkb); @@ -215,9 +215,6 @@ public S2Cell[] Values() => MEOSFactory.WrapTemporal(Meos.Ts2cellFromMfjson(mfjson)); public static Temporal? FromText(string str) - => TS2Cell.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.Ts2cellIn(str)); } diff --git a/MEOS.NET/Types/TSpatial.g.cs b/MEOS.NET/Types/TSpatial.g.cs index ba56d14..de95e81 100644 --- a/MEOS.NET/Types/TSpatial.g.cs +++ b/MEOS.NET/Types/TSpatial.g.cs @@ -59,7 +59,7 @@ public string AsEWKT(int maxdd) public string AsHexEWKB(byte variant) => Meos.TspatialAsHexewkb(this.Ptr, variant); - public string AsText(int maxdd) + public new string AsText(int maxdd) => Meos.TspatialAsText(this.Ptr, maxdd); public bool Back(STBox box) diff --git a/MEOS.NET/Types/TText.g.cs b/MEOS.NET/Types/TText.g.cs index 416c6ea..becb6c8 100644 --- a/MEOS.NET/Types/TText.g.cs +++ b/MEOS.NET/Types/TText.g.cs @@ -16,7 +16,7 @@ internal TText(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool Adjacent(TText temp2) => Meos.AdjacentTemporalTemporal(this.Ptr, temp2.Ptr); @@ -63,9 +63,6 @@ public int AlwaysNe(TText temp2) public int AlwaysOverlaps(TText temp2) => Meos.AlwaysOverlapsTemporalTemporal(this.Ptr, temp2.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public Temporal? AtValue(Text txt) => MEOSFactory.WrapTemporal(Meos.TtextAtValue(this.Ptr, txt.Ptr)); @@ -254,9 +251,6 @@ public bool Same(TText temp2) => MEOSFactory.WrapTemporal(Meos.TtextFromMfjson(str)); public static Temporal? FromText(string str) - => TText.In(str); - - public static Temporal? In(string str) => MEOSFactory.WrapTemporal(Meos.TtextIn(str)); } diff --git a/MEOS.NET/Types/Temporal.g.cs b/MEOS.NET/Types/Temporal.g.cs index 4e0e161..13ed734 100644 --- a/MEOS.NET/Types/Temporal.g.cs +++ b/MEOS.NET/Types/Temporal.g.cs @@ -67,6 +67,9 @@ public string AsHexWKB(byte variant) public string AsMFJSON(int option, int flags, int precision, string srs) => Meos.TemporalAsMfjson(this.Ptr, option, flags, precision, srs); + public string AsText(int maxdd) + => Meos.TemporalOut(this.Ptr, maxdd); + public Temporal? AsTinstant() => MEOSFactory.WrapTemporal(Meos.TemporalAsTinstant(this.Ptr)); @@ -292,9 +295,6 @@ public int NumSequences() public int NumTimestamps() => Meos.TemporalNumTimestamps(this.Ptr); - public string Out(int maxdd) - => Meos.TemporalOut(this.Ptr, maxdd); - public bool Overafter(TsTzSpan s) => Meos.OverafterTemporalTstzspan(this.Ptr, s.Ptr); diff --git a/MEOS.NET/Types/Text.g.cs b/MEOS.NET/Types/Text.g.cs index 8a5e84a..0017088 100644 --- a/MEOS.NET/Types/Text.g.cs +++ b/MEOS.NET/Types/Text.g.cs @@ -16,7 +16,7 @@ internal Text(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(); + => Meos.TextOut(this.Ptr); public int AlwaysEq(TText temp) => Meos.AlwaysEqTextTtext(this.Ptr, temp.Ptr); @@ -78,9 +78,6 @@ public bool Left(TextSet s) public Set? Minus(TextSet s) => MEOSFactory.WrapSet(Meos.MinusTextSet(this.Ptr, s.Ptr)); - public string Out() - => Meos.TextOut(this.Ptr); - public bool Overleft(TextSet s) => Meos.OverleftTextSet(this.Ptr, s.Ptr); @@ -132,8 +129,5 @@ public bool Right(TextSet s) public static Text? FromCstring(string str) => MEOSFactory.WrapText(Meos.CstringToText(str)); - public static Text? In(string str) - => MEOSFactory.WrapText(Meos.TextIn(str)); - } } diff --git a/MEOS.NET/Types/TextSet.g.cs b/MEOS.NET/Types/TextSet.g.cs index 290f6d1..7f3309b 100644 --- a/MEOS.NET/Types/TextSet.g.cs +++ b/MEOS.NET/Types/TextSet.g.cs @@ -16,10 +16,7 @@ internal TextSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); - - public string AsText(int maxdd) - => this.Out(maxdd); + => this.AsText(15); public bool Contained(TextSet s2) => Meos.ContainedSetSet(this.Ptr, s2.Ptr); @@ -118,9 +115,6 @@ public bool Right(TextSet s2) => MEOSFactory.WrapTextArray(Meos.TextsetValues(this.Ptr)); public static Set? FromText(string str) - => TextSet.In(str); - - public static Set? In(string str) => MEOSFactory.WrapSet(Meos.TextsetIn(str)); public static Set? Make(Text[] values) diff --git a/MEOS.NET/Types/TsTzSet.g.cs b/MEOS.NET/Types/TsTzSet.g.cs index c7ad5e1..ace43b1 100644 --- a/MEOS.NET/Types/TsTzSet.g.cs +++ b/MEOS.NET/Types/TsTzSet.g.cs @@ -16,14 +16,11 @@ internal TsTzSet(IntPtr ptr) : base(ptr) { } /// The text MEOS writes this value as. public override string ToString() - => this.Out(15); + => this.AsText(15); public bool After(DateTime t) => Meos.AfterSetTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t)); - public string AsText(int maxdd) - => this.Out(maxdd); - public bool Before(DateTime t) => Meos.BeforeSetTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t)); @@ -198,14 +195,11 @@ public long[] Values() => Meos.TstzsetValues(this.Ptr); public static Set? FromText(string str) - => TsTzSet.In(str); + => MEOSFactory.WrapSet(Meos.TstzsetIn(str)); public static Set? FromTimestamptz(DateTime t) => MEOSFactory.WrapSet(Meos.TimestamptzToSet(MEOSConvert.ToTimestampTz(t))); - public static Set? In(string str) - => MEOSFactory.WrapSet(Meos.TstzsetIn(str)); - public static Set? Make(long[] values) { GCHandle _values = GCHandle.Alloc(values, GCHandleType.Pinned); diff --git a/MEOS.NET/Types/TsTzSpan.g.cs b/MEOS.NET/Types/TsTzSpan.g.cs index f9477bd..c81aaf9 100644 --- a/MEOS.NET/Types/TsTzSpan.g.cs +++ b/MEOS.NET/Types/TsTzSpan.g.cs @@ -167,9 +167,6 @@ public int AlwaysOverlaps(TBool temp) public int AlwaysOverlaps(TText temp) => Meos.AlwaysOverlapsTstzspanTemporal(this.Ptr, temp.Ptr); - public string AsText(int maxdd) - => this.Out(maxdd); - public bool Before(DateTime t) => Meos.BeforeSpanTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t)); @@ -858,7 +855,7 @@ public DateTime Upper() => MEOSConvert.ToDateTime(Meos.TstzspanUpper(this.Ptr)); public static Span? FromText(string str) - => TsTzSpan.In(str); + => MEOSFactory.WrapSpan(Meos.TstzspanIn(str)); public static Span? FromTimestamptz(DateTime t) => MEOSFactory.WrapSpan(Meos.TimestamptzToSpan(MEOSConvert.ToTimestampTz(t))); @@ -877,9 +874,6 @@ public DateTime Upper() } } - public static Span? In(string str) - => MEOSFactory.WrapSpan(Meos.TstzspanIn(str)); - public static Span? Make(DateTime lower, DateTime upper, bool lower_inc, bool upper_inc) => MEOSFactory.WrapSpan(Meos.TstzspanMake(MEOSConvert.ToTimestampTz(lower), MEOSConvert.ToTimestampTz(upper), lower_inc, upper_inc)); diff --git a/MEOS.NET/Types/TsTzSpanSet.g.cs b/MEOS.NET/Types/TsTzSpanSet.g.cs index 5ec9a76..74fe408 100644 --- a/MEOS.NET/Types/TsTzSpanSet.g.cs +++ b/MEOS.NET/Types/TsTzSpanSet.g.cs @@ -26,9 +26,6 @@ public bool Adjacent(TsTzSpanSet ss2) public bool After(DateTime t) => Meos.AfterSpansetTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t)); - public string AsText(int maxdd) - => this.Out(maxdd); - public bool Before(DateTime t) => Meos.BeforeSpansetTimestamptz(this.Ptr, MEOSConvert.ToTimestampTz(t)); @@ -265,13 +262,10 @@ public DateTime Upper() => MEOSConvert.ToDateTime(Meos.TstzspansetUpper(this.Ptr)); public static SpanSet? FromText(string str) - => TsTzSpanSet.In(str); + => MEOSFactory.WrapSpanSet(Meos.TstzspansetIn(str)); public static SpanSet? FromTimestamptz(DateTime t) => MEOSFactory.WrapSpanSet(Meos.TimestamptzToSpanset(MEOSConvert.ToTimestampTz(t))); - public static SpanSet? In(string str) - => MEOSFactory.WrapSpanSet(Meos.TstzspansetIn(str)); - } } diff --git a/tools/objectgen.py b/tools/objectgen.py index c97d76c..64b3784 100644 --- a/tools/objectgen.py +++ b/tools/objectgen.py @@ -473,6 +473,11 @@ def __init__(self, model: Model): # emitted before this one, its ancestors among them, so a class reaches a # reader an ancestor carries (`Temporal.FromWKB`). self.static_functions: dict[str, tuple[str, Method]] = {} + # class -> {C function: method} for each reader or writer the object + # model calls by its role that serves no portable format, left out of + # the class (#role_named) and kept only for a ToString that writes + # through it. + self.flat_functions: dict[str, dict[str, Method]] = {} self.emitted = 0 # Instantiated pairs a class's own operator already answers. self.restated = 0 @@ -1346,6 +1351,7 @@ def emit_class(self, cls: str) -> str: entries = [e for e in self.m.om["classes"].get(cls, {}).get("methods", []) if not e.get("ooExclude")] paired = [(e["function"], self.method_for(cls, e)) for e in entries] + paired = self.take_portable_names(cls, paired, entries) methods = [m for _f, m in paired if m] methods.sort(key=lambda m: (m.static, m.name)) self.emitted += len(methods) @@ -1584,6 +1590,73 @@ def answer(self, method: Method) -> list[str]: "hexwkb": "HexWKB", "ewkb": "EWKB", "hexewkb": "HexEWKB", "mfjson": "MFJSON"} + def portable_format(self, function: str) -> tuple[str, str] | None: + """The verb and spelling of the first format, in #FORMAT_SPELLING's + order, that the catalog's `typeEncodings` reads or writes with the + function, for any type, as #portable_format of GoMEOS's + tools/objectgen.py reads it: ("From", "Text") for tgeompoint_in, which + reads the text and the EWKT of tgeompoint, ("As", "Text") for set_out, + the text writer of every set type, and ("As", "EWKT") for stbox_out.""" + found = set() + for enc in self.m.idl.get("typeEncodings", {}).values(): + for verb, by_type, by_class in (("As", "writers", "encoders"), + ("From", "readers", "decoders")): + for e, per_type in (enc.get(by_type) or {}).items(): + if function in per_type.values(): + found.add((verb, e)) + for e, fn in (enc.get(by_class) or {}).items(): + if fn == function: + found.add((verb, e)) + for e, spelling in self.FORMAT_SPELLING.items(): + for verb in ("As", "From"): + if (verb, e) in found: + return verb, spelling + return None + + @staticmethod + def role_named(entry: dict) -> bool: + """Whether the object model calls a method by its role, the reader or + writer of a type (ooName `in` or `out`), a name the object layer never + gives (rule 1 of the bindings in the I/O plan, MobilityDB #3353).""" + return entry["ooName"] in ("in", "out") + + def take_portable_names(self, cls: str, paired: list, entries: list) -> list: + """Emit each reader or writer the object model calls by its role + (#role_named) under the portable name of the format it serves + (#portable_format), never `In` or `Out`, as #take_portable_names of + GoMEOS's tools/objectgen.py does: tgeompoint_in is + `TGeomPoint.FromText`, set_out `Set.AsText`, stbox_out `STBox.AsEWKT`. + The method keeps its body, so the portable reader or writer that would + forward to it (#portable_methods) is not emitted beside it. One whose + portable name the class already declares with the same parameters is + left out as that method's duplicate. One serving no portable format + leaves the object layer, as #plumbing of GoMEOS's tools/objectgen.py + leaves a type support function serving none: the dialect never names + it (pose_out writes the PostgreSQL wire form, which `Pose.FromText` + reads; the text of a geometry is read and written by geo_from_text and + geo_as_text, not geom_in and geo_out) and its function stays in the + flat `Meos` layer, kept in #flat_functions for a ToString that writes + through it (text_out).""" + out = [] + for (fn, method), entry in zip(paired, entries): + if method is None or not self.role_named(entry): + out.append((fn, method)) + continue + format_ = self.portable_format(fn) + if format_ is None or (format_[0] == "From") != method.static: + self.flat_functions.setdefault(cls, {})[fn] = method + out.append((fn, None)) + continue + name = format_[0] + format_[1] + if any(m is not method and m.name == name + and signature_of(m) == signature_of(method) + for _f, m in paired if m): + out.append((fn, None)) + continue + method.name = name + out.append((fn, method)) + return out + def portable_methods(self, cls: str, methods: list, functions: dict) -> list[Method]: """The portable reader and writer of every encoding the catalog's `typeEncodings` gives the class's type (rule 1 of the bindings in the I/O @@ -1592,8 +1665,8 @@ def portable_methods(self, cls: str, methods: list, functions: dict) -> list[Met `decoders`/`encoders`. Where the class or an ancestor emits no method of that name, `As` forwards to the instance method behind the writer and `From` to the static method behind the reader, so - `TGeomPoint.FromEWKB` is `Temporal.FromWKB` and `FloatSpan.FromText` is - `FloatSpan.In`, one function under two names as in SQL.""" + `TGeomPoint.FromEWKB` is `Temporal.FromWKB` and `STBox.FromEWKT` is + `STBox.FromText`, one function under two names as in SQL.""" meostype = self.m.meostype.get(cls) encoding = self.m.idl.get("typeEncodings", {}).get(self.m.ctype.get(cls)) if not meostype or not encoding: @@ -1642,7 +1715,8 @@ def text_writer(self, cls: str) -> str | None: # parser/enrich.py of MEOS-API counts with the strings since a binding # passes a `text *` as one: the class writes itself through its own # `*_out` (`text_out`), the function the SQL text output calls. - return next((f for f in self.class_functions.get(cls, {}) + return next((f for f in (*self.class_functions.get(cls, {}), + *self.flat_functions.get(cls, {})) if f.endswith("_out")), None) encoding = encodings[ctype] meostype = self.m.meostype.get(cls) @@ -1656,8 +1730,9 @@ def text_writer(self, cls: str) -> str | None: def to_string(self, cls: str, functions: dict) -> list[str]: """`ToString` over the text writer #text_writer names for the class, the function behind the SQL `asText` of its type (rule 2 of the bindings in - the I/O plan, MobilityDB #3353): `AsText` for a spatial value, which - writes its points as WKT, and `Out` for the others. The writer may be a + the I/O plan, MobilityDB #3353): `AsText`, which for a spatial value + writes its points as WKT, else the writer's function in `Meos` where it + serves no portable format (text_out of `Text`). The writer may be a method of an ancestor (`tspatial_as_text` is `TSpatial.AsText`), and a class whose writer is the one it inherits emits no `ToString` of its own. The decimal digits are the default the catalog records for that C type's @@ -1668,6 +1743,16 @@ class whose writer is the one it inherits emits no `ToString` of its own. if writer is None or writer == inherited: return [] out = functions.get(writer) + # A writer serving no portable format is out of the object layer + # (#take_portable_names), so ToString calls its function in `Meos`. + flat = out is None and self.flat_functions.get(cls, {}).get(writer) + if flat and not flat.params: + return [ + " /// The text MEOS writes this value as.", + f" public override string{'?' if flat.ret.endswith('?') else ''} ToString()", + f" => {flat.body};", + "", + ] if out is None or [t for t, _ in out.params] not in ([], ["int"]): return [] ctype = self.m.ctype.get(cls)