Libosmium
2.10.3
Fast and flexible C++ library for working with OpenStreetMap data
|
#include <builder.hpp>
Public Member Functions | |
osmium::memory::Buffer & | buffer () noexcept |
Return the buffer this builder is using. More... | |
void | add_item (const osmium::memory::Item &item) |
OSMIUM_DEPRECATED 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 | |
osmium::memory::Item & | item () const |
unsigned char * | reserve_space (size_t size) |
void | add_padding (bool self=false) |
void | add_size (uint32_t 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 (const char *str) |
osmium::memory::item_size_type | append_zero () |
Private Member Functions | |
Builder (const Builder &)=delete | |
Builder (Builder &&)=delete | |
Builder & | operator= (const Builder &)=delete |
Builder & | operator= (Builder &&)=delete |
Private Attributes | |
osmium::memory::Buffer & | m_buffer |
Builder * | m_parent |
size_t | m_item_offset |
Parent class for individual builder classes. Instantiate one of its derived classes.
|
privatedelete |
|
privatedelete |
|
inlineexplicitprotected |
|
inlineprotectednoexcept |
|
inline |
Add a subitem to the object being built. This can be something like a TagList or RelationMemberList.
|
inline |
|
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 '\0' to the buffer.
|
inlinenoexcept |
Return the buffer this builder is using.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
Reserve space for an object of class T in buffer and return pointer to it.
|
inlineprotectednoexcept |
|
private |
|
private |
|
private |