Buffer

A chunk of memory.

Header#include "nativeui/buffer.h"
Namespacenamespace nu
Typeclass

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

Return

Buffer

Buffer 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

Return

Buffer

Methods

void* content() const

Return the pointer to underlying memory.

Return

void*

size_t size() const

Return the size of pointed memory.

Return

size_t