1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 14:12:24 +01:00

Introduce str_snprintf helper function (#2780)

This commit is contained in:
Oxan van Leeuwen
2021-11-23 08:30:49 +01:00
committed by GitHub
parent 1424091ee5
commit 897277992b
2 changed files with 20 additions and 3 deletions

View File

@@ -57,7 +57,10 @@ bool str_equals_case_insensitive(const std::string &a, const std::string &b);
bool str_startswith(const std::string &full, const std::string &start);
bool str_endswith(const std::string &full, const std::string &ending);
/// sprintf-like function returning std::string instead of writing to char array.
/// snprintf-like function returning std::string with a given maximum length.
std::string __attribute__((format(printf, 1, 3))) str_snprintf(const char *fmt, size_t length, ...);
/// sprintf-like function returning std::string.
std::string __attribute__((format(printf, 1, 2))) str_sprintf(const char *fmt, ...);
class HighFrequencyLoopRequester {