* FileSystemIDandChk/ArrayFill.cs:
* FileSystemIDandChk/FileSystemIDandChk.csproj:
Added array filling class from mykohsu.
* FileSystemIDandChk/Main.cs:
Print disk type as identified by image plugin
* FileSystemIDandChk/ImagePlugins/ImagePlugin.cs:
Added more disk types
* FileSystemIDandChk/ImagePlugins/TeleDisk.cs:
Added link to Dave's document.
Completely implemented OpenImage() for standard
(non-compressed) teledisk images.
Implemented GetImageSize(), GetSectors(), GetSectorSize(),
ReadSectors(), GetImageVersion(),
GetImageApplicationVersion(), GetImageCreationTime(),
GetImageLastModificationtime(), GetImageName(),
GetDiskType(), data sector decoders.
* FileSystemIDandChk/TODO:
Discovered a filesystem specification present on ECMA-67.
Dunno if CP/M, FAT or a different one, must check.
Teledisk plugin is working, but lacks "advanced compression"
and variable sectors per track support.
2014-06-07 04:54:15 +01:00
|
|
|
|
/***************************************************************************
|
2014-06-15 23:39:34 +01:00
|
|
|
|
The Disc Image Chef
|
* FileSystemIDandChk/ArrayFill.cs:
* FileSystemIDandChk/FileSystemIDandChk.csproj:
Added array filling class from mykohsu.
* FileSystemIDandChk/Main.cs:
Print disk type as identified by image plugin
* FileSystemIDandChk/ImagePlugins/ImagePlugin.cs:
Added more disk types
* FileSystemIDandChk/ImagePlugins/TeleDisk.cs:
Added link to Dave's document.
Completely implemented OpenImage() for standard
(non-compressed) teledisk images.
Implemented GetImageSize(), GetSectors(), GetSectorSize(),
ReadSectors(), GetImageVersion(),
GetImageApplicationVersion(), GetImageCreationTime(),
GetImageLastModificationtime(), GetImageName(),
GetDiskType(), data sector decoders.
* FileSystemIDandChk/TODO:
Discovered a filesystem specification present on ECMA-67.
Dunno if CP/M, FAT or a different one, must check.
Teledisk plugin is working, but lacks "advanced compression"
and variable sectors per track support.
2014-06-07 04:54:15 +01:00
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Filename : ArrayFill.cs
|
|
|
|
|
|
Version : 1.0
|
|
|
|
|
|
Author(s) : https://github.com/mykohsu
|
|
|
|
|
|
|
|
|
|
|
|
Component : Helpers
|
|
|
|
|
|
|
|
|
|
|
|
Revision : $Revision$
|
|
|
|
|
|
Last change by : $Author$
|
|
|
|
|
|
Date : $Date$
|
|
|
|
|
|
|
|
|
|
|
|
--[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Fills an array with a
|
|
|
|
|
|
|
|
|
|
|
|
--[ License ] --------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
No license specified by creator.
|
|
|
|
|
|
|
|
|
|
|
|
Published on https://github.com/mykohsu/Extensions/blob/master/ArrayExtensions.cs
|
|
|
|
|
|
|
|
|
|
|
|
Assuming open source.
|
|
|
|
|
|
|
|
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
|
Copyright (C) 2014 mykohsu
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
//$Id$
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
2014-06-15 23:39:34 +01:00
|
|
|
|
namespace DiscImageChef
|
* FileSystemIDandChk/ArrayFill.cs:
* FileSystemIDandChk/FileSystemIDandChk.csproj:
Added array filling class from mykohsu.
* FileSystemIDandChk/Main.cs:
Print disk type as identified by image plugin
* FileSystemIDandChk/ImagePlugins/ImagePlugin.cs:
Added more disk types
* FileSystemIDandChk/ImagePlugins/TeleDisk.cs:
Added link to Dave's document.
Completely implemented OpenImage() for standard
(non-compressed) teledisk images.
Implemented GetImageSize(), GetSectors(), GetSectorSize(),
ReadSectors(), GetImageVersion(),
GetImageApplicationVersion(), GetImageCreationTime(),
GetImageLastModificationtime(), GetImageName(),
GetDiskType(), data sector decoders.
* FileSystemIDandChk/TODO:
Discovered a filesystem specification present on ECMA-67.
Dunno if CP/M, FAT or a different one, must check.
Teledisk plugin is working, but lacks "advanced compression"
and variable sectors per track support.
2014-06-07 04:54:15 +01:00
|
|
|
|
{
|
2016-01-13 19:59:44 +00:00
|
|
|
|
public static partial class ArrayHelpers
|
* FileSystemIDandChk/ArrayFill.cs:
* FileSystemIDandChk/FileSystemIDandChk.csproj:
Added array filling class from mykohsu.
* FileSystemIDandChk/Main.cs:
Print disk type as identified by image plugin
* FileSystemIDandChk/ImagePlugins/ImagePlugin.cs:
Added more disk types
* FileSystemIDandChk/ImagePlugins/TeleDisk.cs:
Added link to Dave's document.
Completely implemented OpenImage() for standard
(non-compressed) teledisk images.
Implemented GetImageSize(), GetSectors(), GetSectorSize(),
ReadSectors(), GetImageVersion(),
GetImageApplicationVersion(), GetImageCreationTime(),
GetImageLastModificationtime(), GetImageName(),
GetDiskType(), data sector decoders.
* FileSystemIDandChk/TODO:
Discovered a filesystem specification present on ECMA-67.
Dunno if CP/M, FAT or a different one, must check.
Teledisk plugin is working, but lacks "advanced compression"
and variable sectors per track support.
2014-06-07 04:54:15 +01:00
|
|
|
|
{
|
|
|
|
|
|
public static void ArrayFill<T>(T[] destinationArray, T value)
|
|
|
|
|
|
{
|
|
|
|
|
|
// if called with a single value, wrap the value in an array and call the main function
|
|
|
|
|
|
ArrayFill<T>(destinationArray, new T[] { value });
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void ArrayFill<T>(T[] destinationArray, T[] value)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (destinationArray == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentNullException("destinationArray");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (value.Length > destinationArray.Length)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new ArgumentException("Length of value array must not be more than length of destination");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// set the initial array value
|
|
|
|
|
|
Array.Copy(value, destinationArray, value.Length);
|
|
|
|
|
|
|
|
|
|
|
|
int arrayToFillHalfLength = destinationArray.Length / 2;
|
|
|
|
|
|
int copyLength;
|
|
|
|
|
|
|
|
|
|
|
|
for(copyLength = value.Length; copyLength < arrayToFillHalfLength; copyLength <<= 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
Array.Copy(destinationArray, 0, destinationArray, copyLength, copyLength);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Array.Copy(destinationArray, 0, destinationArray, copyLength, destinationArray.Length - copyLength);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|