CppUnit - The Unit Testing Library

CppUnit project page | FAQ

SourceLine Class Reference
Creating custom assertions | Browsing collected test result

Represents a source line location. More...

`#include <SourceLine.h>`

## Public Member Functions
| SourceLine ()
| SourceLine (const SourceLine &other)
| SourceLine (const std::string &fileName, int lineNumber)
SourceLine & | operator= (const SourceLine &other)
virtual | ~SourceLine ()
| Destructor.
bool | isValid () const
int | lineNumber () const
std::string | fileName () const
bool | operator== (const SourceLine &other) const
bool | operator!= (const SourceLine &other) const

## Private Attributes
std::string | m_fileName
int | m_lineNumber

## Detailed Description

Represents a source line location.

Used to capture the failure location in assertion.

Use the CPPUNIT_SOURCELINE() macro to construct that object. Typically used when writing an assertion macro in association with Asserter.

See also
  Asserter.

## Constructor & Destructor Documentation

## ◆ SourceLine() [1/3]

CPPUNIT_NS_BEGIN SourceLine::SourceLine | ( |  | ) |

## ◆ SourceLine() [2/3]

SourceLine::SourceLine | ( | const SourceLine & | other | ) |

## ◆ SourceLine() [3/3]

SourceLine::SourceLine | ( | const std::string & | fileName,
|  | int | lineNumber )

## ◆ ~SourceLine()

SourceLine::~SourceLine | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ fileName()

std::string SourceLine::fileName | ( |  | ) | const

## ◆ isValid()

bool SourceLine::isValid | ( |  | ) | const

## ◆ lineNumber()

int SourceLine::lineNumber | ( |  | ) | const

## ◆ operator!=()

bool SourceLine::operator!= | ( | const SourceLine & | other | ) | const

## ◆ operator=()

SourceLine & SourceLine::operator= | ( | const SourceLine & | other | ) |

## ◆ operator==()

bool SourceLine::operator== | ( | const SourceLine & | other | ) | const

## Member Data Documentation

## ◆ m_fileName

std::string SourceLine::m_fileName
| private

## ◆ m_lineNumber

int SourceLine::m_lineNumber
| private

The documentation for this class was generated from the following files:

- SourceLine.h
- SourceLine.cpp

| Send comments to: CppUnit Developers