-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScriptHandler.h
More file actions
57 lines (49 loc) · 1.65 KB
/
Copy pathScriptHandler.h
File metadata and controls
57 lines (49 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef SCRIPTHANDLER_H
#define SCRIPTHANDLER_H
#include <string>
#include <vector>
#include <fstream>
#include <sstream>
#include <queue>
#include <cstdlib>
#include <iostream>
#include <stack>
#include <map>
#include <functional>
#include "MathHandler.h"
using std::string;
using std::cout;
using std::endl;
using std::map;
using std::pair;
const bool SCRIPTHANDLERDEBUG = false;
bool isvariable(std::string teststring);
//I want to do these things
//D: D:if, D:while done
//D:conditionals, D:addition, D:subtraction, D:multiplicatoin, D:devision
//Make variables and numbers replace one another done
//"open file and go to line X"
//D:run functions from other classes that are included
//NOTE: Functions have to be let run by making a functionhandler function in the
//bottom of the main program of the thing that is running this class
//the functionhandler must take a string, and the user of this class
//decides where to and what to do with the string they get when function X is typed
//start script at some trigger points
class ScriptHandler
{
public:
ScriptHandler();
ScriptHandler(std::function<void(std::string)> passedhandler);
void OpenFileAtLine(string file, string line);
void RunScript(std::vector<string> scriptdata);
bool checkconditions(std::queue<std::string> separatedcodeline);
std::string isvariabletype(std::string teststring);
private:
int Iwantaprivatevariable;
bool hasfunctionhandler;
std::function<void(string)> functionhandler;
map<string, int> intmap;
map<string, std::string> stringmap;
map<string, float> floatmap;
};
#endif // SCRIPTHANDLER_H