added extend() method which realloc()s the buffer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
fedde9b906
commit
6901ac371f
1 changed files with 12 additions and 0 deletions
|
|
@ -84,6 +84,18 @@ public: \
|
|||
return *this; \
|
||||
} \
|
||||
\
|
||||
bool extend(size_t len) \
|
||||
{ \
|
||||
chartype * \
|
||||
str = (chartype *)realloc(m_str, (len + 1)*sizeof(chartype)); \
|
||||
if ( !str ) \
|
||||
return false; \
|
||||
\
|
||||
m_str = str; \
|
||||
\
|
||||
return true; \
|
||||
} \
|
||||
\
|
||||
chartype *data() { return m_str; } \
|
||||
const chartype *data() const { return m_str; } \
|
||||
operator const chartype *() const { return m_str; } \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue