arduino-audio-tools
Loading...
Searching...
No Matches
StrView.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdio.h>
4#include <string.h>
5#include <stdlib.h>
7
16namespace audio_tools {
17
28class StrView {
29 public:
30 StrView() = default;
31
33 StrView(const char* chars) {
34 if (chars != nullptr) {
35 int len = strlen(chars);
36 set((char*)chars, len, len, true);
37 } else {
38 this->is_const = true;
39 clear();
40 }
41 }
42
44 StrView(char chars[], int maxlen, int len = 0) { set(chars, maxlen, len, false); }
45
47 virtual void set(const char* alt) {
48 if (alt == nullptr) {
49 this->len = 0;
50 } else {
51 int new_len = strlen(alt);
53 this->len = new_len;
54 if (this->isConst()) {
56 this->maxlen = this->len;
57 this->chars = (char*)alt;
58 } else {
60 strncpy(this->chars, alt, this->maxlen);
61 this->chars[len] = 0;
62 }
63 }
64 }
66 virtual void set(const StrView& alt) {
67 grow(alt.len);
68 this->len = alt.len;
69
70 if (this->isConst()) {
72 this->chars = alt.chars;
73 } else {
75 strncpy(this->chars, alt.chars, this->maxlen);
76 this->chars[len] = 0;
77 }
78 }
79
80 virtual void set(const char c) {
81 clear();
82 add(c);
83 }
84
85 virtual void set(int value) {
86 clear();
87 add(value);
88 }
89
90 virtual void set(double value, int precision = 2, int withd = 0) {
91 clear();
92 add(value);
93 }
94
95 virtual void swap(StrView& str) {
96 char* cpy_chars = chars;
97 ;
99 int cpy_len = len;
100 int cpy_maxlen = maxlen;
101
102 chars = str.chars;
103 is_const = str.is_const;
104 len = str.len;
105 maxlen = str.maxlen;
106
107 str.chars = cpy_chars;
109 str.len = cpy_len;
110 str.maxlen = cpy_maxlen;
111 }
112
114 virtual void set(char chars[], int maxlen, int len = 0,
115 bool isConst = false) {
116 this->chars = chars;
117 this->maxlen = maxlen;
118 this->len = len;
119 this->is_const = isConst;
120 if (len == 0 && !isConst) {
121 this->chars[0] = 0;
122 }
123 }
124
126 virtual void add(int value) {
127 if (!this->isConst()) {
128 grow(this->length() + 11);
129 snprintf(this->chars + len, 10, "%d", value);
130 len = strlen(chars);
131 }
132 }
133
135 virtual void add(double value, int precision = 2, int withd = 0) {
136 if (!this->isConst()) {
137 grow(this->length() + 20);
138 floatToString(this->chars + len, value, precision, withd);
139 len = strlen(chars);
140 }
141 }
142
144 virtual void add(const char* append) {
145 if (!isConst() && append != nullptr) {
146 int append_len = strlen(append);
147 grow(this->length() + append_len + 1);
148 int n = (len + append_len) < maxlen - 1 ? append_len : maxlen - len - 1;
149 strncat(chars, append, n);
150 chars[len + n] = 0;
151 len = strlen(chars);
152 }
153 }
154
156 virtual void add(const char c) {
157 if (!isConst() && len < maxlen - 1) {
158 grow(this->length() + 1);
159 chars[len] = c;
160 chars[++len] = 0;
161 }
162 }
163
165 virtual bool equals(const char* str) {
166 if (str == nullptr) return isEmpty();
167 return strcmp(this->chars, str) == 0;
168 }
169
171 virtual bool startsWith(const char* str) {
172 if (str == nullptr) return false;
173 int len = strlen(str);
174 return strncmp(this->chars, str, len) == 0;
175 }
176
178 virtual bool endsWith(const char* str) {
179 if (str == nullptr) return false;
180 int endlen = strlen(str);
181 return strncmp(this->chars + (len - endlen), str, endlen) == 0;
182 }
183
185 virtual bool endsWithIgnoreCase(const char* str) {
186 if (str == nullptr) return false;
187 int endlen = strlen(str);
188 return strncmp_i(this->chars + (len - endlen), str, endlen) == 0;
189 }
190
193 virtual bool matches(const char* pattern) {
196 int wildcard = 0;
197 const char* line = this->chars;
198
199 const char* last_pattern_start = 0;
200 const char* last_line_start = 0;
201 do {
202 if (*pattern == *line) {
203 if (wildcard == 1) last_line_start = line + 1;
204
205 line++;
206 pattern++;
207 wildcard = 0;
208 } else if (*pattern == '?') {
209 if (*(line) == '\0')
210 return 0;
211 if (wildcard == 1) last_line_start = line + 1;
212 line++;
213 pattern++;
214 wildcard = 0;
215 } else if (*pattern == '*') {
216 if (*(pattern + 1) == '\0') {
217 return 1;
218 }
219
221 // last_line_start = line + 1;
222 wildcard = 1;
223
224 pattern++;
225 } else if (wildcard) {
226 if (*line == *pattern) {
227 wildcard = 0;
228 line++;
229 pattern++;
230 last_line_start = line + 1;
231 } else {
232 line++;
233 }
234 } else {
235 if ((*pattern) == '\0' && (*line) == '\0')
236 return 1;
237 else {
238 if (last_pattern_start != 0)
239 {
242 last_line_start = 0;
243 } else {
244 return false;
245 }
246 }
247 }
248
249 } while (*line);
250
251 if (*pattern == '\0') {
252 return true;
253 } else {
254 return false;
255 }
256 }
257
260 virtual int indexOf(const char c, int start = 0) {
261 for (int j = start; j < len; j++) {
262 if (c == chars[j]) {
263 return j;
264 }
265 }
266 return -1;
267 }
268
270 virtual int nIndexOf(const char c, int n){
271 int result = -1;
272 for (int j=0; j < n; j++){
273 result = indexOf(c, result + 1);
274 if (result < 0) break;
275 }
276 return result;
277 }
278
280 virtual bool contains(const char* str) { return indexOf(str) != -1; }
281
284 virtual int indexOf(const char* cont, int start = 0) {
285 if (chars == nullptr || cont == nullptr) return -1;
286 int contLen = strlen(cont);
287 for (int j = start; j < len; j++) {
288 char* pt = chars + j;
289 if (strncmp(pt, cont, contLen) == 0) {
290 return j;
291 }
292 }
293 return -1;
294 }
295
297 virtual int lastIndexOf(const char* cont) {
298 if (cont == nullptr) return -1;
299 int contLen = strlen(cont);
300 for (int j = (len - contLen); j >= 0; j--) {
301 if (strncmp(cont, chars + j, contLen) == 0) {
302 return j;
303 }
304 }
305 return -1;
306 }
307
309 virtual int nIndexOf(const char* cont, int n){
310 int result = -1;
311 for (int j=0; j < n; j++){
312 result = indexOf(cont, result + 1);
313 if (result < 0) break;
314 }
315 return result;
316 }
317
319 virtual void operator=(const char* str) { set(str); }
320
322 virtual void operator=(char* str) { set(str); }
323
325 virtual void operator=(char c) { set(c); }
326
328 virtual void operator=(double val) { set(val); }
329
331 virtual void operator=(int value) { set(value); }
332
334 virtual void operator<<(int n) {
335 if (isConst()) {
336 this->chars += n;
337 this->len -= n;
338 } else {
339 memmove(this->chars, this->chars + n, len + 1);
340 }
341 }
342
343 virtual char operator[](int index) { return chars[index]; }
344
346 virtual void operator+=(const char* str) { add(str); }
347
349 virtual void operator+=(int value) { add(value); }
350
352 virtual void operator+=(double value) { add(value); }
353
355 virtual void operator+=(const char value) { add(value); }
356
358 virtual bool operator==(const StrView& alt) const {
359 if (this->len != alt.len) return false;
360 return strncmp(this->chars, alt.chars, this->len) == 0;
361 }
362
364 virtual bool operator==(const char* alt) const {
365 return strncmp(this->chars, alt, this->len) == 0;
366 }
367
369 virtual bool operator!=(const StrView& alt) const {
370 return strncmp(this->chars, alt.chars, this->len) != 0;
371 }
372
374 virtual bool operator!=(const char* alt) const {
375 return strncmp(this->chars, alt, this->len) != 0;
376 }
377
379 virtual const char* c_str() { return chars; }
380
383 virtual int length() { return len; }
384
386 virtual bool isEmpty() { return len == 0; }
387
389 virtual int maxLength() { return maxlen; }
390
392 virtual bool replace(const char* toReplace, const char* replaced) {
393 bool result = false;
394 if (toReplace == nullptr || replaced == nullptr) {
395 return result;
396 }
397 if (!isConst()) {
398 int pos = indexOf(toReplace);
399 int old_len = length();
400 int insert_len = 0;
401 if (pos >= 0) {
405 grow(this->length() + insert_len);
406 // save remainder and create gap
407 memmove(this->chars + pos + len_replaced,
408 this->chars + pos + len_to_replace,
409 old_len - pos - len_to_replace + 1);
410 // move new string into gap
411 memmove(this->chars + pos, replaced, len_replaced);
412 result = true;
413 len += insert_len;
414 }
415 }
416 return result;
417 }
418
420 virtual bool replaceAll(const char* toReplace, const char* replaced) {
421 if (indexOf(toReplace) == -1) {
422 return false;
423 }
424 while (replace(toReplace, replaced));
425 return true;
426 }
427
429 virtual void remove(const char* toRemove) {
430 if (!isConst() && chars != nullptr) {
432 int pos = indexOf(toRemove);
433 if (pos >= 0) {
434 memmove((void*)(chars + pos), (void*)(chars + pos + removeLen),
435 len - (pos + removeLen) + 1);
436 len -= removeLen;
437 }
438 }
439 }
440
442 virtual void removeAll(const char* toRemove) {
443 if (!isConst() && chars != nullptr) {
445 while (true) {
446 int pos = indexOf(toRemove);
447 if (pos == -1) {
448 break;
449 }
450 memmove((void*)(chars + pos), (void*)(chars + pos + removeLen),
451 len - (pos + removeLen) + 1);
452 len -= removeLen;
453 }
454 }
455 }
456
458 virtual void setLength(int len, bool addZero = true) {
459 if (!isConst() && addZero) {
460 this->savedChar = chars[len];
461 this->savedLen = len;
462 this->len = len;
463 chars[len] = 0;
464 }
465 }
466
468 virtual void setLengthUndo() {
469 if (savedLen >= 0) {
471 this->len = savedLen;
472 savedLen = -1;
473 }
474 }
475
477 virtual void substring(StrView& from, int start, int end) {
478 if (end > start) {
479 int len = end - start;
480 grow(len);
481 if (this->chars != nullptr) {
482 len = len < this->maxlen ? len : this->maxlen;
483 strncpy(this->chars, from.chars + start, len);
484 this->len = len;
485 this->chars[len] = 0;
486 }
487 }
488 }
489
491 virtual void substring(const char* from, int start, int end) {
492 if (end > start) {
493 int len = end - start;
494 grow(len);
495 if (this->chars != nullptr) {
496 strncpy(this->chars, from + start, len);
497 this->chars[len] = 0;
498 this->len = len;
499 }
500 }
501 }
502
504 virtual void trim() {
505 if (chars == nullptr) return;
506 rtrim();
507 ltrim();
508 }
509
511 virtual int count(char c, int startPos) {
512 for (int j = startPos; j < len; j++) {
513 if (chars[j] != c) {
514 return j;
515 }
516 }
517 return 0;
518 }
519
521 virtual void ltrim() {
522 if (chars == nullptr) return;
523 int n = count(' ', 0);
524 if (n > 0) *this << n;
525 }
526
528 virtual void rtrim() {
529 if (chars == nullptr) return;
530 if (!isConst()) {
531 while (isspace(chars[len])) {
532 len--;
533 chars[len] = 0;
534 }
535 }
536 }
537
539 virtual void clear() {
540 if (chars != nullptr && !isConst()) {
541 chars[0] = 0;
542 }
543 len = 0;
544 }
545
547 virtual bool isOnHeap() { return false; }
548
550 virtual bool isConst() { return is_const; }
551
553 virtual void insert(int pos, const char* str) {
554 if (!isConst()) {
555 int insert_len = strlen(str);
556 grow(this->length() + insert_len);
557 int move_len = this->len - pos + 1;
558 memmove(chars + pos + insert_len, chars + pos, move_len);
559 strncpy(chars + pos, str, insert_len);
560 }
561 }
562
564 virtual bool equalsIgnoreCase(const char* alt) {
565 if (alt == nullptr) return isEmpty();
566 if ((size_t)len != strlen(alt)) {
567 return false;
568 }
569 for (int j = 0; j < len; j++) {
570 if (tolower(chars[j]) != tolower(alt[j])) return false;
571 }
572 return true;
573 }
574
576 int toInt() {
577 int result = 0;
578 if (!isEmpty()) {
579 result = atoi(chars);
580 }
581 return result;
582 }
583
585 long toLong() {
586 long result = 0;
587 if (!isEmpty()) {
588 result = atol(chars);
589 }
590 return result;
591 }
592
594 double toDouble() {
595 double result = 0;
596 char* eptr;
597 if (!isEmpty()) {
598 result = strtod(chars, &eptr);
599 }
600 return result;
601 }
602
604 float toFloat() {
605 float result = 0;
606 char* eptr;
607 if (!isEmpty()) {
608#ifdef USE_STRTOD
609 result = strtof(chars, &eptr);
610#else
611 result = strtod(chars, &eptr);
612#endif
613 }
614 return result;
615 }
616
618 void toLowerCase() {
619 if (chars != nullptr) {
620 for (int j = 0; j < len; j++) {
621 chars[j] = tolower(chars[j]);
622 }
623 }
624 }
625
627 void toUpperCase() {
628 if (chars != nullptr) {
629 for (int j = 0; j < len; j++) {
630 chars[j] = toupper(chars[j]);
631 }
632 }
633 }
634
636 static const char* toBinary(void const* const ptr, size_t const size) {
637 static char result[160];
638 unsigned char* b = (unsigned char*)ptr;
639 unsigned char byte;
640 int i, j, idx = 0;
641
642 for (i = size - 1; i >= 0; i--) {
643 for (j = 7; j >= 0; j--) {
644 byte = (b[i] >> j) & 1;
645 result[idx++] = byte ? '1' : '0';
646 }
647 }
648 result[idx] = 0;
649 return result;
650 }
651
653 for (int j = 0; j < len; j++) {
654 if (isdigit(chars[j])) {
655 return true;
656 }
657 }
658 return false;
659 }
660
662 bool isInteger() {
663 bool result = containsNumber();
664 int minus_count = 0;
665 for (int j = 0; j < len; j++) {
666 char c = chars[j];
667 if (!isdigit(c)) {
668 switch (c) {
669 case '-':
670 minus_count++;
671 if (minus_count > 1) {
672 result = false;
673 }
674 break;
675 default:
676 result = false;
677 break;
678 }
679 }
680 }
681 return result;
682 }
683
686 int result = 0;
687 int pos = indexOf(".");
688 if (pos >= 0) {
689 for (int j = pos + 1; j < len; j++) {
690 if (isdigit(chars[j])) {
691 pos++;
692 } else {
693 break;
694 }
695 }
696 }
697 return result;
698 }
699
700 // Returns true if the string is a number
701 bool isNumber() {
702 bool result = containsNumber();
703 int dot_count = 0;
704 int minus_count = 0;
705 for (int j = 0; j < len; j++) {
706 char c = chars[j];
707 if (!isdigit(c)) {
708 switch (c) {
709 case '-':
710 minus_count++;
711 if (minus_count > 1) {
712 result = false;
713 }
714 break;
715 case '.':
716 dot_count++;
717 if (dot_count > 1) {
718 result = false;
719 }
720 break;
721 default:
722 result = false;
723 break;
724 }
725 }
726 }
727 return result;
728 }
729
730
731 protected:
732 char* chars = nullptr;
733 bool is_const = false;
734 int len = 0;
735 int maxlen = 0;
736 int savedLen = -1;
738
740 virtual bool grow(int newMaxLen) { return false; }
741
742 static char* itoa(int n, char s[]) {
743 int i, sign;
744 if ((sign = n) < 0) /* record sign */
745 n = -n; /* make n positive */
746 i = 0;
747 do { /* generate digits in reverse order */
748 s[i++] = n % 10 + '0'; /* get next digit */
749 } while ((n /= 10) > 0); /* delete it */
750 if (sign < 0) s[i++] = '-';
751 s[i] = '\0';
752 reverse(s);
753 return s;
754 }
755
756 static void reverse(char s[]) {
757 int i, j;
758 char c;
759
760 for (i = 0, j = strlen(s) - 1; i < j; i++, j--) {
761 c = s[i];
762 s[i] = s[j];
763 s[j] = c;
764 }
765 }
766
767 static char* floatToString(char* outstr, double val, int precision,
768 int widthp) {
769 char temp[16];
770 int i;
771
773 double roundingFactor = 0.5;
774 unsigned long mult = 1;
775 for (i = 0; i < precision; i++) {
776 roundingFactor /= 10.0;
777 mult *= 10;
778 }
779
780 temp[0] = '\0';
781 outstr[0] = '\0';
782
783 if (val < 0.0) {
784 strcpy(outstr, "-\0");
785 val = -val;
786 }
787
789
790 strcat(outstr, itoa(int(val), temp)); // prints the int part
791 if (precision > 0) {
792 strcat(outstr, ".\0");
793 unsigned long frac;
794 unsigned long mult = 1;
795 int padding = precision - 1;
796 while (precision--) mult *= 10;
797
798 if (val >= 0)
799 frac = (val - int(val)) * mult;
800 else
801 frac = (int(val) - val) * mult;
802 unsigned long frac1 = frac;
803
804 while (frac1 /= 10) padding--;
805
806 while (padding--) strcat(outstr, "0\0");
807
809 }
810
812 if ((widthp != 0) && ((size_t)widthp >= strlen(outstr))) {
813 int J = 0;
814 J = widthp - strlen(outstr);
815
816 for (i = 0; i < J; i++) {
817 temp[i] = ' ';
818 }
819
820 temp[i++] = '\0';
823 }
824
825 return outstr;
826 }
827
828 static int strncmp_i(const char* s1, const char* s2, int n) {
829 if (n == 0) return (0);
830 do {
831 if (tolower(*s1) != tolower(*s2++))
832 return (*(unsigned char*)s1 - *(unsigned char*)--s2);
833 if (*s1++ == 0) break;
834 } while (--n != 0);
835 return (0);
836 }
837};
838
839} // namespace audio_tools
A simple wrapper to provide string functions on existing allocated char*. If the underlying char* is ...
Definition StrView.h:28
bool is_const
Definition StrView.h:733
static int strncmp_i(const char *s1, const char *s2, int n)
Definition StrView.h:828
static char * floatToString(char *outstr, double val, int precision, int widthp)
Definition StrView.h:767
virtual void operator=(char *str)
we can assign a char*
Definition StrView.h:322
StrView(const char *chars)
Creates a Str for string constant.
Definition StrView.h:33
virtual bool equals(const char *str)
checks if the string equals indicated parameter string
Definition StrView.h:165
virtual bool grow(int newMaxLen)
only supported in subclasses
Definition StrView.h:740
bool containsNumber()
Definition StrView.h:652
int maxlen
Definition StrView.h:735
virtual void set(int value)
Definition StrView.h:85
virtual void operator=(char c)
we can assign a char
Definition StrView.h:325
virtual void operator+=(const char *str)
adds a substring at the end of the string
Definition StrView.h:346
virtual bool endsWith(const char *str)
checks if the string ends with the indicated substring
Definition StrView.h:178
virtual void substring(const char *from, int start, int end)
copies a substring into the current string
Definition StrView.h:491
virtual bool operator!=(const StrView &alt) const
checks if the indicated string is different from the current string
Definition StrView.h:369
bool isInteger()
Returns true if the string is an integer.
Definition StrView.h:662
virtual int length()
Definition StrView.h:383
virtual void operator=(double val)
we can assign a double
Definition StrView.h:328
virtual void set(char chars[], int maxlen, int len=0, bool isConst=false)
assigns a memory buffer
Definition StrView.h:114
virtual bool equalsIgnoreCase(const char *alt)
Compares the string ignoring the case.
Definition StrView.h:564
virtual int maxLength()
provides the maximum length of the string
Definition StrView.h:389
static char * itoa(int n, char s[])
Definition StrView.h:742
virtual bool isOnHeap()
checks if the string is on the heap
Definition StrView.h:547
virtual bool startsWith(const char *str)
checks if the string starts with the indicated substring
Definition StrView.h:171
virtual bool operator==(const char *alt) const
checks if the indicated string is equal to the current string
Definition StrView.h:364
virtual void operator+=(double value)
adds a double at the end of the string
Definition StrView.h:352
virtual bool isEmpty()
checks if the string is empty
Definition StrView.h:386
char * chars
Definition StrView.h:732
virtual void add(const char c)
adds a character
Definition StrView.h:156
virtual int nIndexOf(const char c, int n)
searches for the nth occurence of the indicated character
Definition StrView.h:270
virtual void operator+=(int value)
adds a int at the end of the string
Definition StrView.h:349
double toDouble()
Converts the string to a double.
Definition StrView.h:594
virtual bool operator==(const StrView &alt) const
checks if the indicated string is equal to the current string
Definition StrView.h:358
virtual bool contains(const char *str)
checks if the string contains a substring
Definition StrView.h:280
virtual int lastIndexOf(const char *cont)
provides the position of the last occurrence of the indicated substring
Definition StrView.h:297
virtual void set(double value, int precision=2, int withd=0)
Definition StrView.h:90
virtual void rtrim()
remove trailing spaces
Definition StrView.h:528
virtual bool replaceAll(const char *toReplace, const char *replaced)
Replaces all instances of toReplace with replaced.
Definition StrView.h:420
static void reverse(char s[])
Definition StrView.h:756
virtual void add(const char *append)
adds a string
Definition StrView.h:144
virtual int count(char c, int startPos)
count number of indicated characters as position
Definition StrView.h:511
int numberOfDecimals()
Determines the number of decimals in the number string.
Definition StrView.h:685
virtual void setLength(int len, bool addZero=true)
limits the length of the string (by adding a delimiting 0)
Definition StrView.h:458
virtual void trim()
remove leading and traling spaces
Definition StrView.h:504
virtual void swap(StrView &str)
Definition StrView.h:95
virtual void operator=(int value)
we can assign an int
Definition StrView.h:331
virtual void set(const char *alt)
assigs a value
Definition StrView.h:47
virtual char operator[](int index)
Definition StrView.h:343
virtual void operator+=(const char value)
adds a character
Definition StrView.h:355
int savedLen
Definition StrView.h:736
virtual void operator=(const char *str)
we can assign a const char*
Definition StrView.h:319
virtual bool replace(const char *toReplace, const char *replaced)
Replaces the first instance of toReplace with replaced.
Definition StrView.h:392
StrView(char chars[], int maxlen, int len=0)
Creates a Str with the indicated buffer.
Definition StrView.h:44
virtual void clear()
clears the string by setting the terminating 0 at the beginning
Definition StrView.h:539
long toLong()
Converts the string to an long.
Definition StrView.h:585
virtual void ltrim()
remove leading spaces
Definition StrView.h:521
virtual bool matches(const char *pattern)
Definition StrView.h:193
virtual int nIndexOf(const char *cont, int n)
searches for the nth occurence of the indicated character
Definition StrView.h:309
virtual void substring(StrView &from, int start, int end)
copies a substring into the current string
Definition StrView.h:477
virtual const char * c_str()
provides the string value as const char*
Definition StrView.h:379
float toFloat()
Converts the string to a float.
Definition StrView.h:604
virtual void removeAll(const char *toRemove)
removes the indicated substring from the string
Definition StrView.h:442
virtual void operator<<(int n)
shift characters to the right -> we just move the pointer
Definition StrView.h:334
virtual bool endsWithIgnoreCase(const char *str)
checks if the string ends with the indicated substring
Definition StrView.h:185
virtual void set(const StrView &alt)
assigs from another Str value
Definition StrView.h:66
int toInt()
Converts the string to an int.
Definition StrView.h:576
virtual void add(double value, int precision=2, int withd=0)
adds a double value
Definition StrView.h:135
virtual int indexOf(const char *cont, int start=0)
Definition StrView.h:284
virtual void remove(const char *toRemove)
removes the indicated substring from the string
Definition StrView.h:429
char savedChar
Definition StrView.h:737
virtual bool isConst()
checks if the string is a constant that must not be changed
Definition StrView.h:550
bool isNumber()
Definition StrView.h:701
virtual void insert(int pos, const char *str)
inserts a substring into the string
Definition StrView.h:553
virtual int indexOf(const char c, int start=0)
Definition StrView.h:260
virtual void add(int value)
adds a int value
Definition StrView.h:126
virtual void set(const char c)
Definition StrView.h:80
static const char * toBinary(void const *const ptr, size_t const size)
provides a binary string represntation
Definition StrView.h:636
void toLowerCase()
Converts the string to lowercase letters.
Definition StrView.h:618
virtual void setLengthUndo()
undo the last setLength call
Definition StrView.h:468
void toUpperCase()
Converts the string to uppercase letters.
Definition StrView.h:627
int len
Definition StrView.h:734
virtual bool operator!=(const char *alt) const
checks if the indicated string is different from the current string
Definition StrView.h:374
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition AudioCodecsBase.h:10
size_t writeData(Print *p_out, T *data, int samples, int maxSamples=512)
Definition AudioTypes.h:512