#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. | |
Pt::SourceInfo si(PT_SOURCEINFO);
// 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;
| SourceInfo | ( | const char * | file, | |
| const char * | line, | |||
| const char * | func | |||
| ) |
Do not use the constructor directly, but the PT_SOURCEINFO macro to take advantage of compiler specific macros to indicate the source file name, position and function name.