Clean up some stuff, including a few spots where exceptions were not being handled correctly.
This commit is contained in:
parent
03b909603a
commit
ca93b4a1ac
15 changed files with 42 additions and 66 deletions
|
@ -301,6 +301,25 @@ public:
|
|||
append(b._b,b._l);
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment size and return pointer to field of specified size
|
||||
*
|
||||
* The memory isn't actually written, so this is a shortcut for a multi-step
|
||||
* process involving getting the current pointer and adding size.
|
||||
*
|
||||
* @param l Length of field to append
|
||||
* @return Pointer to beginning of appended field of length 'l'
|
||||
*/
|
||||
inline char *appendField(unsigned int l)
|
||||
throw(std::out_of_range)
|
||||
{
|
||||
if ((_l + l) > C)
|
||||
throw std::out_of_range("Buffer: append beyond capacity");
|
||||
char *r = _b + _l;
|
||||
_l += l;
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
* Increment size by a given number of bytes
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue