SourceLine |
The class SourceLine (see Figure C-12) represents a location in a source code file. It is used to capture the location of an assertion failure. A SourceLine usually is created using the macro CPPUNIT_SOURCELINE( ) , which uses the preprocessor directives _ _FILE_ _ and __LINE_ _ to obtain the filename and line number of the location where it's invoked:
#define CPPUNIT_SOURCELINE( ) ::CppUnit::SourceLine( __FILE__, __LINE_ _ )
SourceLine belongs to the namespace CppUnit . It is declared in SourceLine.h and implemented in SourceLine.cpp .
class SourceLine
A constructor taking a filename and line number.
A default constructor creating an uninitialized SourceLine .
A destructor.
A comparison operator.
An inequality operator.
Returns the filename.
Returns TRUE if SourceLine is initialized (the filename is not empty).
Returns the line number.
A copy constructor declared private to prevent its use.
A copy operator declared private to prevent its use.
The source filename ( private ).
The source file line number ( private ).