File: alog-helpers.ads

## Documentation

Table of Contents
Class Inheritance Tree

1.     --

2.     --  Copyright (c) 2008-2009,

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.     --

23.     with Ada.Direct_IO;

25.     with Alog.MapsTo API docTo specTo body;

27.     --  Alog helper functions/procedures.

28.     package Alog.HelpersTo API docTo specTo body is

30.        function Assert_Files_EqualTo API docTo body

31.          (Filename1 : String;

32.           Filename2 : String)

33.           return Boolean;

34.        --  Compare two files byte-wise. Returns True if both files are equal.

35.        --  The two files are closed but not removed after comparison.

37.        procedure Read_LoglevelsTo API docTo body

38.          (Filename      :        String;

39.           Default_LevelTo API docTo body : in out Log_LevelTo API docTo spec;

40.           IdentifiersTo API docTo body   :    out Maps.Wildcard_Level_MapTo API docTo specTo body);

41.        --  Read default loglevels and (optional) identifier based loglevels from

42.        --  file given by filename. The format is as follows:

43.        --

44.        --  # This is a comment (ignored)

45.        --

46.        --  # Default loglevel

47.        --  Default = Info

48.        --

49.        --  # Identifier-specific loglevels

50.        --  Foo.* = Debug

51.        --  Foo.Bar = Info

52.        --

53.        --  If no default loglevel setting is found in the file, the loglevel passed

54.        --  as Default_Level parameter is returned unchanged.

56.        Invalid_Config : exception;

57.        --  Exception is raised if a loglevel config file is invalid.

59.     private

60.        type My_Rec is record

61.           Char : Character;

62.        end record;

64.        package D_IO is new Ada.Direct_IO (My_Rec);

65.        use D_IO;

67.     end Alog.HelpersTo API docTo specTo body;