comparison include/core/strings.h @ 226:f784b5b1914c

settings: add library page
author Paper <mrpapersonic@gmail.com>
date Mon, 08 Jan 2024 21:23:00 -0500
parents c39ad2a8587d
children 862d0d8619f6
comparison
equal deleted inserted replaced
225:56ea2bdc6724 226:f784b5b1914c
1 #ifndef __core__strings_h 1 #ifndef __core__strings_h
2 #define __core__strings_h 2 #define __core__strings_h
3 3
4 #include <string> 4 #include <string>
5 #include <vector> 5 #include <vector>
6 #include <set>
6 #include <sstream> 7 #include <sstream>
7 8
8 #include <cstdint> 9 #include <cstdint>
9 10
10 class QString; 11 class QString;
14 15
15 /* Implode function: takes a vector of strings and turns it 16 /* Implode function: takes a vector of strings and turns it
16 * into a string, separated by delimiters. 17 * into a string, separated by delimiters.
17 */ 18 */
18 std::string Implode(const std::vector<std::string>& vector, const std::string& delimiter); 19 std::string Implode(const std::vector<std::string>& vector, const std::string& delimiter);
20 std::string Implode(const std::set<std::string>& set, const std::string& delimiter);
19 std::vector<std::string> Split(const std::string &text, const std::string& delimiter); 21 std::vector<std::string> Split(const std::string &text, const std::string& delimiter);
20 22
21 /* Substring removal functions */ 23 /* Substring removal functions */
22 std::string ReplaceAll(std::string string, const std::string& find, const std::string& replace); 24 std::string ReplaceAll(std::string string, const std::string& find, const std::string& replace);
23 std::string SanitizeLineEndings(const std::string& string); 25 std::string SanitizeLineEndings(const std::string& string);