AceCommon
1.1.2
Arduino library for low-level common functions and features with no external dependencies
|
25 #ifndef PRINT_STR_PRINT_STR_H
26 #define PRINT_STR_PRINT_STR_H
31 namespace ace_common {
66 size_t write(uint8_t c)
override {
67 if (index_ < size_ - 1) {
77 size_t write(
const uint8_t *buf,
size_t size)
override {
78 if (buf ==
nullptr)
return 0;
82 size_t ret =
write(*buf++);
136 uint16_t
const size_;
228 template <u
int16_t SIZE>
234 char actualBuf_[SIZE];
An alternate implementation of PrintStr that allocates the character array in the heap,...
~PrintStrN()
Delete the internal buffer on the heap.
An implementation of Print that writes to an in-memory buffer supporting strings less than 65535 in l...
size_t write(const uint8_t *buf, size_t size) override
Write the buf string of size into the internal buffer.
PrintStrBase(uint16_t size, char *buf)
Constructor.
const char * getCstr() const
Return the NUL terminated c-string buffer.
size_t length() const
Return the length of the internal c-string buffer.
size_t write(uint8_t c) override
Write a single character into the internal buffer.
PrintStrN(uint16_t size)
Create an instance with an internal buffer of size on the heap.
char *const buf_
This is the pointer to the character array buffer.
Base class for all template instances of the PrintStr<SIZE> class.
void flush() override
Clear the internal buffer.