|
pjson 2.0.0
A small, owning JSON value for C++11
|
Minimal C++11-compatible, non-owning view of a JSON string. More...
#include <pjson.h>
Public Member Functions | |
| StringView () noexcept | |
| Constructs an empty view with data() == nullptr. | |
| const char * | data () const noexcept |
| Returns the borrowed first byte; a default view returns null. | |
| size_t | size () const noexcept |
| Returns the number of bytes in the view, including embedded NUL bytes. | |
| bool | empty () const noexcept |
| Returns whether size() is zero. | |
Minimal C++11-compatible, non-owning view of a JSON string.
A view aliases bytes owned by this pjson node and is valid only while that node remains alive and unchanged. Assignment, reset, swap, move, destruction, erasing the node, or replacing/resetting an ancestor invalidates it. Strings may contain embedded NUL bytes; use size() rather than strlen().
|
noexcept |
Constructs an empty view with data() == nullptr.
|
noexcept |
Returns the borrowed first byte; a default view returns null.
|
noexcept |
Returns whether size() is zero.
|
noexcept |
Returns the number of bytes in the view, including embedded NUL bytes.