Add Name finder search engine
[viking/guyou.git] / doc / dev / File-Format-Outline
blobcb57a2c9311fc1728b50bd01bbd4247785b9738d
1 WARNING: OLD file format. Will be discarded. Read FF2
2 ----------
3 Magic Number:
4 6c45e131
6 lE..
8 at beginning of file. I love magic numbers.
10 For Serialization, we need to separate realizing a layer and adding it to a aggregate. An aggregate 
11 layer, when realized, should realize all of its children, and add all of its children to the treeview. 
12 An aggregate should realize a layer and add it to the treeview in add_layer only if it is already 
13 realized (we cannot assume that it is.) This will pave the road for serialization.
15 Tree
16   Child
17     Child
20 START
21 (TopLayer)
22 layer type ID
23 layer name len + layer name
24 Layer Data. Call Layer serialize-in func.
26 (if type == aggregate, len = # of layers)
28 Example:
30 Top
31 + Aggy
32   + Aggy2
33     - TRW
34     - MAP
35   - COORD
36 + Aggy1
37   - TRW
38   - TRW
39   - TRW
41 File:
43 0       (Aggregate)
45 Aggy
46 2       (2 Sublayers)
48 0       (Aggregate)
50 Aggy2
51 2       (2 Subs)
53 1       (TRW)
55 TRW
56 (TRW DATA)
58 2       (MAP)
60 MAP
61 (MAP DATA)
63 3       (COORD)
65 COORD
66 (COORD DATA)
70 Aggy1
71 3       (3 subs)
75 TRW
76 100
77 (TRW DATA)
81 TRW
82 100
83 (TRW DATA)
87 TRW
88 100
89 (TRW DATA)
91 (END)
93 Parsing
94 Call agg parse function (top layer) with file format.
95 agg parse function parses, calls appropriate function.
96 repeats add infinitum.
98 ----
100 Functions:
102 Aggregate Read:
103 for 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.
108 Ahhh, the joys of Recursion.
110 Aggregate Write:
111 write length of layers array.
112 for each layer:
113   write ID.
114   run serialize_write.
117 MAX # of layers: 2^16