Mercurial > minori
annotate include/core/strings.h @ 102:b315f3759c56
*: big patch
1. use a wrapper for mINI that enables case sensitivity
(personal preference)
2. rename dark_theme.cc to theme.cc and change it to be
a class
3. include the "dep" folder so we don't have stupidity in
json.h or ini.h
4. I think the graph was also tweaked a lot in this, nothing
is constexpr and size is found at runtime...
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Fri, 03 Nov 2023 21:32:52 -0400 |
| parents | c537996cf67b |
| children | 6d8da6e64d61 |
| rev | line source |
|---|---|
| 9 | 1 #ifndef __core__strings_h |
| 2 #define __core__strings_h | |
| 15 | 3 |
| 9 | 4 #include <string> |
| 5 #include <vector> | |
| 15 | 6 |
| 64 | 7 class QString; |
| 8 | |
| 10 | 9 namespace Strings { |
| 15 | 10 |
| 9 | 11 /* Implode function: takes a vector of strings and turns it |
| 12 into a string, separated by delimiters. */ | |
| 13 std::string Implode(const std::vector<std::string>& vector, const std::string& delimiter); | |
| 14 | |
| 15 /* Substring removal functions */ | |
|
98
582b2fca1561
strings: parse HTML entities when reading synopsis, make the
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
16 std::string ReplaceAll(std::string string, const std::string& find, const std::string& replace); |
| 9 | 17 std::string SanitizeLineEndings(const std::string& string); |
|
100
f5940a575d83
track/constants: add many more video formats
Paper <mrpapersonic@gmail.com>
parents:
98
diff
changeset
|
18 std::string RemoveHtmlTags(std::string string); |
|
f5940a575d83
track/constants: add many more video formats
Paper <mrpapersonic@gmail.com>
parents:
98
diff
changeset
|
19 std::string ParseHtmlEntities(std::string string); |
| 9 | 20 |
| 21 /* stupid HTML bullshit */ | |
| 22 std::string TextifySynopsis(const std::string& string); | |
| 15 | 23 |
| 24 std::string ToUpper(const std::string& string); | |
| 25 std::string ToLower(const std::string& string); | |
| 26 | |
|
98
582b2fca1561
strings: parse HTML entities when reading synopsis, make the
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
27 /* functions that make the way we convert from and to |
|
582b2fca1561
strings: parse HTML entities when reading synopsis, make the
Paper <mrpapersonic@gmail.com>
parents:
85
diff
changeset
|
28 different string formats universal */ |
| 62 | 29 std::wstring ToWstring(const std::string& string); |
| 64 | 30 std::wstring ToWstring(const QString& string); |
| 62 | 31 std::string ToUtf8String(const std::wstring& wstring); |
| 64 | 32 std::string ToUtf8String(const QString& string); |
| 33 QString ToQString(const std::string& string); | |
| 34 QString ToQString(const std::wstring& wstring); | |
| 62 | 35 |
|
101
c537996cf67b
*: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents:
100
diff
changeset
|
36 /* arithmetic :) */ |
|
c537996cf67b
*: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents:
100
diff
changeset
|
37 int ToInt(const std::string& str, int def = 0); |
|
c537996cf67b
*: multitude of config changes
Paper <mrpapersonic@gmail.com>
parents:
100
diff
changeset
|
38 |
| 102 | 39 bool BeginningMatchesSubstring(const std::string& str, const std::string& sub); |
| 40 | |
| 85 | 41 }; // namespace Strings |
| 42 | |
| 9 | 43 #endif // __core__strings_h |
