Mercurial > projects > dynamin
view 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 |
line wrap: on
line source
/* * Copyright Jordan Miner * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file BOOST_LICENSE.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * */ module dynamin.core.file; import dynamin.core.string; import tango.io.device.File; import tango.io.UnicodeFile; ubyte[] readFileBytes(cstring file) { return cast(ubyte[])File.get(file); //scope f = new File(file); //return cast(ubyte[])f.read(); } mstring readFileText(cstring file) { scope f = new UnicodeFile!(char)(file, Encoding.UTF_8); return f.read(); }