--------------------------------------------------------------------------------
--                                                                            --
-- Copyright (C) 2004, RISC OS Ada Library (RASCAL) developers.               --
--                                                                            --
-- This library is free software; you can redistribute it and/or              --
-- modify it under the terms of the GNU Lesser General Public                 --
-- License as published by the Free Software Foundation; either               --
-- version 2.1 of the License, or (at your option) any later version.         --
--                                                                            --
-- This library is distributed in the hope that it will be useful,            --
-- but WITHOUT ANY WARRANTY; without even the implied warranty of             --
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU           --
-- Lesser General Public License for more details.                            --
--                                                                            --
-- You should have received a copy of the GNU Lesser General Public           --
-- License along with this library; if not, write to the Free Software        --
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    --
--                                                                            --
--------------------------------------------------------------------------------

-- @brief MessageTrans types and methods.
-- $Author$
-- $Date$
-- $Revision$

with System.Unsigned_Types;     use System.Unsigned_Types;     
with Ada.Strings.Unbounded;     use Ada.Strings.Unbounded;
with RASCAL.OS;                 use RASCAL.OS;

package RASCAL.MessageTrans is

   Messages_File_Is_Closed      : Exception;

   --
   -- Gives information about a message file.
   --
   procedure Get_FileInfo (Filename : in string;
                           Flags    : out System.Unsigned_Types.Unsigned;
                           Size     : out Integer);

   --
   -- Returns the size the buffer needs to have.
   --
   function Get_Size (Filename : in string) return Integer;

   --
   -- Open messages file.
   --
   function Open_File (Filename : in String) return Messages_Handle_Type;

   --
   -- Lookup token in messages file.
   --
   function Lookup (Token      : in String;
                    MCB        : in Messages_Handle_Type;
                    Parameter1 : in String := "";
                    Parameter2 : in String := "";
                    Parameter3 : in String := "";
                    Parameter4 : in String := "") return String;

   --
   -- Close messages file.
   --
   procedure Close_File (MCB : Messages_Handle_Type);

   --
   -- Looks up the Token and interprets the result as a boolean.
   --
   procedure Read_Boolean (Token : in String;
                           Value : in out Boolean;
                           MCB   : in Messages_Handle_Type);

   --
   -- Looks up the Token and interprets the result as an integer.
   --
   procedure Read_Integer (Token : in String;
                           Value : in out Integer;
                           MCB   : in Messages_Handle_Type);

   --
   -- Looks up the Token and interprets the result as a string.
   --
   procedure Read_String (Token : in String;
                          Value : in out Unbounded_String;
                          MCB   : in Messages_Handle_Type);


end RASCAL.MessageTrans;
