LocationInfo Class Reference

This class represents the location of a logging statement. More...

List of all members.

Public Member Functions

 LocationInfo (const char *const fileName, const char *const functionName, int lineNumber)
 Constructor.
 LocationInfo ()
 Default constructor.
 LocationInfo (const LocationInfo &src)
 Copy constructor.
LocationInfooperator= (const LocationInfo &src)
 Assignment operator.
void clear ()
 Resets location info to default state.
const std::string getClassName () const
 Return the class name of the call site.
const char * getFileName () const
 Return the file name of the caller.
int getLineNumber () const
 Returns the line number of the caller.
const std::string getMethodName () const
 Returns the method name of the caller.
void write (log4cxx::helpers::ObjectOutputStream &os, log4cxx::helpers::Pool &p) const

Static Public Member Functions

static const LocationInfogetLocationUnavailable ()

Static Public Attributes

static const char *const NA
 When location information is not available the constant NA is returned.
static const char *const NA_METHOD


Detailed Description

This class represents the location of a logging statement.

Constructor & Destructor Documentation

LocationInfo ( const char *const   fileName,
const char *const   functionName,
int  lineNumber 
)

Constructor.

Remarks:
Used by LOG4CXX_LOCATION to generate location info for current code site

LocationInfo (  ) 

Default constructor.

LocationInfo ( const LocationInfo src  ) 

Copy constructor.

Parameters:
src source location


Member Function Documentation

void clear (  ) 

Resets location info to default state.

const std::string getClassName (  )  const

Return the class name of the call site.

const char* getFileName (  )  const

Return the file name of the caller.

Returns:
file name, may be null.

int getLineNumber (  )  const

Returns the line number of the caller.

Returns:
line number, -1 if not available.

static const LocationInfo& getLocationUnavailable (  )  [static]

const std::string getMethodName (  )  const

Returns the method name of the caller.

LocationInfo& operator= ( const LocationInfo src  ) 

Assignment operator.

Parameters:
src source location

void write ( log4cxx::helpers::ObjectOutputStream os,
log4cxx::helpers::Pool p 
) const


Member Data Documentation

const char* const NA [static]

When location information is not available the constant NA is returned.

Current value of this string constant is ?.

const char* const NA_METHOD [static]


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