-
Notifications
You must be signed in to change notification settings - Fork 0
/
xmlproc.cpp
executable file
·99 lines (83 loc) · 2.04 KB
/
xmlproc.cpp
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include "xmlproc.h"
#include "thread_touch.h"
#include "thread_timer.h"
#include "HumapXML.h"
DebugTimer fps;
pXmlproc g_cur_xml;
//ProcTimer g_exec;
int xmlproc::init()
{
//elemgr = this;
isDraw = 0; //默认无绘制图像
fore = 0; //默认为后台进程
done = 0; //默认非完成状态
if (out.isNULL())
{
if (out.SetBuffer(fb.u32Width, fb.u32Height))
{
huErrExit("$$$HU$$$ blt_set_dest_buff error\r\n");
}
}
m_exit = 1;
create();
}
void xmlproc::ForeProc()
{
fore = 1;
g_th_touch.SwitchProc(this);
g_th_timer.SwitchProc(this);
// g_exec.ChangeContainer(this);
}
void xmlproc::UnForeProc()
{
fore = 0;
g_th_touch.SwitchProc(NULL);
g_th_timer.SwitchProc(NULL);
// g_exec.ChangeContainer(NULL);
}
void xmlproc::DoneProc()
{
done = 1;
}
void xmlproc::UnDoneProc()
{
done = 0;
}
void xmlproc::StartParseXML_file(const char * file)
{
debug("+++++++++++++%s++++++++++++++\r\n", filename.c_str());
UnDoneProc();
//DebugTimer dbg;
HUMap mp;
HumapFromXmlFile(file, mp);
//mp.display();
HUMap::OrderList lst(mp);
for(HUMap::OrderList::iterator it = lst.begin();it!=lst.end();++it)
{
hustr name = (*it).m_key;
ParseXMLFrom_Instan(name, *it, this);
}
//dbg.debug_timer("ParaseTinyXmlFile3");
DoneProc();
debug("+++++++++++++%s++++++++++++++OK\r\n", filename.c_str());
}
void xmlproc::StartParseXML_str(const char * str)
{
debug("+++++++++++++%s++++++++++++++\r\n", filename.c_str());
lock();
UnDoneProc();
//DebugTimer dbg;
HUMap mp;
HumapFromXmlString(str,strlen(str), mp);
//mp.display();
HUMap::OrderList lst(mp);
for(HUMap::OrderList::iterator it = lst.begin();it!=lst.end();++it)
{
hustr name = (*it).m_key;
ParseXMLFrom_Instan(name, *it, this);
}
//dbg.debug_timer("ParaseTinyXmlFile3");
DoneProc();
unlock();
debug("+++++++++++++%s++++++++++++++OK\r\n", filename.c_str());
}