Natools

Diff
Login

Differences From Artifact [412fa61073]:

To Artifact [ee144af528]:


17
18
19
20
21
22
23

24
25
26
27
28
29
30
------------------------------------------------------------------------------
-- Natools.S_Expressions.File_Readers provides types that read into files   --
-- on disk (using Stream_IO) and expose their data as S-expressions or as   --
-- atoms.                                                                   --
------------------------------------------------------------------------------

with Natools.S_Expressions.Atom_Buffers;

with Natools.S_Expressions.Lockable;

private with Ada.Finalization;
private with Ada.Streams.Stream_IO;
private with Natools.S_Expressions.Parsers;

package Natools.S_Expressions.File_Readers is







>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
------------------------------------------------------------------------------
-- Natools.S_Expressions.File_Readers provides types that read into files   --
-- on disk (using Stream_IO) and expose their data as S-expressions or as   --
-- atoms.                                                                   --
------------------------------------------------------------------------------

with Natools.S_Expressions.Atom_Buffers;
with Natools.S_Expressions.Atom_Refs;
with Natools.S_Expressions.Lockable;

private with Ada.Finalization;
private with Ada.Streams.Stream_IO;
private with Natools.S_Expressions.Parsers;

package Natools.S_Expressions.File_Readers is
53
54
55
56
57
58
59



60
61
62
63
64
65
66

   function Length (Object : Atom_Reader) return Count;
      --  Return the file length

   function Read (Object : Atom_Reader) return Atom;
      --  Read the whole file and return it as a single atom




   procedure Read
     (Object : in Atom_Reader;
      Data : out Atom;
      Length : out Count);
      --  Read the whole file and store it in Data, along with its Length.
      --  If Data is too small, only the file prefix is read.








>
>
>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

   function Length (Object : Atom_Reader) return Count;
      --  Return the file length

   function Read (Object : Atom_Reader) return Atom;
      --  Read the whole file and return it as a single atom

   function Read (Object : Atom_Reader) return Atom_Refs.Reference;
      --  Read the whole file to memory and return a reference to the data

   procedure Read
     (Object : in Atom_Reader;
      Data : out Atom;
      Length : out Count);
      --  Read the whole file and store it in Data, along with its Length.
      --  If Data is too small, only the file prefix is read.