libcsdbg  1.28
C++ exception (and generic) stack trace debug library
filebuf & csdbg::filebuf::operator= ( const filebuf rval)
virtual

Assignment operator.

Parameters
[in]rvalthe assigned object
Returns
*this
Exceptions
std::bad_alloc
csdbg::exception

Definition at line 112 of file filebuf.cpp.

References m_path, csdbg::streambuf::operator=(), and unlikely.

113 {
114  if ( unlikely(this == &rval) )
115  return *this;
116 
117  /* Copy the buffer and duplicate the stream descriptor */
118  streambuf::operator=(rval);
119 
120  u32 len = strlen(rval.m_path);
121  if (len > strlen(m_path)) {
122  delete[] m_path;
123  m_path = NULL;
124  m_path = new i8[len + 1];
125  }
126 
127  strcpy(m_path, rval.m_path);
128  return *this;
129 }
char i8
8-bit signed integer
Definition: config.hpp:72
virtual streambuf & operator=(const streambuf &)
Assignment operator.
Definition: streambuf.cpp:96
unsigned int u32
32-bit unsigned integer
Definition: config.hpp:102
i8 * m_path
Output file path.
Definition: filebuf.hpp:37
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349

+ Here is the call graph for this function: