CppUnit project page
FAQ
CppUnit home page
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
include
cppunit
SourceLine.h
Go to the documentation of this file.
1
#ifndef CPPUNIT_SOURCELINE_H
2
#define CPPUNIT_SOURCELINE_H
3
4
#include <
cppunit/Portability.h
>
5
#include <string>
6
13
#define CPPUNIT_SOURCELINE() CPPUNIT_NS::SourceLine( __FILE__, __LINE__ )
14
15
#if CPPUNIT_NEED_DLL_DECL
16
#pragma warning( push )
17
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
18
#endif
19
20
CPPUNIT_NS_BEGIN
21
22
34
class
CPPUNIT_API
SourceLine
35
{
36
public
:
37
SourceLine
();
38
39
// Ensure thread-safe copy by detaching the string buffer.
40
SourceLine
(
const
SourceLine
&other );
41
42
SourceLine
(
const
std::string &fileName,
43
int
lineNumber );
44
45
SourceLine
&operator =(
const
SourceLine
&other );
46
48
virtual
~
SourceLine
();
49
50
bool
isValid()
const
;
51
52
int
lineNumber()
const
;
53
54
std::string fileName()
const
;
55
56
bool
operator ==(
const
SourceLine
&other )
const
;
57
bool
operator !=(
const
SourceLine
&other )
const
;
58
59
private
:
60
std::string
m_fileName
;
61
int
m_lineNumber
;
62
};
63
64
65
CPPUNIT_NS_END
66
67
#if CPPUNIT_NEED_DLL_DECL
68
#pragma warning( pop )
69
#endif
70
71
#endif // CPPUNIT_SOURCELINE_H
hosts this site.
Send comments to:
CppUnit Developers