comparison mde/file/mergetag/internal.d @ 81:d8fccaa45d5f

Moved file IO code from mde/mergetag to mde/file[/mergetag] and changed how some errors are caught.
author Diggory Hardy <diggory.hardy@gmail.com>
date Fri, 29 Aug 2008 11:59:43 +0100
parents mde/mergetag/internal.d@611f7b9063c6
children 4084f07f2c7a
comparison
equal deleted inserted replaced
80:ea58f277f487 81:d8fccaa45d5f
1 /* LICENSE BLOCK
2 Part of mde: a Modular D game-oriented Engine
3 Copyright © 2007-2008 Diggory Hardy
4
5 This program is free software: you can redistribute it and/or modify it under the terms
6 of the GNU General Public License as published by the Free Software Foundation, either
7 version 2 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 See the GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see <http://www.gnu.org/licenses/>. */
15
16 /// Contains functions/data structures used internally by mergetag.
17 module mde.file.mergetag.internal;
18
19 package abstract class MTFormatVersion {
20 enum VERS : ubyte { // convenient list of all known file format versions
21 INVALID = 0x00,
22 MT01 = 0x01, // not yet final
23 }
24 /// The current MergeTag version
25 static const VERS Current = VERS.MT01;
26 static const char[2] CurrentString = "01";
27
28 static VERS parseString (char[] str)
29 in {
30 assert (str.length == 2);
31 } body {
32 if (str[0] == '0' && str[1] == '1') return VERS.MT01;
33 else return VERS.INVALID;
34 }
35 }