1#ifndef OSMIUM_BUILDER_BUILDER_HPP
2#define OSMIUM_BUILDER_BUILDER_HPP
69 assert(
buffer.is_aligned());
71 assert(
m_buffer.builder_count() == 1 &&
"Only one sub-builder can be open at any time.");
74 assert(
m_buffer.builder_count() == 0 &&
"Only one builder can be open at any time.");
136 uint32_t
size() const noexcept {
144 template <
typename T>
161 std::copy_n(
reinterpret_cast<const unsigned char*
>(data), length, target);
174 std::copy_n(
reinterpret_cast<const unsigned char*
>(data), length, target);
175 target[length] =
'\0';
198 osmium::memory::Buffer&
buffer() noexcept {
Definition: builder.hpp:56
unsigned char * reserve_space(std::size_t size)
Definition: builder.hpp:97
osmium::memory::item_size_type append(const char *data, const osmium::memory::item_size_type length)
Definition: builder.hpp:159
uint32_t size() const noexcept
Definition: builder.hpp:136
T * reserve_space_for()
Definition: builder.hpp:145
osmium::memory::item_size_type append(const char *str)
Definition: builder.hpp:185
void add_padding(bool self=false)
Definition: builder.hpp:114
Builder(osmium::memory::Buffer &buffer, Builder *parent, osmium::memory::item_size_type size)
Definition: builder.hpp:64
void add_size(osmium::memory::item_size_type size)
Definition: builder.hpp:129
Builder(Builder &&)=delete
Builder & operator=(const Builder &)=delete
osmium::memory::Buffer & m_buffer
Definition: builder.hpp:58
unsigned char * item_pos() const noexcept
Definition: builder.hpp:89
osmium::memory::Buffer & buffer() noexcept
Return the buffer this builder is using.
Definition: builder.hpp:198
Builder(const Builder &)=delete
std::size_t m_item_offset
Definition: builder.hpp:60
Builder & operator=(Builder &&)=delete
osmium::memory::Item & item() const noexcept
Definition: builder.hpp:93
osmium::memory::item_size_type append_with_zero(const char *data, const osmium::memory::item_size_type length)
Definition: builder.hpp:172
void add_item(const osmium::memory::Item &item)
Definition: builder.hpp:206
Builder * m_parent
Definition: builder.hpp:59
~Builder() noexcept
Definition: builder.hpp:84
item_size_type byte_size() const noexcept
Definition: item.hpp:163
Item & add_size(const item_size_type size) noexcept
Definition: item.hpp:121
item_size_type padded_size() const
Definition: item.hpp:167
@ align_bytes
Definition: item.hpp:61
uint32_t item_size_type
Definition: item.hpp:57
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53