text-store.cpp 370 B

123456789101112131415161718
  1. #include "text-store.h"
  2. #include <furi.h>
  3. TextStore::TextStore(uint8_t _text_size)
  4. : text_size(_text_size) {
  5. text = static_cast<char*>(malloc(text_size + 1));
  6. }
  7. TextStore::~TextStore() {
  8. free(text);
  9. }
  10. void TextStore::set(const char* _text...) {
  11. va_list args;
  12. va_start(args, _text);
  13. vsnprintf(text, text_size, _text, args);
  14. va_end(args);
  15. }