MIP_SDK
v3.0.0-736-g212583cf
MicroStrain Communications Library for embedded systems
|
Go to the documentation of this file.
6 #if MICROSTRAIN_HAS_STD_STRING
7 #if __cpp_lib_string_view >= 201606L
79 #if MICROSTRAIN_HAS_STD_STRING
80 #if __cpp_lib_string_view >= 201606L
107 return concat(buffer, index, str.data(), str.size());
109 #endif // __cpp_lib_string_view
135 return concat(buffer, index, str.data(), str.size());
137 #endif // MICROSTRAIN_HAS_STD_STRING
175 const size_t len = std::min(maxLen, std::strlen(str));
211 return concat(buffer, index, str, N-1);
215 #ifdef MICROSTRAIN_LOGGING_ENABLED
216 inline bool format_v(
CharArrayView buffer,
size_t* index,
const char* fmt, va_list args)
265 inline bool format(
CharArrayView buffer,
size_t* index,
const char* fmt, ...)
269 bool ok = format_v(buffer, index, fmt, args);
273 #endif // MICROSTRAIN_LOGGING_ENABLED
bool microstrain_string_format_v(char *buffer, size_t buffer_size, size_t *index, const char *fmt, va_list args)
Wrapper for std::vsnprintf with a better interface.
Definition: strings.c:124
ArrayView< char > CharArrayView
Definition: array_view.hpp:153
bool concat_cstr(CharArrayView buffer, size_t *index, const char *str, size_t maxLen=size_t(-1))
Concatenate a NULL-terminated C string into a buffer.
Definition: strings.hpp:173
bool concat(CharArrayView buffer, size_t *index, const char *str, size_t len)
Concatenate a string into a buffer.
Definition: strings.hpp:48
bool microstrain_string_bytes_to_hex_str(char *buffer, size_t buffer_size, size_t *index, const uint8_t *data, size_t data_size, unsigned int byte_grouping)
Formats a byte array to a text buffer in hexadecimal.
Definition: strings.c:239
bool microstrain_string_concat(char *buffer, size_t buffer_size, size_t *index, const char *str, size_t str_len)
Concatenate a string into a buffer.
Definition: strings.c:33
bool concat_l(CharArrayView buffer, size_t *index, const char(&str)[N])
Concatenate a string literal into a buffer.
Definition: strings.hpp:209
constexpr pointer data() const noexcept
Definition: array_view.hpp:69
Represents a view over a contiguous array of objects, similar to std::span, and is implemented as a p...
Definition: array_view.hpp:44
bool bytesToHexStr(CharArrayView buffer, size_t *index, ConstU8ArrayView data, unsigned int byte_grouping)
Formats a byte array to a text buffer in hexadecimal.
Definition: strings.hpp:311
constexpr size_t size() const noexcept
Definition: array_view.hpp:71
Definition: embedded_time.h:8