annotate src/include/string_utils.h @ 8:b1f73678ef61

update text paragraphs are now their own objects, as they should be
author Paper <mrpapersonic@gmail.com>
date Sat, 26 Aug 2023 03:39:34 -0400
parents 23d0d9319a00
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
1 #ifndef __string_utils_h
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
2 #define __string_utils_h
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
3 #include <string>
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
4 #include <vector>
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
5 namespace StringUtils {
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
6 /* Implode function: takes a vector of strings and turns it
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
7 into a string, separated by delimiters. */
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
8 std::string Implode(const std::vector<std::string>& vector,
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
9 const std::string& delimiter);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
10 std::wstring Implode(const std::vector<std::wstring>& vector,
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
11 const std::wstring& delimiter);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
12
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
13 /* Conversion from UTF-8 to std::wstring and vice versa */
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
14 std::string WstrToUtf8(const std::wstring& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
15 std::wstring Utf8ToWstr(const std::string& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
16
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
17 /* Substring removal functions */
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
18 std::string ReplaceAll(const std::string& string,
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
19 const std::string& find,
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
20 const std::string& replace);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
21 std::wstring ReplaceAll(const std::wstring& string,
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
22 const std::wstring& find,
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
23 const std::wstring& replace);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
24 std::string SanitizeLineEndings(const std::string& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
25 std::wstring SanitizeLineEndings(const std::wstring& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
26 std::wstring RemoveHtmlTags(const std::wstring& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
27 std::string RemoveHtmlTags(const std::string& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
28
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
29 /* stupid HTML bullshit */
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
30 std::string TextifySynopsis(const std::string& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
31 std::wstring TextifySynopsis(const std::wstring& string);
Paper <mrpapersonic@gmail.com>
parents: 1
diff changeset
32 };
1
1ae666fdf9e2 *: initial commit
Paper <mrpapersonic@gmail.com>
parents:
diff changeset
33 #endif // __string_utils_h