Skip to content

Commit ec4c2d3

Browse files
author
tk
committed
stack string functions
1 parent 30b038d commit ec4c2d3

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/types/TString.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ namespace tklb {
2222
if (N == 0) { return nullptr; }
2323
return mData;
2424
}
25+
26+
char* c_str() {
27+
if (N == 0) { return nullptr; }
28+
return mData;
29+
}
30+
2531
const char& operator[](const Size index) const {
2632
TKLB_ASSERT(index < N)
2733
// If asserts are disable, pretend the string is terminated
@@ -72,6 +78,10 @@ namespace tklb {
7278
return N; // someone wrote past the end
7379
}
7480

81+
Size maxSize() const {
82+
return N;
83+
}
84+
7585
void set(const char* str) {
7686
if (N == 0) { return; }
7787
Size i = 0;

src/types/audio/TAudio.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace tklb {
1010
if (db < silenceDb) {
1111
return 0;
1212
}
13-
return pow (T(10), db * T(0.05));
13+
return pow(T(10), db * T(0.05));
1414
}
1515

1616
template <typename T>

0 commit comments

Comments
 (0)