// Program converted on 02 Oct 2004
//     ada2cc Release 2.5.1 (2.28)
//     Emitter version 2.32 of 10/02/04
// Options:  rx=struct co=define ct=ISO bt=intrinsic
//           rc=short sc=yes ex=static
// Source file: Text_Io.ads
// static char Sccsid[] = "%W% %G%";
#ifndef TEXT_IO_package
#define TEXT_IO_package
#define USE_INTRINSIC_TYPES
#define ADA_TO_ISO_CPP
#include <ada_classes.H>
// text_io.ads  Fairly standard version of the Text_IO package.
// Supplied with RTI's ada2cc conversion tool - basis for supplied version of
// text_io.H

 
#include "io_exceptions.H"
 
namespace Text_Io
   {
 
      class File_Type /* is LIMITED PRIVATE */;
 
      typedef File_Type *File_Access;
 
      typedef enum
         {
            In_File,
            Out_File,
            Append_File
         } File_Mode;
 
      RangeType(Count, int, 0, Integer_.Last());
      Count Count_;
 
      class Positive_Count : public Count { //  line and page length
         public:
         Positive_Count() { set_parameters(1, Count_.Last()); }
         Positive_Count(Count &X) { set_parameters(1, Count_.Last());
                    assign(X.val); }
         Positive_Count(const Count &X) { set_parameters(1, Count_.Last());
                    assign(X.val); }
         Positive_Count(int X){ set_parameters(1, Count_.Last());  assign(X); }
          };
 
      Positive_Count Positive_Count_;
      const Count       Unbounded = 0;
 
      SubType(Field, Ada_Integer, int, 0, Integer_.Last());
      Field Field_;
      SubType(Number_Base, Ada_Integer, int, 2, 16);
      Number_Base Number_Base_;
 
      typedef enum
         {
            Lower_Case,
            Upper_Case
         } Type_Set;
 
// File Management
// Create, Open, Close, Delete, Reset  Mode, Name
// Form and Is_Open
 
      void
      Create(File_Type &File, File_Mode Mode = Out_File,
              String Name = String(""),
              String Form = String(""));
 
      void
      Open(File_Type &File, File_Mode Mode, String Name,
              String Form = String(""));
      void
      Close(File_Type &File);
      void
      Delete(File_Type &File);
      void
      Reset(File_Type &File,
              File_Mode Mode);
      void
      Reset(File_Type &File);
 
      File_Mode
      Mode(File_Type File);
      String
      Name(File_Type File);
      String
      Form(File_Type File);
 
      Boolean
      Is_Open(File_Type File);
 
// Control of default input and output files
 
      void
      Set_Input(File_Type File);
      void
      Set_Output(File_Type File);
 
      File_Type
      Standard_Input();
      File_Type
      Standard_Output();
 
      File_Type
      Current_Input();
      File_Type
      Current_Output();
 
 
// Specification of line and page lengths with and w/o File Parameter
      void
      Set_Line_Length(File_Type File, Count To);
      void
      Set_Line_Length(Count To);
 
      void
      Set_Page_Length(File_Type File, Count To);
      void
      Set_Page_Length(Count To);
 
      Count
      Line_Length(File_Type File);
      Count
      Line_Length();
 
      Count
      Page_Length(File_Type File);
      Count
      Page_Length();
 
// Column, Line and Page Control
 
      void
      New_Line(File_Type File, Positive_Count Spacing = 1);
      void
      New_Line(Positive_Count Spacing = 1);
 
      void
      Skip_Line(File_Type File, Positive_Count Spacing = 1);
      void
      Skip_Line(Positive_Count Spacing = 1);
 
      Boolean
      End_Of_Line(File_Type File);
      Boolean
      End_Of_Line();
 
      void
      New_Page(File_Type File);
      void
      New_Page();
 
      void
      Skip_Page(File_Type File);
      void
      Skip_Page();
 
      Boolean
      End_Of_Page(File_Type File);
      Boolean
      End_Of_Page();
 
      Boolean
      End_Of_File(File_Type File);
      Boolean
      End_Of_File();
 
 
      void
      Set_Col(File_Type File, Positive_Count To);
      void
      Set_Col(Positive_Count To);
 
      void
      Set_Line(File_Type File, Positive_Count To);
      void
      Set_Line(Positive_Count To);
 
 
      Positive_Count
      Col(File_Type File);
      Positive_Count
      Col();
 
      Positive_Count
      Line(File_Type File);
      Positive_Count
      Line();
 
      Positive_Count
      Page(File_Type File);
      Positive_Count
      Page();
 
// Character Input-Output
 
      void
      Get(File_Type File, Character &Item);
      void
      Get(Character &Item);
      void
      Put(File_Type File, Character Item);
      void
      Put(Character Item);
 
// String Input-Output
 
      void
      Get(File_Type File, String &Item);
      void
      Get(String &Item);
      void
      Put(File_Type File, String Item);
      void
      Put(String Item);
 
      void
      Get_Line(File_Type File, String &Item, Natural &Last);
      void
      Get(File_Type File, String &Item);
      void
      Get(String &Item);
      void
      Put(File_Type File, String Item);
      void
      Put(String Item);
 
      void
      Get_Line(File_Type File, String &Item, Natural &Last);
      void
      Get_Line(String &Item, Natural &Last);
 
      void
      Put_Line(File_Type File, String Item);
      void
      Put_Line(String Item);
 
// Generic package for Input-Output of Integer Types
 

      template
      <
      class Num
      >
      class Integer_Io
         {
            public:
 
            Field       Default_Width  ;
            Number_Base Default_Base  ;
 
            void
            Get(File_Type File, Num &Item, Field Width = 0);
            void
            Get(Num &Item, Field Width = 0);
 
            void
            Put(File_Type File, Num Item, Field Width = Default_Width,
                    Number_Base Base = Default_Base);
            void
            Put(Num Item, Field Width = Default_Width,
                    Number_Base Base = Default_Base);
 
            void
            Get(String From, Num &Item, Positive &Last);
            void
            Put(String &To, Num Item,
                    Number_Base Base = Default_Base);
 
            public:
            Integer_Io()
               {
                  Default_Width = Num_.Width();
                  Default_Base = 10;
               }
 
         } ;
 
-- Other generic I/O (float, fixed, enumeration) redacted for this example
 
 
      static Exception Status_Error("Status_Error") /* RENAMES Io_Exceptions::
                Status_Error */;
      static Exception Mode_Error("Mode_Error") /* RENAMES Io_Exceptions::
                Mode_Error */;
      static Exception Name_Error("Name_Error") /* RENAMES Io_Exceptions::
                Name_Error */;
      static Exception Use_Error("Use_Error") /* RENAMES Io_Exceptions::
                Use_Error */;
      static Exception Device_Error("Device_Error") /* RENAMES Io_Exceptions::
                Device_Error */;
      static Exception End_Error("End_Error") /* RENAMES Io_Exceptions::
                End_Error */;
      static Exception Data_Error("Data_Error") /* RENAMES Io_Exceptions::
                Data_Error */;
      static Exception Layout_Error("Layout_Error") /* RENAMES Io_Exceptions::
                Layout_Error */;
      typedef Integer *File_Type;
 
   } ;
 
 
 
#endif