]>
Commit | Line | Data |
---|---|---|
15b6757b | 1 | ///////////////////////////////////////////////////////////////////////////// |
59c0db6a | 2 | // Name: bufferclasses.h |
15b6757b FM |
3 | // Purpose: topic overview |
4 | // Author: wxWidgets team | |
526954c5 | 5 | // Licence: wxWindows licence |
15b6757b FM |
6 | ///////////////////////////////////////////////////////////////////////////// |
7 | ||
880efa2a | 8 | /** |
36c9828f | 9 | |
880efa2a | 10 | @page overview_bufferclasses Buffer Classes |
36c9828f | 11 | |
e7054054 BP |
12 | @tableofcontents |
13 | ||
880efa2a | 14 | wxWidgets uses two classes of classes for dealing with buffers in memory. |
36c9828f | 15 | |
880efa2a BP |
16 | The first is one for dealing with character buffers, namely wxCharBuffer for |
17 | char pointer or multi-byte c strings and wxWCharBuffer for wchar_t pointer or | |
18 | wide character c strings. | |
36c9828f | 19 | |
880efa2a BP |
20 | Secondly, wxWidgets uses, although only rarely currently, wxMemoryBuffer for |
21 | dealing with raw buffers in memory. | |
59c0db6a | 22 | |
59c0db6a FM |
23 | |
24 | ||
880efa2a | 25 | @section overview_bufferclasses_xcb wxXCharBuffer |
3b88355f | 26 | |
880efa2a | 27 | @subsection overview_bufferclasses_xcb_general General Usage |
36c9828f | 28 | |
880efa2a BP |
29 | As mentioned, wxCharBuffer and its wide character variant wxWCharBuffer deal |
30 | with c strings in memory. They have two constructors, one in which you pass | |
31 | the c string you want them to have a copy of, and another where you specify the | |
32 | size of the buffer in memory in characters you want. | |
36c9828f | 33 | |
880efa2a BP |
34 | wxCharBuffer and its variant only contain the c string as a member, so they can |
35 | be used safely to c functions with variable arguments such as printf. They also | |
36 | contain standard assignment, character access operators and a copy constructor. | |
59c0db6a | 37 | |
880efa2a | 38 | @subsection overview_bufferclasses_xcb_destruct Destruction |
3b88355f | 39 | |
880efa2a BP |
40 | It should be noted that on destruction wxCharBuffer and its wide character |
41 | variant delete the c string that hold onto. If you want to get the pointer to | |
42 | the buffer and don't want wxCharBuffer to delete it on destruction, use the | |
43 | member function release to do so. | |
36c9828f | 44 | |
59c0db6a | 45 | */ |