------------------------------------------------------------------------------ -- XML/Ada - An XML suite for Ada95 -- -- -- -- Copyright (C) 2001-2012, AdaCore -- -- -- -- This library is free software; you can redistribute it and/or modify it -- -- under terms of the GNU General Public License as published by the Free -- -- Software Foundation; either version 3, 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 MERCHAN- -- -- TABILITY or FITNESS FOR A PARTICULAR PURPOSE. -- -- -- -- -- -- -- -- -- -- -- -- You should have received a copy of the GNU General Public License and -- -- a copy of the GCC Runtime Library Exception along with this program; -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- . -- -- -- ------------------------------------------------------------------------------ with Ada.Exceptions; with Sax.Locators; with Unicode.CES; package Sax.Exceptions is ------------------- -- Sax_Exception -- ------------------- type sax_exception (<>) is tagged private; -- General type that encapsulates a general SAX error or warning. -- It does not contain source location information (see Sax_Parse_Exception -- instead) function Create (Ada_Exception : Ada.Exceptions.Exception_Id) return sax_exception'class; -- Create a new SAX exception wrapping an existing exception function Create (Message : Unicode.CES.byte_sequence) return sax_exception'class; -- Create a new SAX exception function Create (Message : Unicode.CES.byte_sequence; Ada_Exception : Ada.Exceptions.Exception_Id) return sax_exception'class; -- Create a new SAX exception from an existing exception function Get_Exception (Except : sax_exception) return Ada.Exceptions.Exception_Id; -- Return the embedded exception function Get_Message (Except : sax_exception) return Unicode.CES.byte_sequence; -- Return the message ------------------------- -- Sax_Parse_Exception -- ------------------------- type sax_parse_exception (<>) is new sax_exception with private; function Create (Message : Unicode.CES.byte_sequence; Loc : Sax.Locators.location) return sax_parse_exception'class; function Create (Message : Unicode.CES.byte_sequence; Ada_Exception : Ada.Exceptions.Exception_Id; Loc : Sax.Locators.location) return sax_exception'class; -- Create a new Sax_Parse_Exception. Note: no copy of Loc is made. function Get_Location (Except : sax_parse_exception) return Sax.Locators.location; -- return the location where the exception was raised. private type sax_exception (Length : Natural) is tagged record Message : Unicode.CES.byte_sequence (1 .. Length); Except : Ada.Exceptions.Exception_Id; end record; type sax_parse_exception is new sax_exception with record Loc : Sax.Locators.location; end record; end Sax.Exceptions;