1--
2--  Copyright (c) 2008,
3--  Reto Buerki, Adrian-Ken Rueegsegger
4--
5--  This file is part of Alog.
6--
7--  Alog is free software; you can redistribute it and/or modify
8--  it under the terms of the GNU Lesser General Public License as published
9--  by the Free Software Foundation; either version 2.1 of the License, or
10--  (at your option) any later version.
11--
12--  Alog is distributed in the hope that it will be useful,
13--  but WITHOUT ANY WARRANTY; without even the implied warranty of
14--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15--  GNU Lesser General Public License for more details.
16--
17--  You should have received a copy of the GNU Lesser General Public License
18--  along with Alog; if not, write to the Free Software
19--  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
20--  MA  02110-1301  USA
21--
22
23with Ada.Characters.Handling;
24
25package body Alog.Transforms.Casing is
26
27   -------------------------------------------------------------------------
28
29   procedure Set_Mode
30     (Transform : in out Instance;
31      Mode      :        Operation_Mode)
32   is
33   begin
34      Transform.Mode := Mode;
35   end Set_Mode;
36
37   -------------------------------------------------------------------------
38
39   function Transform_Message
40     (Transform : Instance;
41      Level     : Log_Level := Info;
42      Msg       : String)
43      return String
44   is
45      pragma Unreferenced (Level);
46   begin
47      if Transform.Mode = Lowercase then
48         return Ada.Characters.Handling.To_Lower (Msg);
49      else
50         return Ada.Characters.Handling.To_Upper (Msg);
51      end if;
52   end Transform_Message;
53
54end Alog.Transforms.Casing;
55