forked from rubenwardy/NodeBoxEditor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileParser.h
48 lines (43 loc) · 1.03 KB
/
FileParser.h
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
#ifndef _FILEPARSER_H_INCLUDED_
#define _FILEPARSER_H_INCLUDED_
#include "common.h"
#include "Project.h"
#include "EditorState.h"
class FileParser
{
public:
virtual void save(Project* project,irr::core::stringc file) = 0;
virtual Project* open(irr::core::stringc file) = 0;
};
class EditorState;
class NBEFileParser:public FileParser
{
public:
NBEFileParser(EditorState* sta):state(sta),proj(NULL),node(NULL),stage(NBEFileParser::ERS_ROOT){}
virtual void save(Project* project,irr::core::stringc file);
virtual Project* open(irr::core::stringc file);
enum readstage
{
ERS_ROOT = 1,
ERS_NODE = 2
};
private:
readstage stage;
Node* node;
Project* proj;
EditorState* state;
void parseLine(stringc line);
};
class LUAFileParser:public FileParser
{
public:
LUAFileParser(EditorState* sta):state(sta){}
virtual void save(Project* project,irr::core::stringc file);
virtual Project* open(irr::core::stringc file){
printf("[WARNING] The lua importer has not been written yet!\n");
return NULL;
}
private:
EditorState* state;
};
#endif