MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write_string()

void MayaFlux::Transitive::Protocol::write_string ( std::vector< uint8_t > &  out,
const std::string &  str 
)
inline

Append a null-terminated string padded to 4-byte boundary.

Writes the string bytes, a null terminator, then zero-padding.

Parameters
outDestination buffer.
strString to write.

Definition at line 125 of file BinaryBuffer.hpp.

126{
127 out.insert(out.end(), str.begin(), str.end());
128 size_t padded = padded_size(str.size() + 1);
129 out.resize(out.size() + (padded - str.size()), 0);
130}
constexpr size_t padded_size(size_t len) noexcept
Round len up to the next 4-byte boundary.

References padded_size().

Referenced by MayaFlux::Core::OscParser::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: