Mercurial > projects > mde
comparison mde/file/mergetag/Reader.d @ 82:ac1e3fd07275
New ssi file format.
(De)serializer now supports non-ascii wide characters (encoded to UTF-8) and no longer supports non-ascii 8-bit chars which would result in bad UTF-8.
Moved/renamed a few things left over from the last commit.
author | Diggory Hardy <diggory.hardy@gmail.com> |
---|---|
date | Sat, 30 Aug 2008 09:37:35 +0100 |
parents | d8fccaa45d5f |
children | 56c0ddd90193 |
comparison
equal
deleted
inserted
replaced
81:d8fccaa45d5f | 82:ac1e3fd07275 |
---|---|
36 import tango.util.collection.HashSet : HashSet; | 36 import tango.util.collection.HashSet : HashSet; |
37 import tango.util.log.Log : Log, Logger; | 37 import tango.util.log.Log : Log, Logger; |
38 | 38 |
39 private Logger logger; | 39 private Logger logger; |
40 static this() { | 40 static this() { |
41 logger = Log.getLogger ("mde.mergetag.Reader"); | 41 logger = Log.getLogger ("mde.file.mergetag.Reader"); |
42 } | 42 } |
43 | 43 |
44 // TODO: allow compressing with zlib for both binary and text? (.mtz, .mtt, .mtb extensions) | 44 // TODO: allow compressing with zlib for both binary and text? (.mtz, .mtt, .mtb extensions) |
45 | 45 |
46 /** Make an IReader class. | 46 /** Make an IReader class. |
147 void dataSecCreator (IDataSection delegate (ID) dSC) { | 147 void dataSecCreator (IDataSection delegate (ID) dSC) { |
148 _dataSecCreator = dSC; | 148 _dataSecCreator = dSC; |
149 } | 149 } |
150 | 150 |
151 private: | 151 private: |
152 static Logger logger; | |
153 | |
154 // Non-static symbols: | 152 // Non-static symbols: |
155 final char[] ErrFile; // added after ErrInFile to do the same without the "in " bit. | 153 final char[] ErrFile; // added after ErrInFile to do the same without the "in " bit. |
156 final char[] ErrInFile; // something like "in \"path/file.mtt\"" | 154 final char[] ErrInFile; // something like "in \"path/file.mtt\"" |
157 | 155 |
158 final char[] fbuf; // file is read into this | 156 final char[] fbuf; // file is read into this |
181 | 179 |
182 DataSet _dataset; | 180 DataSet _dataset; |
183 //END DATA | 181 //END DATA |
184 | 182 |
185 //BEGIN METHODS: CTOR / DTOR | 183 //BEGIN METHODS: CTOR / DTOR |
186 static this () { | |
187 logger = Log.getLogger ("mde.mergetag.read.Reader"); | |
188 } | |
189 | |
190 /** Tries to open file path and read it into a buffer. | 184 /** Tries to open file path and read it into a buffer. |
191 * | 185 * |
192 * Params: | 186 * Params: |
193 * path = The name or FilePath of the file to open. | 187 * path = The name or FilePath of the file to open. |
194 * Standard extensions are .mtt and .mtb for text and binary files respectively. | 188 * Standard extensions are .mtt and .mtb for text and binary files respectively. |