1
0
This commit is contained in:
otya128
2017-07-03 21:41:19 +09:00
parent 11f27a035d
commit 1a8dd40ed6
2 changed files with 17 additions and 6 deletions

View File

@@ -202,6 +202,13 @@ r"ファイルを書き込みます。
File f = File(path, "rb");
DataHeader[1] harray;
f.rawRead(harray);
if (harray[0].magic != "PCBN0001")
{
f.seek(0);
harray[0].dimension = 1;
harray[0].dim[] = [cast(int)f.size, 0, 0, 0];
harray[0].type = DataType.int_;
}
if (harray[0].dimension != contents.dimCount)
{
throw new TypeMismatch("LOAD");
@@ -241,6 +248,10 @@ r"ファイルを書き込みます。
f.rawRead(array);
result = array.map!(x => x.to!T).array;
}
else
{
throw new TypeMismatch("LOAD(invalid file)");
}
//配列に書き込むというより配列を差し替えている
contents.array = result;
contents.dim[] = harray[0].dim[];