Update playlist file parsing, reduce allocs (#1157)

* Update playlist file parsing, reduce allocs
* Cleanup, move impl to cpp
This commit is contained in:
Kyle Reed 2023-06-15 13:15:26 -07:00 committed by GitHub
parent 34fefd1cad
commit d29826e6f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 233 additions and 94 deletions

View file

@ -25,6 +25,7 @@
#include <cstdint>
#include <array>
#include <string>
#include <string_view>
#include "file.hpp"
@ -66,10 +67,10 @@ std::string to_string_FAT_timestamp(const FATTimestamp& timestamp);
std::string to_string_file_size(uint32_t file_size);
std::string unit_auto_scale(double n, const uint32_t base_nano, uint32_t precision);
double get_decimals(double num, int16_t mult, bool round = false); // euquiq added
double get_decimals(double num, int16_t mult, bool round = false);
std::string trim(const std::string& str); // Remove whitespace at ends.
std::string trimr(const std::string& str); // Remove trailing spaces
std::string truncate(const std::string& str, size_t length);
std::string trim(std::string_view str); // Remove whitespace at ends.
std::string trimr(std::string_view str); // Remove trailing spaces
std::string truncate(std::string_view, size_t length);
#endif /*__STRING_FORMAT_H__*/