MCPcopy Create free account
hub / github.com/brainboxdotcc/DPP / append_atom_utf8

Method append_atom_utf8

src/dpp/etf.cpp:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void etf_parser::append_atom_utf8(etf_buffer *b, const char *bytes, size_t size) {
148 if (size < 255) {
149 unsigned char buf[2] = {ett_atom_utf8_small, (unsigned char)size};
150 buffer_write(b, (const char *)buf, 2);
151 buffer_write(b, (const char *)bytes, size);
152 } else {
153 unsigned char buf[3];
154 buf[0] = ett_atom_utf8;
155
156 if (size > 0xFFFF) {
157 throw dpp::parse_exception(err_etf, "ETF: Atom too large");
158 }
159
160 store_16_bits(buf + 1, size);
161 buffer_write(b, (const char *)buf, 3);
162 buffer_write(b, (const char *)bytes, size);
163 }
164}
165
166void etf_parser::append_binary(etf_buffer *b, const char *bytes, size_t size) {
167 unsigned char buf[5];

Callers

nothing calls this directly

Calls 1

parse_exceptionClass · 0.85

Tested by

no test coverage detected