----------------------------------------------------------------------------- -- -- libwww-ada95 : A World Wide Web client library for Ada95 -- -- W W W . R E S P O N S E -- -- B o d y -- -- Copyright (C) 1997-1998 Regents of the University of California -- -- libwww-ada95 is free software; you can redistribute it and/or modify it -- under the terms of the GNU General Public License as published by the Free -- Software Foundation, with or without the single exception listed below; -- either version 2, or (at your option) any later version. libwww-ada95 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 General Public License for more details. -- You should have received a copy of the GNU General Public License -- distributed with libwww-ada95; see the file COPYING. If not, write to the -- Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -- 02111-1307, USA. -- -- As a special exception, if other files instantiate generics from this -- library, or you link this library with other files to produce an -- executable, this library does not by itself cause the resulting -- executable to be covered by the GNU General Public License. This -- exception does not however invalidate any other reasons why the -- executable file might be covered by the GNU General Public License. -- -- Created in 1997 by Kari Nies ----------------------------------------------------------------------------- with Text_IO; with WWW.Message; package body WWW.Response is package Int_IO is new Text_IO.Integer_IO (integer); -- Status code access procedure Set_Status_Code (Response : in out Response_Object; Status : INTEGER) is begin Response.Status_Code := Status; end Set_Status_Code; function Get_Status_Code (Response : Response_Object) return INTEGER is begin return Response.Status_Code; end Get_Status_Code; -- Reason phrase access procedure Set_Reason_Phrase (Response : in out Response_Object; Reason : UB_String) is begin Response.Reason_Phrase := Reason; end Set_Reason_Phrase; procedure Set_Reason_Phrase (Response : in out Response_Object; Reason : STRING) is begin Set_Reason_Phrase (Response, UB_Strings.To_Unbounded_String (Reason)); end Set_Reason_Phrase; function Get_Reason_Phrase (Response : Response_Object) return UB_String is begin return Response.Reason_Phrase; end Get_Reason_Phrase; function Get_Reason_Phrase (Response : Response_Object) return STRING is begin return UB_Strings.To_String (Get_Reason_Phrase (Response)); end Get_Reason_Phrase; procedure Print_Message (Response : Response_Object) is begin Text_IO.Put_Line ( UB_Strings.To_String (Response.Protocol) & "/" & Message.Image (Response.Version) & Integer'Image (Response.Status_Code) & " " & Get_Reason_Phrase (Response)); Message.Print_Message (Message.Message_Object (Response)); end Print_Message; end WWW.Response;