libcsdbg  1.28
C++ exception (and generic) stack trace debug library
i8 & csdbg::string::at ( u32  i)
inlinevirtual

Get/set the character at an offset.

Parameters
[in]ithe offset
Returns
&this->m_data[i]
Exceptions
csdbg::exception

Definition at line 248 of file string.cpp.

References m_data, m_length, and unlikely.

Referenced by csdbg::parser::highlight(), and operator[]().

249 {
250  if ( unlikely(i >= m_length) )
251  throw exception("offset out of string bounds (%d >= %d)", i, m_length);
252 
253  return m_data[i];
254 }
i8 * m_data
String data.
Definition: string.hpp:42
#define unlikely(expr)
Offer a hint (negative) to the pipeline branch predictor.
Definition: config.hpp:349
u32 m_length
Character count.
Definition: string.hpp:44

+ Here is the caller graph for this function: