1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<title>
File: alog-helpers.ads
</title>
<link rel='stylesheet' href='support/docgen.css' type='text/css'/>
<script src='support/docgen.js' type='text/javascript' charset='utf-8'></script>
</head>
<body onload="onloadDoc();">
<div id='leftSide'>
<div id='leftSideInside'>
<div id='header'>
<h2 class="button">Documentation</h2>
<a href='index.html'><div class="button2">Table of Contents</div></a>
<a href='tree.html'><div class="button2">Class Inheritance Tree</div></a>
</div>
</div>
</div> <!-- leftSide -->
<div class='subprograms'>
<div class='details'><ol><li id="l1"><pre><span class="comment">--</span> </pre></li>
<li id="l2"><pre><span class="comment">-- Copyright (c) 2008-2009,</span> </pre></li>
<li id="l3"><pre><span class="comment">-- Reto Buerki, Adrian-Ken Rueegsegger</span> </pre></li>
<li id="l4"><pre><span class="comment">-- secunet SwissIT AG</span> </pre></li>
<li id="l5"><pre><span class="comment">--</span> </pre></li>
<li id="l6"><pre><span class="comment">-- This file is part of Alog.</span> </pre></li>
<li id="l7"><pre><span class="comment">--</span> </pre></li>
<li id="l8"><pre><span class="comment">-- Alog is free software; you can redistribute it and/or modify</span> </pre></li>
<li id="l9"><pre><span class="comment">-- it under the terms of the GNU Lesser General Public License as published</span> </pre></li>
<li id="l10"><pre><span class="comment">-- by the Free Software Foundation; either version 2.1 of the License, or</span> </pre></li>
<li id="l11"><pre><span class="comment">-- (at your option) any later version.</span> </pre></li>
<li id="l12"><pre><span class="comment">--</span> </pre></li>
<li id="l13"><pre><span class="comment">-- Alog is distributed in the hope that it will be useful,</span> </pre></li>
<li id="l14"><pre><span class="comment">-- but WITHOUT ANY WARRANTY; without even the implied warranty of</span> </pre></li>
<li id="l15"><pre><span class="comment">-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span> </pre></li>
<li id="l16"><pre><span class="comment">-- GNU Lesser General Public License for more details.</span> </pre></li>
<li id="l17"><pre><span class="comment">--</span> </pre></li>
<li id="l18"><pre><span class="comment">-- You should have received a copy of the GNU Lesser General Public License</span> </pre></li>
<li id="l19"><pre><span class="comment">-- along with Alog; if not, write to the Free Software</span> </pre></li>
<li id="l20"><pre><span class="comment">-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,</span> </pre></li>
<li id="l21"><pre><span class="comment">-- MA 02110-1301 USA</span> </pre></li>
<li id="l22"><pre><span class="comment">--</span> </pre></li>
<li id="l23"><pre> </pre></li>
<li id="l24"><pre><span class="keyword">with</span> Ada.Direct_IO; </pre></li>
<li id="l25"><pre> </pre></li>
<li id="l26"><pre><span class="keyword">with</span> <span class="droplink">Alog.Maps<ul><li><a href="alog-maps.ads.html#alog-maps.ads:28:14" title="To API doc">To API doc</a></li><li><a href="src_alog-maps.ads.html#l28" title="To spec">To spec</a></li><li><a href="src_alog-maps.adb.html#l26" title="To body">To body</a></li></ul></span>; </pre></li>
<li id="l27"><pre> </pre></li>
<li id="l28"><pre><span class="comment">-- Alog helper functions/procedures.</span> </pre></li>
<li id="l29"><pre><span class="keyword">package</span> <span class="droplink">Alog.Helpers<ul><li><a href="alog-helpers.ads.html#alog-helpers.ads:29:14" title="To API doc">To API doc</a></li><li><a href="src_alog-helpers.ads.html#l29" title="To spec">To spec</a></li><li><a href="src_alog-helpers.adb.html#l27" title="To body">To body</a></li></ul></span> <span class="keyword">is</span> </pre></li>
<li id="l30"><pre> </pre></li>
<li id="l31"><pre> <span class="keyword">function</span> <span class="droplink">Assert_Files_Equal<ul><li><a href="alog-helpers.ads.html#alog-helpers.ads:31:13" title="To API doc">To API doc</a></li><li><a href="src_alog-helpers.adb.html#l31" title="To body">To body</a></li></ul></span> </pre></li>
<li id="l32"><pre> (<a href="alog-helpers.ads.html#alog-helpers.ads:32:7" title="defined at alog-helpers.ads:32:7">Filename1</a> : String; </pre></li>
<li id="l33"><pre> <a href="alog-helpers.ads.html#alog-helpers.ads:33:7" title="defined at alog-helpers.ads:33:7">Filename2</a> : String) </pre></li>
<li id="l34"><pre> <span class="keyword">return</span> Boolean; </pre></li>
<li id="l35"><pre> <span class="comment">-- Compare two files byte-wise. Returns True if both files are equal.</span> </pre></li>
<li id="l36"><pre> <span class="comment">-- The two files are closed but not removed after comparison.</span> </pre></li>
<li id="l37"><pre> </pre></li>
<li id="l38"><pre> <span class="keyword">procedure</span> <span class="droplink">Read_Loglevels<ul><li><a href="alog-helpers.ads.html#alog-helpers.ads:38:14" title="To API doc">To API doc</a></li><li><a href="src_alog-helpers.adb.html#l77" title="To body">To body</a></li></ul></span> </pre></li>
<li id="l39"><pre> (<a href="alog-helpers.ads.html#alog-helpers.ads:39:7" title="defined at alog-helpers.ads:39:7">Filename</a> : String; </pre></li>
<li id="l40"><pre> <span class="droplink">Default_Level<ul><li><a href="alog-helpers.ads.html#alog-helpers.ads:40:7" title="To API doc">To API doc</a></li><li><a href="src_alog-helpers.adb.html#l79" title="To body">To body</a></li></ul></span> : <span class="keyword">in</span> <span class="keyword">out</span> <span class="droplink">Log_Level<ul><li><a href="alog.ads.html#alog.ads:32:9" title="To API doc">To API doc</a></li><li><a href="src_alog.ads.html#l32" title="To spec">To spec</a></li></ul></span>; </pre></li>
<li id="l41"><pre> <span class="droplink">Identifiers<ul><li><a href="alog-helpers.ads.html#alog-helpers.ads:41:7" title="To API doc">To API doc</a></li><li><a href="src_alog-helpers.adb.html#l80" title="To body">To body</a></li></ul></span> : <span class="keyword">out</span> <span class="droplink">Maps.Wildcard_Level_Map<ul><li><a href="alog-maps.ads.html#alog-maps.ads:30:9" title="To API doc">To API doc</a></li><li><a href="src_alog-maps.ads.html#l30" title="To spec">To spec</a></li><li><a href="src_alog-maps.ads.html#l100" title="To body">To body</a></li></ul></span>); </pre></li>
<li id="l42"><pre> <span class="comment">-- Read default loglevels and (optional) identifier based loglevels from</span> </pre></li>
<li id="l43"><pre> <span class="comment">-- file given by filename. The format is as follows:</span> </pre></li>
<li id="l44"><pre> <span class="comment">--</span> </pre></li>
<li id="l45"><pre> <span class="comment">-- # This is a comment (ignored)</span> </pre></li>
<li id="l46"><pre> <span class="comment">--</span> </pre></li>
<li id="l47"><pre> <span class="comment">-- # Default loglevel</span> </pre></li>
<li id="l48"><pre> <span class="comment">-- Default = Info</span> </pre></li>
<li id="l49"><pre> <span class="comment">--</span> </pre></li>
<li id="l50"><pre> <span class="comment">-- # Identifier-specific loglevels</span> </pre></li>
<li id="l51"><pre> <span class="comment">-- Foo.* = Debug</span> </pre></li>
<li id="l52"><pre> <span class="comment">-- Foo.Bar = Info</span> </pre></li>
<li id="l53"><pre> <span class="comment">--</span> </pre></li>
<li id="l54"><pre> <span class="comment">-- If no default loglevel setting is found in the file, the loglevel passed</span> </pre></li>
<li id="l55"><pre> <span class="comment">-- as Default_Level parameter is returned unchanged.</span> </pre></li>
<li id="l56"><pre> </pre></li>
<li id="l57"><pre> <a href="alog-helpers.ads.html#alog-helpers.ads:57:4" title="defined at alog-helpers.ads:57:4">Invalid_Config</a> : <span class="keyword">exception</span>; </pre></li>
<li id="l58"><pre> <span class="comment">-- Exception is raised if a loglevel config file is invalid.</span> </pre></li>
<li id="l59"><pre> </pre></li>
<li id="l60"><pre><span class="keyword">private</span> </pre></li>
<li id="l61"><pre> <span class="keyword">type</span> My_Rec <span class="keyword">is</span> <span class="keyword">record</span> </pre></li>
<li id="l62"><pre> Char : Character; </pre></li>
<li id="l63"><pre> <span class="keyword">end</span> <span class="keyword">record</span>; </pre></li>
<li id="l64"><pre> </pre></li>
<li id="l65"><pre> <span class="keyword">package</span> D_IO <span class="keyword">is</span> <span class="keyword">new</span> Ada.Direct_IO (My_Rec); </pre></li>
<li id="l66"><pre> <span class="keyword">use</span> D_IO; </pre></li>
<li id="l67"><pre> </pre></li>
<li id="l68"><pre><span class="keyword">end</span> <span class="droplink">Alog.Helpers<ul><li><a href="alog-helpers.ads.html#alog-helpers.ads:29:14" title="To API doc">To API doc</a></li><li><a href="src_alog-helpers.ads.html#l29" title="To spec">To spec</a></li><li><a href="src_alog-helpers.adb.html#l27" title="To body">To body</a></li></ul></span>; </pre></li>
</ol></div>
</div>
</body>
</html>
|