diff options
Diffstat (limited to 'docs/doxygen/nel/a02525.html')
-rw-r--r-- | docs/doxygen/nel/a02525.html | 887 |
1 files changed, 887 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02525.html b/docs/doxygen/nel/a02525.html new file mode 100644 index 00000000..32167d61 --- /dev/null +++ b/docs/doxygen/nel/a02525.html @@ -0,0 +1,887 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> +<title>NeL: NLMISC::CFileDisplayer class Reference</title> +<link href="doxygen.css" rel="stylesheet" type="text/css"> +</head><body> +<!-- Generated by Doxygen 1.3.6 --> +<div class="qindex"> <form class="search" action="search.php" method="get"> +<a class="qindex" href="main.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>NLMISC::CFileDisplayer Class Reference</h1><code>#include <<a class="el" href="a05638.html">displayer.h</a>></code> +<p> +<p>Inheritance diagram for NLMISC::CFileDisplayer: +<p><center><img src="a02525.png" usemap="#NLMISC::CFileDisplayer_map" border="0" alt=""></center> +<map name="NLMISC::CFileDisplayer_map"> +<area href="a02526.html" alt="NLMISC::IDisplayer" shape="rect" coords="0,0,149,24"> +</map> +<hr><a name="_details"></a><h2>Detailed Description</h2> +File displayer. Put string into a file. log_howto <dl compact><dt><b>Author:</b></dt><dd>Vianney Lecroart <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2000 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05638.html#l00122">122</a> of file <a class="el" href="a05638.html">displayer.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayera0">CFileDisplayer</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayera1">CFileDisplayer</a> (const std::string &<a class="el" href="a04560.html#a1">filename</a>, bool eraseLastLog=false, const char *displayerName="", bool raw=false)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NLMISC_1_1CFileDisplayera1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02526.html#NLMISC_1_1IDisplayera0">display</a> (const <a class="el" href="a02814.html">CLog::TDisplayInfo</a> &args, const char *message)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Display the string where it does. <a href="#NLMISC_1_1IDisplayera0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayera3">setParam</a> (const std::string &<a class="el" href="a04560.html#a1">filename</a>, bool eraseLastLog=false)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Set Parameter of the displayer if not set at the ctor time. <a href="#NLMISC_1_1CFileDisplayera3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayera4">~CFileDisplayer</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Static Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="a02526.html#NLMISC_1_1IDisplayere0">dateToComputerString</a> (time_t date)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert date to "784551148" string (time in second from 1975). <a href="#NLMISC_1_1IDisplayere0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="a02526.html#NLMISC_1_1IDisplayere1">dateToHumanString</a> (time_t date)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert date to "2000/01/14 10:05:17" string. <a href="#NLMISC_1_1IDisplayere1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="a02526.html#NLMISC_1_1IDisplayere2">dateToHumanString</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert the current date to human string. <a href="#NLMISC_1_1IDisplayere2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="a02526.html#NLMISC_1_1IDisplayere3">logTypeToString</a> (<a class="el" href="a02813.html#NLNET_1_1CNetLogw8">CLog::TLogType</a> logType, bool longFormat=false)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Convert log type to string. <a href="#NLMISC_1_1IDisplayere3"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Data Fields</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a02526.html#NLMISC_1_1IDisplayero0">DisplayerName</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the idenfiant for a displayer, it is used to fond or remove a displayer. <a href="#NLMISC_1_1IDisplayero0"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerb0">doDisplay</a> (const <a class="el" href="a02814.html">CLog::TDisplayInfo</a> &args, const char *message)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Put the string into the file. <a href="#NLMISC_1_1CFileDisplayerb0"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Static Protected Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const char * </td><td class="memItemRight" valign=bottom><a class="el" href="a02526.html#NLMISC_1_1IDisplayerf0">HeaderString</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr0">_FileName</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>FILE * </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr2">_LastLogSizeChecked</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr3">_NeedHeader</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a></td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NLMISC_1_1CFileDisplayera1" doxytag="NLMISC::CFileDisplayer::CFileDisplayer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CFileDisplayer::CFileDisplayer </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname" nowrap> <em>filename</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>eraseLastLog</em> = false, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>displayerName</em> = "", </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>raw</em> = false</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00328">328</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05638.html#l00143">_FilePointer</a>, and <a class="el" href="a05637.html#l00350">setParam()</a>. +<p> +<div class="fragment"><pre>00328 : +00329 <a class="code" href="a02526.html#NLMISC_1_1IDisplayera1">IDisplayer</a> (displayerName), <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr3">_NeedHeader</a>(<span class="keyword">true</span>), <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr2">_LastLogSizeChecked</a>(0), <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>(raw) +00330 { +00331 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> = (FILE*)1; +00332 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayera3">setParam</a> (filename, eraseLastLog); +00333 } + +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayera0" doxytag="NLMISC::CFileDisplayer::CFileDisplayer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CFileDisplayer::CFileDisplayer </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00335">335</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05638.html#l00143">_FilePointer</a>. +<p> +<div class="fragment"><pre>00335 : +00336 <a class="code" href="a02526.html#NLMISC_1_1IDisplayera1">IDisplayer</a> (<span class="stringliteral">""</span>), <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr3">_NeedHeader</a>(<span class="keyword">true</span>), <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr2">_LastLogSizeChecked</a>(0), <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>(<span class="keyword">false</span>) +00337 { +00338 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> = (FILE*)1; +00339 } + +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayera4" doxytag="NLMISC::CFileDisplayer::~CFileDisplayer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> NLMISC::CFileDisplayer::~<a class="el" href="a02525.html">CFileDisplayer</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00341">341</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05638.html#l00143">_FilePointer</a>. +<p> +<div class="fragment"><pre>00342 { +00343 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> > (FILE*)1) +00344 { +00345 fclose(_FilePointer); +00346 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> = NULL; +00347 } +00348 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NLMISC_1_1IDisplayere0" doxytag="NLMISC::CFileDisplayer::dateToComputerString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const char * NLMISC::IDisplayer::dateToComputerString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">time_t </td> + <td class="mdname1" valign="top" nowrap> <em>date</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Convert date to "784551148" string (time in second from 1975). +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00103">103</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05586.html#l00161">NLMISC::smprintf()</a>. +<p> +<div class="fragment"><pre>00104 { +00105 <span class="keyword">static</span> <span class="keywordtype">char</span> cstime[25]; +00106 <a class="code" href="a05378.html#a259">smprintf</a> (cstime, 25, <span class="stringliteral">"%ld"</span>, &date); +00107 <span class="keywordflow">return</span> cstime; +00108 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1IDisplayere1" doxytag="NLMISC::CFileDisplayer::dateToHumanString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const char * NLMISC::IDisplayer::dateToHumanString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">time_t </td> + <td class="mdname1" valign="top" nowrap> <em>date</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Convert date to "2000/01/14 10:05:17" string. +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00092">92</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>00093 { +00094 <span class="keyword">static</span> <span class="keywordtype">char</span> cstime[25]; +00095 <span class="keyword">struct </span>tm *tms = localtime(&date); +00096 <span class="keywordflow">if</span> (tms) +00097 strftime (cstime, 25, <span class="stringliteral">"%Y/%m/%d %H:%M:%S"</span>, tms); +00098 <span class="keywordflow">else</span> +00099 sprintf(cstime, <span class="stringliteral">"bad date %d"</span>, (<a class="code" href="a04558.html#a11">uint32</a>)date); +00100 <span class="keywordflow">return</span> cstime; +00101 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1IDisplayere2" doxytag="NLMISC::CFileDisplayer::dateToHumanString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const char * NLMISC::IDisplayer::dateToHumanString </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Convert the current date to human string. +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00085">85</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +Referenced by <a class="el" href="a06094.html#l00123">NLNET::CNetDisplayer::doDisplay()</a>, <a class="el" href="a05976.html#l00330">NLMISC::CMemDisplayer::doDisplay()</a>, <a class="el" href="a05637.html#l00479">NLMISC::CMsgBoxDisplayer::doDisplay()</a>, <a class="el" href="a05637.html#l00379">doDisplay()</a>, and <a class="el" href="a05637.html#l00110">NLMISC::IDisplayer::HeaderString()</a>. +<p> +<div class="fragment"><pre>00086 { +00087 time_t date; +00088 time (&date); +00089 <span class="keywordflow">return</span> <a class="code" href="a02526.html#NLMISC_1_1IDisplayere2">dateToHumanString</a> (date); +00090 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1IDisplayera0" doxytag="NLMISC::CFileDisplayer::display" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::IDisplayer::display </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02814.html">CLog::TDisplayInfo</a> & </td> + <td class="mdname" nowrap> <em>args</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>message</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Display the string where it does. +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00132">132</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a02526.html#NLMISC_1_1IDisplayerb0">NLMISC::IDisplayer::doDisplay()</a>. +<p> +<div class="fragment"><pre>00133 { +00134 _Mutex->enter(); +00135 <span class="keywordflow">try</span> +00136 { +00137 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerb0">doDisplay</a>( args, message ); +00138 } +00139 <span class="keywordflow">catch</span> (<a class="code" href="a02482.html">Exception</a> &) +00140 { +00141 <span class="comment">// silence</span> +00142 } +00143 _Mutex->leave(); +00144 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayerb0" doxytag="NLMISC::CFileDisplayer::doDisplay" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CFileDisplayer::doDisplay </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const <a class="el" href="a02814.html">CLog::TDisplayInfo</a> & </td> + <td class="mdname" nowrap> <em>args</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const char * </td> + <td class="mdname" nowrap> <em>message</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [protected, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Put the string into the file. +<p> + +<p> +Implements <a class="el" href="a02526.html#NLMISC_1_1IDisplayerb0">NLMISC::IDisplayer</a>. +<p> +Definition at line <a class="el" href="a05637.html#l00379">379</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05638.html#l00143">_FilePointer</a>, <a class="el" href="a05638.html#l00147">_LastLogSizeChecked</a>, <a class="el" href="a05638.html#l00145">_NeedHeader</a>, <a class="el" href="a05638.html#l00149">_Raw</a>, <a class="el" href="a05944.html#l00071">NLMISC::CLog::TDisplayInfo::CallstackAndLog</a>, <a class="el" href="a05944.html#l00064">NLMISC::CLog::TDisplayInfo::Date</a>, <a class="el" href="a05637.html#l00085">NLMISC::IDisplayer::dateToHumanString()</a>, <a class="el" href="a05944.html#l00068">NLMISC::CLog::TDisplayInfo::Filename</a>, <a class="el" href="a05637.html#l00110">NLMISC::IDisplayer::HeaderString()</a>, <a class="el" href="a05944.html#l00069">NLMISC::CLog::TDisplayInfo::Line</a>, <a class="el" href="a05944.html#l00065">NLMISC::CLog::TDisplayInfo::LogType</a>, <a class="el" href="a05637.html#l00077">NLMISC::IDisplayer::logTypeToString()</a>, <a class="el" href="a05944.html#l00066">NLMISC::CLog::TDisplayInfo::ProcessName</a>, <a class="el" href="a05646.html#l01119">res</a>, <a class="el" href="a05944.html#l00067">NLMISC::CLog::TDisplayInfo::ThreadId</a>, and <a class="el" href="a06229.html#l02652">NLMISC::toString()</a>. +<p> +<div class="fragment"><pre>00380 { +00381 <span class="keywordtype">bool</span> needSpace = <span class="keyword">false</span>; +00382 <span class="comment">//stringstream ss;</span> +00383 string str; +00384 +00385 <span class="comment">// if the filename is not set, don't log</span> +00386 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr0">_FileName</a>.empty()) <span class="keywordflow">return</span>; +00387 +00388 <span class="keywordflow">if</span> (args.Date != 0 && !<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>) +00389 { +00390 str += <a class="code" href="a02526.html#NLMISC_1_1IDisplayere2">dateToHumanString</a>(args.Date); +00391 needSpace = <span class="keyword">true</span>; +00392 } +00393 +00394 <span class="keywordflow">if</span> (args.LogType != CLog::LOG_NO && !<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>) +00395 { +00396 <span class="keywordflow">if</span> (needSpace) { str += <span class="stringliteral">" "</span>; needSpace = <span class="keyword">false</span>; } +00397 str += <a class="code" href="a02526.html#NLMISC_1_1IDisplayere3">logTypeToString</a>(args.LogType); +00398 needSpace = <span class="keyword">true</span>; +00399 } +00400 +00401 <span class="comment">// Write thread identifier</span> +00402 <span class="keywordflow">if</span> ( args.ThreadId != 0 && !<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>) +00403 { +00404 <span class="keywordflow">if</span> (needSpace) { str += <span class="stringliteral">" "</span>; needSpace = <span class="keyword">false</span>; } +00405 str += <a class="code" href="a05378.html#a244">NLMISC::toString</a>(args.ThreadId); +00406 needSpace = <span class="keyword">true</span>; +00407 } +00408 +00409 <span class="keywordflow">if</span> (!args.ProcessName.empty() && !<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>) +00410 { +00411 <span class="keywordflow">if</span> (needSpace) { str += <span class="stringliteral">" "</span>; needSpace = <span class="keyword">false</span>; } +00412 str += args.ProcessName; +00413 needSpace = <span class="keyword">true</span>; +00414 } +00415 +00416 <span class="keywordflow">if</span> (args.Filename != NULL && !<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>) +00417 { +00418 <span class="keywordflow">if</span> (needSpace) { str += <span class="stringliteral">" "</span>; needSpace = <span class="keyword">false</span>; } +00419 str += CFile::getFilename(args.Filename); +00420 needSpace = <span class="keyword">true</span>; +00421 } +00422 +00423 <span class="keywordflow">if</span> (args.Line != -1 && !<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr4">_Raw</a>) +00424 { +00425 <span class="keywordflow">if</span> (needSpace) { str += <span class="stringliteral">" "</span>; needSpace = <span class="keyword">false</span>; } +00426 str += <a class="code" href="a05378.html#a244">NLMISC::toString</a>(args.Line); +00427 needSpace = <span class="keyword">true</span>; +00428 } +00429 +00430 <span class="keywordflow">if</span> (needSpace) { str += <span class="stringliteral">" : "</span>; needSpace = <span class="keyword">false</span>; } +00431 +00432 str += message; +00433 +00434 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> > (FILE*)1) +00435 { +00436 <span class="comment">// if the file is too big (>5mb), rename it and create another one (check only after 20 lines to speed up)</span> +00437 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr2">_LastLogSizeChecked</a>++ > 20) +00438 { +00439 <span class="keywordtype">int</span> <a class="code" href="a04223.html#a643">res</a> = ftell (_FilePointer); +00440 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a643">res</a> > 5*1024*1024) +00441 { +00442 fclose (_FilePointer); +00443 rename (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr0">_FileName</a>.c_str(), CFile::findNewFile (_FileName).c_str()); +00444 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> = (FILE*) 1; +00445 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr2">_LastLogSizeChecked</a> = 0; +00446 } +00447 } +00448 } +00449 +00450 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> == (FILE*)1) +00451 { +00452 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> = fopen (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr0">_FileName</a>.c_str(), <span class="stringliteral">"at"</span>); +00453 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> == NULL) +00454 printf (<span class="stringliteral">"Can't open log file '%s': %s\n"</span>, <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr0">_FileName</a>.c_str(), strerror (errno)); +00455 } +00456 +00457 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> != 0) +00458 { +00459 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr3">_NeedHeader</a>) +00460 { +00461 <span class="keyword">const</span> <span class="keywordtype">char</span> *hs = <a class="code" href="a02526.html#NLMISC_1_1IDisplayerf0">HeaderString</a>(); +00462 fwrite (hs, strlen (hs), 1, _FilePointer); +00463 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr3">_NeedHeader</a> = <span class="keyword">false</span>; +00464 } +00465 +00466 <span class="keywordflow">if</span>(!str.empty()) +00467 fwrite (str.c_str(), str.size(), 1, <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a>); +00468 +00469 <span class="keywordflow">if</span>(!args.CallstackAndLog.empty()) +00470 fwrite (args.CallstackAndLog.c_str(), args.CallstackAndLog.size (), 1, <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a>); +00471 +00472 fflush (_FilePointer); +00473 } +00474 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1IDisplayerf0" doxytag="NLMISC::CFileDisplayer::HeaderString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const char * NLMISC::IDisplayer::HeaderString </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [static, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00110">110</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05637.html#l00085">NLMISC::IDisplayer::dateToHumanString()</a>, and <a class="el" href="a05586.html#l00161">NLMISC::smprintf()</a>. +<p> +Referenced by <a class="el" href="a05976.html#l00330">NLMISC::CMemDisplayer::doDisplay()</a>, and <a class="el" href="a05637.html#l00379">doDisplay()</a>. +<p> +<div class="fragment"><pre>00111 { +00112 <span class="keyword">static</span> <span class="keywordtype">char</span> header[1024]; +00113 <a class="code" href="a05378.html#a259">smprintf</a>(header, 1024, <span class="stringliteral">"\nLog Starting [%s]\n"</span>, <a class="code" href="a02526.html#NLMISC_1_1IDisplayere2">dateToHumanString</a>()); +00114 <span class="keywordflow">return</span> header; +00115 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1IDisplayere3" doxytag="NLMISC::CFileDisplayer::logTypeToString" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> const char * NLMISC::IDisplayer::logTypeToString </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02813.html#NLNET_1_1CNetLogw8">CLog::TLogType</a> </td> + <td class="mdname" nowrap> <em>logType</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>longFormat</em> = false</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [static, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Convert log type to string. +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00077">77</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05637.html#l00071">NLMISC::LogTypeToString</a>. +<p> +Referenced by <a class="el" href="a06751.html#l00130">NLMISC::CWindowDisplayer::doDisplay()</a>, <a class="el" href="a06094.html#l00123">NLNET::CNetDisplayer::doDisplay()</a>, <a class="el" href="a05976.html#l00330">NLMISC::CMemDisplayer::doDisplay()</a>, <a class="el" href="a05637.html#l00479">NLMISC::CMsgBoxDisplayer::doDisplay()</a>, <a class="el" href="a05637.html#l00379">doDisplay()</a>, and <a class="el" href="a05637.html#l00148">NLMISC::CStdDisplayer::doDisplay()</a>. +<p> +<div class="fragment"><pre>00078 { +00079 <span class="keywordflow">if</span> (logType < CLog::LOG_NO || logType > CLog::LOG_UNKNOWN) +00080 <span class="keywordflow">return</span> <span class="stringliteral">"<NotDefined>"</span>; +00081 +00082 <span class="keywordflow">return</span> <a class="code" href="a05378.html#a20">LogTypeToString</a>[longFormat?1:0][logType]; +00083 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayera3" doxytag="NLMISC::CFileDisplayer::setParam" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> void NLMISC::CFileDisplayer::setParam </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname" nowrap> <em>filename</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>eraseLastLog</em> = false</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Set Parameter of the displayer if not set at the ctor time. +<p> + +<p> +Definition at line <a class="el" href="a05637.html#l00350">350</a> of file <a class="el" href="a05637.html">displayer.cpp</a>. +<p> +References <a class="el" href="a05638.html#l00143">_FilePointer</a>. +<p> +Referenced by <a class="el" href="a05637.html#l00328">CFileDisplayer()</a>, <a class="el" href="a05621.html#l00893">NLMISC::changeLogDirectory()</a>, and <a class="el" href="a06645.html#l00479">NLNET::CUnifiedNetwork::init()</a>. +<p> +<div class="fragment"><pre>00351 { +00352 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr0">_FileName</a> = <a class="code" href="a05377.html#a2">filename</a>; +00353 +00354 <span class="keywordflow">if</span> (<a class="code" href="a05377.html#a2">filename</a>.empty()) +00355 { +00356 <span class="comment">// can't do nlwarning or infinite recurs</span> +00357 printf (<span class="stringliteral">"CFileDisplayer::setParam(): Can't create file with empty filename\n"</span>); +00358 <span class="keywordflow">return</span>; +00359 } +00360 +00361 <span class="keywordflow">if</span> (eraseLastLog) +00362 { +00363 ofstream ofs (<a class="code" href="a05377.html#a2">filename</a>.c_str(), ios::out | ios::trunc); +00364 <span class="keywordflow">if</span> (!ofs.is_open()) +00365 { +00366 <span class="comment">// can't do nlwarning or infinite recurs</span> +00367 printf (<span class="stringliteral">"CFileDisplayer::setParam(): Can't open and clear the log file '%s'\n"</span>, <a class="code" href="a05377.html#a2">filename</a>.c_str()); +00368 } +00369 } +00370 +00371 <span class="keywordflow">if</span> (<a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> > (FILE*)1) +00372 { +00373 fclose (_FilePointer); +00374 <a class="code" href="a02525.html#NLMISC_1_1CFileDisplayerr1">_FilePointer</a> = (FILE*)1; +00375 } +00376 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NLMISC_1_1CFileDisplayerr0" doxytag="NLMISC::CFileDisplayer::_FileName" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::string <a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr0">NLMISC::CFileDisplayer::_FileName</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05638.html#l00141">141</a> of file <a class="el" href="a05638.html">displayer.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayerr1" doxytag="NLMISC::CFileDisplayer::_FilePointer" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> FILE* <a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr1">NLMISC::CFileDisplayer::_FilePointer</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05638.html#l00143">143</a> of file <a class="el" href="a05638.html">displayer.h</a>. +<p> +Referenced by <a class="el" href="a05637.html#l00328">CFileDisplayer()</a>, <a class="el" href="a05637.html#l00379">doDisplay()</a>, <a class="el" href="a05637.html#l00350">setParam()</a>, and <a class="el" href="a05637.html#l00341">~CFileDisplayer()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayerr2" doxytag="NLMISC::CFileDisplayer::_LastLogSizeChecked" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> <a class="el" href="a04558.html#a15">uint</a> <a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr2">NLMISC::CFileDisplayer::_LastLogSizeChecked</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05638.html#l00147">147</a> of file <a class="el" href="a05638.html">displayer.h</a>. +<p> +Referenced by <a class="el" href="a05637.html#l00379">doDisplay()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayerr3" doxytag="NLMISC::CFileDisplayer::_NeedHeader" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr3">NLMISC::CFileDisplayer::_NeedHeader</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05638.html#l00145">145</a> of file <a class="el" href="a05638.html">displayer.h</a>. +<p> +Referenced by <a class="el" href="a05637.html#l00379">doDisplay()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1CFileDisplayerr4" doxytag="NLMISC::CFileDisplayer::_Raw" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> bool <a class="el" href="a02525.html#NLMISC_1_1CFileDisplayerr4">NLMISC::CFileDisplayer::_Raw</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a05638.html#l00149">149</a> of file <a class="el" href="a05638.html">displayer.h</a>. +<p> +Referenced by <a class="el" href="a05637.html#l00379">doDisplay()</a>. </td> + </tr> +</table> +<a class="anchor" name="NLMISC_1_1IDisplayero0" doxytag="NLMISC::CFileDisplayer::DisplayerName" ></a><p> +<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> + <tr> + <td class="mdRow"> + <table cellpadding="0" cellspacing="0" border="0"> + <tr> + <td class="md" nowrap valign="top"> std::string <a class="el" href="a02526.html#NLMISC_1_1IDisplayero0">NLMISC::IDisplayer::DisplayerName</a><code> [inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This is the idenfiant for a displayer, it is used to fond or remove a displayer. +<p> + +<p> +Definition at line <a class="el" href="a05638.html#l00063">63</a> of file <a class="el" href="a05638.html">displayer.h</a>. +<p> +Referenced by <a class="el" href="a05637.html#l00118">NLMISC::IDisplayer::IDisplayer()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05638.html">displayer.h</a><li><a class="el" href="a05637.html">displayer.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 13:13:01 2004 for NeL by +<a href="http://www.doxygen.org/index.html"> +<img src="doxygen.png" alt="doxygen" align="middle" border=0 > +</a>1.3.6 </small></address> +</body> +</html> |