annotate mde/mergetag/doc/file-format-text.txt @ 8:f63f4f41a2dc

Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint. committer: Diggory Hardy <diggory.hardy@gmail.com>
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 25 Jan 2008 18:17:38 +0000
parents 9a990644948c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
1 This is the file format for mergetag text files.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
2 Version: 0.1 unfinalised
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
3
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
4
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
5 The encoding should be unicode UTF-8, UTF-16 or UTF-32, and for anything other than UTF-8 must include a BOM.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
6
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
7
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
8 Hierarchy:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
9 + Sections (special section: see header)
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
10 ++ Data Tags
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
11
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
12
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
13 IDs:
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
14 IDs are used for several purposes; they are UTF-8 strings. They are stored in text files as unquoted strings; escape sequences are not supported and the strings should not contain the following characters, although this is not checked: <|=>{}
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
15 All characters between the appropriate markers are consumed into the ID, hence whitespace is meaningful.
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
16 Multiple section or data tags with the same ID are allowed; see the "Merging rules" section.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
17
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
18
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
19 Outside of tags only whitespace or valid tags is allowed. Whitespace is ignored.
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
20 The following tags are valid (see below for details):
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
21 tag purpose
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
22 {...} section identifiers
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
23 <...> data items
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
24 !{...} simple comment block
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
25 !<...> comment block parsed the same as <...>
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
26 Within tags, type specifications or data items whitespace is allowed between symbols.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
27
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
28
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
29 Section identifier tags:
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
30 Format: {ID}
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
31 The ID is the section identifier/name. The ID type is DefaultData unless overriden by the code using the reader.
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
32 A section identifier marks the beginning of a new section, extending until the next section identifier or the end of the file.
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
33
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
34
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
35 Data item tags:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
36 Format: <tp|ID=dt>
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
37 A data item with type tp, identifier ID and data dt. If the data does not fit the given type it is an error and the tag is ignored. Once split into a type string, ID and data string, the contents are passed to an addTag() function within the DataSection class which will parse tags of a recognised format and either ignore or print a warning about other tags.
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
38
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
39
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
40 Data item tags: Type format:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
41 Note:
2
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
42 The type is read as a single token terminated by any of these characters: <>|=
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
43 There must not be spaces within the type, e.g. "char []".
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
44 Of course any character other than a | terminating the token is an error.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
45 Format:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
46 tp a basic type
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
47 tp[] a dynamic list of sub-type tp
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
48 t1[t2] an associative array with key-type t2
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
49 Possible future additions:
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
50 tp() a dynamic merging list of sub-type tp (only valid as the primary type, ie <subtype()|...>, not a sub-type of a tuple or another dynamic list)
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
51 {t1,t2,...,tn} a tuple with sub-types t1, t2, ..., tn
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
52
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
53 Basic types (only items with a + are currently supported, items with * are in DefaultData):
2
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
54 name
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
55
2
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
56 void --- less useful type
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
57 +* bool --- integer types
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
58 +* byte
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
59 +* ubyte
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
60 +* short
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
61 +* ushort
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
62 +* int
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
63 +* uint
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
64 +* long
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
65 +* ulong
2
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
66 cent
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
67 ucent
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
68
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
69 +* binary --- alias for ubyte[]
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
70
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
71 +* float --- floating point types
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
72 +* double
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
73 +* real
2
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
74 ifloat
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
75 idouble
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
76 ireal
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
77 cfloat
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
78 cdouble
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
79 creal
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
80
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
81 +* char --- single character types (actually these CANNOT support UTF8 symbols with length > 1)
2
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
82 wchar
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
83 dchar
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
84 +* string --- alias for char[] --- (DOES support UTF8)
2
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
85 wstring --- alias for wchar[]
78eb491bd642 mergetag: partially redesigned dataset and text reader classes. Changed text format.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 0
diff changeset
86 dstring --- alias for dchar[]
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
87
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
88
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
89 Data item tags: Data format:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
90 Valid chars: [](){},+-.0-9eEixXa-fA-F '.' ".*"
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
91 Format:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
92 [d1,d2,...,dn] data all of type t corresponding to t[]
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
93 (d1,d2,...,dn) data all of type t corresponding to t()
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
94 {d1,d2,...,dn} data corresponding to a type declaration of {t1,t2,...,tn}
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
95 d a single data element
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
96
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
97 Single data elements:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
98 z an integer number (regexp: [+-]?[0-9]+)
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
99 z a floating point number (rough regexp: [+-]?[0-9]*[.]?[0-9]*(e[+-]?[0-9]+)?)
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
100 zi an imaginary floating point number (z is a floating point number)
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
101 y+zi, y-zi a complex number (4+0i may be written as 4, etc) (y, z are f.p.s)
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
102 0xz, -0xz a hexadecimal integer z (composed of chars 0-9,a-f,A-F)
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
103 'c' a char/wchar/dchar character, depending on the type specified (c may be any single character except ' or an escape sequence)
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
104 "string" equivalent to ['s','t','r','i','n','g'] --- may contain the following escape sequences as defined in D: \" \' \\ \a \b \f \n \r \t \v
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
105 XX...XX Binary (ubyte[]); each pair of chars is read as a hex ubyte
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
106 <void> void "data" has no symbols
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
107
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
108
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
109 Data format: Escape sequences:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
110 To be created and written.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
111
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
112
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
113 Comment tags (there are no line comments):
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
114 Simple comment blocks:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
115 Format: !{...}
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
116 This is a simple comment block, and only curly braces ({,}) are treated specially. A {, whether or not it is preceded by a !, starts an embedded comment block, and a } ends either an embedded block or the actual comment block. Note: beware commenting out anything containing curly braces which aren't in matching pairs.
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
117 Commented data tags:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
118 Format: !<tp|ID=dt>
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
119 Basically a commented out data tag. Conformance to the above spec may not be checked as strictly as normal, but the dt section is checked for strings so that a > within a string won't end the tag.
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
120
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
121
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
122 Merging rules:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
123 if, when a data item is read, a data item with the same identifier
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
124 within the same section exists in the DataSet being read into:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
125 + if the types are identical:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
126 ++ if the primary type is a tp() mergeable dynamic list:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
127 +++ the entries from the item being read are concatenated to those in the item
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
128 +++ in the DataSet
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
129 ++ else:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
130 ++- the item already in the DataSet takes priority and is left untouched
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
131 + else:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
132 +- a warning is issued, and the data item within the DataSet is left untouched
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
133 This allows merging some config settings in a user config file with the remaining settings in a
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
134 complete system config file and some support for modifications overriding or adding to some data.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
135
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
136
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
137 Header:
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
138 The header is a standard section which is mandatory and must be the first section. Its section identifier must start at the beginning of the file with no whitespace, declared with:
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
139 {MTXY} where XY is a two digit CAPITAL HEX version number representing the mergetag format version, e.g. {MT01} .
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
140 If these are not the first 6 characters of the file the file will not be regarded as valid.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
141 This formatting is very strict to allow reliable low-level parsing.
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
142
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
143
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
144 The data tags within the header have no special meaning; any may be used such as the following:
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
145 <string|"Author"="...">
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
146 <string|"Name"="...">
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
147 <string|"Description"="...">
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
148 <string|"Program"="..."> (which program created/uses this?)
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
149 <*|"Version"=...> (use any supported type)
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
150 <string|"Date"="YYYYMMDD"> (reverse date format; optionally "YYYYMMDDhhmmss")
8
f63f4f41a2dc Big changes to init; got some way towards input event support; changed mergetag ID to char[] from uint.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 4
diff changeset
151 <{u16,u8,u8}|"Date"={YYYY,MM,DD}> (actually this type probably won't be supported by a standard section)
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
152 <string|"Copyright"=...>
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
153
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
154
4
9a990644948c Many changes: upgraded to tango 0.99.4, reorganised mde/input, large changes to mde/mergetag and mde/init, separated off test/MTTest.d and more.
Diggory Hardy <diggory.hardy@gmail.com>
parents: 2
diff changeset
155 Example: !THIS IS NO LONGER VALID!
0
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
156 {MT01}
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
157 {example section}
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
158 <u32|"num"=5>
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
159 <{u32,UTF8[]}()|"DATA"=(
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
160 {1,['a']},
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
161 {59,['w','o','r','d']},
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
162 {2,"strings can be written like this"} )>
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
163 <wchar[]|"name"="This string is stored in UTF16, regardless of the file's encoding.">
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
164 <{u32,UTF8[]}()|"DATA"=(
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
165 {3,"this is appended to the previous 'DATA' item"} )>
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
166 {"section: section identifiers and tuples are not confused since tuples only occur inside <...> items"}
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
167 <void|Empty tag= >
d547009c104c Repository creation.
Diggory Hardy <diggory.hardy@gmail.com>
parents:
diff changeset
168 !{this is a comment {containing a comment}}