-
Notifications
You must be signed in to change notification settings - Fork 3
/
reactionListObject.e
68 lines (53 loc) · 1.37 KB
/
reactionListObject.e
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
OPT MODULE
MODULE '*stringlist','*reactionObject','*baseStreamer'
EXPORT OBJECT reactionListObject OF reactionObject
listnode:LONG
items:PTR TO stringlist
ENDOBJECT
PROC create(parent) OF reactionListObject
DEF items:PTR TO stringlist
self.type:=TYPE_REACTIONLIST
SUPER self.create(parent)
NEW items.stringlist(10)
self.items:=items
ENDPROC
PROC end() OF reactionListObject
END self.items
SUPER self.end()
ENDPROC
EXPORT PROC serialise(fser:PTR TO baseStreamer) OF reactionListObject
DEF tempStr[200]:STRING
DEF i
SUPER self.serialise(fser)
FOR i:=0 TO self.items.count()-1
StringF(tempStr,'LISTITEM: \s',self.items.item(i))
fser.writeLine(tempStr)
ENDFOR
fser.writeLine('-')
self.serialiseChildren(fser)
ENDPROC
EXPORT PROC deserialise(fser:PTR TO baseStreamer) OF reactionListObject
DEF tempStr[200]:STRING
DEF done=FALSE
DEF i
SUPER self.deserialise(fser)
self.items.clear()
REPEAT
IF fser.readLine(tempStr)
IF StrCmp('-',tempStr)
done:=TRUE
ELSEIF StrCmp('LISTITEM: ',tempStr,STRLEN)
self.items.add(tempStr+STRLEN)
ENDIF
ELSE
done:=TRUE
ENDIF
UNTIL done
ENDPROC
EXPORT PROC getTypeName() OF reactionListObject
RETURN 'ReactionList'
ENDPROC
EXPORT PROC createReactionListObject(parent)
DEF list:PTR TO reactionListObject
NEW list.create(parent)
ENDPROC list