Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
serializer::read (1 of 2 overloads)

Read the next buffer of serialized JSON.

Synopsis
string_view
read(
    char* dest,
    std::size_t size);
Description

This function attempts to fill the caller provided buffer starting at dest with up to size characters of the serialized JSON that represents the value. If the buffer is not large enough, multiple calls may be required.

If serialization completes during this call; that is, that all of the characters belonging to the serialized value have been written to caller-provided buffers, the function done will return true.

Preconditions

this->done() == true

Complexity

Linear in size.

Exception Safety

Basic guarantee. Calls to memory_resource::allocate may throw.

Return Value

A string_view containing the characters written, which may be less than size.

Parameters

Name

Description

dest

A pointer to valid memory of at least size bytes.

size

The maximum number of characters to write to the memory pointed to by dest.


PrevUpHomeNext