]> git.street.me.uk Git - andy/viking.git/blame - doc/dev/File-Format-Outline
strtod -> g_strtod
[andy/viking.git] / doc / dev / File-Format-Outline
CommitLineData
50a14534
EB
1WARNING: OLD file format. Will be discarded. Read FF2
2----------
3Magic Number:
46c45e131
5
6lE..
7
8at beginning of file. I love magic numbers.
9
10For Serialization, we need to separate realizing a layer and adding it to a aggregate. An aggregate
11layer, when realized, should realize all of its children, and add all of its children to the treeview.
12An aggregate should realize a layer and add it to the treeview in add_layer only if it is already
13realized (we cannot assume that it is.) This will pave the road for serialization.
14
15Tree
16 Child
17 Child
18
19
20START
21(TopLayer)
22layer type ID
23layer name len + layer name
24Layer Data. Call Layer serialize-in func.
25
26(if type == aggregate, len = # of layers)
27
28Example:
29
30Top
31+ Aggy
32 + Aggy2
33 - TRW
34 - MAP
35 - COORD
36+ Aggy1
37 - TRW
38 - TRW
39 - TRW
40
41File:
42
430 (Aggregate)
444
45Aggy
462 (2 Sublayers)
47
480 (Aggregate)
495
50Aggy2
512 (2 Subs)
52
531 (TRW)
543
55TRW
56(TRW DATA)
57
582 (MAP)
593
60MAP
61(MAP DATA)
62
633 (COORD)
645
65COORD
66(COORD DATA)
67
681
695
70Aggy1
713 (3 subs)
72
731
743
75TRW
76100
77(TRW DATA)
78
791
803
81TRW
82100
83(TRW DATA)
84
851
863
87TRW
88100
89(TRW DATA)
90
91(END)
92
93Parsing
94Call agg parse function (top layer) with file format.
95agg parse function parses, calls appropriate function.
96repeats add infinitum.
97
98----
99
100Functions:
101
102Aggregate Read:
103for loop thru # of layers:
104 read a byte, get id, create a layer of such type via the "serialize_read" func which
105 returns a layer I can then read.
106 repeat, enjoy.
107
108Ahhh, the joys of Recursion.
109
110Aggregate Write:
111write length of layers array.
112for each layer:
113 write ID.
114 run serialize_write.
115
116
117MAX # of layers: 2^16
118