Index: src/natools-s_expressions-atom_buffers.adb ================================================================== --- src/natools-s_expressions-atom_buffers.adb +++ src/natools-s_expressions-atom_buffers.adb @@ -171,11 +171,11 @@ Process.all (Buffer.Ref.Query.Data.all (1 .. Buffer.Used)); end if; end Query; - procedure Read + procedure Peek (Buffer : in Atom_Buffer; Data : out Atom; Length : out Count) is Transmit : constant Count := Count'Min (Data'Length, Buffer.Used); @@ -187,11 +187,11 @@ null; else Data (Data'First .. Data'First + Transmit - 1) := Buffer.Ref.Query.Data.all (1 .. Transmit); end if; - end Read; + end Peek; function Element (Buffer : Atom_Buffer; Position : Count) return Octet is begin return Buffer.Ref.Query.Data.all (Position); Index: src/natools-s_expressions-atom_buffers.ads ================================================================== --- src/natools-s_expressions-atom_buffers.ads +++ src/natools-s_expressions-atom_buffers.ads @@ -48,11 +48,11 @@ function Capacity (Buffer : Atom_Buffer) return Count; function Data (Buffer : Atom_Buffer) return Atom; procedure Query (Buffer : in Atom_Buffer; Process : not null access procedure (Data : in Atom)); - procedure Read + procedure Peek (Buffer : in Atom_Buffer; Data : out Atom; Length : out Count); function Element (Buffer : Atom_Buffer; Position : Count) return Octet; -- Accessors to the whole buffer as an Atom Index: src/natools-s_expressions-parsers.adb ================================================================== --- src/natools-s_expressions-parsers.adb +++ src/natools-s_expressions-parsers.adb @@ -91,11 +91,11 @@ begin if Self.Locked or Self.Latest /= Events.Add_Atom then raise Program_Error; end if; - Self.Buffer.Read (Data, Length); + Self.Buffer.Peek (Data, Length); end Read_Atom; overriding procedure Next (Self : in out Parser; Index: tests/natools-s_expressions-atom_buffers-tests.adb ================================================================== --- tests/natools-s_expressions-atom_buffers-tests.adb +++ tests/natools-s_expressions-atom_buffers-tests.adb @@ -218,16 +218,16 @@ declare Retrieved : Atom (10 .. 310); Length : Count; begin - Buffer.Read (Retrieved, Length); + Buffer.Peek (Retrieved, Length); if Length /= Data'Length or else Retrieved (10 .. Length + 9) /= Data then Report.Item (Name, NT.Fail); - Report.Info ("Read into an existing buffer"); + Report.Info ("Peek into an existing buffer"); Report.Info ("Length returned" & Count'Image (Length) & ", expected" & Count'Image (Data'Length)); Test_Tools.Dump_Atom (Report, Retrieved (10 .. Length + 9), "Found"); Test_Tools.Dump_Atom (Report, Data, "Expected"); @@ -237,14 +237,14 @@ declare Retrieved : Atom (20 .. 50); Length : Count; begin - Buffer.Read (Retrieved, Length); + Buffer.Peek (Retrieved, Length); if Length /= Data'Length or else Retrieved /= Data (0 .. 30) then Report.Item (Name, NT.Fail); - Report.Info ("Read into a buffer too small"); + Report.Info ("Peek into a buffer too small"); Report.Info ("Length returned" & Count'Image (Length) & ", expected" & Count'Image (Data'Length)); Test_Tools.Dump_Atom (Report, Retrieved, "Found"); Test_Tools.Dump_Atom (Report, Data (0 .. 30), "Expected"); return; @@ -298,14 +298,14 @@ declare Retrieved : Atom (1 .. 10); Length : Count; begin - Buffer.Read (Retrieved, Length); + Buffer.Peek (Retrieved, Length); if Length /= 0 then Report.Item (Name, NT.Fail); - Report.Info ("Read into an existing buffer"); + Report.Info ("Peek into an existing buffer"); Report.Info ("Length returned" & Count'Image (Length) & ", expected 0"); return; end if; end;