SourceCodeLocation Class Reference

Debug helper class to ship __FILE__, __(PRETTY_)FUNCTION__, __LINE__. Use SOURCECODELOCATION macro to create. More...

#include <SourceCodeLocation.h>

List of all members.

Public Member Functions

 SourceCodeLocation ()
 SourceCodeLocation (const std::string &file_r, const std::string &func_r, const std::string &pretty_func_r, unsigned line_r)
 operator const void *const () const
const std::string & file () const
const std::string & func () const
const std::string & pretty_func () const
unsigned line () const

Private Attributes

std::string _file
std::string _func
std::string _pretty_func
unsigned _line

Static Private Attributes

static const unsigned _unknown

Friends

SourceCodeLocation::_Verbose verbose (const SourceCodeLocation &obj_r)
std::ostream & operator<< (std::ostream &str, const SourceCodeLocation &obj_r)
std::ostream & operator<< (std::ostream &str, const SourceCodeLocation::_Verbose &obj_r)

Classes

struct  _Verbose


Detailed Description

Debug helper class to ship __FILE__, __(PRETTY_)FUNCTION__, __LINE__. Use SOURCECODELOCATION macro to create.

Constructor & Destructor Documentation

SourceCodeLocation::SourceCodeLocation (  )  [inline]

Default ctor: unknown location.

SourceCodeLocation::SourceCodeLocation ( const std::string &  file_r,
const std::string &  func_r,
const std::string &  pretty_func_r,
unsigned  line_r 
) [inline]

Ctor, use SOURCECODELOCATION macro for convenient creation.


Member Function Documentation

SourceCodeLocation::operator const void *const (  )  const [inline]

Returns:
NULL if unknown location

const std::string& SourceCodeLocation::file (  )  const [inline]

Returns:
__FILE__

const std::string& SourceCodeLocation::func (  )  const [inline]

Returns:
__FUNCTION__

const std::string& SourceCodeLocation::pretty_func (  )  const [inline]

Returns:
__PRETTY_FUNCTION__

unsigned SourceCodeLocation::line (  )  const [inline]

Returns:
__LINE__


Friends And Related Function Documentation

SourceCodeLocation::_Verbose verbose ( const SourceCodeLocation obj_r  )  [friend]

Helper wrapping SourceCodeLocation into a SourceCodeLocation::_Verbose for stream output.

std::ostream& operator<< ( std::ostream &  str,
const SourceCodeLocation obj_r 
) [friend]

Stream output as "__FILE__(__FUNCTION__):__LINE__"

std::ostream& operator<< ( std::ostream &  str,
const SourceCodeLocation::_Verbose obj_r 
) [friend]

Stream output as "__FILE__(__PRETTY_FUNCTION__):__LINE__" via verbose(SOURCECODELOCATION)


Member Data Documentation

const unsigned SourceCodeLocation::_unknown [static, private]

std::string SourceCodeLocation::_file [private]

std::string SourceCodeLocation::_func [private]

std::string SourceCodeLocation::_pretty_func [private]

unsigned SourceCodeLocation::_line [private]


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 22:35:03 2007 for liby2util by  doxygen 1.5.3