Buffer
A chunk of memory.
| Header | #include "nativeui/buffer.h" |
| Namespace | namespace nu |
| Type | class |
This type is move-only, you should pass instances by value and use std::move
when necessary.
Class methods
Buffer Wrap(const void* content, size_t size)
Return a Buffer with content of size. The content is not managed
by the returned Buffer, it is caller's reposnsibility to manage the
lifetime of content and ensure content is valid during Buffer's
lifetime.
Parameters
const void*contentsize_tsize
Return
BufferBuffer TakeOver(void* content, size_t size, std::function<void(void*)> free)
Return a Buffer with content of size, when destroyed the content
would be released with free.
Parameters
void*contentsize_tsizestd::function<void(void*)>free
Return
BufferMethods
void* content() const
Return the pointer to underlying memory.
Return
void*size_t size() const
Return the size of pointed memory.
Return
size_t