Libosmium
2.20.0
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <builder.hpp>
Public Member Functions | |
Builder (const Builder &)=delete | |
Builder (Builder &&)=delete | |
Builder & | operator= (const Builder &)=delete |
Builder & | operator= (Builder &&)=delete |
osmium::memory::Buffer & | buffer () noexcept |
Return the buffer this builder is using. More... | |
void | add_item (const osmium::memory::Item &item) |
Protected Member Functions | |
Builder (osmium::memory::Buffer &buffer, Builder *parent, osmium::memory::item_size_type size) | |
~Builder () noexcept | |
unsigned char * | item_pos () const noexcept |
osmium::memory::Item & | item () const noexcept |
unsigned char * | reserve_space (std::size_t size) |
void | add_padding (bool self=false) |
void | add_size (osmium::memory::item_size_type size) |
uint32_t | size () const noexcept |
template<typename T > | |
T * | reserve_space_for () |
osmium::memory::item_size_type | append (const char *data, const osmium::memory::item_size_type length) |
osmium::memory::item_size_type | append_with_zero (const char *data, const osmium::memory::item_size_type length) |
osmium::memory::item_size_type | append (const char *str) |
Private Attributes | |
osmium::memory::Buffer & | m_buffer |
Builder * | m_parent |
std::size_t | m_item_offset |
Parent class for individual builder classes. Instantiate one of its derived classes.
|
inlineexplicitprotected |
|
inlineprotectednoexcept |
|
delete |
|
delete |
|
inline |
Add a subitem to the object being built. This can be something like a TagList or RelationMemberList.
|
inlineprotected |
Add padding to buffer (if needed) to align data properly.
This calculates how many padding bytes are needed and adds as many zero bytes to the buffer. It also adds this number to the size of the current item (if the "self" param is true) and recursively to all the parent items.
self | If true add number of padding bytes to size of current item. Size is always added to parent item (if any). |
|
inlineprotected |
|
inlineprotected |
Append data to buffer.
data | Pointer to data. |
length | Length of data in bytes. If data is a \0-terminated string, length must contain the \0 byte. |
|
inlineprotected |
Append \0-terminated string to buffer.
str | \0-terminated string. |
|
inlineprotected |
Append data to buffer and append an additional \0.
data | Pointer to data. |
length | Length of data in bytes. |
|
inlinenoexcept |
Return the buffer this builder is using.
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotected |
|
inlineprotected |
Reserve space for an object of class T in buffer and return pointer to it.
|
inlineprotectednoexcept |
|
private |
|
private |
|
private |