Added resize method used to re-alloc a DataBlock if it doesn't have a required length.
git-svn-id: http://yate.null.ro/svn/yate/trunk@3762 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
d6dc35ac2f
commit
76bf65c908
|
@ -2854,6 +2854,15 @@ public:
|
|||
*/
|
||||
void insert(const DataBlock& value);
|
||||
|
||||
/**
|
||||
* Resize (re-alloc or free) this block if required size is not the same as the current one
|
||||
* @param len Required block size
|
||||
*/
|
||||
inline void resize(unsigned int len) {
|
||||
if (len != length())
|
||||
assign(0,len);
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncate the data block
|
||||
* @param len The maximum length to keep
|
||||
|
|
Loading…
Reference in New Issue