diff options
| author | robojumper <robojumper@gmail.com> | 2024-10-06 22:34:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-06 16:34:31 -0400 |
| commit | f8e61c7de8b2b8d2b2174f33457b1357175e2c0d (patch) | |
| tree | 8bc6000f32e20b0466fea7c8097b97de8cef1d36 /include/sized_string.h | |
| parent | 25d80826c74e968ef61591b7b973534a53244dba (diff) | |
More d/lyt (#52)
* More Lyt (maybe some wrong type associations)
* more meter
* Rename
* More splits and renames
* Fix SizedString conversion operators
* Renames
* dLytBattery_c almost OK
* d_lyt_battery OK
* diff clean
* Continue doing splits while I'm at it
* two more splits
Diffstat (limited to 'include/sized_string.h')
| -rw-r--r-- | include/sized_string.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/sized_string.h b/include/sized_string.h index c1abcd5f..e5c63521 100644 --- a/include/sized_string.h +++ b/include/sized_string.h @@ -3,6 +3,8 @@ #include <MSL_C/string.h> +extern "C" bool strequals(const char *a, const char *b); + /** * A statically sized string buffer used for resource * identification where strings are guaranteed to be short. @@ -23,11 +25,11 @@ struct SizedString { char mChars[Size]; - char *operator&() { + operator char *() { return mChars; } - const char *operator&() const { + operator const char *() const { return mChars; } @@ -57,6 +59,10 @@ struct SizedString { } } + bool operator==(const char* other) const { + return strequals(mChars, other); + } + int sprintf(const char *fmt, ...) { va_list args; va_start(args, fmt); |
