Game Develop Core: EventsRefactorer.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
EventsRefactorer.h
Go to the documentation of this file.
1
5 #ifndef GDCORE_EVENTSREFACTORER_H
6 #define GDCORE_EVENTSREFACTORER_H
7 #include <vector>
8 #include <string>
9 #include <boost/shared_ptr.hpp>
10 #include <boost/weak_ptr.hpp>
11 namespace gd { class Layout; }
12 namespace gd { class Platform; }
13 namespace gd { class Project; }
14 namespace gd { class ExternalEvents; }
15 namespace gd { class BaseEvent; }
16 namespace gd { class Instruction; }
17 namespace gd {typedef boost::shared_ptr<gd::BaseEvent> BaseEventSPtr;}
18
19 namespace gd
20 {
21
27 class GD_CORE_API EventsSearchResult
28 {
29 public:
30 EventsSearchResult(boost::weak_ptr<gd::BaseEvent> event_, std::vector<boost::shared_ptr<gd::BaseEvent> > * eventsList_, unsigned int positionInList_ );
31 EventsSearchResult();
32 ~EventsSearchResult() {};
33
34 boost::weak_ptr<gd::BaseEvent> event;
35 std::vector<boost::shared_ptr<gd::BaseEvent> > * eventsList;
36 unsigned int positionInList;
37 };
38
45 class GD_CORE_API EventsRefactorer
46 {
47 public:
52 static void RenameObjectInEvents(const gd::Platform & platform, gd::Project & project, gd::Layout & layout, std::vector < gd::BaseEventSPtr > & events, std::string oldName, std::string newName);
53
57 static void RemoveObjectInEvents(const gd::Platform & platform, gd::Project & project, gd::Layout & layout, std::vector < gd::BaseEventSPtr > & events, std::string name);
58
64 static std::vector < EventsSearchResult > SearchInEvents(gd::Project & project, gd::Layout & layout, std::vector < gd::BaseEventSPtr > & events,
65 std::string search,
66 bool matchCase,
67 bool inConditions,
68 bool inAction);
69
73 static void ReplaceStringInEvents(gd::Project & project, gd::Layout & layout, std::vector < gd::BaseEventSPtr > & events,
74 std::string toReplace,
75 std::string newString,
76 bool matchCase,
77 bool inConditions,
78 bool inActions);
79
80 private:
87 static bool RenameObjectInActions(const gd::Platform & platform, gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & instructions, std::string oldName, std::string newName);
88
95 static bool RenameObjectInConditions(const gd::Platform & platform, gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & instructions, std::string oldName, std::string newName);
96
102 static bool RemoveObjectInConditions(const gd::Platform & platform, gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & conditions, std::string name);
103
109 static bool RemoveObjectInActions(const gd::Platform & platform, gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & conditions, std::string name);
110
116 static bool ReplaceStringInConditions(gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase);
117
123 static bool ReplaceStringInActions(gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & conditions, std::string toReplace, std::string newString, bool matchCase);
124
125 static bool SearchStringInActions(gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & actions, std::string search, bool matchCase);
126 static bool SearchStringInConditions(gd::Project & project, gd::Layout & layout, std::vector < gd::Instruction > & conditions, std::string search, bool matchCase);
127
128 EventsRefactorer() {};
129 virtual ~EventsRefactorer() {};
130 };
131
132 }
133
134 #endif // GDCORE_EVENTSREFACTORER_H