Skip to content

Commit 144bfc8

Browse files
committed
Rename to Str and StrView
1 parent 1d0586c commit 144bfc8

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

src/AudioDictionarySD.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,15 @@ class AudioDictionarySD : public AudioDictionaryBase {
9696
}
9797

9898
protected:
99-
audio_tools::StrExt url_with_text;
99+
audio_tools::Str url_with_text;
100100
AudioFile file;
101101
AudioStreamFileWrapper<AudioFile> fileWrapper;
102102
#ifndef USE_SD
103103
AudioFat SD;
104104
#endif
105105
const char *path;
106106
const char *ext;
107-
StrExt file_path{40}; // allocate 40 bytes as a typical good initial size
107+
Str file_path{40}; // allocate 40 bytes as a typical good initial size
108108
bool is_setup = false;
109109
int cs_pin = -1;
110110

src/AudioDictionaryURL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class AudioDictionaryURL : public AudioDictionaryBase {
3636
protected:
3737
const char *url_cstr;
3838
const char *ext_cstr;
39-
StrExt url_str;
39+
Str url_str;
4040
URLStream *p_url;
4141
};
4242

src/NumberToText.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class NumberToText : public SimpleTTSBase {
4343
convert(wholeNumber);
4444

4545
// add decimals
46-
if (Str(decimals).toLong()>0l){
46+
if (StrView(decimals).toLong()>0l){
4747
convertDecimals(decimals);
4848
}
4949

@@ -106,7 +106,7 @@ class NumberToText : public SimpleTTSBase {
106106
}
107107
}
108108
void convert(const char* strValue){
109-
convert(Str(strValue).toLong());
109+
convert(StrView(strValue).toLong());
110110
}
111111

112112
// TODO: convert to string operations

src/NumberUnitToText.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class NumberUnitToText : public SimpleTTSBase {
4545
// determine unit
4646
const char* unit = unitIn ? unitIn : default_unit;
4747
// singular or plural ?
48-
bool isOne = Str(wholeNumber).toLong() == 1l;
48+
bool isOne = StrView(wholeNumber).toLong() == 1l;
4949

5050
// We support 2 scenarios: combined units or just a smple number with a single unit.
5151
int idx = idxCombinedUnit(unit);
@@ -67,7 +67,7 @@ class NumberUnitToText : public SimpleTTSBase {
6767
const char* decimals_to_say = calc.decAsInt(decimals, digits);
6868
addAll(ntt.say(decimals_to_say));
6969
// say decimals unit
70-
bool decIsOne = Str(decimals).toLong() == 1l;
70+
bool decIsOne = StrView(decimals).toLong() == 1l;
7171
processDecimalUnit(idx, decIsOne);
7272
}
7373

src/SimpleTTSBase.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class SimpleTTSBase {
2727
void printCSV(Print &out) {
2828
for (auto txt : allTexts()) {
2929
if (txt!=nullptr && strlen(txt)>0){
30-
StrExt str = txt;
30+
StrView str = txt;
3131
str.toLowerCase(); // convert txt to lowercase
3232
out.print(str.c_str());
3333
out.print(",");

src/sandbox/Importer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Importer {
6868
}
6969

7070
protected:
71-
audio_tools::StrExt url_with_text;
71+
audio_tools::Str url_with_text;
7272
File file;
7373
AudioStreamFileWrapper fileWrapper;
7474
const char *path;

tools/audio.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ eighty,eighty
3030
ninety,ninety
3131
and,and
3232
dot,dot
33+
point,point
3334
minus,minus
3435
hundred,hundred
3536
thousand,thousand

0 commit comments

Comments
 (0)