Mercurial > projects > dynamin
annotate dynamin/core/file.d @ 106:acdbb30fee7e
Port to D2.
Most of the effort was dealing with immutable and const.
author | Jordan Miner <jminer7@gmail.com> |
---|---|
date | Mon, 17 Dec 2012 23:41:50 -0600 |
parents | 73060bc3f004 |
children |
rev | line source |
---|---|
0 | 1 |
2 /* | |
103
73060bc3f004
Change license to Boost 1.0 and MPL 2.0.
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
3 * Copyright Jordan Miner |
0 | 4 * |
103
73060bc3f004
Change license to Boost 1.0 and MPL 2.0.
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
5 * Distributed under the Boost Software License, Version 1.0. |
73060bc3f004
Change license to Boost 1.0 and MPL 2.0.
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
6 * (See accompanying file BOOST_LICENSE.txt or copy at |
73060bc3f004
Change license to Boost 1.0 and MPL 2.0.
Jordan Miner <jminer7@gmail.com>
parents:
0
diff
changeset
|
7 * http://www.boost.org/LICENSE_1_0.txt) |
0 | 8 * |
9 */ | |
10 | |
11 module dynamin.core.file; | |
12 | |
13 import dynamin.core.string; | |
14 import tango.io.device.File; | |
15 import tango.io.UnicodeFile; | |
16 | |
106 | 17 ubyte[] readFileBytes(cstring file) { |
0 | 18 return cast(ubyte[])File.get(file); |
19 //scope f = new File(file); | |
20 //return cast(ubyte[])f.read(); | |
21 } | |
106 | 22 mstring readFileText(cstring file) { |
0 | 23 scope f = new UnicodeFile!(char)(file, Encoding.UTF_8); |
24 return f.read(); | |
25 } | |
26 |