#include <Pt/SourceInfo.h>
Source code info class. More...
Public Member Functions | |
SourceInfo (const char *f, const char *ln, const char *fn) | |
Constructor. More... | |
const char * | file () const |
Returns the filename. | |
const char * | func () const |
Returns the function signature. | |
const char * | line () const |
Returns the line number. | |
Related Functions | |
std::string | operator+ (const std::string &what, const SourceInfo &info) |
Concatenates a string with a SourceInfo. | |
std::string | operator+ (const char *what, const SourceInfo &info) |
Concatenates a string with a SourceInfo. | |
std::string | operator+ (const SourceInfo &info, const std::string &what) |
Concatenates a string with a SourceInfo. | |
std::string | operator+ (const SourceInfo &info, const char *what) |
Concatenates a string with a SourceInfo. | |
The SourceInfo class is used to store information about a location in the source code. This includes the file name, the line number and the name of the function. The PT_SOURCEINFO macro can be used to construct a SourceInfo object conveniently, based on compiler macros such as __FILE__ or __LINE__.
Note, that the SourceInfo will contain the file and line information of the location where the PT_SOURCEINFO macro is used.
SourceInfo | ( | const char * | f, |
const char * | ln, | ||
const char * | fn | ||
) |
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.