cxxtools::SourceInfo Class Reference

Source code info classThis class is used to store information about a location in the source code. More...

#include <cxxtools/sourceinfo.h>

Public Member Functions

 SourceInfo (const char *file, const char *line, const char *func)
 Constructor.
const char * file () const
 Returns the filename.
const char * line () const
 Returns the line number.
const char * func () const
 Returns the function signature.

Detailed Description

Source code info class

This class is used to store information about a location in the source code.

The CXXTOOLS_SOURCEINFO macro can be used to construct a cxxtools::SourceInfo object conveniently.

// print file, line and function
std::cout << si.file() << std::endl;
std::cout << si.line() << std::endl;
std::cout << si.func() << std::endl;
// print combined string
std::cout << si.where() << std::endl;

Constructor & Destructor Documentation

cxxtools::SourceInfo::SourceInfo ( const char *  file,
const char *  line,
const char *  func 
)
inline

Constructor.

Do not use the constructor directly, but the CXXTOOLS_SOURCEINFO macro to take advantage of compiler specific macros to indicate the source file name, position and function name.

Member Function Documentation

const char* cxxtools::SourceInfo::file ( ) const
inline

Returns the filename.

const char* cxxtools::SourceInfo::func ( ) const
inline

Returns the function signature.

const char* cxxtools::SourceInfo::line ( ) const
inline

Returns the line number.


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