Mercurial > minori
comparison include/core/strings.h @ 273:f31305b9f60a
*: various code safety changes
this also makes the code build on Qt 5.7. I can't test it though
because I don't have it working... FAIL!
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Thu, 18 Apr 2024 16:53:17 -0400 |
parents | 9a04802848c0 |
children | 1b5c04268d6a |
comparison
equal
deleted
inserted
replaced
272:5437009cb10e | 273:f31305b9f60a |
---|---|
65 bool ToBool(const std::string& s, bool def); | 65 bool ToBool(const std::string& s, bool def); |
66 | 66 |
67 std::string ToUtf8String(bool b); | 67 std::string ToUtf8String(bool b); |
68 | 68 |
69 uint64_t HumanReadableSizeToBytes(const std::string& str); | 69 uint64_t HumanReadableSizeToBytes(const std::string& str); |
70 std::string BytesToHumanReadableSize(uint64_t bytes, int precision = 2); | |
70 | 71 |
71 void RemoveLeadingChars(std::string& s, const char c); | 72 void RemoveLeadingChars(std::string& s, const char c); |
72 void RemoveTrailingChars(std::string& s, const char c); | 73 void RemoveTrailingChars(std::string& s, const char c); |
73 | 74 |
74 bool BeginningMatchesSubstring(const std::string& str, const std::string& sub); | 75 bool BeginningMatchesSubstring(const std::string& str, const std::string& sub); |