sajson
High-Performance JSON Parser
|
A pointer to a mutable buffer, its size in bytes, and strong ownership of any copied memory. More...
#include <sajson.h>
Public Member Functions | |
mutable_string_view () | |
Creates an empty, zero-sized view. More... | |
mutable_string_view (size_t length, char *data) | |
Given a length in bytes and a pointer, constructs a view that does not allocate a copy of the data or maintain its life. More... | |
mutable_string_view (const literal &s) | |
Allocates a copy of the given literal string and exposes a mutable view into it. More... | |
mutable_string_view (const string &s) | |
Allocates a copy of the given string and exposes a mutable view into it. More... | |
mutable_string_view (const mutable_string_view &that) | |
Copies a mutable_string_view. More... | |
mutable_string_view (mutable_string_view &&that) | |
Move constructor - neuters the old mutable_string_view. More... | |
mutable_string_view & | operator= (mutable_string_view &&that) |
mutable_string_view & | operator= (const mutable_string_view &that) |
size_t | length () const |
char * | get_data () const |
A pointer to a mutable buffer, its size in bytes, and strong ownership of any copied memory.
|
inline |
Creates an empty, zero-sized view.
|
inline |
Given a length in bytes and a pointer, constructs a view that does not allocate a copy of the data or maintain its life.
The given pointer must stay valid for the duration of the parse and the resulting document's life.
|
inline |
Allocates a copy of the given literal string and exposes a mutable view into it.
Throws std::bad_alloc if allocation fails.
|
inline |
Allocates a copy of the given string and exposes a mutable view into it.
Throws std::bad_alloc if allocation fails.
|
inline |
Copies a mutable_string_view.
If any backing memory has been allocated, its refcount is incremented - both views can safely use the memory.
|
inline |
Move constructor - neuters the old mutable_string_view.