TDME2  1.9.200
TextTools.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
8 
9 using std::string;
10 
12 
13 /**
14  * Text Tools
15  * @author Andreas Drewke
16  */
18 {
19 public:
20 
21  /**
22  * Find string
23  * @param textNode text node
24  * @param findString find string
25  * @param matchCase only find string that also matches case in find string
26  * @param wholeWord only find whole worlds
27  * @param selection only find in selection
28  * @param firstSearch first search
29  * @param index index
30  * @return success
31  */
32  static bool find(GUIStyledTextNode* textNode, const string& findString, bool matchCase, bool wholeWord, bool selection, bool firstSearch, int& index);
33 
34  /**
35  * Count string
36  * @param textNode text node
37  * @param findString find string
38  * @param matchCase only find string that also matches case in find string
39  * @param wholeWord only find whole worlds
40  * @param selection only find in selection
41  */
42  static int count(GUIStyledTextNode* textNode, const string& findString, bool matchCase, bool wholeWord, bool selection);
43 
44  /**
45  * Replace string
46  * @param textNode text node
47  * @param findString find string
48  * @param replaceString replace string
49  * @param matchCase only find string that also matches case in find string
50  * @param wholeWord only find whole worlds
51  * @param selection only find in selection
52  * @param index index
53  * @return success
54  */
55  static bool replace(GUIStyledTextNode* textNode, const string& findString, const string& replaceString, bool matchCase, bool wholeWord, bool selection, int& index);
56 
57  /**
58  * Replace all string
59  * @param textNode text node
60  * @param findString find string
61  * @param replaceString replace string
62  * @param matchCase only find string that also matches case in find string
63  * @param wholeWord only find whole worlds
64  * @param selection only find in selection
65  * @return success
66  */
67  static bool replaceAll(GUIStyledTextNode* textNode, const string& findString, const string& replaceString, bool matchCase, bool wholeWord, bool selection);
68 
69 };
static int count(GUIStyledTextNode *textNode, const string &findString, bool matchCase, bool wholeWord, bool selection)
Count string.
Definition: TextTools.cpp:72
static bool replace(GUIStyledTextNode *textNode, const string &findString, const string &replaceString, bool matchCase, bool wholeWord, bool selection, int &index)
Replace string.
Definition: TextTools.cpp:104
static bool find(GUIStyledTextNode *textNode, const string &findString, bool matchCase, bool wholeWord, bool selection, bool firstSearch, int &index)
Find string.
Definition: TextTools.cpp:23
static bool replaceAll(GUIStyledTextNode *textNode, const string &findString, const string &replaceString, bool matchCase, bool wholeWord, bool selection)
Replace all string.
Definition: TextTools.cpp:159