ESPHome
2026.3.0
Loading...
Searching...
No Matches
esphome
components
api
api_buffer.cpp
Go to the documentation of this file.
1
#include "
api_buffer.h
"
2
3
namespace
esphome::api
{
4
5
void
APIBuffer::grow_
(
size_t
n) {
6
auto
new_data =
make_buffer
(n);
7
if
(this->
size_
)
8
std::memcpy(new_data.get(), this->data_.get(), this->size_);
9
this->
data_
= std::move(new_data);
10
this->
capacity_
= n;
11
}
12
13
}
// namespace esphome::api
api_buffer.h
esphome::api::APIBuffer::capacity_
size_t capacity_
Definition
api_buffer.h:64
esphome::api::APIBuffer::grow_
void grow_(size_t n)
Definition
api_buffer.cpp:5
esphome::api::APIBuffer::size_
size_t size_
Definition
api_buffer.h:63
esphome::api::APIBuffer::data_
std::unique_ptr< uint8_t[]> data_
Definition
api_buffer.h:62
esphome::api
Definition
api_buffer.cpp:3
esphome::api::make_buffer
std::unique_ptr< uint8_t[]> make_buffer(size_t n)
Helper to use make_unique_for_overwrite where available (skips zero-fill), falling back to make_uniqu...
Definition
api_buffer.h:14
Generated by
1.12.0