My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
libpolys
tests
cxxtest
StdioFilePrinter.h
Go to the documentation of this file.
1
#ifndef __cxxtest__StdioFilePrinter_h__
2
#define __cxxtest__StdioFilePrinter_h__
3
4
//
5
// The StdioFilePrinter is a simple TestListener that
6
// just prints "OK" if everything goes well, otherwise
7
// reports the error in the format of compiler messages.
8
// This class uses <stdio.h>, i.e. FILE * and fprintf().
9
//
10
11
#include <
cxxtest/ErrorFormatter.h
>
12
#include <stdio.h>
13
14
namespace
CxxTest
15
{
16
class
StdioFilePrinter
:
public
ErrorFormatter
17
{
18
public
:
19
StdioFilePrinter
( FILE *o,
const
char
*preLine =
":"
,
const
char
*postLine =
""
) :
20
ErrorFormatter
( new
Adapter
(o), preLine, postLine ) {}
21
virtual
~StdioFilePrinter
() {
delete
outputStream
(); }
22
23
private
:
24
class
Adapter
:
public
OutputStream
25
{
26
Adapter
(
const
Adapter
& );
27
Adapter
&
operator=
(
const
Adapter
& );
28
29
FILE *
_o
;
30
31
public
:
32
Adapter
( FILE *o ) :
_o
(o) {}
33
void
flush
() { fflush(
_o
); }
34
OutputStream
&
operator<<
(
unsigned
i
) { fprintf(
_o
,
"%u"
,
i
);
return
*
this
; }
35
OutputStream
&
operator<<
(
const
char
*
s
) { fputs(
s
,
_o
);
return
*
this
; }
36
OutputStream
&
operator<<
(
Manipulator
m
) {
return
OutputStream::operator<<
(
m
); }
37
};
38
};
39
}
40
41
#endif
// __cxxtest__StdioFilePrinter_h__
ErrorFormatter.h
m
int m
Definition
cfEzgcd.cc:128
i
int i
Definition
cfEzgcd.cc:132
CxxTest::ErrorFormatter::outputStream
OutputStream * outputStream() const
Definition
ErrorFormatter.h:208
CxxTest::ErrorFormatter::ErrorFormatter
ErrorFormatter(OutputStream *o, const char *preLine=":", const char *postLine="")
Definition
ErrorFormatter.h:36
CxxTest::OutputStream
Definition
ErrorFormatter.h:20
CxxTest::OutputStream::operator<<
virtual OutputStream & operator<<(unsigned)
Definition
ErrorFormatter.h:24
CxxTest::OutputStream::Manipulator
void(* Manipulator)(OutputStream &)
Definition
ErrorFormatter.h:27
CxxTest::StdioFilePrinter::Adapter
Definition
StdioFilePrinter.h:25
CxxTest::StdioFilePrinter::Adapter::operator<<
OutputStream & operator<<(const char *s)
Definition
StdioFilePrinter.h:35
CxxTest::StdioFilePrinter::Adapter::operator<<
OutputStream & operator<<(Manipulator m)
Definition
StdioFilePrinter.h:36
CxxTest::StdioFilePrinter::Adapter::Adapter
Adapter(FILE *o)
Definition
StdioFilePrinter.h:32
CxxTest::StdioFilePrinter::Adapter::operator=
Adapter & operator=(const Adapter &)
CxxTest::StdioFilePrinter::Adapter::operator<<
OutputStream & operator<<(unsigned i)
Definition
StdioFilePrinter.h:34
CxxTest::StdioFilePrinter::Adapter::_o
FILE * _o
Definition
StdioFilePrinter.h:29
CxxTest::StdioFilePrinter::Adapter::Adapter
Adapter(const Adapter &)
CxxTest::StdioFilePrinter::Adapter::flush
void flush()
Definition
StdioFilePrinter.h:33
CxxTest::StdioFilePrinter::~StdioFilePrinter
virtual ~StdioFilePrinter()
Definition
StdioFilePrinter.h:21
CxxTest::StdioFilePrinter::StdioFilePrinter
StdioFilePrinter(FILE *o, const char *preLine=":", const char *postLine="")
Definition
StdioFilePrinter.h:19
CxxTest
Definition
Descriptions.cpp:7
CxxTest::s
char * s
Definition
ValueTraits.h:143
Generated on
for My Project by
doxygen 1.17.0
for
Singular