comparison include/core/strings.h @ 264:9a04802848c0

*: improve multiple things e.g. making some strings.cc functions modify strings in-place, improving m4_ax_have_qt.m4 code, making anime_db.cc rely on std::optional rather than std::shared_ptr (which was stupid anyway)
author Paper <paper@paper.us.eu.org>
date Thu, 11 Apr 2024 10:15:57 -0400
parents 3ec7804abf17
children f31305b9f60a
comparison
equal deleted inserted replaced
263:96416310ea14 264:9a04802848c0
23 /* Substring removal functions */ 23 /* Substring removal functions */
24 void ReplaceAll(std::string& string, std::string_view find, std::string_view replace); 24 void ReplaceAll(std::string& string, std::string_view find, std::string_view replace);
25 void SanitizeLineEndings(std::string& string); 25 void SanitizeLineEndings(std::string& string);
26 void RemoveHtmlTags(std::string& string); 26 void RemoveHtmlTags(std::string& string);
27 void ParseHtmlEntities(std::string& string); 27 void ParseHtmlEntities(std::string& string);
28 void NormalizeUnicode(std::string& string);
29 void NormalizeAnimeTitle(std::string& string);
28 30
29 /* stupid HTML bullshit */ 31 /* stupid HTML bullshit */
30 void TextifySynopsis(std::string& string); 32 void TextifySynopsis(std::string& string);
31 33
32 std::string ToUpper(const std::string& string); 34 std::string ToUpper(const std::string& string);
64 66
65 std::string ToUtf8String(bool b); 67 std::string ToUtf8String(bool b);
66 68
67 uint64_t HumanReadableSizeToBytes(const std::string& str); 69 uint64_t HumanReadableSizeToBytes(const std::string& str);
68 70
69 std::string RemoveLeadingChars(std::string s, const char c); 71 void RemoveLeadingChars(std::string& s, const char c);
70 std::string RemoveTrailingChars(std::string s, const char c); 72 void RemoveTrailingChars(std::string& s, const char c);
71 73
72 bool BeginningMatchesSubstring(const std::string& str, const std::string& sub); 74 bool BeginningMatchesSubstring(const std::string& str, const std::string& sub);
73 75
74 }; // namespace Strings 76 }; // namespace Strings
75 77