2008-02-18 19:04:03 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2008-02-21 16:58:30 -05:00
|
|
|
// Name: bufferclasses.h
|
2008-02-18 19:04:03 -05:00
|
|
|
// Purpose: topic overview
|
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Licence: wxWindows license
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
/**
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
@page overview_bufferclasses Buffer Classes
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
wxWidgets uses two classes of classes for dealing with buffers in memory.
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
The first is one for dealing with character buffers, namely wxCharBuffer for
|
|
|
|
char pointer or multi-byte c strings and wxWCharBuffer for wchar_t pointer or
|
|
|
|
wide character c strings.
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
Secondly, wxWidgets uses, although only rarely currently, wxMemoryBuffer for
|
|
|
|
dealing with raw buffers in memory.
|
2008-02-21 16:58:30 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
@li @ref overview_bufferclasses_xcb
|
2008-02-21 16:58:30 -05:00
|
|
|
|
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
<hr>
|
2008-02-21 16:58:30 -05:00
|
|
|
|
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
@section overview_bufferclasses_xcb wxXCharBuffer
|
2008-02-23 19:47:29 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
@subsection overview_bufferclasses_xcb_general General Usage
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
As mentioned, wxCharBuffer and its wide character variant wxWCharBuffer deal
|
|
|
|
with c strings in memory. They have two constructors, one in which you pass
|
|
|
|
the c string you want them to have a copy of, and another where you specify the
|
|
|
|
size of the buffer in memory in characters you want.
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
wxCharBuffer and its variant only contain the c string as a member, so they can
|
|
|
|
be used safely to c functions with variable arguments such as printf. They also
|
|
|
|
contain standard assignment, character access operators and a copy constructor.
|
2008-02-21 16:58:30 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
@subsection overview_bufferclasses_xcb_destruct Destruction
|
2008-02-23 19:47:29 -05:00
|
|
|
|
2008-03-12 04:50:42 -04:00
|
|
|
It should be noted that on destruction wxCharBuffer and its wide character
|
|
|
|
variant delete the c string that hold onto. If you want to get the pointer to
|
|
|
|
the buffer and don't want wxCharBuffer to delete it on destruction, use the
|
|
|
|
member function release to do so.
|
2008-02-19 08:28:24 -05:00
|
|
|
|
2008-02-21 16:58:30 -05:00
|
|
|
*/
|
2008-02-19 08:28:24 -05:00
|
|
|
|