mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-14 09:25:30 -04:00
Logging Updates (#978)
* log_file ensures directory exists * Fix audio timestamp path * Fix auto inc, add subfolder for recordings * Fix auto inc and support subfolder
This commit is contained in:
parent
8b395239d2
commit
a8cdde7bea
22 changed files with 132 additions and 62 deletions
|
@ -256,8 +256,17 @@ double get_decimals(double num, int16_t mult, bool round) {
|
|||
return intnum;
|
||||
}
|
||||
|
||||
std::string trimr(std::string str)
|
||||
{
|
||||
std::string trim(const std::string& str) {
|
||||
auto first = str.find_first_not_of(' ');
|
||||
auto last = str.find_last_not_of(' ');
|
||||
return str.substr(first, last - first);
|
||||
}
|
||||
|
||||
std::string trimr(std::string str) {
|
||||
size_t last = str.find_last_not_of(' ');
|
||||
return (last!=std::string::npos) ? str.substr(0, last+1) : ""; // Remove the trailing spaces
|
||||
}
|
||||
|
||||
std::string truncate(const std::string& str, size_t length) {
|
||||
return str.length() <= length ? str : str.substr(0, length);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue