📄 wzwarningtest.html
字号:
<TITLE>WZ 1.0 - Warnings</TITLE>
<H1>Warnings</H1>
To handle warnings, we use the class <B>wzWarning</B>. It is implemented
as a derived class of <B>wzCounter</B>. This class is defined in
<PRE>
#include "<A HREF="wzwarning.hxx">wzwarning.hxx</A>"
</PRE>
<P>The following test code creates a warning:
<PRE>
static wzWarning Example("wzwarningtest","Example");
void test()
{
Example("first call"); // at this moment the warning will be printed;
Example("second call"); // but only once;
Example(); // you need not define a string
</PRE>
<P>The text of the warning includes the name of the warning (here
"Example"), the info string if available (here "first call") and
extracts the related part from the documentation file (In this case <A
HREF="wzwarningtest.html#Example"> wzwarningtest.html#Example</A>,
that means the following:
<A NAME="Example"> <hr></A>
<P>This text should be written out.
<P><A NAME="End of example"> <hr></A>
<P>If not, control the environment variable <B>COG_HOME</B>. It should
be the path name of the sources.
<P><A NAME="suppress"> <hr></A>
<H2>Suppressing Warnings</H2>
<P>The text of the warning gives you information how the warning may
be suppressed. For this purpose, you have to know which is the
warning you have to suppress, and to call the method
<B>.ignore()</B>. For example, the call of <B>wzUntested()</B>
creates the warning <B>wzWarning::Untested</B>. We suppress this
warning with the following code:
<PRE>
wzWarning::Untested.ignore();
wzUntested("should be ignored in this test example");
</PRE>
<P>To try out the following may be interesting too (but please don't
send me a mail after this ;-):
<PRE>
/*
{
wzWarning ww1("badfilename","entry");
wzWarning ww2("warnings","badentryname");
ww1();
ww2();
}
*/
</PRE>
<A NAME="errors"> <hr></A>
<H2><A HREF="errors.html">Errors</A></H2>
<P>No exceptions will be caused.
<A NAME="Documentation_Not_Found"> <hr></A>
<H2>Documentation not found</H2>
<P>The documentation seems to be invalid, for the error/warning which
has occured we have not yet written a documentation, or written it
into the wrong place. Mail a short info to the author.
<A NAME="Documentation_Entry_Not_Found"> <hr></A>
<H2>Documentation entry not found</H2>
<P>The documentation seems to be invalid, for the error/warning which
has occured we have not yet written a documentation, or written it
into the wrong place. Mail a short info to the author.
<A NAME="End"> <hr></A>
<PRE>
}
</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -