0
|
1 // Written in the D programming language
|
|
2 // www.digitalmars.com/d/
|
|
3
|
|
4 /*
|
|
5 * The contents of this file are subject to the Mozilla Public License Version
|
|
6 * 1.1 (the "License"); you may not use this file except in compliance with
|
|
7 * the License. You may obtain a copy of the License at
|
|
8 * http://www.mozilla.org/MPL/
|
|
9 *
|
|
10 * Software distributed under the License is distributed on an "AS IS" basis,
|
|
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
12 * for the specific language governing rights and limitations under the
|
|
13 * License.
|
|
14 *
|
|
15 * The Original Code is the Dynamin library.
|
|
16 *
|
|
17 * The Initial Developer of the Original Code is Jordan Miner.
|
|
18 * Portions created by the Initial Developer are Copyright (C) 2009
|
|
19 * the Initial Developer. All Rights Reserved.
|
|
20 *
|
|
21 * Contributor(s):
|
|
22 * Jordan Miner <jminer7@gmail.com>
|
|
23 *
|
|
24 */
|
|
25
|
|
26 module dynamin.core.file;
|
|
27
|
|
28 import dynamin.core.string;
|
|
29 import tango.io.device.File;
|
|
30 import tango.io.UnicodeFile;
|
|
31
|
|
32 ubyte[] readFileBytes(string file) {
|
|
33 return cast(ubyte[])File.get(file);
|
|
34 //scope f = new File(file);
|
|
35 //return cast(ubyte[])f.read();
|
|
36 }
|
|
37 string readFileText(string file) {
|
|
38 scope f = new UnicodeFile!(char)(file, Encoding.UTF_8);
|
|
39 return f.read();
|
|
40 }
|
|
41
|