libcsdbg  1.28
C++ exception (and generic) stack trace debug library
std::ostream& operator<< ( std::ostream &  lval,
const parser rval 
)
friend

Stream insertion operator for csdbg::parser objects.

Parameters
[in]lvalthe output stream
[in]rvalthe object to output
Returns
its first argument

Definition at line 128 of file parser.cpp.

129 {
130  util::lock();
131 
132  /* If an exception occurs, output its details instead of rval */
133  try {
134  string *buf = rval.highlight();
135  lval << *buf;
136  delete buf;
137  }
138 
139  catch (exception &x) {
140  lval << x;
141  }
142 
143  catch (std::exception &x) {
144  lval << x;
145  }
146 
147  util::unlock();
148  return lval;
149 }
static void lock()
Lock the global access mutex.
Definition: util.cpp:397
static void unlock()
Unlock the global access mutex.
Definition: util.cpp:406