rutz::error_context Class Reference

Don't use this class directly; use the GVX_ERR_CONTEXT() macro instead. More...

#include <rutz/error_context.h>

List of all members.

Public Member Functions

 error_context ()
 Constructor (but use current() to get the current context).
 ~error_context ()
 Destructor.
bool add_entry (const error_context_entry *e)
 Add an entry to the context stack.
void remove_entry (const error_context_entry *e)
 Remove an entry from the context stack.
rutz::fstring get_text () const
 get the text of all context entries, separated by newlines
template<class S>
void prepend_to (S &str) const
 Prepend our message (if any) to the given string.

Static Public Member Functions

static const rutz::error_contextcurrent ()
 Get the current thread-local error context object.


Detailed Description

Don't use this class directly; use the GVX_ERR_CONTEXT() macro instead.

Definition at line 46 of file error_context.h.


Member Function Documentation

template<class S>
void rutz::error_context::prepend_to ( S &  str  )  const [inline]

Prepend our message (if any) to the given string.

This function is a template that is designed to work with either std::string or rutz::fstring (but without naming std::string explicitly here, we can avoid needing to include the 50K lines of code from <string>).

Example usage:

      std::string mymsg = "something bad happened";
      rutz::error_context::current().prepend_to(mymsg);

Definition at line 81 of file error_context.h.

References rutz::fstring::c_str(), get_text(), and rutz::fstring::length().


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

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:56:33 2008 by Doxygen version 1.5.5.