|
rolmodl
C++ API for the Simple Directmedia Library 2 (SDL2)
|
Container for SDL-owned strings that must be freed with SDL_free.
More...
#include <Base.hpp>
Public Member Functions | |
| ~SDLString () noexcept | |
SDL_free the underlying char*. | |
| SDLString (const SDLString &that) | |
| Copying SDLStrings is not allowed as SDL does not provide a way to allocate a new string. We can only free existing strings. | |
| SDLString (SDLString &&that) noexcept | |
Take over the underlying char* of that. | |
| SDLString & | operator= (const SDLString &that) |
| Copying SDLStrings is not allowed as SDL does not provide a way to allocate a new string. We can only free existing strings. | |
| SDLString & | operator= (SDLString &&that) noexcept |
Take over the underlying char* of that. | |
| char * | unsafeRaw () noexcept |
Get the underlying char*. Unsafe because it allows invalidating the pointer by freeing it. | |
| const char * | unsafeRaw () const noexcept |
Get the underlying char* in a const context. Unsafe because it allows saving a pointer and using it after it has been freed. | |
Friends | |
| SDLString | sys::clipboard::getText () |
| The clipboard text is an SDL-owned string. | |
| std::optional< Event > | event::poll () noexcept |
| The drag-n-drop text and file paths are SDL-owned strings. | |
| void | swap (SDLString &a, SDLString &b) noexcept |
Exchange the underlying char* with that. | |
Container for SDL-owned strings that must be freed with SDL_free.
1.8.16