bufferclasses.h 1.7 KB

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