Webmaster  |  Imprint 
C++ Server Pages
Main  |  License  |  Documentation  |  Download 

SourceInfo Class Reference

Source code info class. More...

#include <cxxtools/sourceinfo.h>

List of all members.

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

This class is used to store information about a location in the source code. The CXXTOOLS_SOURCEINFO macro can be used to construct a Pt::SourceInfo object conveniently.

        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;


Constructor & Destructor Documentation

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.

Copyright © 2008 The Tntnet Development Team
Tntnet 1.6