template <size_t N>

class StringBuffer

Defined at line 24 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

fbl::StringBuffer: designed to resemble std::string, without allocating heap storage.

The buffer is sized to hold up to N characters plus a null-terminator.

Public Methods

void StringBuffer<N> ()

Creates an empty string buffer.

Defined at line 27 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

void StringBuffer<N> (char c)

Creates a string buffer containing exactly one character and a null terminator. This

constructor is constinit in practice so that it can be used to initialize fdio's "cwd" path

element without generating a dynamic initializer.

Defined at line 32 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

void ~StringBuffer<N> ()

Releases the string buffer.

Defined at line 35 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

char * data ()

Returns a pointer to the null-terminated contents of the string.

Defined at line 38 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

const char * data ()

Defined at line 39 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

const char * c_str ()

Defined at line 40 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

size_t length ()

Returns the length of the string, excluding its null terminator.

Defined at line 43 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

size_t size ()

Defined at line 44 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

void Set (std::string_view data)

Clears existing data and sets the buffer to the new value, plus a null terminator.

Defined at line 47 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

StringBuffer<N> & Append (std::string_view view)

Appends content to the string buffer from a string view.

The result is truncated if the appended content does not fit completely.

Defined at line 56 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h

std::string_view operator basic_string_view ()

Creates a string view backed by the string.

The string_view does not take ownership of the data so the string must outlast the string_view.

NOLINTNEXTLINE(google-explicit-constructor)

Defined at line 65 of file ../../src/media/audio/drivers/lib/inspect/string_buffer.h