mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Merge Aaru.CommonTypes into devel
This commit is contained in:
1342
Aaru.CommonTypes/.editorconfig
Normal file
1342
Aaru.CommonTypes/.editorconfig
Normal file
File diff suppressed because it is too large
Load Diff
595
Aaru.CommonTypes/.gitignore
vendored
Normal file
595
Aaru.CommonTypes/.gitignore
vendored
Normal file
@@ -0,0 +1,595 @@
|
||||
### VisualStudio template
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
### Linux template
|
||||
|
||||
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||
.fuse_hidden*
|
||||
|
||||
# KDE directory preferences
|
||||
.directory
|
||||
|
||||
# Linux trash folder which might appear on any partition or disk
|
||||
.Trash-*
|
||||
|
||||
# .nfs files are created when an open file is removed but is still being accessed
|
||||
.nfs*
|
||||
### Xcode template
|
||||
# Xcode
|
||||
#
|
||||
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
|
||||
|
||||
## User settings
|
||||
xcuserdata/
|
||||
|
||||
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
|
||||
*.xcscmblueprint
|
||||
*.xccheckout
|
||||
|
||||
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
|
||||
build/
|
||||
DerivedData/
|
||||
*.moved-aside
|
||||
*.pbxuser
|
||||
!default.pbxuser
|
||||
*.mode1v3
|
||||
!default.mode1v3
|
||||
*.mode2v3
|
||||
!default.mode2v3
|
||||
*.perspectivev3
|
||||
!default.perspectivev3
|
||||
### VisualStudioCode template
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
### C++ template
|
||||
# Prerequisites
|
||||
*.d
|
||||
|
||||
# Compiled Object files
|
||||
*.slo
|
||||
*.lo
|
||||
*.o
|
||||
|
||||
# Precompiled Headers
|
||||
*.gch
|
||||
|
||||
# Compiled Dynamic libraries
|
||||
*.so
|
||||
*.dylib
|
||||
*.dll
|
||||
|
||||
# Fortran module files
|
||||
*.mod
|
||||
*.smod
|
||||
|
||||
# Compiled Static libraries
|
||||
*.lai
|
||||
*.la
|
||||
*.a
|
||||
*.lib
|
||||
|
||||
# Executables
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
### MonoDevelop template
|
||||
#User Specific
|
||||
*.usertasks
|
||||
|
||||
#Mono Project Files
|
||||
*.resources
|
||||
test-results/
|
||||
### GPG template
|
||||
secring.*
|
||||
|
||||
### JetBrains template
|
||||
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
|
||||
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
||||
|
||||
# User-specific stuff
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
# Sensitive or high-churn files
|
||||
.idea/**/dataSources/
|
||||
.idea/**/dataSources.ids
|
||||
.idea/**/dataSources.local.xml
|
||||
.idea/**/sqlDataSources.xml
|
||||
.idea/**/dynamic.xml
|
||||
.idea/**/uiDesigner.xml
|
||||
.idea/**/dbnavigator.xml
|
||||
|
||||
# Gradle
|
||||
.idea/**/gradle.xml
|
||||
.idea/**/libraries
|
||||
|
||||
# Gradle and Maven with auto-import
|
||||
# When using Gradle or Maven with auto-import, you should exclude module files,
|
||||
# since they will be recreated, and may cause churn. Uncomment if using
|
||||
# auto-import.
|
||||
# .idea/modules.xml
|
||||
# .idea/*.iml
|
||||
# .idea/modules
|
||||
|
||||
# CMake
|
||||
cmake-build-*/
|
||||
|
||||
# Mongo Explorer plugin
|
||||
.idea/**/mongoSettings.xml
|
||||
|
||||
# File-based project format
|
||||
*.iws
|
||||
|
||||
# IntelliJ
|
||||
out/
|
||||
|
||||
# mpeltonen/sbt-idea plugin
|
||||
.idea_modules/
|
||||
|
||||
# JIRA plugin
|
||||
atlassian-ide-plugin.xml
|
||||
|
||||
# Cursive Clojure plugin
|
||||
.idea/replstate.xml
|
||||
|
||||
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||
com_crashlytics_export_strings.xml
|
||||
crashlytics.properties
|
||||
crashlytics-build.properties
|
||||
fabric.properties
|
||||
|
||||
# Editor-based Rest Client
|
||||
.idea/httpRequests
|
||||
### CMake template
|
||||
CMakeCache.txt
|
||||
CMakeFiles
|
||||
CMakeScripts
|
||||
Testing
|
||||
Makefile
|
||||
cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
### C template
|
||||
# Object files
|
||||
*.ko
|
||||
*.elf
|
||||
|
||||
# Linker output
|
||||
*.map
|
||||
*.exp
|
||||
|
||||
*.so.*
|
||||
|
||||
# Executables
|
||||
*.i*86
|
||||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Debug files
|
||||
*.dSYM/
|
||||
*.su
|
||||
*.idb
|
||||
|
||||
# Kernel Module Compile Results
|
||||
*.mod*
|
||||
*.cmd
|
||||
.tmp_versions/
|
||||
modules.order
|
||||
Module.symvers
|
||||
Mkfile.old
|
||||
dkms.conf
|
||||
### Windows template
|
||||
# Windows thumbnail cache files
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
|
||||
# Dump file
|
||||
*.stackdump
|
||||
|
||||
# Folder config file
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Windows Installer files
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
|
||||
# NuGet Packages Directory
|
||||
packages/
|
||||
## TODO: If the tool you use requires repositories.config uncomment the next line
|
||||
#!packages/repositories.config
|
||||
|
||||
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
|
||||
# This line needs to be after the ignore of the build folder (and the packages folder if the line above has been uncommented)
|
||||
!packages/build/
|
||||
|
||||
|
||||
# Others
|
||||
sql/
|
||||
*.Cache
|
||||
|
||||
# Visual Studio 2017
|
||||
.vs
|
||||
|
||||
workspace.xml
|
||||
cmake-build-debug
|
||||
### macOS template
|
||||
# General
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Icon must end with two \r
|
||||
Icon
|
||||
|
||||
# Thumbnails
|
||||
._*
|
||||
|
||||
# Files that might appear in the root of a volume
|
||||
.DocumentRevisions-V100
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
.VolumeIcon.icns
|
||||
.com.apple.timemachine.donotpresent
|
||||
|
||||
# Directories potentially created on remote AFP share
|
||||
.AppleDB
|
||||
.AppleDesktop
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
|
||||
pkg/**/pkg
|
||||
pkg/**/src
|
||||
pkg/**/*.asc
|
||||
pkg/**/*.sig
|
||||
pkg/**/*.tar.xz
|
||||
pkg/**/*.zip
|
||||
pkg/**/aaru
|
||||
|
||||
.sonarqube
|
||||
70
Aaru.CommonTypes/Aaru.CommonTypes.csproj
Normal file
70
Aaru.CommonTypes/Aaru.CommonTypes.csproj
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{F2B84194-26EB-4227-B1C5-6602517E85AE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Aaru.CommonTypes</RootNamespace>
|
||||
<AssemblyName>Aaru.CommonTypes</AssemblyName>
|
||||
<ReleaseVersion>$(Version)</ReleaseVersion>
|
||||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
|
||||
<Version>6.0.0-alpha9</Version>
|
||||
<Company>Claunia.com</Company>
|
||||
<Copyright>Copyright © 2011-2023 Natalia Portillo</Copyright>
|
||||
<Product>Aaru Data Preservation Suite</Product>
|
||||
<Title>Aaru.CommonTypes</Title>
|
||||
<ApplicationVersion>$(Version)</ApplicationVersion>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<LangVersion>12</LangVersion>
|
||||
<Description>Contains common types defined by the Aaru Data Preservation Suite.</Description>
|
||||
<PackageProjectUrl>https://github.com/aaru-dps/</PackageProjectUrl>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<RepositoryUrl>https://github.com/aaru-dps/Aaru.CommonTypes</RepositoryUrl>
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||
<Authors>Natalia Portillo <claunia@claunia.com></Authors>
|
||||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports>
|
||||
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<NoWarn>CS1591;CS1574</NoWarn>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<InternalsVisibleTo Include="Aaru.Tests"/>
|
||||
<InternalsVisibleTo Include="Aaru.Tests.Devices"/>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<NrtRevisionFormat>$(Version)+{chash:8}</NrtRevisionFormat>
|
||||
<NrtResolveSimpleAttributes>true</NrtResolveSimpleAttributes>
|
||||
<NrtShowRevision>true</NrtShowRevision>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Macross.Json.Extensions" Version="3.0.0"/>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0-rc.1.23419.4"/>
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0-rc.1.23419.4"/>
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="6.0.0-preview.4.21253.7"/>
|
||||
<PackageReference Include="System.Security.Principal.Windows" Version="6.0.0-preview.5.21301.5"/>
|
||||
<PackageReference Include="System.Text.Json" Version="8.0.0-rc.1.23419.4"/>
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0"/>
|
||||
<PackageReference Include="Unclassified.NetRevisionTask" Version="0.4.3" PrivateAssets="all"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\LICENSE.MIT">
|
||||
<Link>LICENSE.MIT</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj"/>
|
||||
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
|
||||
<ProjectReference Include="..\Aaru.Localization\Aaru.Localization.csproj"/>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Localization\Localization.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Localization.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
7
Aaru.CommonTypes/Aaru.CommonTypes.csproj.DotSettings
Normal file
7
Aaru.CommonTypes/Aaru.CommonTypes.csproj.DotSettings
Normal file
@@ -0,0 +1,7 @@
|
||||
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:s="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xml:space="preserve">
|
||||
<s:Boolean
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=localization/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean
|
||||
x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=mediatypefromdevice/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
58
Aaru.CommonTypes/AaruMetadata/ATA.cs
Normal file
58
Aaru.CommonTypes/AaruMetadata/ATA.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ATA.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class ATA
|
||||
{
|
||||
public Dump Identify { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator ATA(ATAType cicm) => cicm is null
|
||||
? null
|
||||
: new ATA
|
||||
{
|
||||
Identify = cicm.Identify
|
||||
};
|
||||
}
|
||||
219
Aaru.CommonTypes/AaruMetadata/AaruMetadata.cs
Normal file
219
Aaru.CommonTypes/AaruMetadata/AaruMetadata.cs
Normal file
@@ -0,0 +1,219 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AaruMetadata.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
[JsonSerializable(typeof(MetadataJson))]
|
||||
// ReSharper disable once PartialTypeWithSinglePart
|
||||
public partial class MetadataJsonContext : JsonSerializerContext;
|
||||
|
||||
public class MetadataJson
|
||||
{
|
||||
public Metadata AaruMetadata { get; set; }
|
||||
}
|
||||
|
||||
public class Metadata
|
||||
{
|
||||
public List<string> Developers { get; set; }
|
||||
public List<string> Publishers { get; set; }
|
||||
public List<string> Authors { get; set; }
|
||||
public List<string> Performers { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
public ReleaseType? Release { get; set; }
|
||||
public DateTime? ReleaseDate { get; set; }
|
||||
public List<Barcode> Barcodes { get; set; }
|
||||
public string PartNumber { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
public List<string> Keywords { get; set; }
|
||||
public List<Magazine> Magazines { get; set; }
|
||||
public List<Book> Books { get; set; }
|
||||
public List<string> Categories { get; set; }
|
||||
public List<string> Subcategories { get; set; }
|
||||
public List<Language> Languages { get; set; }
|
||||
public List<string> Systems { get; set; }
|
||||
public List<Architecture> Architectures { get; set; }
|
||||
public List<RequiredOperatingSystem> RequiredOperatingSystems { get; set; }
|
||||
public List<UserManual> UserManuals { get; set; }
|
||||
public List<OpticalDisc> OpticalDiscs { get; set; }
|
||||
public List<Advertisement> Advertisements { get; set; }
|
||||
public List<LinearMedia> LinearMedias { get; set; }
|
||||
public List<Pci> PciCards { get; set; }
|
||||
public List<BlockMedia> BlockMedias { get; set; }
|
||||
public List<AudioMedia> AudioMedias { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Metadata(CICMMetadataType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var metadata = new Metadata
|
||||
{
|
||||
Developers = cicm.Developer is null ? null : new List<string>(cicm.Developer),
|
||||
Publishers = cicm.Publisher is null ? null : new List<string>(cicm.Publisher),
|
||||
Authors = cicm.Author is null ? null : new List<string>(cicm.Author),
|
||||
Performers = cicm.Performer is null ? null : new List<string>(cicm.Performer),
|
||||
Name = cicm.Name,
|
||||
Version = cicm.Version,
|
||||
Release = cicm.ReleaseTypeSpecified ? (ReleaseType)cicm.ReleaseType : null,
|
||||
ReleaseDate = cicm.ReleaseDateSpecified ? cicm.ReleaseDate : null,
|
||||
PartNumber = cicm.PartNumber,
|
||||
SerialNumber = cicm.SerialNumber,
|
||||
Keywords = cicm.Keywords is null ? null : new List<string>(cicm.Keywords),
|
||||
Categories = cicm.Categories is null ? null : new List<string>(cicm.Categories),
|
||||
Subcategories = cicm.Subcategories is null ? null : new List<string>(cicm.Subcategories),
|
||||
Systems = cicm.Systems is null ? null : new List<string>(cicm.Systems)
|
||||
};
|
||||
|
||||
if(cicm.Barcodes is not null)
|
||||
{
|
||||
metadata.Barcodes = new List<Barcode>();
|
||||
|
||||
foreach(Schemas.BarcodeType code in cicm.Barcodes)
|
||||
metadata.Barcodes.Add(code);
|
||||
}
|
||||
|
||||
if(cicm.Magazine is not null)
|
||||
{
|
||||
metadata.Magazines = new List<Magazine>();
|
||||
|
||||
foreach(MagazineType magazine in cicm.Magazine)
|
||||
metadata.Magazines.Add(magazine);
|
||||
}
|
||||
|
||||
if(cicm.Book is not null)
|
||||
{
|
||||
metadata.Books = new List<Book>();
|
||||
|
||||
foreach(BookType book in cicm.Book)
|
||||
metadata.Books.Add(book);
|
||||
}
|
||||
|
||||
if(cicm.Languages is not null)
|
||||
{
|
||||
metadata.Languages = new List<Language>();
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages)
|
||||
metadata.Languages.Add((Language)lng);
|
||||
}
|
||||
|
||||
if(cicm.Architectures is not null)
|
||||
{
|
||||
metadata.Architectures = new List<Architecture>();
|
||||
|
||||
foreach(ArchitecturesTypeArchitecture arch in cicm.Architectures)
|
||||
metadata.Architectures.Add((Architecture)arch);
|
||||
}
|
||||
|
||||
if(cicm.RequiredOperatingSystems is not null)
|
||||
{
|
||||
metadata.RequiredOperatingSystems = new List<RequiredOperatingSystem>();
|
||||
|
||||
foreach(RequiredOperatingSystemType os in cicm.RequiredOperatingSystems)
|
||||
metadata.RequiredOperatingSystems.Add(os);
|
||||
}
|
||||
|
||||
if(cicm.UserManual is not null)
|
||||
{
|
||||
metadata.UserManuals = new List<UserManual>();
|
||||
|
||||
foreach(UserManualType manual in cicm.UserManual)
|
||||
metadata.UserManuals.Add(manual);
|
||||
}
|
||||
|
||||
if(cicm.OpticalDisc is not null)
|
||||
{
|
||||
metadata.OpticalDiscs = new List<OpticalDisc>();
|
||||
|
||||
foreach(OpticalDiscType disc in cicm.OpticalDisc)
|
||||
metadata.OpticalDiscs.Add(disc);
|
||||
}
|
||||
|
||||
if(cicm.Advertisement is not null)
|
||||
{
|
||||
metadata.Advertisements = new List<Advertisement>();
|
||||
|
||||
foreach(AdvertisementType adv in cicm.Advertisement)
|
||||
metadata.Advertisements.Add(adv);
|
||||
}
|
||||
|
||||
if(cicm.LinearMedia is not null)
|
||||
{
|
||||
metadata.LinearMedias = new List<LinearMedia>();
|
||||
|
||||
foreach(LinearMediaType media in cicm.LinearMedia)
|
||||
metadata.LinearMedias.Add(media);
|
||||
}
|
||||
|
||||
if(cicm.PCICard is not null)
|
||||
{
|
||||
metadata.PciCards = new List<Pci>();
|
||||
|
||||
foreach(PCIType pci in cicm.PCICard)
|
||||
metadata.PciCards.Add(pci);
|
||||
}
|
||||
|
||||
if(cicm.BlockMedia is not null)
|
||||
{
|
||||
metadata.BlockMedias = new List<BlockMedia>();
|
||||
|
||||
foreach(BlockMediaType media in cicm.BlockMedia)
|
||||
metadata.BlockMedias.Add(media);
|
||||
}
|
||||
|
||||
if(cicm.AudioMedia is null)
|
||||
return metadata;
|
||||
|
||||
metadata.AudioMedias = new List<AudioMedia>();
|
||||
|
||||
foreach(AudioMediaType media in cicm.AudioMedia)
|
||||
metadata.AudioMedias.Add(media);
|
||||
|
||||
return metadata;
|
||||
}
|
||||
}
|
||||
117
Aaru.CommonTypes/AaruMetadata/Advertisement.cs
Normal file
117
Aaru.CommonTypes/AaruMetadata/Advertisement.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Advertisement.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Advertisement
|
||||
{
|
||||
public string Manufacturer { get; set; }
|
||||
public string Product { get; set; }
|
||||
public File File { get; set; }
|
||||
public ulong FileSize { get; set; }
|
||||
public ulong? Frames { get; set; }
|
||||
public double Duration { get; set; }
|
||||
public float? MeanFrameRate { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public List<AudioTrack> AudioTracks { get; set; }
|
||||
public List<VideoTrack> VideoTracks { get; set; }
|
||||
public List<SubtitleTrack> SubtitleTracks { get; set; }
|
||||
public Recording Recording { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Advertisement(AdvertisementType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var adv = new Advertisement
|
||||
{
|
||||
Manufacturer = cicm.Manufacturer,
|
||||
Product = cicm.Product,
|
||||
File = cicm.File,
|
||||
FileSize = cicm.FileSize,
|
||||
Frames = cicm.FramesSpecified ? cicm.Frames : null,
|
||||
Duration = cicm.Duration,
|
||||
MeanFrameRate = cicm.MeanFrameRateSpecified ? cicm.MeanFrameRate : null,
|
||||
Recording = cicm.Recording
|
||||
};
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
adv.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
adv.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.AudioTrack is not null)
|
||||
{
|
||||
adv.AudioTracks = new List<AudioTrack>();
|
||||
|
||||
foreach(AudioTracksType trk in cicm.AudioTrack)
|
||||
adv.AudioTracks.Add(trk);
|
||||
}
|
||||
|
||||
if(cicm.VideoTrack is not null)
|
||||
{
|
||||
adv.VideoTracks = new List<VideoTrack>();
|
||||
|
||||
foreach(VideoTracksType trk in cicm.VideoTrack)
|
||||
adv.VideoTracks.Add(trk);
|
||||
}
|
||||
|
||||
if(cicm.SubtitleTrack is null)
|
||||
return adv;
|
||||
|
||||
{
|
||||
adv.SubtitleTracks = new List<SubtitleTrack>();
|
||||
|
||||
foreach(SubtitleTracksType trk in cicm.SubtitleTrack)
|
||||
adv.SubtitleTracks.Add(trk);
|
||||
}
|
||||
|
||||
return adv;
|
||||
}
|
||||
}
|
||||
129
Aaru.CommonTypes/AaruMetadata/Architecture.cs
Normal file
129
Aaru.CommonTypes/AaruMetadata/Architecture.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Architecture.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
public enum Architecture
|
||||
{
|
||||
[JsonPropertyName("4004")]
|
||||
_4004,
|
||||
[JsonPropertyName("4040")]
|
||||
_4040,
|
||||
[JsonPropertyName("6502")]
|
||||
_6502,
|
||||
[JsonPropertyName("65816")]
|
||||
_65816,
|
||||
[JsonPropertyName("8008")]
|
||||
_8008,
|
||||
[JsonPropertyName("8051")]
|
||||
_8051,
|
||||
[JsonPropertyName("8080")]
|
||||
_8080,
|
||||
[JsonPropertyName("8085")]
|
||||
_8085,
|
||||
Aarch64,
|
||||
Am29000,
|
||||
Amd64,
|
||||
Apx432,
|
||||
Arm,
|
||||
Avr,
|
||||
Avr32,
|
||||
Axp,
|
||||
Clipper,
|
||||
Cray,
|
||||
Esa390,
|
||||
Hobbit,
|
||||
I86,
|
||||
I860,
|
||||
I960,
|
||||
Ia32,
|
||||
Ia64,
|
||||
M56K,
|
||||
M6800,
|
||||
M6801,
|
||||
M6805,
|
||||
M6809,
|
||||
M68K,
|
||||
M88K,
|
||||
Mcs41,
|
||||
Mcs48,
|
||||
Mips32,
|
||||
Mips64,
|
||||
Msp430,
|
||||
Nios2,
|
||||
Openrisc,
|
||||
Parisc,
|
||||
PDP1,
|
||||
PDP10,
|
||||
PDP11,
|
||||
PDP7,
|
||||
PDP8,
|
||||
Pic,
|
||||
Power,
|
||||
Ppc,
|
||||
Ppc64,
|
||||
Prism,
|
||||
Renesasrx,
|
||||
Riscv,
|
||||
S360,
|
||||
S370,
|
||||
Sh,
|
||||
Sh1,
|
||||
Sh2,
|
||||
Sh3,
|
||||
Sh4,
|
||||
Sh5,
|
||||
Sh64,
|
||||
Sparc,
|
||||
Sparc64,
|
||||
Transputer,
|
||||
Vax,
|
||||
We32000,
|
||||
X32,
|
||||
Z80,
|
||||
Z800,
|
||||
Z8000,
|
||||
Z80000,
|
||||
Zarch
|
||||
}
|
||||
146
Aaru.CommonTypes/AaruMetadata/AudioMedia.cs
Normal file
146
Aaru.CommonTypes/AaruMetadata/AudioMedia.cs
Normal file
@@ -0,0 +1,146 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AudioMedia.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class AudioMedia
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public Sequence Sequence { get; set; }
|
||||
public string PartNumber { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string AccoustID { get; set; }
|
||||
public List<AudioBlock> Blocks { get; set; }
|
||||
public string CopyProtection { get; set; }
|
||||
public Dimensions Dimensions { get; set; }
|
||||
public Scans Scans { get; set; }
|
||||
public List<DumpHardware> DumpHardware { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator AudioMedia(AudioMediaType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var media = new AudioMedia
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Sequence = cicm.Sequence,
|
||||
PartNumber = cicm.PartNumber,
|
||||
SerialNumber = cicm.SerialNumber,
|
||||
Manufacturer = cicm.Manufacturer,
|
||||
Model = cicm.Model,
|
||||
AccoustID = cicm.AccoustID,
|
||||
CopyProtection = cicm.CopyProtection,
|
||||
Dimensions = cicm.Dimensions,
|
||||
Scans = cicm.Scans
|
||||
};
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
media.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
media.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.Block is not null)
|
||||
{
|
||||
media.Blocks = new List<AudioBlock>();
|
||||
|
||||
foreach(AudioBlockType blk in cicm.Block)
|
||||
media.Blocks.Add(blk);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null)
|
||||
return media;
|
||||
|
||||
media.DumpHardware = new List<DumpHardware>();
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray)
|
||||
media.DumpHardware.Add(hw);
|
||||
|
||||
return media;
|
||||
}
|
||||
}
|
||||
|
||||
public class AudioBlock
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public string AccoustID { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public string Format { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator AudioBlock(AudioBlockType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var blk = new AudioBlock
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
AccoustID = cicm.AccoustID,
|
||||
Format = cicm.Format
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return blk;
|
||||
|
||||
blk.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
blk.Checksums.Add(chk);
|
||||
|
||||
return blk;
|
||||
}
|
||||
}
|
||||
333
Aaru.CommonTypes/AaruMetadata/AudioVideo.cs
Normal file
333
Aaru.CommonTypes/AaruMetadata/AudioVideo.cs
Normal file
@@ -0,0 +1,333 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AudioVideo.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class AudioTrack
|
||||
{
|
||||
public List<Language> Languages { get; set; }
|
||||
public uint Number { get; set; }
|
||||
public string AccoustID { get; set; }
|
||||
public string Codec { get; set; }
|
||||
public uint Channels { get; set; }
|
||||
public double SampleRate { get; set; }
|
||||
public long MeanBitrate { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator AudioTrack(AudioTracksType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var trk = new AudioTrack
|
||||
{
|
||||
Number = cicm.TrackNumber,
|
||||
AccoustID = cicm.AccoustID,
|
||||
Codec = cicm.Codec,
|
||||
Channels = cicm.Channels,
|
||||
SampleRate = cicm.SampleRate,
|
||||
MeanBitrate = cicm.MeanBitrate
|
||||
};
|
||||
|
||||
if(cicm.Languages is null)
|
||||
return trk;
|
||||
|
||||
trk.Languages = new List<Language>();
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages)
|
||||
trk.Languages.Add((Language)lng);
|
||||
|
||||
return trk;
|
||||
}
|
||||
}
|
||||
|
||||
public class VideoTrack
|
||||
{
|
||||
public List<Language> Languages { get; set; }
|
||||
public uint Number { get; set; }
|
||||
public string Codec { get; set; }
|
||||
public uint Horizontal { get; set; }
|
||||
public uint Vertical { get; set; }
|
||||
public long MeanBitrate { get; set; }
|
||||
|
||||
[JsonPropertyName("3D")]
|
||||
public bool ThreeD { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator VideoTrack(VideoTracksType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var trk = new VideoTrack
|
||||
{
|
||||
Number = cicm.TrackNumber,
|
||||
Codec = cicm.Codec,
|
||||
Horizontal = cicm.Horizontal,
|
||||
Vertical = cicm.Vertical,
|
||||
MeanBitrate = cicm.MeanBitrate,
|
||||
ThreeD = cicm.ThreeD
|
||||
};
|
||||
|
||||
if(cicm.Languages is null)
|
||||
return trk;
|
||||
|
||||
trk.Languages = new List<Language>();
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages)
|
||||
trk.Languages.Add((Language)lng);
|
||||
|
||||
return trk;
|
||||
}
|
||||
}
|
||||
|
||||
public class SubtitleTrack
|
||||
{
|
||||
public List<Language> Languages { get; set; }
|
||||
public uint Number { get; set; }
|
||||
public string Codec { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator SubtitleTrack(SubtitleTracksType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var sub = new SubtitleTrack
|
||||
{
|
||||
Number = cicm.TrackNumber,
|
||||
Codec = cicm.Codec
|
||||
};
|
||||
|
||||
if(cicm.Languages is null)
|
||||
return sub;
|
||||
|
||||
sub.Languages = new List<Language>();
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Languages)
|
||||
sub.Languages.Add((Language)lng);
|
||||
|
||||
return sub;
|
||||
}
|
||||
}
|
||||
|
||||
public class Recording
|
||||
{
|
||||
public string Broadcaster { get; set; }
|
||||
public string BroadcastPlatform { get; set; }
|
||||
public SourceFormat SourceFormat { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public List<Software> Software { get; set; }
|
||||
public Coordinates Coordinates { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Recording(RecordingType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var recording = new Recording
|
||||
{
|
||||
Broadcaster = cicm.Broadcaster,
|
||||
BroadcastPlatform = cicm.BroadcastPlatform,
|
||||
SourceFormat = (SourceFormat)cicm.SourceFormat,
|
||||
Timestamp = cicm.Timestamp,
|
||||
Coordinates = cicm.Coordinates
|
||||
};
|
||||
|
||||
if(cicm.Software is null)
|
||||
return recording;
|
||||
|
||||
recording.Software = new List<Software>();
|
||||
|
||||
foreach(SoftwareType sw in cicm.Software)
|
||||
recording.Software.Add(sw);
|
||||
|
||||
return recording;
|
||||
}
|
||||
}
|
||||
|
||||
public class Coordinates
|
||||
{
|
||||
public double Latitude { get; set; }
|
||||
public double Longitude { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Coordinates(CoordinatesType cicm) => cicm is null
|
||||
? null
|
||||
: new Coordinates
|
||||
{
|
||||
Latitude = cicm.Latitude,
|
||||
Longitude = cicm.Longitude
|
||||
};
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum SourceFormat
|
||||
{
|
||||
[JsonPropertyName("ITU-A")]
|
||||
ITUA,
|
||||
[JsonPropertyName("ITU-B")]
|
||||
ITUB,
|
||||
[JsonPropertyName("ITU-C")]
|
||||
ITUC,
|
||||
[JsonPropertyName("ITU-D")]
|
||||
ITUD,
|
||||
[JsonPropertyName("ITU-E")]
|
||||
ITUE,
|
||||
[JsonPropertyName("ITU-F")]
|
||||
ITUF,
|
||||
[JsonPropertyName("ITU-G")]
|
||||
ITUG,
|
||||
[JsonPropertyName("ITU-H")]
|
||||
ITUH,
|
||||
[JsonPropertyName("ITU-I")]
|
||||
ITUI,
|
||||
[JsonPropertyName("ITU-J")]
|
||||
ITUJ,
|
||||
[JsonPropertyName("ITU-K")]
|
||||
ITUK,
|
||||
[JsonPropertyName("ITU-L")]
|
||||
ITUL,
|
||||
[JsonPropertyName("ITU-M")]
|
||||
ITUM,
|
||||
[JsonPropertyName("ITU-N")]
|
||||
ITUN,
|
||||
[JsonPropertyName("PAL-B")]
|
||||
PALB,
|
||||
[JsonPropertyName("SECAM-B")]
|
||||
SECAMB,
|
||||
[JsonPropertyName("PAL-D")]
|
||||
PALD,
|
||||
[JsonPropertyName("SECAM-D")]
|
||||
SECAMD,
|
||||
[JsonPropertyName("PAL-G")]
|
||||
PALG,
|
||||
[JsonPropertyName("SECAM-G")]
|
||||
SECAMG,
|
||||
[JsonPropertyName("PAL-H")]
|
||||
PALH,
|
||||
[JsonPropertyName("PAL-I")]
|
||||
PALI,
|
||||
[JsonPropertyName("PAL-K")]
|
||||
PALK,
|
||||
[JsonPropertyName("SECAM-K")]
|
||||
SECAMK,
|
||||
[JsonPropertyName("NTSC-M")]
|
||||
NTSCM,
|
||||
[JsonPropertyName("PAL-N")]
|
||||
PALN,
|
||||
[JsonPropertyName("PAL-M")]
|
||||
PALM,
|
||||
[JsonPropertyName("SECAM-M")]
|
||||
SECAMM,
|
||||
MUSE,
|
||||
PALplus,
|
||||
FM,
|
||||
AM,
|
||||
COFDM,
|
||||
[JsonPropertyName("CAM-D")]
|
||||
CAMD,
|
||||
DAB,
|
||||
[JsonPropertyName("DAB+")]
|
||||
DAB1,
|
||||
DRM,
|
||||
[JsonPropertyName("DRM+")]
|
||||
DRM1,
|
||||
FMeXtra,
|
||||
ATSC,
|
||||
ATSC2,
|
||||
ATSC3,
|
||||
[JsonPropertyName("ATSC-M/H")]
|
||||
ATSCMH,
|
||||
[JsonPropertyName("DVB-T")]
|
||||
DVBT,
|
||||
[JsonPropertyName("DVB-T2")]
|
||||
DVBT2,
|
||||
[JsonPropertyName("DVB-S")]
|
||||
DVBS,
|
||||
[JsonPropertyName("DVB-S2")]
|
||||
DVBS2,
|
||||
[JsonPropertyName("DVB-S2X")]
|
||||
DVBS2X,
|
||||
[JsonPropertyName("DVB-C")]
|
||||
DVBC,
|
||||
[JsonPropertyName("DVB-C2")]
|
||||
DVBC2,
|
||||
[JsonPropertyName("DVB-H")]
|
||||
DVBH,
|
||||
[JsonPropertyName("DVB-NGH")]
|
||||
DVBNGH,
|
||||
[JsonPropertyName("DVB-SH")]
|
||||
DVBSH,
|
||||
[JsonPropertyName("ISDB-T")]
|
||||
ISDBT,
|
||||
[JsonPropertyName("ISDB-Tb")]
|
||||
ISDBTb,
|
||||
[JsonPropertyName("ISDB-S")]
|
||||
ISDBS,
|
||||
[JsonPropertyName("ISDB-C")]
|
||||
ISDBC,
|
||||
[JsonPropertyName("1seg")]
|
||||
Item1seg,
|
||||
DTMB,
|
||||
CCMB,
|
||||
[JsonPropertyName("T-DMB")]
|
||||
TDMB,
|
||||
[JsonPropertyName("S-DMB")]
|
||||
SDMB,
|
||||
IPTV,
|
||||
[JsonPropertyName("DVB-MT")]
|
||||
DVBMT,
|
||||
[JsonPropertyName("DVB-MC")]
|
||||
DVBMC,
|
||||
[JsonPropertyName("DVB-MS")]
|
||||
DVBMS,
|
||||
ADR,
|
||||
SDR
|
||||
}
|
||||
95
Aaru.CommonTypes/AaruMetadata/Barcode.cs
Normal file
95
Aaru.CommonTypes/AaruMetadata/Barcode.cs
Normal file
@@ -0,0 +1,95 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Barcode.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum BarcodeType
|
||||
{
|
||||
Aztec,
|
||||
Codabar,
|
||||
Code11,
|
||||
Code128,
|
||||
Code39,
|
||||
Code93,
|
||||
CPC_Binary,
|
||||
EZcode,
|
||||
FIM,
|
||||
ITF,
|
||||
ITF14,
|
||||
EAN13,
|
||||
EAN8,
|
||||
MaxiCode,
|
||||
ISBN,
|
||||
ISRC,
|
||||
MSI,
|
||||
ShotCode,
|
||||
RM4SCC,
|
||||
QR,
|
||||
EAN5,
|
||||
EAN2,
|
||||
POSTNET,
|
||||
PostBar,
|
||||
Plessey,
|
||||
Pharmacode,
|
||||
PDF417,
|
||||
PatchCode
|
||||
}
|
||||
|
||||
public class Barcode
|
||||
{
|
||||
public BarcodeType Type { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Barcode(Schemas.BarcodeType cicm) => cicm is null
|
||||
? null
|
||||
: new Barcode
|
||||
{
|
||||
Type = (BarcodeType)cicm.type,
|
||||
Value = cicm.Value
|
||||
};
|
||||
}
|
||||
220
Aaru.CommonTypes/AaruMetadata/BlockMedia.cs
Normal file
220
Aaru.CommonTypes/AaruMetadata/BlockMedia.cs
Normal file
@@ -0,0 +1,220 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : BlockMedia.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class BlockMedia
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public List<Checksum> ContentChecksums { get; set; }
|
||||
public Sequence Sequence { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Serial { get; set; }
|
||||
public string Firmware { get; set; }
|
||||
public string PartNumber { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
public uint PhysicalBlockSize { get; set; }
|
||||
public uint LogicalBlockSize { get; set; }
|
||||
public ulong LogicalBlocks { get; set; }
|
||||
public List<BlockSize> VariableBlockSize { get; set; }
|
||||
public List<TapePartition> TapeInformation { get; set; }
|
||||
public Scans Scans { get; set; }
|
||||
public ATA ATA { get; set; }
|
||||
public Pci Pci { get; set; }
|
||||
public Pcmcia Pcmcia { get; set; }
|
||||
public SecureDigital SecureDigital { get; set; }
|
||||
public MultiMediaCard MultiMediaCard { get; set; }
|
||||
public SCSI SCSI { get; set; }
|
||||
public Usb Usb { get; set; }
|
||||
public Dump Mam { get; set; }
|
||||
public ushort? Heads { get; set; }
|
||||
public uint? Cylinders { get; set; }
|
||||
public ulong? SectorsPerTrack { get; set; }
|
||||
public List<BlockTrack> Track { get; set; }
|
||||
public string CopyProtection { get; set; }
|
||||
public Dimensions Dimensions { get; set; }
|
||||
public List<Partition> FileSystemInformation { get; set; }
|
||||
public List<DumpHardware> DumpHardware { get; set; }
|
||||
public string MediaType { get; set; }
|
||||
public string MediaSubType { get; set; }
|
||||
public string Interface { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator BlockMedia(BlockMediaType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var media = new BlockMedia
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Sequence = cicm.Sequence,
|
||||
Manufacturer = cicm.Manufacturer,
|
||||
Model = cicm.Model,
|
||||
Serial = cicm.Serial,
|
||||
Firmware = cicm.Firmware,
|
||||
PartNumber = cicm.PartNumber,
|
||||
SerialNumber = cicm.SerialNumber,
|
||||
PhysicalBlockSize = cicm.PhysicalBlockSize,
|
||||
LogicalBlockSize = cicm.LogicalBlockSize,
|
||||
LogicalBlocks = cicm.LogicalBlocks,
|
||||
Scans = cicm.Scans,
|
||||
ATA = cicm.ATA,
|
||||
Pci = cicm.PCI,
|
||||
Pcmcia = cicm.PCMCIA,
|
||||
SecureDigital = cicm.SecureDigital,
|
||||
MultiMediaCard = cicm.MultiMediaCard,
|
||||
SCSI = cicm.SCSI,
|
||||
Usb = cicm.USB,
|
||||
Mam = cicm.MAM,
|
||||
Heads = cicm.HeadsSpecified ? cicm.Heads : null,
|
||||
Cylinders = cicm.CylindersSpecified ? cicm.Cylinders : null,
|
||||
SectorsPerTrack = cicm.SectorsPerTrackSpecified ? cicm.SectorsPerTrack : null,
|
||||
CopyProtection = cicm.CopyProtection,
|
||||
Dimensions = cicm.Dimensions,
|
||||
MediaType = cicm.DiskType,
|
||||
MediaSubType = cicm.DiskSubType,
|
||||
Interface = cicm.Interface
|
||||
};
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
media.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
media.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.ContentChecksums is not null)
|
||||
{
|
||||
media.ContentChecksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.ContentChecksums)
|
||||
media.ContentChecksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.VariableBlockSize is not null)
|
||||
{
|
||||
media.VariableBlockSize = new List<BlockSize>();
|
||||
|
||||
foreach(BlockSizeType blkSize in cicm.VariableBlockSize)
|
||||
media.VariableBlockSize.Add(blkSize);
|
||||
}
|
||||
|
||||
if(cicm.TapeInformation is not null)
|
||||
{
|
||||
media.TapeInformation = new List<TapePartition>();
|
||||
|
||||
foreach(TapePartitionType tapeInformation in cicm.TapeInformation)
|
||||
media.TapeInformation.Add(tapeInformation);
|
||||
}
|
||||
|
||||
if(cicm.FileSystemInformation is not null)
|
||||
{
|
||||
media.FileSystemInformation = new List<Partition>();
|
||||
|
||||
foreach(PartitionType fsInfo in cicm.FileSystemInformation)
|
||||
media.FileSystemInformation.Add(fsInfo);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null)
|
||||
return media;
|
||||
|
||||
media.DumpHardware = new List<DumpHardware>();
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray)
|
||||
media.DumpHardware.Add(hw);
|
||||
|
||||
return media;
|
||||
}
|
||||
}
|
||||
|
||||
public class BlockTrack
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public ushort Head { get; set; }
|
||||
public uint Cylinder { get; set; }
|
||||
public ulong StartSector { get; set; }
|
||||
public ulong EndSector { get; set; }
|
||||
public ulong Sectors { get; set; }
|
||||
public uint BytesPerSector { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public string Format { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator BlockTrack(BlockTrackType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var trk = new BlockTrack
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Head = cicm.Head,
|
||||
Cylinder = cicm.Cylinder,
|
||||
StartSector = cicm.StartSector,
|
||||
EndSector = cicm.EndSector,
|
||||
Sectors = cicm.Sectors,
|
||||
BytesPerSector = cicm.BytesPerSector,
|
||||
Format = cicm.Format
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return trk;
|
||||
|
||||
trk.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
trk.Checksums.Add(chk);
|
||||
|
||||
return trk;
|
||||
}
|
||||
}
|
||||
97
Aaru.CommonTypes/AaruMetadata/Book.cs
Normal file
97
Aaru.CommonTypes/AaruMetadata/Book.cs
Normal file
@@ -0,0 +1,97 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Book.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Book
|
||||
{
|
||||
public List<Barcode> Barcodes { get; set; }
|
||||
public Cover Cover { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Editorial { get; set; }
|
||||
public string Author { get; set; }
|
||||
public DateTime? PublicationDate { get; set; }
|
||||
public List<Language> Languages { get; set; }
|
||||
public uint? Pages { get; set; }
|
||||
public string PageSize { get; set; }
|
||||
public Scan Scan { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Book(BookType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var book = new Book
|
||||
{
|
||||
Cover = cicm.Cover,
|
||||
Name = cicm.Name,
|
||||
Editorial = cicm.Editorial,
|
||||
Author = cicm.Author,
|
||||
PublicationDate = cicm.PublicationDateSpecified ? cicm.PublicationDate : null,
|
||||
Pages = cicm.PagesSpecified ? cicm.Pages : null,
|
||||
PageSize = cicm.PageSize,
|
||||
Scan = cicm.Scan
|
||||
};
|
||||
|
||||
if(cicm.Barcodes is not null)
|
||||
{
|
||||
book.Barcodes = new List<Barcode>();
|
||||
|
||||
foreach(Schemas.BarcodeType code in cicm.Barcodes)
|
||||
book.Barcodes.Add(code);
|
||||
}
|
||||
|
||||
if(cicm.Language is null)
|
||||
return book;
|
||||
|
||||
book.Languages = new List<Language>();
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Language)
|
||||
book.Languages.Add((Language)lng);
|
||||
|
||||
return book;
|
||||
}
|
||||
}
|
||||
91
Aaru.CommonTypes/AaruMetadata/Checksum.cs
Normal file
91
Aaru.CommonTypes/AaruMetadata/Checksum.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Checksum.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Checksum
|
||||
{
|
||||
public ChecksumType Type { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Checksum(Schemas.ChecksumType cicm) => cicm is null
|
||||
? null
|
||||
: new Checksum
|
||||
{
|
||||
Value = cicm.Value,
|
||||
Type = (ChecksumType)cicm.type
|
||||
};
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
public enum ChecksumType
|
||||
{
|
||||
Fletcher16,
|
||||
Fletcher32,
|
||||
Adler32,
|
||||
CRC16,
|
||||
CRC16Ccitt,
|
||||
CRC32,
|
||||
CRC64,
|
||||
Md4,
|
||||
Md5,
|
||||
Dm6,
|
||||
Ripemd128,
|
||||
Ripemd160,
|
||||
Ripemed320,
|
||||
Sha1,
|
||||
Sha224,
|
||||
Sha256,
|
||||
Sha384,
|
||||
Sha512,
|
||||
Sha3,
|
||||
Skein,
|
||||
Snefru,
|
||||
Blake256,
|
||||
Blake512,
|
||||
Tiger,
|
||||
Whirlpool,
|
||||
SpamSum
|
||||
}
|
||||
237
Aaru.CommonTypes/AaruMetadata/Contents.cs
Normal file
237
Aaru.CommonTypes/AaruMetadata/Contents.cs
Normal file
@@ -0,0 +1,237 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Contents.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class FilesystemContents
|
||||
{
|
||||
public List<ContentsFile> Files { get; set; }
|
||||
public List<Directory> Directories { get; set; }
|
||||
public string Namespace { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator FilesystemContents(FilesystemContentsType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var fs = new FilesystemContents
|
||||
{
|
||||
Namespace = cicm.@namespace
|
||||
};
|
||||
|
||||
if(cicm.File is not null)
|
||||
{
|
||||
fs.Files = new List<ContentsFile>();
|
||||
|
||||
foreach(ContentsFileType file in cicm.File)
|
||||
fs.Files.Add(file);
|
||||
}
|
||||
|
||||
if(cicm.Directory is null)
|
||||
return fs;
|
||||
|
||||
fs.Directories = new List<Directory>();
|
||||
|
||||
foreach(DirectoryType dir in cicm.Directory)
|
||||
fs.Directories.Add(dir);
|
||||
|
||||
return fs;
|
||||
}
|
||||
}
|
||||
|
||||
public class ContentsFile
|
||||
{
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public List<ExtendedAttribute> ExtendedAttributes { get; set; }
|
||||
public string Name { get; set; }
|
||||
public DateTime? CreationTime { get; set; }
|
||||
public DateTime? AccessTime { get; set; }
|
||||
public DateTime? StatusChangeTime { get; set; }
|
||||
public DateTime? BackupTime { get; set; }
|
||||
public DateTime? LastWriteTime { get; set; }
|
||||
public ulong Attributes { get; set; }
|
||||
public uint? PosixMode { get; set; }
|
||||
public ulong? DeviceNumber { get; set; }
|
||||
public ulong? PosixGroupId { get; set; }
|
||||
public ulong Inode { get; set; }
|
||||
public ulong Links { get; set; }
|
||||
public ulong? PosixUserId { get; set; }
|
||||
public ulong Length { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator ContentsFile(ContentsFileType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var file = new ContentsFile
|
||||
{
|
||||
Name = cicm.name,
|
||||
CreationTime = cicm.creationTimeSpecified ? cicm.creationTime : null,
|
||||
AccessTime = cicm.accessTimeSpecified ? cicm.accessTime : null,
|
||||
StatusChangeTime = cicm.statusChangeTimeSpecified ? cicm.statusChangeTime : null,
|
||||
BackupTime = cicm.backupTimeSpecified ? cicm.backupTime : null,
|
||||
LastWriteTime = cicm.lastWriteTimeSpecified ? cicm.lastWriteTime : null,
|
||||
Attributes = cicm.attributes,
|
||||
PosixMode = cicm.posixModeSpecified ? cicm.posixMode : null,
|
||||
DeviceNumber = cicm.deviceNumberSpecified ? cicm.deviceNumber : null,
|
||||
PosixGroupId = cicm.posixGroupIdSpecified ? cicm.posixGroupId : null,
|
||||
Inode = cicm.inode,
|
||||
Links = cicm.links,
|
||||
PosixUserId = cicm.posixUserIdSpecified ? cicm.posixUserId : null,
|
||||
Length = cicm.length
|
||||
};
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
file.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
file.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.ExtendedAttributes is null)
|
||||
return file;
|
||||
|
||||
file.ExtendedAttributes = new List<ExtendedAttribute>();
|
||||
|
||||
foreach(ExtendedAttributeType xa in cicm.ExtendedAttributes)
|
||||
file.ExtendedAttributes.Add(xa);
|
||||
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
public class ExtendedAttribute
|
||||
{
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public string Name { get; set; }
|
||||
public ulong Length { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator ExtendedAttribute(ExtendedAttributeType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var xa = new ExtendedAttribute
|
||||
{
|
||||
Name = cicm.name,
|
||||
Length = cicm.length
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return xa;
|
||||
|
||||
xa.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
xa.Checksums.Add(chk);
|
||||
|
||||
return xa;
|
||||
}
|
||||
}
|
||||
|
||||
public class Directory
|
||||
{
|
||||
public List<ContentsFile> Files { get; set; }
|
||||
public List<Directory> Directories { get; set; }
|
||||
public string Name { get; set; }
|
||||
public DateTime? CreationTime { get; set; }
|
||||
public DateTime? AccessTime { get; set; }
|
||||
public DateTime? StatusChangeTime { get; set; }
|
||||
public DateTime? BackupTime { get; set; }
|
||||
public DateTime? LastWriteTime { get; set; }
|
||||
public ulong Attributes { get; set; }
|
||||
public uint? PosixMode { get; set; }
|
||||
public ulong? DeviceNumber { get; set; }
|
||||
public ulong? PosixGroupId { get; set; }
|
||||
public ulong? Inode { get; set; }
|
||||
public ulong? Links { get; set; }
|
||||
public ulong? PosixUserId { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Directory(DirectoryType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var dir = new Directory
|
||||
{
|
||||
Name = cicm.name,
|
||||
CreationTime = cicm.creationTimeSpecified ? cicm.creationTime : null,
|
||||
AccessTime = cicm.accessTimeSpecified ? cicm.accessTime : null,
|
||||
StatusChangeTime = cicm.statusChangeTimeSpecified ? cicm.statusChangeTime : null,
|
||||
BackupTime = cicm.backupTimeSpecified ? cicm.backupTime : null,
|
||||
LastWriteTime = cicm.lastWriteTimeSpecified ? cicm.lastWriteTime : null,
|
||||
Attributes = cicm.attributes,
|
||||
PosixMode = cicm.posixModeSpecified ? cicm.posixMode : null,
|
||||
DeviceNumber = cicm.deviceNumberSpecified ? cicm.deviceNumber : null,
|
||||
PosixGroupId = cicm.posixGroupIdSpecified ? cicm.posixGroupId : null,
|
||||
Inode = cicm.inodeSpecified ? cicm.inode : null,
|
||||
Links = cicm.linksSpecified ? cicm.links : null,
|
||||
PosixUserId = cicm.posixUserIdSpecified ? cicm.posixUserId : null
|
||||
};
|
||||
|
||||
if(cicm.Directory is not null)
|
||||
{
|
||||
dir.Directories = new List<Directory>();
|
||||
|
||||
foreach(DirectoryType d in cicm.Directory)
|
||||
dir.Directories.Add(d);
|
||||
}
|
||||
|
||||
if(cicm.File is null)
|
||||
return dir;
|
||||
|
||||
dir.Files = new List<ContentsFile>();
|
||||
|
||||
foreach(ContentsFileType file in cicm.File)
|
||||
dir.Files.Add(file);
|
||||
|
||||
return dir;
|
||||
}
|
||||
}
|
||||
1159
Aaru.CommonTypes/AaruMetadata/Dimensions.cs
Normal file
1159
Aaru.CommonTypes/AaruMetadata/Dimensions.cs
Normal file
File diff suppressed because it is too large
Load Diff
155
Aaru.CommonTypes/AaruMetadata/Dump.cs
Normal file
155
Aaru.CommonTypes/AaruMetadata/Dump.cs
Normal file
@@ -0,0 +1,155 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Dump.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Image
|
||||
{
|
||||
public string Format { get; set; }
|
||||
public ulong? Offset { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Image(ImageType cicm) => cicm is null
|
||||
? null
|
||||
: new Image
|
||||
{
|
||||
Format = cicm.format,
|
||||
Offset = cicm.offsetSpecified ? cicm.offset : null,
|
||||
Value = cicm.Value
|
||||
};
|
||||
}
|
||||
|
||||
public class Dump
|
||||
{
|
||||
public string Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Dump(DumpType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
Dump dump = new()
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return dump;
|
||||
|
||||
dump.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
dump.Checksums.Add(chk);
|
||||
|
||||
return dump;
|
||||
}
|
||||
}
|
||||
|
||||
public class Border
|
||||
{
|
||||
public string Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public uint? Session { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Border(BorderType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var border = new Border
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Session = cicm.sessionSpecified ? cicm.session : null
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return border;
|
||||
|
||||
border.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
border.Checksums.Add(chk);
|
||||
|
||||
return border;
|
||||
}
|
||||
}
|
||||
|
||||
public class File
|
||||
{
|
||||
public string Format { get; set; }
|
||||
public string Value { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator File(FileType cicm) => cicm is null
|
||||
? null
|
||||
: new File
|
||||
{
|
||||
Format = cicm.format,
|
||||
Value = cicm.Value
|
||||
};
|
||||
}
|
||||
|
||||
public class BlockSize
|
||||
{
|
||||
public uint StartingBlock { get; set; }
|
||||
public uint Value { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator BlockSize(BlockSizeType cicm) => cicm is null
|
||||
? null
|
||||
: new BlockSize
|
||||
{
|
||||
StartingBlock = cicm.startingBlock,
|
||||
Value = cicm.Value
|
||||
};
|
||||
}
|
||||
116
Aaru.CommonTypes/AaruMetadata/DumpHardware.cs
Normal file
116
Aaru.CommonTypes/AaruMetadata/DumpHardware.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DumpHardware.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class DumpHardware
|
||||
{
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Revision { get; set; }
|
||||
public string Firmware { get; set; }
|
||||
public string Serial { get; set; }
|
||||
public List<Extent> Extents { get; set; }
|
||||
public Software Software { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator DumpHardware(DumpHardwareType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var hw = new DumpHardware
|
||||
{
|
||||
Manufacturer = cicm.Manufacturer,
|
||||
Model = cicm.Model,
|
||||
Revision = cicm.Revision,
|
||||
Firmware = cicm.Firmware,
|
||||
Serial = cicm.Serial,
|
||||
Software = cicm.Software
|
||||
};
|
||||
|
||||
if(cicm.Extents is null)
|
||||
return hw;
|
||||
|
||||
hw.Extents = new List<Extent>();
|
||||
|
||||
foreach(ExtentType ext in cicm.Extents)
|
||||
hw.Extents.Add(ext);
|
||||
|
||||
return hw;
|
||||
}
|
||||
}
|
||||
|
||||
public class Extent
|
||||
{
|
||||
public ulong Start { get; set; }
|
||||
public ulong End { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Extent(ExtentType cicm) => cicm is null
|
||||
? null
|
||||
: new Extent
|
||||
{
|
||||
Start = cicm.Start,
|
||||
End = cicm.End
|
||||
};
|
||||
}
|
||||
|
||||
public class Software
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Version { get; set; }
|
||||
public string OperatingSystem { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Software(SoftwareType cicm) => cicm is null
|
||||
? null
|
||||
: new Software
|
||||
{
|
||||
Name = cicm.Name,
|
||||
Version = cicm.Version,
|
||||
OperatingSystem = cicm.OperatingSystem
|
||||
};
|
||||
}
|
||||
120
Aaru.CommonTypes/AaruMetadata/FileSystem.cs
Normal file
120
Aaru.CommonTypes/AaruMetadata/FileSystem.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FileSystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class FileSystem
|
||||
{
|
||||
public string Type { get; set; }
|
||||
public DateTime? CreationDate { get; set; }
|
||||
public DateTime? ModificationDate { get; set; }
|
||||
public DateTime? BackupDate { get; set; }
|
||||
public uint ClusterSize { get; set; }
|
||||
public ulong Clusters { get; set; }
|
||||
public ulong? Files { get; set; }
|
||||
public bool Bootable { get; set; }
|
||||
public string VolumeSerial { get; set; }
|
||||
public string VolumeName { get; set; }
|
||||
public ulong? FreeClusters { get; set; }
|
||||
public bool Dirty { get; set; }
|
||||
public DateTime? ExpirationDate { get; set; }
|
||||
public DateTime? EffectiveDate { get; set; }
|
||||
public string SystemIdentifier { get; set; }
|
||||
public string VolumeSetIdentifier { get; set; }
|
||||
public string PublisherIdentifier { get; set; }
|
||||
public string DataPreparerIdentifier { get; set; }
|
||||
public string ApplicationIdentifier { get; set; }
|
||||
public FilesystemContents Contents { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator FileSystem(FileSystemType cicm) => cicm is null
|
||||
? null
|
||||
: new FileSystem
|
||||
{
|
||||
Type = cicm.Type,
|
||||
CreationDate =
|
||||
cicm.CreationDateSpecified
|
||||
? cicm.CreationDate
|
||||
: null,
|
||||
ModificationDate =
|
||||
cicm.ModificationDateSpecified
|
||||
? cicm.ModificationDate
|
||||
: null,
|
||||
BackupDate =
|
||||
cicm.BackupDateSpecified
|
||||
? cicm.BackupDate
|
||||
: null,
|
||||
ClusterSize = cicm.ClusterSize,
|
||||
Clusters = cicm.Clusters,
|
||||
Files = cicm.FilesSpecified
|
||||
? cicm.Files
|
||||
: null,
|
||||
Bootable = cicm.Bootable,
|
||||
VolumeSerial = cicm.VolumeSerial,
|
||||
VolumeName = cicm.VolumeName,
|
||||
FreeClusters =
|
||||
cicm.FreeClustersSpecified
|
||||
? cicm.FreeClusters
|
||||
: null,
|
||||
Dirty = cicm.Dirty,
|
||||
ExpirationDate =
|
||||
cicm.ExpirationDateSpecified
|
||||
? cicm.ExpirationDate
|
||||
: null,
|
||||
EffectiveDate =
|
||||
cicm.EffectiveDateSpecified
|
||||
? cicm.EffectiveDate
|
||||
: null,
|
||||
SystemIdentifier = cicm.SystemIdentifier,
|
||||
VolumeSetIdentifier =
|
||||
cicm.VolumeSetIdentifier,
|
||||
PublisherIdentifier =
|
||||
cicm.PublisherIdentifier,
|
||||
DataPreparerIdentifier =
|
||||
cicm.DataPreparerIdentifier,
|
||||
ApplicationIdentifier =
|
||||
cicm.ApplicationIdentifier,
|
||||
Contents = cicm.Contents
|
||||
};
|
||||
}
|
||||
538
Aaru.CommonTypes/AaruMetadata/Language.cs
Normal file
538
Aaru.CommonTypes/AaruMetadata/Language.cs
Normal file
@@ -0,0 +1,538 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Language.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum Language
|
||||
{
|
||||
aar,
|
||||
abk,
|
||||
ace,
|
||||
ach,
|
||||
ada,
|
||||
ady,
|
||||
afa,
|
||||
afh,
|
||||
afr,
|
||||
ain,
|
||||
aka,
|
||||
akk,
|
||||
alb,
|
||||
ale,
|
||||
alg,
|
||||
alt,
|
||||
amh,
|
||||
ang,
|
||||
anp,
|
||||
apa,
|
||||
ara,
|
||||
arc,
|
||||
arg,
|
||||
arm,
|
||||
arn,
|
||||
arp,
|
||||
art,
|
||||
arw,
|
||||
asm,
|
||||
ast,
|
||||
ath,
|
||||
aus,
|
||||
ava,
|
||||
ave,
|
||||
awa,
|
||||
aym,
|
||||
aze,
|
||||
bad,
|
||||
bai,
|
||||
bak,
|
||||
bal,
|
||||
bam,
|
||||
ban,
|
||||
baq,
|
||||
bas,
|
||||
bat,
|
||||
bej,
|
||||
bel,
|
||||
bem,
|
||||
ben,
|
||||
ber,
|
||||
bho,
|
||||
bih,
|
||||
bik,
|
||||
bin,
|
||||
bis,
|
||||
bla,
|
||||
bnt,
|
||||
bos,
|
||||
bra,
|
||||
bre,
|
||||
btk,
|
||||
bua,
|
||||
bug,
|
||||
bul,
|
||||
bur,
|
||||
byn,
|
||||
cad,
|
||||
cai,
|
||||
car,
|
||||
cat,
|
||||
cau,
|
||||
ceb,
|
||||
cel,
|
||||
cha,
|
||||
chb,
|
||||
che,
|
||||
chg,
|
||||
chi,
|
||||
chk,
|
||||
chm,
|
||||
chn,
|
||||
cho,
|
||||
chp,
|
||||
chr,
|
||||
chu,
|
||||
chv,
|
||||
chy,
|
||||
cmc,
|
||||
cop,
|
||||
cor,
|
||||
cos,
|
||||
cpe,
|
||||
cpf,
|
||||
cpp,
|
||||
cre,
|
||||
crh,
|
||||
crp,
|
||||
csb,
|
||||
cus,
|
||||
cze,
|
||||
dak,
|
||||
dan,
|
||||
dar,
|
||||
day,
|
||||
del,
|
||||
den,
|
||||
dgr,
|
||||
din,
|
||||
div,
|
||||
doi,
|
||||
dra,
|
||||
dsb,
|
||||
dua,
|
||||
dum,
|
||||
dut,
|
||||
dyu,
|
||||
dzo,
|
||||
efi,
|
||||
egy,
|
||||
eka,
|
||||
elx,
|
||||
eng,
|
||||
enm,
|
||||
epo,
|
||||
est,
|
||||
ewe,
|
||||
ewo,
|
||||
fan,
|
||||
fao,
|
||||
fat,
|
||||
fij,
|
||||
fil,
|
||||
fin,
|
||||
fiu,
|
||||
fon,
|
||||
fre,
|
||||
frm,
|
||||
fro,
|
||||
frr,
|
||||
frs,
|
||||
fry,
|
||||
ful,
|
||||
fur,
|
||||
gaa,
|
||||
gay,
|
||||
gba,
|
||||
gem,
|
||||
geo,
|
||||
ger,
|
||||
gez,
|
||||
gil,
|
||||
gla,
|
||||
gle,
|
||||
glg,
|
||||
glv,
|
||||
gmh,
|
||||
goh,
|
||||
gon,
|
||||
gor,
|
||||
got,
|
||||
grb,
|
||||
grc,
|
||||
gre,
|
||||
grn,
|
||||
gsw,
|
||||
guj,
|
||||
gwi,
|
||||
hai,
|
||||
hat,
|
||||
hau,
|
||||
haw,
|
||||
heb,
|
||||
her,
|
||||
hil,
|
||||
him,
|
||||
hin,
|
||||
hit,
|
||||
hmn,
|
||||
hmo,
|
||||
hrv,
|
||||
hsb,
|
||||
hun,
|
||||
hup,
|
||||
iba,
|
||||
ibo,
|
||||
ice,
|
||||
ido,
|
||||
iii,
|
||||
ijo,
|
||||
iku,
|
||||
ile,
|
||||
ilo,
|
||||
ina,
|
||||
inc,
|
||||
ind,
|
||||
ine,
|
||||
inh,
|
||||
ipk,
|
||||
ira,
|
||||
iro,
|
||||
ita,
|
||||
jav,
|
||||
jbo,
|
||||
jpn,
|
||||
jpr,
|
||||
jrb,
|
||||
kaa,
|
||||
kab,
|
||||
kac,
|
||||
kal,
|
||||
kam,
|
||||
kan,
|
||||
kar,
|
||||
kas,
|
||||
kau,
|
||||
kaw,
|
||||
kaz,
|
||||
kbd,
|
||||
kha,
|
||||
khi,
|
||||
khm,
|
||||
kho,
|
||||
kik,
|
||||
kin,
|
||||
kir,
|
||||
kmb,
|
||||
kok,
|
||||
kom,
|
||||
kon,
|
||||
kor,
|
||||
kos,
|
||||
kpe,
|
||||
krc,
|
||||
krl,
|
||||
kro,
|
||||
kru,
|
||||
kua,
|
||||
kum,
|
||||
kur,
|
||||
kut,
|
||||
lad,
|
||||
lah,
|
||||
lam,
|
||||
lao,
|
||||
lat,
|
||||
lav,
|
||||
lez,
|
||||
lim,
|
||||
lin,
|
||||
lit,
|
||||
lol,
|
||||
loz,
|
||||
ltz,
|
||||
lua,
|
||||
lub,
|
||||
lug,
|
||||
lui,
|
||||
lun,
|
||||
luo,
|
||||
lus,
|
||||
mac,
|
||||
mad,
|
||||
mag,
|
||||
mah,
|
||||
mai,
|
||||
mak,
|
||||
mal,
|
||||
man,
|
||||
mao,
|
||||
map,
|
||||
mar,
|
||||
mas,
|
||||
may,
|
||||
mdf,
|
||||
mdr,
|
||||
men,
|
||||
mga,
|
||||
mic,
|
||||
min,
|
||||
mis,
|
||||
mkh,
|
||||
mlg,
|
||||
mlt,
|
||||
mnc,
|
||||
mni,
|
||||
mno,
|
||||
moh,
|
||||
mon,
|
||||
mos,
|
||||
mul,
|
||||
mun,
|
||||
mus,
|
||||
mwl,
|
||||
mwr,
|
||||
myn,
|
||||
myv,
|
||||
nah,
|
||||
nai,
|
||||
nap,
|
||||
nau,
|
||||
nav,
|
||||
nbl,
|
||||
nde,
|
||||
ndo,
|
||||
nds,
|
||||
nep,
|
||||
@new,
|
||||
nia,
|
||||
nic,
|
||||
niu,
|
||||
nno,
|
||||
nob,
|
||||
nog,
|
||||
non,
|
||||
nor,
|
||||
nqo,
|
||||
nso,
|
||||
nub,
|
||||
nwc,
|
||||
nya,
|
||||
nym,
|
||||
nyn,
|
||||
nyo,
|
||||
nzi,
|
||||
oci,
|
||||
oji,
|
||||
ori,
|
||||
orm,
|
||||
osa,
|
||||
oss,
|
||||
ota,
|
||||
oto,
|
||||
paa,
|
||||
pag,
|
||||
pal,
|
||||
pam,
|
||||
pan,
|
||||
pap,
|
||||
pau,
|
||||
peo,
|
||||
per,
|
||||
phi,
|
||||
phn,
|
||||
pli,
|
||||
pol,
|
||||
pon,
|
||||
por,
|
||||
pra,
|
||||
pro,
|
||||
pus,
|
||||
[JsonPropertyName("qaa-qtz")]
|
||||
qaaqtz,
|
||||
que,
|
||||
raj,
|
||||
rap,
|
||||
rar,
|
||||
roa,
|
||||
roh,
|
||||
rom,
|
||||
rum,
|
||||
run,
|
||||
rup,
|
||||
rus,
|
||||
sad,
|
||||
sag,
|
||||
sah,
|
||||
sai,
|
||||
sal,
|
||||
sam,
|
||||
san,
|
||||
sas,
|
||||
sat,
|
||||
scn,
|
||||
sco,
|
||||
sel,
|
||||
sem,
|
||||
sga,
|
||||
sgn,
|
||||
shn,
|
||||
sid,
|
||||
sin,
|
||||
sio,
|
||||
sit,
|
||||
sla,
|
||||
slo,
|
||||
slv,
|
||||
sma,
|
||||
sme,
|
||||
smi,
|
||||
smj,
|
||||
smn,
|
||||
smo,
|
||||
sms,
|
||||
sna,
|
||||
snd,
|
||||
snk,
|
||||
sog,
|
||||
som,
|
||||
son,
|
||||
sot,
|
||||
spa,
|
||||
srd,
|
||||
srn,
|
||||
srp,
|
||||
srr,
|
||||
ssa,
|
||||
ssw,
|
||||
suk,
|
||||
sun,
|
||||
sus,
|
||||
sux,
|
||||
swa,
|
||||
swe,
|
||||
syc,
|
||||
syr,
|
||||
tah,
|
||||
tai,
|
||||
tam,
|
||||
tat,
|
||||
tel,
|
||||
tem,
|
||||
ter,
|
||||
tet,
|
||||
tgk,
|
||||
tgl,
|
||||
tha,
|
||||
tib,
|
||||
tig,
|
||||
tir,
|
||||
tiv,
|
||||
tkl,
|
||||
tlh,
|
||||
tli,
|
||||
tmh,
|
||||
tog,
|
||||
ton,
|
||||
tpi,
|
||||
tsi,
|
||||
tsn,
|
||||
tso,
|
||||
tuk,
|
||||
tum,
|
||||
tup,
|
||||
tur,
|
||||
tut,
|
||||
tvl,
|
||||
twi,
|
||||
tyv,
|
||||
udm,
|
||||
uga,
|
||||
uig,
|
||||
ukr,
|
||||
umb,
|
||||
und,
|
||||
urd,
|
||||
uzb,
|
||||
vai,
|
||||
ven,
|
||||
vie,
|
||||
vol,
|
||||
vot,
|
||||
wak,
|
||||
wal,
|
||||
war,
|
||||
was,
|
||||
wel,
|
||||
wen,
|
||||
wln,
|
||||
wol,
|
||||
xal,
|
||||
xho,
|
||||
yao,
|
||||
yap,
|
||||
yid,
|
||||
yor,
|
||||
ypk,
|
||||
zap,
|
||||
zbl,
|
||||
zen,
|
||||
zgh,
|
||||
zha,
|
||||
znd,
|
||||
zul,
|
||||
zun,
|
||||
zxx,
|
||||
zza
|
||||
}
|
||||
117
Aaru.CommonTypes/AaruMetadata/Layers.cs
Normal file
117
Aaru.CommonTypes/AaruMetadata/Layers.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Layers.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Layers
|
||||
{
|
||||
public List<Sectors> Sectors { get; set; }
|
||||
public LayerType? Type { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Layers(LayersType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var layers = new Layers
|
||||
{
|
||||
Type = cicm.typeSpecified ? (LayerType)cicm.type : null
|
||||
};
|
||||
|
||||
if(cicm.Sectors is null)
|
||||
return layers;
|
||||
|
||||
layers.Sectors = new List<Sectors>();
|
||||
|
||||
foreach(SectorsType sec in cicm.Sectors)
|
||||
layers.Sectors.Add(sec);
|
||||
|
||||
return layers;
|
||||
}
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
public enum LayerType
|
||||
{
|
||||
PTP,
|
||||
OTP
|
||||
}
|
||||
|
||||
public class LayeredText
|
||||
{
|
||||
public uint? Layer { get; set; }
|
||||
public string Text { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator LayeredText(LayeredTextType cicm) => cicm is null
|
||||
? null
|
||||
: new LayeredText
|
||||
{
|
||||
Layer = cicm.layerSpecified
|
||||
? cicm.layer
|
||||
: null,
|
||||
Text = cicm.Value
|
||||
};
|
||||
}
|
||||
|
||||
public class Sectors
|
||||
{
|
||||
public uint? Layer { get; set; }
|
||||
public ulong Value { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Sectors(SectorsType cicm) => cicm is null
|
||||
? null
|
||||
: new Sectors
|
||||
{
|
||||
Layer =
|
||||
cicm.layerSpecified ? cicm.layer : null,
|
||||
Value = cicm.Value
|
||||
};
|
||||
}
|
||||
122
Aaru.CommonTypes/AaruMetadata/LinearMedia.cs
Normal file
122
Aaru.CommonTypes/AaruMetadata/LinearMedia.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : LinearMedia.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class LinearMedia
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public List<Checksum> ImageChecksums { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public string PartNumber { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
public string Title { get; set; }
|
||||
public uint? Sequence { get; set; }
|
||||
public uint? ImageInterleave { get; set; }
|
||||
public uint? Interleave { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Package { get; set; }
|
||||
public string Interface { get; set; }
|
||||
public Dimensions Dimensions { get; set; }
|
||||
public Scans Scans { get; set; }
|
||||
public List<DumpHardware> DumpHardware { get; set; }
|
||||
public Pcmcia Pcmcia { get; set; }
|
||||
public string CopyProtection { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator LinearMedia(LinearMediaType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var linearMedia = new LinearMedia
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
PartNumber = cicm.PartNumber,
|
||||
SerialNumber = cicm.SerialNumber,
|
||||
Title = cicm.Title,
|
||||
Sequence = cicm.SequenceSpecified ? cicm.Sequence : null,
|
||||
ImageInterleave = cicm.ImageInterleaveSpecified ? cicm.ImageInterleave : null,
|
||||
Interleave = cicm.InterleaveSpecified ? cicm.Interleave : null,
|
||||
Manufacturer = cicm.Manufacturer,
|
||||
Model = cicm.Model,
|
||||
Package = cicm.Package,
|
||||
Interface = cicm.Interface,
|
||||
Dimensions = cicm.Dimensions,
|
||||
Scans = cicm.Scans,
|
||||
Pcmcia = cicm.PCMCIA,
|
||||
CopyProtection = cicm.CopyProtection
|
||||
};
|
||||
|
||||
if(cicm.ImageChecksums is not null)
|
||||
{
|
||||
linearMedia.ImageChecksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.ImageChecksums)
|
||||
linearMedia.ImageChecksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
linearMedia.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
linearMedia.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null)
|
||||
return linearMedia;
|
||||
|
||||
linearMedia.DumpHardware = new List<DumpHardware>();
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray)
|
||||
linearMedia.DumpHardware.Add(hw);
|
||||
|
||||
return linearMedia;
|
||||
}
|
||||
}
|
||||
94
Aaru.CommonTypes/AaruMetadata/Magazine.cs
Normal file
94
Aaru.CommonTypes/AaruMetadata/Magazine.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Magazine.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Magazine
|
||||
{
|
||||
public List<Barcode> Barcodes { get; set; }
|
||||
public Cover Cover { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Editorial { get; set; }
|
||||
public DateTime? PublicationDate { get; set; }
|
||||
public uint? Number { get; set; }
|
||||
public List<Language> Languages { get; set; }
|
||||
public uint? Pages { get; set; }
|
||||
public string PageSize { get; set; }
|
||||
public Scan Scan { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Magazine(MagazineType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var magazine = new Magazine
|
||||
{
|
||||
Cover = cicm.Cover,
|
||||
Name = cicm.Name,
|
||||
Editorial = cicm.Editorial,
|
||||
PublicationDate = cicm.PublicationDateSpecified ? cicm.PublicationDate : null,
|
||||
Number = cicm.NumberSpecified ? cicm.Number : null,
|
||||
Pages = cicm.PagesSpecified ? cicm.Pages : null,
|
||||
Scan = cicm.Scan
|
||||
};
|
||||
|
||||
if(cicm.Barcodes is not null)
|
||||
{
|
||||
magazine.Barcodes = new List<Barcode>();
|
||||
|
||||
foreach(Schemas.BarcodeType code in cicm.Barcodes)
|
||||
magazine.Barcodes.Add(code);
|
||||
}
|
||||
|
||||
if(cicm.Language is null)
|
||||
return magazine;
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Language)
|
||||
magazine.Languages.Add((Language)lng);
|
||||
|
||||
return magazine;
|
||||
}
|
||||
}
|
||||
64
Aaru.CommonTypes/AaruMetadata/MultiMediaCard.cs
Normal file
64
Aaru.CommonTypes/AaruMetadata/MultiMediaCard.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : MultiMediaCard.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class MultiMediaCard
|
||||
{
|
||||
public Dump CID { get; set; }
|
||||
public Dump CSD { get; set; }
|
||||
public Dump ExtendedCSD { get; set; }
|
||||
public Dump OCR { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator MultiMediaCard(MultiMediaCardType cicm) => cicm is null
|
||||
? null
|
||||
: new MultiMediaCard
|
||||
{
|
||||
CSD = cicm.CSD,
|
||||
CID = cicm.CID,
|
||||
ExtendedCSD = cicm.ExtendedCSD,
|
||||
OCR = cicm.OCR
|
||||
};
|
||||
}
|
||||
398
Aaru.CommonTypes/AaruMetadata/OpticalDisc.cs
Normal file
398
Aaru.CommonTypes/AaruMetadata/OpticalDisc.cs
Normal file
@@ -0,0 +1,398 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : OpticalDisc.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class OpticalDisc
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public Sequence Sequence { get; set; }
|
||||
public Layers Layers { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public string PartNumber { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
public List<LayeredText> RingCode { get; set; }
|
||||
public List<LayeredText> MasteringSid { get; set; }
|
||||
public List<LayeredText> Toolstamp { get; set; }
|
||||
public List<LayeredText> MouldSid { get; set; }
|
||||
public List<LayeredText> MouldText { get; set; }
|
||||
public string DiscType { get; set; }
|
||||
public string DiscSubType { get; set; }
|
||||
public int? Offset { get; set; }
|
||||
public uint[] Tracks { get; set; }
|
||||
public uint Sessions { get; set; }
|
||||
public string CopyProtection { get; set; }
|
||||
public Dimensions Dimensions { get; set; }
|
||||
public Case Case { get; set; }
|
||||
public Scans Scans { get; set; }
|
||||
public Dump Pfi { get; set; }
|
||||
public Dump Dmi { get; set; }
|
||||
public Dump Cmi { get; set; }
|
||||
public Dump Bca { get; set; }
|
||||
public Dump Atip { get; set; }
|
||||
public Dump Adip { get; set; }
|
||||
public Dump Pma { get; set; }
|
||||
public Dump Dds { get; set; }
|
||||
public Dump Sai { get; set; }
|
||||
public Dump LastRmd { get; set; }
|
||||
public Dump Pri { get; set; }
|
||||
public Dump MediaID { get; set; }
|
||||
public Dump Pfir { get; set; }
|
||||
public Dump Dcb { get; set; }
|
||||
public Dump Di { get; set; }
|
||||
public Dump Pac { get; set; }
|
||||
public Dump Toc { get; set; }
|
||||
public Dump LeadInCdText { get; set; }
|
||||
public List<Border> FirstTrackPregrap { get; set; }
|
||||
public List<Border> LeadIn { get; set; }
|
||||
public List<Border> LeadOut { get; set; }
|
||||
public Xbox Xbox { get; set; }
|
||||
public Ps3Encryption Ps3Encryption { get; set; }
|
||||
public string MediaCatalogueNumber { get; set; }
|
||||
public List<Track> Track { get; set; }
|
||||
public List<DumpHardware> DumpHardware { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator OpticalDisc(OpticalDiscType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var disc = new OpticalDisc
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Sequence = cicm.Sequence,
|
||||
Layers = cicm.Layers,
|
||||
PartNumber = cicm.PartNumber,
|
||||
SerialNumber = cicm.SerialNumber,
|
||||
DiscType = cicm.DiscType,
|
||||
DiscSubType = cicm.DiscSubType,
|
||||
Offset = cicm.OffsetSpecified ? cicm.Offset : null,
|
||||
Tracks = cicm.Tracks,
|
||||
Sessions = cicm.Sessions,
|
||||
CopyProtection = cicm.CopyProtection,
|
||||
Dimensions = cicm.Dimensions,
|
||||
Case = cicm.Case,
|
||||
Scans = cicm.Scans,
|
||||
Pfi = cicm.PFI,
|
||||
Dmi = cicm.DMI,
|
||||
Cmi = cicm.CMI,
|
||||
Bca = cicm.BCA,
|
||||
Atip = cicm.ATIP,
|
||||
Adip = cicm.ADIP,
|
||||
Pma = cicm.PMA,
|
||||
Dds = cicm.DDS,
|
||||
Sai = cicm.SAI,
|
||||
LastRmd = cicm.LastRMD,
|
||||
Pri = cicm.PRI,
|
||||
MediaID = cicm.MediaID,
|
||||
Pfir = cicm.PFIR,
|
||||
Dcb = cicm.DCB,
|
||||
Pac = cicm.PAC,
|
||||
Toc = cicm.TOC,
|
||||
LeadInCdText = cicm.LeadInCdText,
|
||||
Xbox = cicm.Xbox,
|
||||
Ps3Encryption = cicm.PS3Encryption,
|
||||
MediaCatalogueNumber = cicm.MediaCatalogueNumber
|
||||
};
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
disc.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
disc.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.RingCode is not null)
|
||||
{
|
||||
disc.RingCode = new List<LayeredText>();
|
||||
|
||||
foreach(LayeredTextType lt in cicm.RingCode)
|
||||
disc.RingCode.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.MasteringSID is not null)
|
||||
{
|
||||
disc.MasteringSid = new List<LayeredText>();
|
||||
|
||||
foreach(LayeredTextType lt in cicm.MasteringSID)
|
||||
disc.MasteringSid.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.Toolstamp is not null)
|
||||
{
|
||||
disc.Toolstamp = new List<LayeredText>();
|
||||
|
||||
foreach(LayeredTextType lt in cicm.Toolstamp)
|
||||
disc.Toolstamp.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.MouldSID is not null)
|
||||
{
|
||||
disc.MouldSid = new List<LayeredText>();
|
||||
|
||||
foreach(LayeredTextType lt in cicm.MouldSID)
|
||||
disc.MouldSid.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.MouldText is not null)
|
||||
{
|
||||
disc.MouldText = new List<LayeredText>();
|
||||
|
||||
foreach(LayeredTextType lt in cicm.MouldText)
|
||||
disc.MouldText.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.FirstTrackPregrap is not null)
|
||||
{
|
||||
disc.FirstTrackPregrap = new List<Border>();
|
||||
|
||||
foreach(BorderType lt in cicm.FirstTrackPregrap)
|
||||
disc.FirstTrackPregrap.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.LeadIn is not null)
|
||||
{
|
||||
disc.LeadIn = new List<Border>();
|
||||
|
||||
foreach(BorderType lt in cicm.LeadIn)
|
||||
disc.LeadIn.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.LeadOut is not null)
|
||||
{
|
||||
disc.LeadOut = new List<Border>();
|
||||
|
||||
foreach(BorderType lt in cicm.LeadOut)
|
||||
disc.LeadOut.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.Track is not null)
|
||||
{
|
||||
disc.Track = new List<Track>();
|
||||
|
||||
foreach(Schemas.TrackType lt in cicm.Track)
|
||||
disc.Track.Add(lt);
|
||||
}
|
||||
|
||||
if(cicm.DumpHardwareArray is null)
|
||||
return disc;
|
||||
|
||||
disc.DumpHardware = new List<DumpHardware>();
|
||||
|
||||
foreach(DumpHardwareType hw in cicm.DumpHardwareArray)
|
||||
disc.DumpHardware.Add(hw);
|
||||
|
||||
return disc;
|
||||
}
|
||||
}
|
||||
|
||||
public class Track
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public TrackSequence Sequence { get; set; }
|
||||
public string StartMsf { get; set; }
|
||||
public string EndMsf { get; set; }
|
||||
public ulong StartSector { get; set; }
|
||||
public ulong EndSector { get; set; }
|
||||
public List<TrackIndex> Indexes { get; set; }
|
||||
public TrackFlags Flags { get; set; }
|
||||
public string ISRC { get; set; }
|
||||
public TrackType Type { get; set; }
|
||||
public uint BytesPerSector { get; set; }
|
||||
public string AccoustID { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public SubChannel SubChannel { get; set; }
|
||||
public List<Partition> FileSystemInformation { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Track(Schemas.TrackType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var trk = new Track
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Sequence = cicm.Sequence,
|
||||
StartMsf = cicm.StartMSF,
|
||||
EndMsf = cicm.EndMSF,
|
||||
StartSector = cicm.StartSector,
|
||||
EndSector = cicm.EndSector,
|
||||
Flags = cicm.Flags,
|
||||
ISRC = cicm.ISRC,
|
||||
Type = (TrackType)cicm.TrackType1,
|
||||
BytesPerSector = cicm.BytesPerSector,
|
||||
AccoustID = cicm.AccoustID,
|
||||
SubChannel = cicm.SubChannel
|
||||
};
|
||||
|
||||
if(cicm.Indexes is not null)
|
||||
{
|
||||
trk.Indexes = new List<TrackIndex>();
|
||||
|
||||
foreach(TrackIndexType idx in cicm.Indexes)
|
||||
trk.Indexes.Add(idx);
|
||||
}
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
trk.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
trk.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.FileSystemInformation is null)
|
||||
return trk;
|
||||
|
||||
trk.FileSystemInformation = new List<Partition>();
|
||||
|
||||
foreach(PartitionType fs in cicm.FileSystemInformation)
|
||||
trk.FileSystemInformation.Add(fs);
|
||||
|
||||
return trk;
|
||||
}
|
||||
}
|
||||
|
||||
public class TrackSequence
|
||||
{
|
||||
public uint Number { get; set; }
|
||||
public uint Session { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator TrackSequence(TrackSequenceType cicm) => cicm is null
|
||||
? null
|
||||
: new TrackSequence
|
||||
{
|
||||
Number = cicm.TrackNumber,
|
||||
Session = cicm.Session
|
||||
};
|
||||
}
|
||||
|
||||
public class TrackIndex
|
||||
{
|
||||
public ushort Index { get; set; }
|
||||
public int Value { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator TrackIndex(TrackIndexType cicm) => cicm is null
|
||||
? null
|
||||
: new TrackIndex
|
||||
{
|
||||
Index = cicm.index,
|
||||
Value = cicm.Value
|
||||
};
|
||||
}
|
||||
|
||||
public class TrackFlags
|
||||
{
|
||||
public bool Quadraphonic { get; set; }
|
||||
public bool Data { get; set; }
|
||||
public bool CopyPermitted { get; set; }
|
||||
public bool PreEmphasis { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator TrackFlags(TrackFlagsType cicm) => cicm is null
|
||||
? null
|
||||
: new TrackFlags
|
||||
{
|
||||
CopyPermitted = cicm.CopyPermitted,
|
||||
Data = cicm.Data,
|
||||
PreEmphasis = cicm.PreEmphasis,
|
||||
Quadraphonic = cicm.Quadraphonic
|
||||
};
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
public enum TrackType
|
||||
{
|
||||
Audio,
|
||||
Mode0,
|
||||
Mode1,
|
||||
Mode2,
|
||||
Mode2Form1,
|
||||
Mode2Form2,
|
||||
Dvd,
|
||||
HdDvd,
|
||||
Bluray,
|
||||
Ddcd
|
||||
}
|
||||
|
||||
public class SubChannel
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator SubChannel(SubChannelType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var subchannel = new SubChannel
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return subchannel;
|
||||
|
||||
subchannel.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
subchannel.Checksums.Add(chk);
|
||||
|
||||
return subchannel;
|
||||
}
|
||||
}
|
||||
67
Aaru.CommonTypes/AaruMetadata/PCI.cs
Normal file
67
Aaru.CommonTypes/AaruMetadata/PCI.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : PCI.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Pci
|
||||
{
|
||||
public ushort VendorID { get; set; }
|
||||
|
||||
public ushort DeviceID { get; set; }
|
||||
|
||||
public Dump Configuration { get; set; }
|
||||
|
||||
public LinearMedia ExpansionRom { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Pci(PCIType cicm) => cicm is null
|
||||
? null
|
||||
: new Pci
|
||||
{
|
||||
VendorID = cicm.VendorID,
|
||||
DeviceID = cicm.DeviceID,
|
||||
Configuration = cicm.Configuration,
|
||||
ExpansionRom = cicm.ExpansionROM
|
||||
};
|
||||
}
|
||||
80
Aaru.CommonTypes/AaruMetadata/PCMCIA.cs
Normal file
80
Aaru.CommonTypes/AaruMetadata/PCMCIA.cs
Normal file
@@ -0,0 +1,80 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : PCMCIA.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Pcmcia
|
||||
{
|
||||
public Dump Cis { get; set; }
|
||||
public string Compliance { get; set; }
|
||||
public ushort? ManufacturerCode { get; set; }
|
||||
public ushort? CardCode { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string ProductName { get; set; }
|
||||
public List<string> AdditionalInformation { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Pcmcia(PCMCIAType cicm) => cicm is null
|
||||
? null
|
||||
: new Pcmcia
|
||||
{
|
||||
Cis = cicm.CIS,
|
||||
Compliance = cicm.Compliance,
|
||||
ManufacturerCode =
|
||||
cicm.ManufacturerCodeSpecified
|
||||
? cicm.ManufacturerCode
|
||||
: null,
|
||||
CardCode = cicm.CardCodeSpecified
|
||||
? cicm.CardCode
|
||||
: null,
|
||||
Manufacturer = cicm.Manufacturer,
|
||||
ProductName = cicm.ProductName,
|
||||
AdditionalInformation =
|
||||
cicm.AdditionalInformation is null
|
||||
? null
|
||||
: new List<string>(cicm.
|
||||
AdditionalInformation)
|
||||
};
|
||||
}
|
||||
60
Aaru.CommonTypes/AaruMetadata/PS3.cs
Normal file
60
Aaru.CommonTypes/AaruMetadata/PS3.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : PS3.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Ps3Encryption
|
||||
{
|
||||
public string Key { get; set; }
|
||||
public string Serial { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Ps3Encryption(PS3EncryptionType cicm) => cicm is null
|
||||
? null
|
||||
: new Ps3Encryption
|
||||
{
|
||||
Key = cicm.Key,
|
||||
Serial = cicm.Serial
|
||||
};
|
||||
}
|
||||
84
Aaru.CommonTypes/AaruMetadata/Partition.cs
Normal file
84
Aaru.CommonTypes/AaruMetadata/Partition.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Partition.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Partition
|
||||
{
|
||||
public uint Sequence { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Type { get; set; }
|
||||
public ulong StartSector { get; set; }
|
||||
public ulong EndSector { get; set; }
|
||||
public string Description { get; set; }
|
||||
public List<FileSystem> FileSystems { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Partition(PartitionType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var part = new Partition
|
||||
{
|
||||
Sequence = cicm.Sequence,
|
||||
Name = cicm.Name,
|
||||
Type = cicm.Type,
|
||||
StartSector = cicm.StartSector,
|
||||
EndSector = cicm.EndSector,
|
||||
Description = cicm.Description
|
||||
};
|
||||
|
||||
if(cicm.FileSystems is null)
|
||||
return part;
|
||||
|
||||
part.FileSystems = new List<FileSystem>();
|
||||
|
||||
foreach(FileSystemType fs in cicm.FileSystems)
|
||||
part.FileSystems.Add(fs);
|
||||
|
||||
return part;
|
||||
}
|
||||
}
|
||||
63
Aaru.CommonTypes/AaruMetadata/ReleaseType.cs
Normal file
63
Aaru.CommonTypes/AaruMetadata/ReleaseType.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ReleaseType.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum ReleaseType
|
||||
{
|
||||
Retail,
|
||||
Bundle,
|
||||
Coverdisc,
|
||||
Subscription,
|
||||
Demo,
|
||||
OEM,
|
||||
Shareware,
|
||||
FOSS,
|
||||
Adware,
|
||||
Donationware,
|
||||
DigitalDownload,
|
||||
SaaS
|
||||
}
|
||||
62
Aaru.CommonTypes/AaruMetadata/RequiredOperatingSystem.cs
Normal file
62
Aaru.CommonTypes/AaruMetadata/RequiredOperatingSystem.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : RequiredOperatingSystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class RequiredOperatingSystem
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public List<string> Versions { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator RequiredOperatingSystem(RequiredOperatingSystemType cicm) =>
|
||||
cicm is null
|
||||
? null
|
||||
: new RequiredOperatingSystem
|
||||
{
|
||||
Name = cicm.Name,
|
||||
Versions = cicm.Version is null ? null : new List<string>(cicm.Version)
|
||||
};
|
||||
}
|
||||
112
Aaru.CommonTypes/AaruMetadata/SCSI.cs
Normal file
112
Aaru.CommonTypes/AaruMetadata/SCSI.cs
Normal file
@@ -0,0 +1,112 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : SCSI.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class SCSI
|
||||
{
|
||||
public Dump Inquiry { get; set; }
|
||||
public List<Evpd> Evpds { get; set; }
|
||||
public Dump ModeSense { get; set; }
|
||||
public Dump ModeSense10 { get; set; }
|
||||
public Dump LogSense { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator SCSI(SCSIType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var scsi = new SCSI
|
||||
{
|
||||
Inquiry = cicm.Inquiry,
|
||||
LogSense = cicm.LogSense,
|
||||
ModeSense = cicm.ModeSense,
|
||||
ModeSense10 = cicm.ModeSense10
|
||||
};
|
||||
|
||||
if(cicm.EVPD is null)
|
||||
return cicm;
|
||||
|
||||
scsi.Evpds = new List<Evpd>();
|
||||
|
||||
foreach(EVPDType evpd in cicm.EVPD)
|
||||
scsi.Evpds.Add(evpd);
|
||||
|
||||
return scsi;
|
||||
}
|
||||
}
|
||||
|
||||
public class Evpd
|
||||
{
|
||||
public string Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public byte? Page { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Evpd(EVPDType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var evpd = new Evpd
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Page = cicm.pageSpecified ? cicm.page : null
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return evpd;
|
||||
|
||||
evpd.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
evpd.Checksums.Add(chk);
|
||||
|
||||
return evpd;
|
||||
}
|
||||
}
|
||||
324
Aaru.CommonTypes/AaruMetadata/Scanning.cs
Normal file
324
Aaru.CommonTypes/AaruMetadata/Scanning.cs
Normal file
@@ -0,0 +1,324 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Scanning.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Scan
|
||||
{
|
||||
public File File { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public List<Scanner> Scanner { get; set; }
|
||||
public List<ScanProcessing> ScanProcessing { get; set; }
|
||||
public List<OCR> OCR { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Scan(ScanType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var scan = new Scan
|
||||
{
|
||||
File = cicm.File
|
||||
};
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
scan.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
scan.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.Scanner is not null)
|
||||
{
|
||||
scan.Scanner = new List<Scanner>();
|
||||
|
||||
foreach(ScannerType scanner in cicm.Scanner)
|
||||
scan.Scanner.Add(scanner);
|
||||
}
|
||||
|
||||
if(cicm.ScanProcessing is not null)
|
||||
{
|
||||
scan.ScanProcessing = new List<ScanProcessing>();
|
||||
|
||||
foreach(ScanProcessingType processing in cicm.ScanProcessing)
|
||||
scan.ScanProcessing.Add(processing);
|
||||
}
|
||||
|
||||
if(cicm.OCR is null)
|
||||
return scan;
|
||||
|
||||
scan.OCR = new List<OCR>();
|
||||
|
||||
foreach(OCRType ocr in cicm.OCR)
|
||||
scan.OCR.Add(ocr);
|
||||
|
||||
return scan;
|
||||
}
|
||||
}
|
||||
|
||||
public class Cover
|
||||
{
|
||||
public File File { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public byte[] Thumbnail { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Cover(CoverType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var cover = new Cover
|
||||
{
|
||||
File = cicm.File,
|
||||
Thumbnail = cicm.Thumbnail
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return cover;
|
||||
|
||||
cover.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
cover.Checksums.Add(chk);
|
||||
|
||||
return cover;
|
||||
}
|
||||
}
|
||||
|
||||
public class Case
|
||||
{
|
||||
public CaseType Type { get; set; }
|
||||
public Scans Scans { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Case(Schemas.CaseType cicm) => cicm is null
|
||||
? null
|
||||
: new Case
|
||||
{
|
||||
Type = (CaseType)cicm.CaseType1,
|
||||
Scans = cicm.Scans
|
||||
};
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
public enum CaseType
|
||||
{
|
||||
Jewel,
|
||||
BigJewel,
|
||||
SlimJewel,
|
||||
Sleeve,
|
||||
Qpack,
|
||||
Digisleeve,
|
||||
DiscboxSlider,
|
||||
CompacPlus,
|
||||
KeepCase,
|
||||
SnapCase,
|
||||
SoftCase,
|
||||
EcoPack,
|
||||
Liftlock,
|
||||
Spindle,
|
||||
Ps2Case,
|
||||
Ps3Case,
|
||||
BlurayKeepCase,
|
||||
PsCase,
|
||||
DcCase,
|
||||
SaturnCase,
|
||||
XboxCase,
|
||||
Xbox360Case,
|
||||
XboxOneCase,
|
||||
SaturnBigCase,
|
||||
GcCase,
|
||||
WiiCase,
|
||||
Unknown
|
||||
}
|
||||
|
||||
public class Scans
|
||||
{
|
||||
public CaseScan Case { get; set; }
|
||||
public MediaScan Media { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Scans(ScansType cicm) => cicm is null
|
||||
? null
|
||||
: new Scans
|
||||
{
|
||||
Case = cicm.CaseScan,
|
||||
Media = cicm.Scan
|
||||
};
|
||||
}
|
||||
|
||||
public class CaseScan
|
||||
{
|
||||
public CaseScanElement Element { get; set; }
|
||||
public Scan Scan { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator CaseScan(CaseScanType cicm) => cicm is null
|
||||
? null
|
||||
: new CaseScan
|
||||
{
|
||||
Element = (CaseScanElement)cicm.
|
||||
CaseScanElement,
|
||||
Scan = cicm.Scan
|
||||
};
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
public enum CaseScanElement
|
||||
{
|
||||
Sleeve,
|
||||
Inner,
|
||||
Inlay,
|
||||
FrontBack,
|
||||
FrontFull,
|
||||
BoxFront,
|
||||
BoxBack,
|
||||
BoxSpine,
|
||||
External
|
||||
}
|
||||
|
||||
public class MediaScan
|
||||
{
|
||||
public MediaScanElement Element { get; set; }
|
||||
public Scan Scan { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator MediaScan(MediaScanType cicm) => cicm is null
|
||||
? null
|
||||
: new MediaScan
|
||||
{
|
||||
Element = (MediaScanElement)cicm.
|
||||
MediaScanElement,
|
||||
Scan = cicm.Scan
|
||||
};
|
||||
}
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
|
||||
public enum MediaScanElement
|
||||
{
|
||||
Up,
|
||||
Down,
|
||||
Front,
|
||||
Back,
|
||||
Left,
|
||||
Right
|
||||
}
|
||||
|
||||
public class Scanner
|
||||
{
|
||||
public string Author { get; set; }
|
||||
public string Manufacturer { get; set; }
|
||||
public string Model { get; set; }
|
||||
public string Serial { get; set; }
|
||||
public string Software { get; set; }
|
||||
public string SoftwareVersion { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Scanner(ScannerType cicm) => cicm is null
|
||||
? null
|
||||
: new Scanner
|
||||
{
|
||||
Author = cicm.Author,
|
||||
Manufacturer = cicm.Manufacturer,
|
||||
Model = cicm.Model,
|
||||
Serial = cicm.Serial,
|
||||
Software = cicm.Software,
|
||||
SoftwareVersion = cicm.SoftwareVersion
|
||||
};
|
||||
}
|
||||
|
||||
public class ScanProcessing
|
||||
{
|
||||
public string Author { get; set; }
|
||||
public string Software { get; set; }
|
||||
public string SoftwareVersion { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator ScanProcessing(ScanProcessingType cicm) => cicm is null
|
||||
? null
|
||||
: new ScanProcessing
|
||||
{
|
||||
Author = cicm.Author,
|
||||
Software = cicm.Software,
|
||||
SoftwareVersion =
|
||||
cicm.SoftwareVersion
|
||||
};
|
||||
}
|
||||
|
||||
public class OCR
|
||||
{
|
||||
public string Author { get; set; }
|
||||
public string Software { get; set; }
|
||||
public string SoftwareVersion { get; set; }
|
||||
public List<Language> Language { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator OCR(OCRType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var ocr = new OCR
|
||||
{
|
||||
Author = cicm.Author,
|
||||
Software = cicm.Software,
|
||||
SoftwareVersion = cicm.SoftwareVersion
|
||||
};
|
||||
|
||||
if(cicm.Language is null)
|
||||
return ocr;
|
||||
|
||||
ocr.Language = new List<Language>();
|
||||
|
||||
foreach(Language lng in cicm.Language)
|
||||
ocr.Language.Add(lng);
|
||||
|
||||
return ocr;
|
||||
}
|
||||
}
|
||||
64
Aaru.CommonTypes/AaruMetadata/SecureDigital.cs
Normal file
64
Aaru.CommonTypes/AaruMetadata/SecureDigital.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : SecureDigital.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class SecureDigital
|
||||
{
|
||||
public Dump CID { get; set; }
|
||||
public Dump CSD { get; set; }
|
||||
public Dump SCR { get; set; }
|
||||
public Dump OCR { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator SecureDigital(SecureDigitalType cicm) => cicm is null
|
||||
? null
|
||||
: new SecureDigital
|
||||
{
|
||||
CID = cicm.CID,
|
||||
CSD = cicm.CSD,
|
||||
SCR = cicm.SCR,
|
||||
OCR = cicm.OCR
|
||||
};
|
||||
}
|
||||
68
Aaru.CommonTypes/AaruMetadata/Sequence.cs
Normal file
68
Aaru.CommonTypes/AaruMetadata/Sequence.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Sequence.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Sequence
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public uint MediaSequence { get; set; }
|
||||
public uint TotalMedia { get; set; }
|
||||
public byte? Side { get; set; }
|
||||
public byte? Layer { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Sequence(SequenceType cicm) => cicm is null
|
||||
? null
|
||||
: new Sequence
|
||||
{
|
||||
Title = cicm.MediaTitle,
|
||||
MediaSequence = cicm.MediaSequence,
|
||||
TotalMedia = cicm.TotalMedia,
|
||||
Side = cicm.SideSpecified ? cicm.Side : null,
|
||||
Layer = cicm.LayerSpecified
|
||||
? cicm.Layer
|
||||
: null
|
||||
};
|
||||
}
|
||||
129
Aaru.CommonTypes/AaruMetadata/Tape.cs
Normal file
129
Aaru.CommonTypes/AaruMetadata/Tape.cs
Normal file
@@ -0,0 +1,129 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Tape.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class TapePartition
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public ulong Sequence { get; set; }
|
||||
public ulong StartBlock { get; set; }
|
||||
public ulong EndBlock { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
public List<TapeFile> Files { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator TapePartition(TapePartitionType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
TapePartition partition = new()
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Sequence = cicm.Sequence,
|
||||
StartBlock = cicm.StartBlock,
|
||||
EndBlock = cicm.EndBlock
|
||||
};
|
||||
|
||||
if(cicm.Checksums is not null)
|
||||
{
|
||||
partition.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
partition.Checksums.Add(chk);
|
||||
}
|
||||
|
||||
if(cicm.File is null)
|
||||
return partition;
|
||||
|
||||
partition.Files = new List<TapeFile>();
|
||||
|
||||
foreach(TapeFileType file in cicm.File)
|
||||
partition.Files.Add(file);
|
||||
|
||||
return partition;
|
||||
}
|
||||
}
|
||||
|
||||
public class TapeFile
|
||||
{
|
||||
public Image Image { get; set; }
|
||||
public ulong Size { get; set; }
|
||||
public ulong Sequence { get; set; }
|
||||
public ulong BlockSize { get; set; }
|
||||
public ulong StartBlock { get; set; }
|
||||
public ulong EndBlock { get; set; }
|
||||
public List<Checksum> Checksums { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator TapeFile(TapeFileType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var file = new TapeFile
|
||||
{
|
||||
Image = cicm.Image,
|
||||
Size = cicm.Size,
|
||||
Sequence = cicm.Sequence,
|
||||
BlockSize = cicm.BlockSize,
|
||||
StartBlock = cicm.StartBlock,
|
||||
EndBlock = cicm.EndBlock
|
||||
};
|
||||
|
||||
if(cicm.Checksums is null)
|
||||
return file;
|
||||
|
||||
file.Checksums = new List<Checksum>();
|
||||
|
||||
foreach(Schemas.ChecksumType chk in cicm.Checksums)
|
||||
file.Checksums.Add(chk);
|
||||
|
||||
return file;
|
||||
}
|
||||
}
|
||||
62
Aaru.CommonTypes/AaruMetadata/USB.cs
Normal file
62
Aaru.CommonTypes/AaruMetadata/USB.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : USB.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
using System;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Usb
|
||||
{
|
||||
public ushort VendorID { get; set; }
|
||||
public ushort ProductID { get; set; }
|
||||
public Dump Descriptors { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Usb(USBType cicm) => cicm is null
|
||||
? null
|
||||
: new Usb
|
||||
{
|
||||
VendorID = cicm.VendorID,
|
||||
ProductID = cicm.ProductID,
|
||||
Descriptors = cicm.Descriptors
|
||||
};
|
||||
}
|
||||
78
Aaru.CommonTypes/AaruMetadata/UserManual.cs
Normal file
78
Aaru.CommonTypes/AaruMetadata/UserManual.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UserManual.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class UserManual
|
||||
{
|
||||
public List<Language> Language { get; set; }
|
||||
public uint Pages { get; set; }
|
||||
public string PageSize { get; set; }
|
||||
public Scan Scan { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator UserManual(UserManualType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
var manual = new UserManual
|
||||
{
|
||||
Pages = cicm.Pages,
|
||||
PageSize = cicm.PageSize,
|
||||
Scan = cicm.Scan
|
||||
};
|
||||
|
||||
if(cicm.Language is null)
|
||||
return manual;
|
||||
|
||||
manual.Language = new List<Language>();
|
||||
|
||||
foreach(LanguagesTypeLanguage lng in cicm.Language)
|
||||
manual.Language.Add((Language)lng);
|
||||
|
||||
return manual;
|
||||
}
|
||||
}
|
||||
92
Aaru.CommonTypes/AaruMetadata/Xbox.cs
Normal file
92
Aaru.CommonTypes/AaruMetadata/Xbox.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Xbox.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines format for metadata.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Schemas;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
|
||||
namespace Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
public class Xbox
|
||||
{
|
||||
public Dump Pfi { get; set; }
|
||||
public Dump Dmi { get; set; }
|
||||
public List<XboxSecuritySector> SecuritySectors { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator Xbox(XboxType cicm)
|
||||
{
|
||||
if(cicm is null)
|
||||
return null;
|
||||
|
||||
Xbox xbox = new()
|
||||
{
|
||||
Pfi = cicm.PFI,
|
||||
Dmi = cicm.DMI
|
||||
};
|
||||
|
||||
if(cicm.SecuritySectors is null)
|
||||
return xbox;
|
||||
|
||||
foreach(XboxSecuritySectorsType ss in cicm.SecuritySectors)
|
||||
xbox.SecuritySectors.Add(ss);
|
||||
|
||||
return xbox;
|
||||
}
|
||||
}
|
||||
|
||||
public class XboxSecuritySector
|
||||
{
|
||||
public uint RequestVersion { get; set; }
|
||||
public uint RequestNumber { get; set; }
|
||||
public Dump SecuritySectors { get; set; }
|
||||
|
||||
[Obsolete("Will be removed in Aaru 7")]
|
||||
public static implicit operator XboxSecuritySector(XboxSecuritySectorsType cicm) =>
|
||||
cicm is null
|
||||
? null
|
||||
: new XboxSecuritySector
|
||||
{
|
||||
RequestNumber = cicm.RequestNumber,
|
||||
RequestVersion = cicm.RequestVersion,
|
||||
SecuritySectors = cicm.SecuritySectors
|
||||
};
|
||||
}
|
||||
91
Aaru.CommonTypes/Delegates.cs
Normal file
91
Aaru.CommonTypes/Delegates.cs
Normal file
@@ -0,0 +1,91 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Delegates.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Common types.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Delegates to communicate with user interface.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedType.Global
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
/// <summary>Initializes a progress indicator (e.g. makes a progress bar visible)</summary>
|
||||
public delegate void InitProgressHandler();
|
||||
|
||||
/// <summary>Updates a progress indicator with text</summary>
|
||||
public delegate void UpdateProgressHandler(string text, long current, long maximum);
|
||||
|
||||
/// <summary>Pulses a progress indicator with indeterminate boundaries</summary>
|
||||
public delegate void PulseProgressHandler(string text);
|
||||
|
||||
/// <summary>Uninitializes a progress indicator (e.g. adds a newline to the console)</summary>
|
||||
public delegate void EndProgressHandler();
|
||||
|
||||
/// <summary>Initializes a secondary progress indicator (e.g. makes a progress bar visible)</summary>
|
||||
public delegate void InitProgressHandler2();
|
||||
|
||||
/// <summary>Updates a secondary progress indicator with text</summary>
|
||||
public delegate void UpdateProgressHandler2(string text, long current, long maximum);
|
||||
|
||||
/// <summary>Pulses a secondary progress indicator with indeterminate boundaries</summary>
|
||||
public delegate void PulseProgressHandler2(string text);
|
||||
|
||||
/// <summary>Uninitializes a secondary progress indicator (e.g. adds a newline to the console)</summary>
|
||||
public delegate void EndProgressHandler2();
|
||||
|
||||
/// <summary>Initializes two progress indicators (e.g. makes a progress bar visible)</summary>
|
||||
public delegate void InitTwoProgressHandler();
|
||||
|
||||
/// <summary>Updates two progress indicators with text</summary>
|
||||
public delegate void UpdateTwoProgressHandler(string text, long current, long maximum, string text2, long current2,
|
||||
long maximum2);
|
||||
|
||||
/// <summary>Pulses a progress indicator with indeterminate boundaries</summary>
|
||||
public delegate void PulseTwoProgressHandler(string text, string text2);
|
||||
|
||||
/// <summary>Uninitializes a progress indicator (e.g. adds a newline to the console)</summary>
|
||||
public delegate void EndTwoProgressHandler();
|
||||
|
||||
/// <summary>Updates a status indicator</summary>
|
||||
public delegate void UpdateStatusHandler(string text);
|
||||
|
||||
/// <summary>Shows an error message</summary>
|
||||
public delegate void ErrorMessageHandler(string text);
|
||||
|
||||
/// <summary>Initializes a block map that's going to be filled with a media scan</summary>
|
||||
public delegate void InitBlockMapHandler(ulong blocks, ulong blockSize, ulong blocksToRead, ushort currentProfile);
|
||||
|
||||
/// <summary>Updates lists of time taken on scanning from the specified sector</summary>
|
||||
/// <param name="duration">Time in milliseconds</param>
|
||||
public delegate void ScanTimeHandler(ulong sector, double duration);
|
||||
|
||||
/// <summary>Specified a number of blocks could not be read on scan</summary>
|
||||
public delegate void ScanUnreadableHandler(ulong sector);
|
||||
|
||||
/// <summary>Sends the speed of scanning a specific sector</summary>
|
||||
public delegate void ScanSpeedHandler(ulong sector, double currentSpeed);
|
||||
58
Aaru.CommonTypes/Enums/DeviceType.cs
Normal file
58
Aaru.CommonTypes/Enums/DeviceType.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DeviceType.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines enumerations of device types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Enums;
|
||||
|
||||
/// <summary>Device types</summary>
|
||||
public enum DeviceType
|
||||
{
|
||||
/// <summary>Unknown device type</summary>
|
||||
Unknown = -1,
|
||||
/// <summary>ATA device</summary>
|
||||
ATA = 1,
|
||||
/// <summary>ATA Packet device (aka SCSI over ATA)</summary>
|
||||
ATAPI = 2,
|
||||
/// <summary>SCSI device (or USB-MSC, SBP2, FC, UAS, etc)</summary>
|
||||
SCSI = 3,
|
||||
/// <summary>SecureDigital memory card</summary>
|
||||
SecureDigital = 4,
|
||||
/// <summary>MultiMediaCard memory card</summary>
|
||||
MMC = 5,
|
||||
/// <summary>NVMe device</summary>
|
||||
NVMe = 6
|
||||
}
|
||||
287
Aaru.CommonTypes/Enums/ErrorNumber.cs
Normal file
287
Aaru.CommonTypes/Enums/ErrorNumber.cs
Normal file
@@ -0,0 +1,287 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ErrorNumber.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Common types.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines enumerations of error numbers.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Enums;
|
||||
|
||||
/// <summary>Enumerates error codes. Negative for UNIX error number equivalents, positive for Aaru error numbers.</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "IdentifierTypo")]
|
||||
public enum ErrorNumber
|
||||
{
|
||||
/// <summary>Operation not permitted</summary>
|
||||
NotPermitted = -1,
|
||||
/// <summary>No such file or directory</summary>
|
||||
NoSuchFile = -2,
|
||||
/// <summary>No such process</summary>
|
||||
NoSuchProcess = -3,
|
||||
/// <summary>System call interrupted</summary>
|
||||
InterruptedSyscall = -4,
|
||||
/// <summary>I/O error</summary>
|
||||
InOutError = -5,
|
||||
/// <summary>No such device or address</summary>
|
||||
NoSuchDeviceOrAddress = -6,
|
||||
/// <summary>The argument list is too long</summary>
|
||||
ArgumentListTooLong = -7,
|
||||
/// <summary>Error loading the executable format</summary>
|
||||
ExecutableFormatError = -8,
|
||||
/// <summary>Bad file descriptor</summary>
|
||||
BadFileNumber = -9,
|
||||
/// <summary>No child process</summary>
|
||||
NoChildProcess = -10,
|
||||
/// <summary>Try again</summary>
|
||||
TryAgain = -11,
|
||||
/// <summary>Process ran out of memory</summary>
|
||||
OutOfMemory = -12,
|
||||
/// <summary>Access denied</summary>
|
||||
AccessDenied = -13,
|
||||
/// <summary>Bad address</summary>
|
||||
BadAddress = -14,
|
||||
/// <summary>File is not a block device</summary>
|
||||
NotABlockDevice = -15,
|
||||
/// <summary>Busy, cannot complete</summary>
|
||||
Busy = -16,
|
||||
/// <summary>File already exists</summary>
|
||||
FileExists = -17,
|
||||
/// <summary>Tried to create a link that crosses devices</summary>
|
||||
CrossDeviceLink = -18,
|
||||
/// <summary>No such device</summary>
|
||||
NoSuchDevice = -19,
|
||||
/// <summary>Is not a directory (e.g.: trying to ReadDir() a file)</summary>
|
||||
NotDirectory = -20,
|
||||
/// <summary>Is a directory (e.g.: trying to Read() a dir)</summary>
|
||||
IsDirectory = -21,
|
||||
/// <summary>Invalid argument</summary>
|
||||
InvalidArgument = -22,
|
||||
/// <summary>File table overflow</summary>
|
||||
FileTableOverflow = -23,
|
||||
/// <summary>Too many open files</summary>
|
||||
TooManyOpenFiles = -24,
|
||||
/// <summary>Destination is not a TTY</summary>
|
||||
NotTypewriter = -25,
|
||||
/// <summary>Text file busy</summary>
|
||||
TextFileBusy = -26,
|
||||
/// <summary>File is too large</summary>
|
||||
FileTooLarge = -27,
|
||||
/// <summary>No space left on volume</summary>
|
||||
NoSpaceLeft = -28,
|
||||
/// <summary>Illegal seek requested</summary>
|
||||
IllegalSeek = -29,
|
||||
/// <summary>Tried a write operation on a read-only device</summary>
|
||||
ReadOnly = -30,
|
||||
/// <summary>Too many links</summary>
|
||||
TooManyLinks = -31,
|
||||
/// <summary>Broken pipe</summary>
|
||||
BrokenPipe = -32,
|
||||
/// <summary>Out of domain</summary>
|
||||
OutOfDomain = -33,
|
||||
/// <summary>Out of range</summary>
|
||||
OutOfRange = -34,
|
||||
/// <summary>Operation would incur in a deadlock</summary>
|
||||
DeadlockWouldOccur = -35,
|
||||
/// <summary>Name is too long</summary>
|
||||
NameTooLong = -36,
|
||||
/// <summary>There are no available locks</summary>
|
||||
NoLocksAvailable = -37,
|
||||
/// <summary>Not implemented</summary>
|
||||
NotImplemented = -38,
|
||||
/// <summary>There is no data available</summary>
|
||||
NoData = -61,
|
||||
/// <summary>Link is severed</summary>
|
||||
SeveredLink = -67,
|
||||
/// <summary>There is no such attribute</summary>
|
||||
NoSuchExtendedAttribute = NoData,
|
||||
/// <summary>Not supported</summary>
|
||||
NotSupported = -252,
|
||||
/// <summary>Operation not permitted</summary>
|
||||
EPERM = NotPermitted,
|
||||
/// <summary>No such file or directory</summary>
|
||||
ENOENT = NoSuchFile,
|
||||
/// <summary>No such process</summary>
|
||||
ESRCH = NoSuchProcess,
|
||||
/// <summary>System call interrupted</summary>
|
||||
EINTR = InterruptedSyscall,
|
||||
/// <summary>I/O error</summary>
|
||||
EIO = InOutError,
|
||||
/// <summary>No such device or address</summary>
|
||||
ENXIO = NoSuchDeviceOrAddress,
|
||||
/// <summary>The argument list is too long</summary>
|
||||
E2BIG = ArgumentListTooLong,
|
||||
/// <summary>Error loading the executable format</summary>
|
||||
ENOEXEC = ExecutableFormatError,
|
||||
/// <summary>Bad file descriptor</summary>
|
||||
EBADF = BadFileNumber,
|
||||
/// <summary>No child process</summary>
|
||||
ECHILD = NoChildProcess,
|
||||
/// <summary>Try again</summary>
|
||||
EAGAIN = TryAgain,
|
||||
/// <summary>Process ran out of memory</summary>
|
||||
ENOMEM = OutOfMemory,
|
||||
/// <summary>Access denied</summary>
|
||||
EACCES = AccessDenied,
|
||||
/// <summary>Bad address</summary>
|
||||
EFAULT = BadAddress,
|
||||
/// <summary>File is not a block device</summary>
|
||||
ENOTBLK = NotABlockDevice,
|
||||
/// <summary>Busy, cannot complete</summary>
|
||||
EBUSY = Busy,
|
||||
/// <summary>File already exists</summary>
|
||||
EEXIST = FileExists,
|
||||
/// <summary>Tried to create a link that crosses devices</summary>
|
||||
EXDEV = CrossDeviceLink,
|
||||
/// <summary>No such device</summary>
|
||||
ENODEV = NoSuchDevice,
|
||||
/// <summary>Is not a directory (e.g.: trying to ReadDir() a file)</summary>
|
||||
ENOTDIR = NotDirectory,
|
||||
/// <summary>Is a directory (e.g.: trying to Read() a dir)</summary>
|
||||
EISDIR = IsDirectory,
|
||||
/// <summary>Invalid argument</summary>
|
||||
EINVAL = InvalidArgument,
|
||||
/// <summary>File table overflow</summary>
|
||||
ENFILE = FileTableOverflow,
|
||||
/// <summary>Too many open files</summary>
|
||||
EMFILE = TooManyOpenFiles,
|
||||
/// <summary>Destination is not a TTY</summary>
|
||||
ENOTTY = NotTypewriter,
|
||||
/// <summary>Text file busy</summary>
|
||||
ETXTBSY = TextFileBusy,
|
||||
/// <summary>File is too large</summary>
|
||||
EFBIG = FileTooLarge,
|
||||
/// <summary>No space left on volume</summary>
|
||||
ENOSPC = NoSpaceLeft,
|
||||
/// <summary>Illegal seek requested</summary>
|
||||
ESPIPE = IllegalSeek,
|
||||
/// <summary>Tried a write operation on a read-only device</summary>
|
||||
EROFS = ReadOnly,
|
||||
/// <summary>Too many links</summary>
|
||||
EMLINK = TooManyLinks,
|
||||
/// <summary>Broken pipe</summary>
|
||||
EPIPE = BrokenPipe,
|
||||
/// <summary>Out of domain</summary>
|
||||
EDOM = OutOfDomain,
|
||||
/// <summary>Out of range</summary>
|
||||
ERANGE = OutOfRange,
|
||||
/// <summary>Operation would incur in a deadlock</summary>
|
||||
EDEADLK = DeadlockWouldOccur,
|
||||
/// <summary>Name is too long</summary>
|
||||
ENAMETOOLONG = NameTooLong,
|
||||
/// <summary>There are no available locks</summary>
|
||||
ENOLCK = NoLocksAvailable,
|
||||
/// <summary>Not implemented</summary>
|
||||
ENOSYS = NotImplemented,
|
||||
/// <summary>Link is severed</summary>
|
||||
ENOLINK = SeveredLink,
|
||||
/// <summary>Not supported</summary>
|
||||
ENOTSUP = NotSupported,
|
||||
/// <summary>Directory is not empty</summary>
|
||||
DirectoryNotEmpty = -39,
|
||||
/// <summary>Too many symbolic links encountered</summary>
|
||||
TooManySymbolicLinks = -40,
|
||||
/// <summary>Directory is not empty</summary>
|
||||
ENOTEMPTY = DirectoryNotEmpty,
|
||||
/// <summary>Too many symbolic links encountered</summary>
|
||||
ELOOP = TooManySymbolicLinks,
|
||||
/// <summary>There is no such attribute</summary>
|
||||
ENOATTR = NoSuchExtendedAttribute,
|
||||
/// <summary>There is no data available</summary>
|
||||
ENODATA = NoData,
|
||||
/// <summary>No error</summary>
|
||||
NoError = 0,
|
||||
/// <summary>User requested help to be shown</summary>
|
||||
HelpRequested = 1,
|
||||
/// <summary>Command found nothing</summary>
|
||||
NothingFound = 2,
|
||||
/// <summary>Media has been already dumped completely</summary>
|
||||
AlreadyDumped = 3,
|
||||
/// <summary>Image and its sectors cannot be verified</summary>
|
||||
NotVerifiable = 4,
|
||||
/// <summary>There are bad sectors and image cannot be verified</summary>
|
||||
BadSectorsImageNotVerified = 5,
|
||||
/// <summary>All sectors are good and image cannot be verified</summary>
|
||||
CorrectSectorsImageNotVerified = 6,
|
||||
/// <summary>Image is bad and sectors cannot be verified</summary>
|
||||
BadImageSectorsNotVerified = 7,
|
||||
/// <summary>Image is bad and there are bad sectors</summary>
|
||||
BadImageBadSectors = 8,
|
||||
/// <summary>All sectors are good and image is bad</summary>
|
||||
CorrectSectorsBadImage = 9,
|
||||
/// <summary>Image is good and sectors cannot be verified</summary>
|
||||
CorrectImageSectorsNotVerified = 10,
|
||||
/// <summary>Image is good and there are bad sectors</summary>
|
||||
CorrectImageBadSectors = 11,
|
||||
/// <summary>Exception has been raised</summary>
|
||||
UnexpectedException = 12,
|
||||
/// <summary>The number of arguments is not as expected</summary>
|
||||
UnexpectedArgumentCount = 13,
|
||||
/// <summary>A required argument is not present</summary>
|
||||
MissingArgument = 14,
|
||||
/// <summary>The specified file cannot be opened</summary>
|
||||
CannotOpenFile = 15,
|
||||
/// <summary>The specified encoding cannot be found</summary>
|
||||
EncodingUnknown = 16,
|
||||
/// <summary>The image format has not been recognized</summary>
|
||||
UnrecognizedFormat = 17,
|
||||
/// <summary>The image format failed to open</summary>
|
||||
CannotOpenFormat = 18,
|
||||
/// <summary>The specified metadata sidecar does not have the correct format</summary>
|
||||
InvalidSidecar = 19,
|
||||
/// <summary>The specified resume map does not have the correct format</summary>
|
||||
InvalidResume = 20,
|
||||
/// <summary>The specified image format cannot be found</summary>
|
||||
FormatNotFound = 21,
|
||||
/// <summary>More than one format found for the specified search criteria</summary>
|
||||
TooManyFormats = 22,
|
||||
/// <summary>The specified format does not support the specified media</summary>
|
||||
UnsupportedMedia = 23,
|
||||
/// <summary>Data will be lost writing the specified format</summary>
|
||||
DataWillBeLost = 24,
|
||||
/// <summary>Cannot create destination format</summary>
|
||||
CannotCreateFormat = 25,
|
||||
/// <summary>Error writing data</summary>
|
||||
WriteError = 26,
|
||||
/// <summary>Cannot open device</summary>
|
||||
CannotOpenDevice = 27,
|
||||
/// <summary>Cannot remove the existing database</summary>
|
||||
CannotRemoveDatabase = 28,
|
||||
/// <summary>Specified sector could not be found</summary>
|
||||
SectorNotFound = 29,
|
||||
/// <summary>Image or device has not been opened</summary>
|
||||
NotOpened = 30
|
||||
}
|
||||
436
Aaru.CommonTypes/Enums/Images.cs
Normal file
436
Aaru.CommonTypes/Enums/Images.cs
Normal file
@@ -0,0 +1,436 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Images.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines enumerations to be used by disc image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// Copyright © 2020-2023 Rebecca Wallander
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Enums;
|
||||
|
||||
/// <summary>Track (as partitioning element) types.</summary>
|
||||
public enum TrackType : byte
|
||||
{
|
||||
/// <summary>Audio track</summary>
|
||||
Audio = 0,
|
||||
/// <summary>Data track (not any of the below defined ones)</summary>
|
||||
Data = 1,
|
||||
/// <summary>Data track, compact disc mode 1</summary>
|
||||
CdMode1 = 2,
|
||||
/// <summary>Data track, compact disc mode 2, formless</summary>
|
||||
CdMode2Formless = 3,
|
||||
/// <summary>Data track, compact disc mode 2, form 1</summary>
|
||||
CdMode2Form1 = 4,
|
||||
/// <summary>Data track, compact disc mode 2, form 2</summary>
|
||||
CdMode2Form2 = 5
|
||||
}
|
||||
|
||||
/// <summary>Type of subchannel in track</summary>
|
||||
public enum TrackSubchannelType : byte
|
||||
{
|
||||
/// <summary>Track does not has subchannel dumped, or it's not a CD</summary>
|
||||
None = 0,
|
||||
/// <summary>Subchannel is packed and error corrected</summary>
|
||||
Packed = 1,
|
||||
/// <summary>Subchannel is interleaved</summary>
|
||||
Raw = 2,
|
||||
/// <summary>Subchannel is packed and comes interleaved with main channel in same file</summary>
|
||||
PackedInterleaved = 3,
|
||||
/// <summary>Subchannel is interleaved and comes interleaved with main channel in same file</summary>
|
||||
RawInterleaved = 4,
|
||||
/// <summary>Only Q subchannel is stored as 16 bytes</summary>
|
||||
Q16 = 5,
|
||||
/// <summary>Only Q subchannel is stored as 16 bytes and comes interleaved with main channel in same file</summary>
|
||||
Q16Interleaved = 6
|
||||
}
|
||||
|
||||
/// <summary>Metadata present for each sector (aka, "tag").</summary>
|
||||
public enum SectorTagType
|
||||
{
|
||||
/// <summary>Apple's GCR sector tags, 12 bytes</summary>
|
||||
AppleSectorTag = 0,
|
||||
/// <summary>Sync frame from CD sector, 12 bytes</summary>
|
||||
CdSectorSync = 1,
|
||||
/// <summary>CD sector header, 4 bytes</summary>
|
||||
CdSectorHeader = 2,
|
||||
/// <summary>CD mode 2 sector subheader</summary>
|
||||
CdSectorSubHeader = 3,
|
||||
/// <summary>CD sector EDC, 4 bytes</summary>
|
||||
CdSectorEdc = 4,
|
||||
/// <summary>CD sector ECC P, 172 bytes</summary>
|
||||
CdSectorEccP = 5,
|
||||
/// <summary>CD sector ECC Q, 104 bytes</summary>
|
||||
CdSectorEccQ = 6,
|
||||
/// <summary>CD sector ECC (P and Q), 276 bytes</summary>
|
||||
CdSectorEcc = 7,
|
||||
/// <summary>CD sector subchannel, 96 bytes</summary>
|
||||
CdSectorSubchannel = 8,
|
||||
/// <summary>CD track ISRC, string, 12 bytes</summary>
|
||||
CdTrackIsrc = 9,
|
||||
/// <summary>CD track text, string, 13 bytes</summary>
|
||||
CdTrackText = 10,
|
||||
/// <summary>CD track flags, 1 byte</summary>
|
||||
CdTrackFlags = 11,
|
||||
/// <summary>DVD sector copyright information</summary>
|
||||
DvdSectorCmi = 12,
|
||||
/// <summary>Floppy address mark (contents depend on underlying floppy format)</summary>
|
||||
FloppyAddressMark = 13,
|
||||
/// <summary>DVD sector title key, 5 bytes</summary>
|
||||
DvdSectorTitleKey = 14,
|
||||
/// <summary>Decrypted DVD sector title key, 5 bytes</summary>
|
||||
DvdTitleKeyDecrypted = 15,
|
||||
/// <summary>DVD sector information, 1 bytes</summary>
|
||||
DvdSectorInformation = 16,
|
||||
/// <summary>DVD sector number, 3 bytes</summary>
|
||||
DvdSectorNumber = 17,
|
||||
/// <summary>DVD sector ID error detection, 2 bytes</summary>
|
||||
DvdSectorIed = 18,
|
||||
/// <summary>DVD sector EDC, 4 bytes</summary>
|
||||
DvdSectorEdc = 19
|
||||
}
|
||||
|
||||
/// <summary>Metadata present for each media.</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum MediaTagType
|
||||
{
|
||||
/// <summary>CD table of contents</summary>
|
||||
CD_TOC = 0,
|
||||
/// <summary>CD session information</summary>
|
||||
CD_SessionInfo = 1,
|
||||
/// <summary>CD full table of contents</summary>
|
||||
CD_FullTOC = 2,
|
||||
/// <summary>CD PMA</summary>
|
||||
CD_PMA = 3,
|
||||
/// <summary>CD Address-Time-In-Pregroove</summary>
|
||||
CD_ATIP = 4,
|
||||
/// <summary>CD-Text</summary>
|
||||
CD_TEXT = 5,
|
||||
/// <summary>CD Media Catalogue Number</summary>
|
||||
CD_MCN = 6,
|
||||
/// <summary>DVD/HD DVD Physical Format Information</summary>
|
||||
DVD_PFI = 7,
|
||||
/// <summary>DVD Lead-in Copyright Management Information</summary>
|
||||
DVD_CMI = 8,
|
||||
/// <summary>DVD disc key</summary>
|
||||
DVD_DiscKey = 9,
|
||||
/// <summary>DVD/HD DVD Burst Cutting Area</summary>
|
||||
DVD_BCA = 10,
|
||||
/// <summary>DVD/HD DVD Lead-in Disc Manufacturer Information</summary>
|
||||
DVD_DMI = 11,
|
||||
/// <summary>Media identifier</summary>
|
||||
DVD_MediaIdentifier = 12,
|
||||
/// <summary>Media key block</summary>
|
||||
DVD_MKB = 13,
|
||||
/// <summary>DVD-RAM/HD DVD-RAM DDS information</summary>
|
||||
DVDRAM_DDS = 14,
|
||||
/// <summary>DVD-RAM/HD DVD-RAM Medium status</summary>
|
||||
DVDRAM_MediumStatus = 15,
|
||||
/// <summary>DVD-RAM/HD DVD-RAM Spare area information</summary>
|
||||
DVDRAM_SpareArea = 16,
|
||||
/// <summary>DVD-R/-RW/HD DVD-R RMD in last border-out</summary>
|
||||
DVDR_RMD = 17,
|
||||
/// <summary>Pre-recorded information from DVD-R/-RW lead-in</summary>
|
||||
DVDR_PreRecordedInfo = 18,
|
||||
/// <summary>DVD-R/-RW/HD DVD-R media identifier</summary>
|
||||
DVDR_MediaIdentifier = 19,
|
||||
/// <summary>DVD-R/-RW/HD DVD-R physical format information</summary>
|
||||
DVDR_PFI = 20,
|
||||
/// <summary>ADIP information</summary>
|
||||
DVD_ADIP = 21,
|
||||
/// <summary>HD DVD Lead-in copyright protection information</summary>
|
||||
HDDVD_CPI = 22,
|
||||
/// <summary>HD DVD-R Medium Status</summary>
|
||||
HDDVD_MediumStatus = 23,
|
||||
/// <summary>DVD+/-R DL Layer capacity</summary>
|
||||
DVDDL_LayerCapacity = 24,
|
||||
/// <summary>DVD-R DL Middle Zone start address</summary>
|
||||
DVDDL_MiddleZoneAddress = 25,
|
||||
/// <summary>DVD-R DL Jump Interval Size</summary>
|
||||
DVDDL_JumpIntervalSize = 26,
|
||||
/// <summary>DVD-R DL Start LBA of the manual layer jump</summary>
|
||||
DVDDL_ManualLayerJumpLBA = 27,
|
||||
/// <summary>Blu-ray Disc Information</summary>
|
||||
BD_DI = 28,
|
||||
/// <summary>Blu-ray Burst Cutting Area</summary>
|
||||
BD_BCA = 29,
|
||||
/// <summary>Blu-ray Disc Definition Structure</summary>
|
||||
BD_DDS = 30,
|
||||
/// <summary>Blu-ray Cartridge Status</summary>
|
||||
BD_CartridgeStatus = 31,
|
||||
/// <summary>Blu-ray Status of Spare Area</summary>
|
||||
BD_SpareArea = 32,
|
||||
/// <summary>AACS volume identifier</summary>
|
||||
AACS_VolumeIdentifier = 33,
|
||||
/// <summary>AACS pre-recorded media serial number</summary>
|
||||
AACS_SerialNumber = 34,
|
||||
/// <summary>AACS media identifier</summary>
|
||||
AACS_MediaIdentifier = 35,
|
||||
/// <summary>Lead-in AACS media key block</summary>
|
||||
AACS_MKB = 36,
|
||||
/// <summary>AACS data keys</summary>
|
||||
AACS_DataKeys = 37,
|
||||
/// <summary>LBA extents flagged for bus encryption by AACS</summary>
|
||||
AACS_LBAExtents = 38,
|
||||
/// <summary>CPRM media key block in Lead-in</summary>
|
||||
AACS_CPRM_MKB = 39,
|
||||
/// <summary>Recognized layer formats in hybrid discs</summary>
|
||||
Hybrid_RecognizedLayers = 40,
|
||||
/// <summary>Disc write protection status</summary>
|
||||
MMC_WriteProtection = 41,
|
||||
/// <summary>Disc standard information</summary>
|
||||
MMC_DiscInformation = 42,
|
||||
/// <summary>Disc track resources information</summary>
|
||||
MMC_TrackResourcesInformation = 43,
|
||||
/// <summary>BD-R Pseudo-overwrite information</summary>
|
||||
MMC_POWResourcesInformation = 44,
|
||||
/// <summary>SCSI INQUIRY response</summary>
|
||||
SCSI_INQUIRY = 45,
|
||||
/// <summary>SCSI MODE PAGE 2Ah</summary>
|
||||
SCSI_MODEPAGE_2A = 46,
|
||||
/// <summary>ATA IDENTIFY DEVICE response</summary>
|
||||
ATA_IDENTIFY = 47,
|
||||
/// <summary>ATA IDENTIFY PACKET DEVICE response</summary>
|
||||
ATAPI_IDENTIFY = 48,
|
||||
/// <summary>PCMCIA/CardBus Card Information Structure</summary>
|
||||
PCMCIA_CIS = 49,
|
||||
/// <summary>SecureDigital CID</summary>
|
||||
SD_CID = 50,
|
||||
/// <summary>SecureDigital CSD</summary>
|
||||
SD_CSD = 51,
|
||||
/// <summary>SecureDigital SCR</summary>
|
||||
SD_SCR = 52,
|
||||
/// <summary>SecureDigital OCR</summary>
|
||||
SD_OCR = 53,
|
||||
/// <summary>MultiMediaCard CID</summary>
|
||||
MMC_CID = 54,
|
||||
/// <summary>MultiMediaCard CSD</summary>
|
||||
MMC_CSD = 55,
|
||||
/// <summary>MultiMediaCard OCR</summary>
|
||||
MMC_OCR = 56,
|
||||
/// <summary>MultiMediaCard Extended CSD</summary>
|
||||
MMC_ExtendedCSD = 57,
|
||||
/// <summary>Xbox Security Sector</summary>
|
||||
Xbox_SecuritySector = 58,
|
||||
/// <summary>
|
||||
/// On floppy disks, data in last cylinder usually in a different format that contains duplication or
|
||||
/// manufacturing information
|
||||
/// </summary>
|
||||
Floppy_LeadOut = 59,
|
||||
/// <summary>DVD Disc Control Blocks</summary>
|
||||
DCB = 60,
|
||||
/// <summary>Compact Disc First Track Pregap</summary>
|
||||
CD_FirstTrackPregap = 61,
|
||||
/// <summary>Compact Disc Lead-out</summary>
|
||||
CD_LeadOut = 62,
|
||||
/// <summary>SCSI MODE SENSE (6)</summary>
|
||||
SCSI_MODESENSE_6 = 63,
|
||||
/// <summary>SCSI MODE SENSE (10)</summary>
|
||||
SCSI_MODESENSE_10 = 64,
|
||||
/// <summary>USB descriptors</summary>
|
||||
USB_Descriptors = 65,
|
||||
/// <summary>XGD unlocked DMI</summary>
|
||||
Xbox_DMI = 66,
|
||||
/// <summary>XDG unlocked PFI</summary>
|
||||
Xbox_PFI = 67,
|
||||
/// <summary>Compact Disc Lead-in</summary>
|
||||
CD_LeadIn = 68,
|
||||
/// <summary>8 bytes response that seems to define type of MiniDisc</summary>
|
||||
MiniDiscType = 69,
|
||||
/// <summary>4 bytes response to vendor command D5h</summary>
|
||||
MiniDiscD5 = 70,
|
||||
/// <summary>User TOC, contains fragments, track names, and can be from 1 to 3 sectors of 2336 bytes</summary>
|
||||
MiniDiscUTOC = 71,
|
||||
/// <summary>Not entirely clear kind of TOC that only appears on MD-DATA discs</summary>
|
||||
MiniDiscDTOC = 72,
|
||||
/// <summary>Decrypted DVD disc key</summary>
|
||||
DVD_DiscKey_Decrypted = 73
|
||||
}
|
||||
|
||||
/// <summary>Enumeration of media types defined in metadata</summary>
|
||||
public enum MetadataMediaType : byte
|
||||
{
|
||||
/// <summary>Purely optical discs</summary>
|
||||
OpticalDisc = 0,
|
||||
/// <summary>Media that is physically block-based or abstracted like that</summary>
|
||||
BlockMedia = 1,
|
||||
/// <summary>Media that can be accessed by-byte or by-bit, like chips</summary>
|
||||
LinearMedia = 2,
|
||||
/// <summary>Media that can only store data when it is modulated to audio</summary>
|
||||
AudioMedia = 3
|
||||
}
|
||||
|
||||
/// <summary> CD flags bitmask</summary>
|
||||
[Flags]
|
||||
public enum CdFlags : byte
|
||||
{
|
||||
/// <summary>Track is quadraphonic.</summary>
|
||||
FourChannel = 0x08,
|
||||
/// <summary>Track is non-audio (data).</summary>
|
||||
DataTrack = 0x04,
|
||||
/// <summary>Track is copy protected.</summary>
|
||||
CopyPermitted = 0x02,
|
||||
/// <summary>Track has pre-emphasis.</summary>
|
||||
PreEmphasis = 0x01
|
||||
}
|
||||
|
||||
/// <summary>Status of a requested floppy sector</summary>
|
||||
[Flags]
|
||||
public enum FloppySectorStatus : byte
|
||||
{
|
||||
/// <summary>Both address mark and data checksums are correct.</summary>
|
||||
Correct = 0x01,
|
||||
/// <summary>Data checksum is incorrect.</summary>
|
||||
DataError = 0x02,
|
||||
/// <summary>Address mark checksum is incorrect.</summary>
|
||||
AddressMarkError = 0x04,
|
||||
/// <summary>There is another sector in the same track/head with same sector id.</summary>
|
||||
Duplicated = 0x08,
|
||||
/// <summary>Sector data section is not magnetized.</summary>
|
||||
Demagnetized = 0x10,
|
||||
/// <summary>Sector data section has a physically visible hole.</summary>
|
||||
Hole = 0x20,
|
||||
/// <summary>There is no address mark containing the requested sector id in the track/head.</summary>
|
||||
NotFound = 0x40
|
||||
}
|
||||
|
||||
/// <summary>Types of floppy disks</summary>
|
||||
public enum FloppyTypes : byte
|
||||
{
|
||||
/// <summary>8" floppy</summary>
|
||||
Floppy,
|
||||
/// <summary>5.25" floppy</summary>
|
||||
MiniFloppy,
|
||||
/// <summary>3.5" floppy</summary>
|
||||
MicroFloppy,
|
||||
/// <summary>3" floppy</summary>
|
||||
CompactFloppy,
|
||||
/// <summary>5.25" twiggy</summary>
|
||||
FileWare,
|
||||
/// <summary>2.5" quickdisk</summary>
|
||||
QuickDisk
|
||||
}
|
||||
|
||||
/// <summary>Enumeration of floppy densities</summary>
|
||||
public enum FloppyDensities : byte
|
||||
{
|
||||
/// <summary>Standard coercivity (about 300Oe as found in 8" and 5.25"-double-density disks).</summary>
|
||||
Standard,
|
||||
/// <summary>Double density coercivity (about 600Oe as found in 5.25" HD and 3.5" DD disks).</summary>
|
||||
Double,
|
||||
/// <summary>High density coercivity (about 700Oe as found in 3.5" HD disks).</summary>
|
||||
High,
|
||||
/// <summary>Extended density coercivity (about 750Oe as found in 3.5" ED disks).</summary>
|
||||
Extended
|
||||
}
|
||||
|
||||
/// <summary>Capabilities for optical media image formats</summary>
|
||||
[Flags]
|
||||
public enum OpticalImageCapabilities : ulong
|
||||
{
|
||||
/// <summary>Can store Red Book audio tracks?</summary>
|
||||
CanStoreAudioTracks = 0x01,
|
||||
/// <summary>Can store CD-V analogue video tracks?</summary>
|
||||
CanStoreVideoTracks = 0x02,
|
||||
/// <summary>Can store Yellow Book data tracks?</summary>
|
||||
CanStoreDataTracks = 0x03,
|
||||
/// <summary>Can store pregaps without needing to interpret the subchannel?</summary>
|
||||
CanStorePregaps = 0x04,
|
||||
/// <summary>Can store indexes without needing to interpret the subchannel?</summary>
|
||||
CanStoreIndexes = 0x08,
|
||||
/// <summary>Can store raw P to W subchannel data?</summary>
|
||||
CanStoreSubchannelRw = 0x10,
|
||||
/// <summary>Can store more than one session?</summary>
|
||||
CanStoreSessions = 0x20,
|
||||
/// <summary>Can store track ISRCs without needing to interpret the subchannel?</summary>
|
||||
CanStoreIsrc = 0x40,
|
||||
/// <summary>Can store Lead-In's CD-TEXT?</summary>
|
||||
CanStoreCdText = 0x80,
|
||||
/// <summary>Can store the MCN without needing to interpret the subchannel?</summary>
|
||||
CanStoreMcn = 0x100,
|
||||
/// <summary>Can store the whole 2352 bytes of a sector?</summary>
|
||||
CanStoreRawData = 0x200,
|
||||
/// <summary>Can store more than 1 session in media that is not CD based (DVD et al)?</summary>
|
||||
CanStoreNotCdSessions = 0x2000,
|
||||
/// <summary>Can store more than 1 track in media that is not CD based (DVD et al)?</summary>
|
||||
CanStoreNotCdTracks = 0x4000,
|
||||
/// <summary>Can store hidden tracks with a type different from track 1?</summary>
|
||||
CanStoreHiddenTracks = 0x8000,
|
||||
|
||||
// TODO: Implement
|
||||
/// <summary>Can store scrambled data?</summary>
|
||||
CanStoreScrambledData = 0x400,
|
||||
/// <summary>Can store only the user area of a sector (2048, 2324, etc)?</summary>
|
||||
CanStoreCookedData = 0x800,
|
||||
/// <summary>Can store more than 1 track?</summary>
|
||||
CanStoreMultipleTracks = 0x1000
|
||||
}
|
||||
|
||||
/// <summary>Enumeration of linear memory device types</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum LinearMemoryType
|
||||
{
|
||||
/// <summary>Unknown device type</summary>
|
||||
Unknown = 0,
|
||||
/// <summary>Read-only memory</summary>
|
||||
ROM = 1,
|
||||
/// <summary>Read-write memory, power-off persistent, used to save data</summary>
|
||||
SaveRAM = 2,
|
||||
/// <summary>Read-write volatile memory</summary>
|
||||
WorkRAM = 3,
|
||||
/// <summary>NOR flash memory</summary>
|
||||
NOR = 4,
|
||||
/// <summary>NAND flash memory</summary>
|
||||
NAND = 5,
|
||||
/// <summary>Memory mapper device</summary>
|
||||
Mapper = 6,
|
||||
/// <summary>Processor, CPU, DSP, etc</summary>
|
||||
Processor = 7,
|
||||
/// <summary>Programmable Array Logic</summary>
|
||||
PAL = 8,
|
||||
/// <summary>Generic Array Logic</summary>
|
||||
GAL = 9,
|
||||
/// <summary>Electronically Erasable Programmable Read Only Memory</summary>
|
||||
EEPROM = 10,
|
||||
/// <summary>Read-only memory, character</summary>
|
||||
CharacterROM = 11,
|
||||
/// <summary>Read-write volatile memory for character</summary>
|
||||
CharacterRAM = 12,
|
||||
/// <summary>Trainer, or hack</summary>
|
||||
Trainer = 13
|
||||
}
|
||||
127
Aaru.CommonTypes/Enums/Nes.cs
Normal file
127
Aaru.CommonTypes/Enums/Nes.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Enums;
|
||||
|
||||
public enum NesConsoleType : byte
|
||||
{
|
||||
Nes = 0,
|
||||
Vs = 1,
|
||||
Playchoice = 2,
|
||||
Extended = 3
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public enum NesTimingMode : byte
|
||||
{
|
||||
RP2C02 = 0,
|
||||
RP2C07 = 1,
|
||||
Multiple = 2,
|
||||
UMC6527P = 3
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public enum NesVsPpuType : byte
|
||||
{
|
||||
RP2C03B = 0,
|
||||
RP2C03G = 1,
|
||||
RP2C04_0001 = 2,
|
||||
RP2C04_0002 = 3,
|
||||
RP2C04_0003 = 4,
|
||||
RP2C04_0004 = 5,
|
||||
RC2C03B = 6,
|
||||
RC2C03C = 7,
|
||||
RC2C05_01 = 8,
|
||||
RC2C05_02 = 9,
|
||||
RC2C05_03 = 10,
|
||||
RC2C05_04 = 11,
|
||||
RC2C05_05 = 12
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public enum NesVsHardwareType : byte
|
||||
{
|
||||
Normal = 0,
|
||||
RBI = 1,
|
||||
TKO = 2,
|
||||
SuperXevious = 3,
|
||||
IceClimber = 4,
|
||||
Dual = 5,
|
||||
RaidOnBungeling = 6
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public enum NesExtendedConsoleType : byte
|
||||
{
|
||||
Normal = 0,
|
||||
Vs = 1,
|
||||
Playchoice = 2,
|
||||
DecimalMode = 3,
|
||||
VT01_Monochrome = 4,
|
||||
VT01 = 5,
|
||||
VT02 = 6,
|
||||
VT03 = 7,
|
||||
VT09 = 8,
|
||||
VT32 = 9,
|
||||
VT369 = 10,
|
||||
UM6578 = 11
|
||||
}
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public enum NesDefaultExpansionDevice : byte
|
||||
{
|
||||
Unspecified = 0,
|
||||
Controller = 1,
|
||||
FourScore = 2,
|
||||
FourPlayersAdapter = 3,
|
||||
Vs = 4,
|
||||
VsSystem = 5,
|
||||
VsPinball = 6,
|
||||
VsZapper = 7,
|
||||
Zapper = 8,
|
||||
TwoZappers = 9,
|
||||
HyperShotLightgun = 0xA,
|
||||
PowerPadSideA = 0xB,
|
||||
PowerPadSideB = 0xC,
|
||||
FamilyTrainerSideA = 0xD,
|
||||
FamilyTrainerSideB = 0xE,
|
||||
ArkanoidVaus = 0xF,
|
||||
ArkanoidVausFamicom = 0x10,
|
||||
TwoVausDataRecorder = 0x11,
|
||||
HyperShotController = 0x12,
|
||||
CoconutsPachinko = 0x13,
|
||||
ExcitingBoxing = 0x14,
|
||||
JissenMahjong = 0x15,
|
||||
PartyTap = 0x16,
|
||||
OekaKidsTablet = 0x17,
|
||||
SunsoftBarcodeBattler = 0x18,
|
||||
PianoKeyboard = 0x19,
|
||||
PokkunMoguraa = 0x1A,
|
||||
TopRider = 0x1B,
|
||||
DoubleFisted = 0x1C,
|
||||
Famicom3DSystem = 0x1D,
|
||||
DoremikkoKeyboard = 0x1E,
|
||||
GyroSet = 0x1F,
|
||||
DataRecorder = 0x20,
|
||||
TurboFile = 0x21,
|
||||
StorageBattleBox = 0x22,
|
||||
FamilyBASICKeyboardDataRecorder = 0x23,
|
||||
DongdaKeyboard = 0x24,
|
||||
BitCorpKeyboard = 0x25,
|
||||
SuborKeyboard = 0x26,
|
||||
SuborKeyboardMouse = 0x27,
|
||||
SuborKeyboardMouse24 = 0x28,
|
||||
SNESMouse = 0x29,
|
||||
Multicart = 0x2A,
|
||||
SNESControllers = 0x2B,
|
||||
RacerMateBicycle = 0x2C,
|
||||
UForce = 0x2D,
|
||||
StackUp = 0x2E,
|
||||
PatrolmanLightgun = 0x2F,
|
||||
C1CassetteInterface = 0x30,
|
||||
SwappedController = 0x31,
|
||||
SudokuPad = 0x32,
|
||||
ABLPinball = 0x33,
|
||||
GoldenNuggetCasino = 0x34
|
||||
}
|
||||
250
Aaru.CommonTypes/Extents/ExtentsByte.cs
Normal file
250
Aaru.CommonTypes/Extents/ExtentsByte.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsByte.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for byte types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="byte" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public sealed class ExtentsByte
|
||||
{
|
||||
List<Tuple<byte, byte>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsByte() => _backend = new List<Tuple<byte, byte>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsByte(IEnumerable<Tuple<byte, byte>> list)
|
||||
{
|
||||
_backend = new List<Tuple<byte, byte>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<byte, byte> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(byte item)
|
||||
{
|
||||
Tuple<byte, byte> removeOne = null;
|
||||
Tuple<byte, byte> removeTwo = null;
|
||||
Tuple<byte, byte> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<byte, byte>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<byte, byte>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<byte, byte>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<byte, byte>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<byte, byte>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(byte start, byte end, bool run = false)
|
||||
{
|
||||
byte realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = (byte)(start + end - 1);
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(byte t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(byte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(byte item)
|
||||
{
|
||||
Tuple<byte, byte> toRemove = null;
|
||||
Tuple<byte, byte> toAddOne = null;
|
||||
Tuple<byte, byte> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<byte, byte> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<byte, byte>(extent.Item1, (byte)(item - 1));
|
||||
toAddTwo = new Tuple<byte, byte>((byte)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<byte, byte>((byte)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<byte, byte>(extent.Item1, (byte)(item - 1));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<byte, byte>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(byte item, out byte start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<byte, byte> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
84
Aaru.CommonTypes/Extents/ExtentsConverter.cs
Normal file
84
Aaru.CommonTypes/Extents/ExtentsConverter.cs
Normal file
@@ -0,0 +1,84 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsConverter.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : XML metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Converts extents to/from XML.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Converts extents</summary>
|
||||
public static class ExtentsConverter
|
||||
{
|
||||
/// <summary>Converts unsigned long integer extents into XML based extents</summary>
|
||||
/// <param name="extents">Extents</param>
|
||||
/// <returns>XML based extents</returns>
|
||||
public static List<Extent> ToMetadata(ExtentsULong extents)
|
||||
{
|
||||
if(extents == null)
|
||||
return null;
|
||||
|
||||
Tuple<ulong, ulong>[] tuples = extents.ToArray();
|
||||
List<Extent> list = new();
|
||||
|
||||
for(ulong i = 0; i < (ulong)tuples.LongLength; i++)
|
||||
{
|
||||
list.Add(new Extent
|
||||
{
|
||||
Start = tuples[i].Item1,
|
||||
End = tuples[i].Item2
|
||||
});
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>Converts XML based extents into unsigned long integer extents</summary>
|
||||
/// <param name="extents">XML based extents</param>
|
||||
/// <returns>Extents</returns>
|
||||
public static ExtentsULong FromMetadata(IEnumerable<Extent> extents)
|
||||
{
|
||||
if(extents == null)
|
||||
return null;
|
||||
|
||||
var tuples = extents.Select(extent => new Tuple<ulong, ulong>(extent.Start, extent.End)).ToList();
|
||||
|
||||
return new ExtentsULong(tuples);
|
||||
}
|
||||
}
|
||||
250
Aaru.CommonTypes/Extents/ExtentsInt.cs
Normal file
250
Aaru.CommonTypes/Extents/ExtentsInt.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsInt.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for int types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="int" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public sealed class ExtentsInt
|
||||
{
|
||||
List<Tuple<int, int>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsInt() => _backend = new List<Tuple<int, int>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsInt(IEnumerable<Tuple<int, int>> list)
|
||||
{
|
||||
_backend = new List<Tuple<int, int>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<int, int> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(int item)
|
||||
{
|
||||
Tuple<int, int> removeOne = null;
|
||||
Tuple<int, int> removeTwo = null;
|
||||
Tuple<int, int> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<int, int>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<int, int>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<int, int>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<int, int>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<int, int>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(int start, int end, bool run = false)
|
||||
{
|
||||
int realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = start + end - 1;
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(int t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(int item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(int item)
|
||||
{
|
||||
Tuple<int, int> toRemove = null;
|
||||
Tuple<int, int> toAddOne = null;
|
||||
Tuple<int, int> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<int, int> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<int, int>(extent.Item1, item - 1);
|
||||
toAddTwo = new Tuple<int, int>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<int, int>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<int, int>(extent.Item1, item - 1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<int, int>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(int item, out int start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<int, int> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
249
Aaru.CommonTypes/Extents/ExtentsLong.cs
Normal file
249
Aaru.CommonTypes/Extents/ExtentsLong.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsLong.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for long types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="long" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
public sealed class ExtentsLong
|
||||
{
|
||||
List<Tuple<long, long>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsLong() => _backend = new List<Tuple<long, long>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsLong(IEnumerable<Tuple<long, long>> list)
|
||||
{
|
||||
_backend = new List<Tuple<long, long>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<long, long> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(long item)
|
||||
{
|
||||
Tuple<long, long> removeOne = null;
|
||||
Tuple<long, long> removeTwo = null;
|
||||
Tuple<long, long> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<long, long>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<long, long>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<long, long>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<long, long>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<long, long>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(long start, long end, bool run = false)
|
||||
{
|
||||
long realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = start + end - 1;
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(long t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(long item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(long item)
|
||||
{
|
||||
Tuple<long, long> toRemove = null;
|
||||
Tuple<long, long> toAddOne = null;
|
||||
Tuple<long, long> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<long, long> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<long, long>(extent.Item1, item - 1);
|
||||
toAddTwo = new Tuple<long, long>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<long, long>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<long, long>(extent.Item1, item - 1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<long, long>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(long item, out long start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<long, long> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
250
Aaru.CommonTypes/Extents/ExtentsSByte.cs
Normal file
250
Aaru.CommonTypes/Extents/ExtentsSByte.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsSByte.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for sbyte types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="sbyte" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
public sealed class ExtentsSByte
|
||||
{
|
||||
List<Tuple<sbyte, sbyte>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsSByte() => _backend = new List<Tuple<sbyte, sbyte>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsSByte(IEnumerable<Tuple<sbyte, sbyte>> list)
|
||||
{
|
||||
_backend = new List<Tuple<sbyte, sbyte>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<sbyte, sbyte> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(sbyte item)
|
||||
{
|
||||
Tuple<sbyte, sbyte> removeOne = null;
|
||||
Tuple<sbyte, sbyte> removeTwo = null;
|
||||
Tuple<sbyte, sbyte> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<sbyte, sbyte>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<sbyte, sbyte>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<sbyte, sbyte>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<sbyte, sbyte>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<sbyte, sbyte>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(sbyte start, sbyte end, bool run = false)
|
||||
{
|
||||
sbyte realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = (sbyte)(start + end - 1);
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(sbyte t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(sbyte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(sbyte item)
|
||||
{
|
||||
Tuple<sbyte, sbyte> toRemove = null;
|
||||
Tuple<sbyte, sbyte> toAddOne = null;
|
||||
Tuple<sbyte, sbyte> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<sbyte, sbyte> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<sbyte, sbyte>(extent.Item1, (sbyte)(item - 1));
|
||||
toAddTwo = new Tuple<sbyte, sbyte>((sbyte)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<sbyte, sbyte>((sbyte)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<sbyte, sbyte>(extent.Item1, (sbyte)(item - 1));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<sbyte, sbyte>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(sbyte item, out sbyte start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<sbyte, sbyte> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
250
Aaru.CommonTypes/Extents/ExtentsShort.cs
Normal file
250
Aaru.CommonTypes/Extents/ExtentsShort.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsShort.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for short types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="short" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
public sealed class ExtentsShort
|
||||
{
|
||||
List<Tuple<short, short>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsShort() => _backend = new List<Tuple<short, short>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsShort(IEnumerable<Tuple<short, short>> list)
|
||||
{
|
||||
_backend = new List<Tuple<short, short>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<short, short> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(short item)
|
||||
{
|
||||
Tuple<short, short> removeOne = null;
|
||||
Tuple<short, short> removeTwo = null;
|
||||
Tuple<short, short> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<short, short>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<short, short>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<short, short>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<short, short>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<short, short>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(short start, short end, bool run = false)
|
||||
{
|
||||
short realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = (short)(start + end - 1);
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(short t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(short item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(short item)
|
||||
{
|
||||
Tuple<short, short> toRemove = null;
|
||||
Tuple<short, short> toAddOne = null;
|
||||
Tuple<short, short> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<short, short> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<short, short>(extent.Item1, (short)(item - 1));
|
||||
toAddTwo = new Tuple<short, short>((short)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<short, short>((short)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<short, short>(extent.Item1, (short)(item - 1));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<short, short>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(short item, out short start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<short, short> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
250
Aaru.CommonTypes/Extents/ExtentsUInt.cs
Normal file
250
Aaru.CommonTypes/Extents/ExtentsUInt.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsUInt.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for uint types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="uint" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
public sealed class ExtentsUInt
|
||||
{
|
||||
List<Tuple<uint, uint>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsUInt() => _backend = new List<Tuple<uint, uint>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsUInt(IEnumerable<Tuple<uint, uint>> list)
|
||||
{
|
||||
_backend = new List<Tuple<uint, uint>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<uint, uint> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(uint item)
|
||||
{
|
||||
Tuple<uint, uint> removeOne = null;
|
||||
Tuple<uint, uint> removeTwo = null;
|
||||
Tuple<uint, uint> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<uint, uint>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<uint, uint>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<uint, uint>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<uint, uint>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<uint, uint>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(uint start, uint end, bool run = false)
|
||||
{
|
||||
uint realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = start + end - 1;
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(uint t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(uint item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(uint item)
|
||||
{
|
||||
Tuple<uint, uint> toRemove = null;
|
||||
Tuple<uint, uint> toAddOne = null;
|
||||
Tuple<uint, uint> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<uint, uint> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<uint, uint>(extent.Item1, item - 1);
|
||||
toAddTwo = new Tuple<uint, uint>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<uint, uint>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<uint, uint>(extent.Item1, item - 1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<uint, uint>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(uint item, out uint start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<uint, uint> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
250
Aaru.CommonTypes/Extents/ExtentsULong.cs
Normal file
250
Aaru.CommonTypes/Extents/ExtentsULong.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsULong.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for ulong types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="ulong" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBeInternal")]
|
||||
public sealed class ExtentsULong
|
||||
{
|
||||
List<Tuple<ulong, ulong>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsULong() => _backend = new List<Tuple<ulong, ulong>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsULong(IEnumerable<Tuple<ulong, ulong>> list)
|
||||
{
|
||||
_backend = new List<Tuple<ulong, ulong>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<ulong, ulong> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(ulong item)
|
||||
{
|
||||
Tuple<ulong, ulong> removeOne = null;
|
||||
Tuple<ulong, ulong> removeTwo = null;
|
||||
Tuple<ulong, ulong> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<ulong, ulong>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<ulong, ulong>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<ulong, ulong>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<ulong, ulong>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<ulong, ulong>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(ulong start, ulong end, bool run = false)
|
||||
{
|
||||
ulong realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = start + end - 1;
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(ulong t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(ulong item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(ulong item)
|
||||
{
|
||||
Tuple<ulong, ulong> toRemove = null;
|
||||
Tuple<ulong, ulong> toAddOne = null;
|
||||
Tuple<ulong, ulong> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<ulong, ulong> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<ulong, ulong>(extent.Item1, item - 1);
|
||||
toAddTwo = new Tuple<ulong, ulong>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<ulong, ulong>(item + 1, extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<ulong, ulong>(extent.Item1, item - 1);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<ulong, ulong>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(ulong item, out ulong start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<ulong, ulong> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
250
Aaru.CommonTypes/Extents/ExtentsUShort.cs
Normal file
250
Aaru.CommonTypes/Extents/ExtentsUShort.cs
Normal file
@@ -0,0 +1,250 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ExtentsUShort.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Extent helpers.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides extents for ushort types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="ushort" /></summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
public sealed class ExtentsUShort
|
||||
{
|
||||
List<Tuple<ushort, ushort>> _backend;
|
||||
|
||||
/// <summary>Initialize an empty list of extents</summary>
|
||||
public ExtentsUShort() => _backend = new List<Tuple<ushort, ushort>>();
|
||||
|
||||
/// <summary>Initializes extents with an specific list</summary>
|
||||
/// <param name="list">List of extents as tuples "start, end"</param>
|
||||
public ExtentsUShort(IEnumerable<Tuple<ushort, ushort>> list)
|
||||
{
|
||||
_backend = new List<Tuple<ushort, ushort>>();
|
||||
|
||||
// This ensure no overlapping extents are added on creation
|
||||
foreach(Tuple<ushort, ushort> t in list)
|
||||
Add(t.Item1, t.Item2);
|
||||
}
|
||||
|
||||
/// <summary>Gets a count of how many extents are stored</summary>
|
||||
public int Count => _backend.Count;
|
||||
|
||||
/// <summary>Adds the specified number to the corresponding extent, or creates a new one</summary>
|
||||
/// <param name="item"></param>
|
||||
public void Add(ushort item)
|
||||
{
|
||||
Tuple<ushort, ushort> removeOne = null;
|
||||
Tuple<ushort, ushort> removeTwo = null;
|
||||
Tuple<ushort, ushort> itemToAdd = null;
|
||||
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 && item <= _backend[i].Item2)
|
||||
return;
|
||||
|
||||
// Expands existing extent start
|
||||
if(item == _backend[i].Item1 - 1)
|
||||
{
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i > 0 && item == _backend[i - 1].Item2 + 1)
|
||||
{
|
||||
removeTwo = _backend[i - 1];
|
||||
itemToAdd = new Tuple<ushort, ushort>(_backend[i - 1].Item1, _backend[i].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<ushort, ushort>(item, _backend[i].Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Expands existing extent end
|
||||
if(item != _backend[i].Item2 + 1)
|
||||
continue;
|
||||
|
||||
removeOne = _backend[i];
|
||||
|
||||
if(i < _backend.Count - 1 && item == _backend[i + 1].Item1 - 1)
|
||||
{
|
||||
removeTwo = _backend[i + 1];
|
||||
itemToAdd = new Tuple<ushort, ushort>(_backend[i].Item1, _backend[i + 1].Item2);
|
||||
}
|
||||
else
|
||||
itemToAdd = new Tuple<ushort, ushort>(_backend[i].Item1, item);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if(itemToAdd != null)
|
||||
{
|
||||
_backend.Remove(removeOne);
|
||||
_backend.Remove(removeTwo);
|
||||
_backend.Add(itemToAdd);
|
||||
}
|
||||
else
|
||||
_backend.Add(new Tuple<ushort, ushort>(item, item));
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
}
|
||||
|
||||
/// <summary>Adds a new extent</summary>
|
||||
/// <param name="start">First element of the extent</param>
|
||||
/// <param name="end">
|
||||
/// Last element of the extent or if <see cref="run" /> is <c>true</c> how many elements the extent runs
|
||||
/// for
|
||||
/// </param>
|
||||
/// <param name="run">If set to <c>true</c>, <see cref="end" /> indicates how many elements the extent runs for</param>
|
||||
public void Add(ushort start, ushort end, bool run = false)
|
||||
{
|
||||
ushort realEnd;
|
||||
|
||||
if(run)
|
||||
realEnd = (ushort)(start + end - 1);
|
||||
else
|
||||
realEnd = end;
|
||||
|
||||
// TODO: Optimize this
|
||||
for(ushort t = start; t <= realEnd; t++)
|
||||
Add(t);
|
||||
}
|
||||
|
||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||
/// <param name="item">Item to search for</param>
|
||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||
public bool Contains(ushort item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||
|
||||
/// <summary>Removes all extents from this instance</summary>
|
||||
public void Clear() => _backend.Clear();
|
||||
|
||||
/// <summary>Removes an item from the extents in this instance</summary>
|
||||
/// <param name="item">Item to remove</param>
|
||||
/// <returns><c>true</c> if the item was contained in a known extent and removed, false otherwise</returns>
|
||||
public bool Remove(ushort item)
|
||||
{
|
||||
Tuple<ushort, ushort> toRemove = null;
|
||||
Tuple<ushort, ushort> toAddOne = null;
|
||||
Tuple<ushort, ushort> toAddTwo = null;
|
||||
|
||||
foreach(Tuple<ushort, ushort> extent in _backend)
|
||||
{
|
||||
// Extent is contained and not a border
|
||||
if(item > extent.Item1 && item < extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<ushort, ushort>(extent.Item1, (ushort)(item - 1));
|
||||
toAddTwo = new Tuple<ushort, ushort>((ushort)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is left border, but not only element
|
||||
if(item == extent.Item1 && item != extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<ushort, ushort>((ushort)(item + 1), extent.Item2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is right border, but not only element
|
||||
if(item != extent.Item1 && item == extent.Item2)
|
||||
{
|
||||
toRemove = extent;
|
||||
toAddOne = new Tuple<ushort, ushort>(extent.Item1, (ushort)(item - 1));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Extent is only element
|
||||
if(item != extent.Item1 || item != extent.Item2)
|
||||
continue;
|
||||
|
||||
toRemove = extent;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Item not found
|
||||
if(toRemove == null)
|
||||
return false;
|
||||
|
||||
_backend.Remove(toRemove);
|
||||
|
||||
if(toAddOne != null)
|
||||
_backend.Add(toAddOne);
|
||||
|
||||
if(toAddTwo != null)
|
||||
_backend.Add(toAddTwo);
|
||||
|
||||
// Sort
|
||||
_backend = _backend.OrderBy(t => t.Item1).ToList();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the list of extents to an array of <see cref="Tuple" /> where T1 is first element of the extent and
|
||||
/// T2 is last element
|
||||
/// </summary>
|
||||
/// <returns>Array of <see cref="Tuple" /></returns>
|
||||
public Tuple<ushort, ushort>[] ToArray() => _backend.ToArray();
|
||||
|
||||
/// <summary>Gets the first element of the extent that contains the specified item</summary>
|
||||
/// <param name="item">Item</param>
|
||||
/// <param name="start">First element of extent</param>
|
||||
/// <returns><c>true</c> if item was found in an extent, false otherwise</returns>
|
||||
public bool GetStart(ushort item, out ushort start)
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<ushort, ushort> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
144
Aaru.CommonTypes/Geometry.cs
Normal file
144
Aaru.CommonTypes/Geometry.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Geometry.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : CommonTypes.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Includes geometry for several medias.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
/// <summary>Handles CHS geometries</summary>
|
||||
public static class Geometry
|
||||
{
|
||||
/// <summary>List of known disk geometries</summary>
|
||||
public static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding
|
||||
encoding, bool variableSectorsPerTrack, MediaType type)[] KnownGeometries =
|
||||
{
|
||||
(32, 1, 8, 319, MediaEncoding.FM, false, MediaType.IBM23FD),
|
||||
(35, 1, 9, 256, MediaEncoding.FM, false, MediaType.ECMA_66),
|
||||
(35, 1, 13, 256, MediaEncoding.AppleGCR, false, MediaType.Apple32SS),
|
||||
(35, 1, 16, 256, MediaEncoding.MFM, false, MediaType.MetaFloppy_Mod_I),
|
||||
(35, 1, 16, 256, MediaEncoding.AppleGCR, false, MediaType.Apple33SS),
|
||||
(35, 1, 19, 256, MediaEncoding.CommodoreGCR, false, MediaType.CBM_1540),
|
||||
(35, 2, 13, 256, MediaEncoding.AppleGCR, false, MediaType.Apple32DS),
|
||||
(35, 2, 16, 256, MediaEncoding.AppleGCR, false, MediaType.Apple33DS),
|
||||
(35, 2, 19, 256, MediaEncoding.CommodoreGCR, false, MediaType.CBM_1571),
|
||||
(40, 1, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_525_SS_DD_8),
|
||||
(40, 1, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_525_SS_DD_9),
|
||||
(40, 1, 10, 256, MediaEncoding.FM, false, MediaType.ACORN_525_SS_SD_40),
|
||||
(40, 1, 16, 256, MediaEncoding.MFM, false, MediaType.ACORN_525_SS_DD_40),
|
||||
(40, 1, 18, 128, MediaEncoding.FM, false, MediaType.ATARI_525_SD),
|
||||
(40, 1, 18, 256, MediaEncoding.MFM, false, MediaType.ATARI_525_DD),
|
||||
(40, 1, 19, 256, MediaEncoding.CommodoreGCR, false, MediaType.CBM_1540_Ext),
|
||||
(40, 1, 26, 128, MediaEncoding.MFM, false, MediaType.ATARI_525_ED),
|
||||
(40, 2, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_525_DS_DD_8),
|
||||
(40, 2, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_525_DS_DD_9),
|
||||
(40, 2, 16, 256, MediaEncoding.FM, false, MediaType.ECMA_70),
|
||||
(70, 2, 9, 512, MediaEncoding.MFM, false, MediaType.Apricot_35),
|
||||
(74, 1, 8, 512, MediaEncoding.FM, false, MediaType.IBM33FD_512),
|
||||
(74, 1, 15, 256, MediaEncoding.FM, false, MediaType.IBM33FD_256),
|
||||
(74, 1, 26, 128, MediaEncoding.FM, false, MediaType.IBM33FD_128),
|
||||
(74, 2, 8, 1024, MediaEncoding.MFM, false, MediaType.IBM53FD_1024),
|
||||
(74, 2, 15, 256, MediaEncoding.FM, false, MediaType.IBM43FD_256),
|
||||
(74, 2, 15, 512, MediaEncoding.MFM, false, MediaType.IBM53FD_512),
|
||||
(74, 2, 26, 128, MediaEncoding.FM, false, MediaType.IBM43FD_128),
|
||||
(74, 2, 26, 256, MediaEncoding.MFM, false, MediaType.IBM53FD_256),
|
||||
(77, 1, 16, 256, MediaEncoding.MFM, false, MediaType.MetaFloppy_Mod_II),
|
||||
(77, 1, 26, 128, MediaEncoding.FM, false, MediaType.RX01),
|
||||
(77, 1, 26, 256, MediaEncoding.MFM, false, MediaType.RX02),
|
||||
(77, 2, 8, 1024, MediaEncoding.MFM, false, MediaType.NEC_525_HD),
|
||||
(77, 2, 15, 512, MediaEncoding.MFM, false, MediaType.ECMA_99_15),
|
||||
(77, 2, 26, 128, MediaEncoding.FM, false, MediaType.NEC_8_SD),
|
||||
(77, 2, 26, 256, MediaEncoding.MFM, false, MediaType.RX03),
|
||||
(80, 1, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_35_SS_DD_8),
|
||||
(80, 1, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_35_SS_DD_9),
|
||||
(80, 1, 10, 256, MediaEncoding.FM, false, MediaType.ACORN_525_SS_SD_80),
|
||||
(80, 1, 10, 512, MediaEncoding.AppleGCR, true, MediaType.AppleSonySS),
|
||||
(80, 1, 10, 512, MediaEncoding.MFM, false, MediaType.RX50),
|
||||
(80, 1, 11, 512, MediaEncoding.MFM, false, MediaType.ATARI_35_SS_DD_11),
|
||||
(80, 1, 16, 256, MediaEncoding.MFM, false, MediaType.ACORN_525_SS_DD_80),
|
||||
(80, 2, 5, 1024, MediaEncoding.MFM, false, MediaType.ACORN_35_DS_DD),
|
||||
(80, 2, 8, 512, MediaEncoding.MFM, false, MediaType.DOS_35_DS_DD_8),
|
||||
(80, 2, 9, 512, MediaEncoding.MFM, false, MediaType.DOS_35_DS_DD_9),
|
||||
(80, 2, 10, 512, MediaEncoding.AppleGCR, true, MediaType.AppleSonyDS),
|
||||
(80, 2, 10, 512, MediaEncoding.MFM, false, MediaType.CBM_35_DD),
|
||||
(80, 2, 10, 1024, MediaEncoding.MFM, false, MediaType.ACORN_35_DS_HD),
|
||||
(80, 2, 11, 512, MediaEncoding.MFM, false, MediaType.CBM_AMIGA_35_DD),
|
||||
(80, 2, 15, 512, MediaEncoding.MFM, false, MediaType.DOS_525_HD),
|
||||
(80, 2, 16, 256, MediaEncoding.FM, false, MediaType.ECMA_78),
|
||||
(80, 2, 16, 256, MediaEncoding.MFM, false, MediaType.ACORN_525_DS_DD),
|
||||
(80, 2, 18, 512, MediaEncoding.MFM, false, MediaType.DOS_35_HD),
|
||||
(80, 2, 19, 512, MediaEncoding.MFM, false, MediaType.XDF_525),
|
||||
(80, 2, 21, 512, MediaEncoding.MFM, false, MediaType.DMF),
|
||||
(80, 2, 22, 512, MediaEncoding.MFM, false, MediaType.CBM_AMIGA_35_HD),
|
||||
(80, 2, 23, 512, MediaEncoding.MFM, false, MediaType.XDF_35),
|
||||
(80, 2, 36, 512, MediaEncoding.MFM, false, MediaType.DOS_35_ED),
|
||||
(82, 2, 10, 512, MediaEncoding.MFM, false, MediaType.FDFORMAT_35_DD),
|
||||
(82, 2, 17, 512, MediaEncoding.MFM, false, MediaType.FDFORMAT_525_HD),
|
||||
(82, 2, 21, 512, MediaEncoding.MFM, false, MediaType.FDFORMAT_35_HD),
|
||||
(240, 2, 38, 512, MediaEncoding.MFM, false, MediaType.NEC_35_TD),
|
||||
(753, 2, 27, 512, MediaEncoding.MFM, false, MediaType.Floptical),
|
||||
|
||||
// Following ones are what the device itself report, not the physical geometry
|
||||
(154, 16, 32, 512, MediaEncoding.MFM, false, MediaType.PocketZip),
|
||||
(262, 32, 56, 512, MediaEncoding.MFM, false, MediaType.LS240),
|
||||
(963, 8, 32, 512, MediaEncoding.MFM, false, MediaType.LS120),
|
||||
(1021, 64, 32, 512, MediaEncoding.MFM, false, MediaType.Jaz),
|
||||
(1024, 2, 32, 512, MediaEncoding.MFM, false, MediaType.FD32MB)
|
||||
};
|
||||
|
||||
/// <summary>Gets the media type for a given geometry</summary>
|
||||
/// <param name="geometry">Geometry</param>
|
||||
/// <returns>Media type</returns>
|
||||
public static MediaType GetMediaType(
|
||||
(ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding, bool
|
||||
variableSectorsPerTrack) geometry) => (from geom in KnownGeometries
|
||||
where geom.cylinders == geometry.cylinders &&
|
||||
geom.heads == geometry.heads &&
|
||||
geom.sectorsPerTrack == geometry.sectorsPerTrack &&
|
||||
geom.bytesPerSector == geometry.bytesPerSector &&
|
||||
geom.encoding == geometry.encoding &&
|
||||
geom.variableSectorsPerTrack ==
|
||||
geometry.variableSectorsPerTrack
|
||||
select geom.type).FirstOrDefault();
|
||||
|
||||
/// <summary>Gets the geometry for a given media type</summary>
|
||||
/// <param name="mediaType">Media type</param>
|
||||
/// <returns>Geometry</returns>
|
||||
public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding,
|
||||
bool variableSectorsPerTrack, MediaType type) GetGeometry(MediaType mediaType) =>
|
||||
(from geom in KnownGeometries where geom.type == mediaType select geom).FirstOrDefault();
|
||||
}
|
||||
208
Aaru.CommonTypes/Interfaces/IArchive.cs
Normal file
208
Aaru.CommonTypes/Interfaces/IArchive.cs
Normal file
@@ -0,0 +1,208 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IArchive.cs
|
||||
// Author(s) : Michael Drüing <michael@drueing.de>
|
||||
//
|
||||
// Component : Archives.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface for implementing archive plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2018-2023 Michael Drüing
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using FileAttributes = System.IO.FileAttributes;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Supported archive features</summary>
|
||||
[Flags]
|
||||
public enum ArchiveSupportedFeature : uint
|
||||
{
|
||||
/// <summary>The archive supports filenames for its entries. If this flag is not set, files can only be accessed by number.</summary>
|
||||
SupportsFilenames = 1 << 0,
|
||||
/// <summary>
|
||||
/// The archive supports compression. If this flag is not set, compressed and uncompressed lengths are always the
|
||||
/// same.
|
||||
/// </summary>
|
||||
SupportsCompression = 1 << 1,
|
||||
/// <summary>
|
||||
/// The archive supports subdirectories. If this flag is not set, all filenames are guaranteed to not contain any
|
||||
/// "/" character.
|
||||
/// </summary>
|
||||
SupportsSubdirectories = 1 << 2,
|
||||
/// <summary>
|
||||
/// The archive supports explicit entries for directories (like Zip, for example). If this flag is not set,
|
||||
/// directories are implicit by the relative name of the files.
|
||||
/// </summary>
|
||||
HasExplicitDirectories = 1 << 3,
|
||||
/// <summary>The archive stores a timestamp with each entry if this flag is set.</summary>
|
||||
HasEntryTimestamp = 1 << 4,
|
||||
/// <summary>If this flag is set, individual files or the whole archive might be encrypted or password-protected.</summary>
|
||||
SupportsProtection = 1 << 5, // TODO: not implemented yet
|
||||
|
||||
/// <summary>If this flag is set, the archive supports returning extended attributes (Xattrs) for each entry.</summary>
|
||||
SupportsXAttrs = 1 << 6
|
||||
}
|
||||
|
||||
/// <summary>Defines the interface to handle an archive (e.g. ZIP, WAD, etc)</summary>
|
||||
public interface IArchive
|
||||
{
|
||||
/// <summary>Descriptive name of the plugin</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>Unique UUID of the plugin</summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>Plugin author</summary>
|
||||
string Author { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the archive has a file/stream/buffer currently opened and no
|
||||
/// <see cref="M:Aaru.Filters.Filter.Close" /> has been issued.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if the archive is opened, <c>false</c> otherwise.</value>
|
||||
bool Opened { get; }
|
||||
|
||||
/// <summary>Return a bitfield indicating the features supported by this archive type.</summary>
|
||||
/// <value>The <c>ArchiveSupportedFeature</c> bitfield.</value>
|
||||
/// <remarks>
|
||||
/// If the archive is not opened, this returns the capabilities of the archive format, otherwise it returns the
|
||||
/// capabilities in use by the currently opened archive.
|
||||
/// </remarks>
|
||||
ArchiveSupportedFeature ArchiveFeatures { get; }
|
||||
|
||||
/// <summary>Gets the number of entries (i.e. files) that are contained in this archive.</summary>
|
||||
/// <remarks>
|
||||
/// Entries in this context can also mean directories or volume labels, for some types of archives that store
|
||||
/// these explicitly. Do not rely on all entries being regular files!
|
||||
/// </remarks>
|
||||
/// <value>The number of files.</value>
|
||||
int NumberOfEntries { get; }
|
||||
|
||||
/// <summary>Identifies if the specified filter contains data recognizable by this archive instance</summary>
|
||||
/// <param name="filter">Filter that contains the archive. This allows use to handle .tar.gz and similars.</param>
|
||||
bool Identify(IFilter filter);
|
||||
|
||||
/// <summary>Opens the specified stream with this archive instance</summary>
|
||||
/// <param name="filter">Filter that contains the archive. This allows use to handle .tar.gz and similars.</param>
|
||||
/// <param name="encoding">The encoding codepage to use for this archive.</param>
|
||||
ErrorNumber Open(IFilter filter, Encoding encoding);
|
||||
|
||||
/// <summary>Closes the archive.</summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>Gets the file name (and path) of the given entry in the archive.</summary>
|
||||
/// <remarks>
|
||||
/// The path components are separated by a forward slash "/". <br /> The path should not start with a leading
|
||||
/// slash (i.e. it should be relative, not absolute).
|
||||
/// </remarks>
|
||||
/// <seealso cref="Stat" />
|
||||
/// <param name="entryNumber">The entry in the archive for which to return the file name.</param>
|
||||
/// <param name="fileName">The file name, with (relative) path</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber GetFilename(int entryNumber, out string fileName);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the entry number for a particular file path in the archive. <c>fileName</c> is the relative path of the
|
||||
/// file in the archive. If the file cannot be found, -1 is returned.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// The path should be relative (no leading slash), using regular slashes as path separator, and be normalized,
|
||||
/// i.e. no "foo//bar" or "foo/../bar" path components.
|
||||
/// </remarks>
|
||||
/// <param name="fileName">The relative path for which to get the entry number.</param>
|
||||
/// <param name="caseInsensitiveMatch">If set, do a case insensitive matching and return the first file that matches.</param>
|
||||
/// <param name="entryNumber">The number of the entry corresponding to the given path, or -1 if the path does not exist.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber GetEntryNumber(string fileName, bool caseInsensitiveMatch, out int entryNumber);
|
||||
|
||||
/// <summary>Gets the (compressed) size of the given entry.</summary>
|
||||
/// <param name="entryNumber">The entry for which to get the compressed size.</param>
|
||||
/// <param name="length">The compressed size of the entry, or 0 if the entry is not a regular file.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <remarks>The return value is equal to the return value of <c>GetUncompressedSize()</c> if the file is not compressed.</remarks>
|
||||
/// <seealso cref="GetUncompressedSize" />
|
||||
ErrorNumber GetCompressedSize(int entryNumber, out long length);
|
||||
|
||||
/// <summary>Gets the uncompressed size of the given entry.</summary>
|
||||
/// <param name="entryNumber">The entry for which to get the uncompressed size.</param>
|
||||
/// <param name="length">The uncompressed size of the entry, or 0 if the entry is not a regular file.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <remarks>The return value is equal to the return value of <c>GetCompressedSize()</c> if the file is not compressed.</remarks>
|
||||
/// <seealso cref="GetCompressedSize" />
|
||||
ErrorNumber GetUncompressedSize(int entryNumber, out long length);
|
||||
|
||||
/// <summary>Gets the attributes of a file or directory.</summary>
|
||||
/// <param name="entryNumber">The entry in the archive for which to retrieve the attributes.</param>
|
||||
/// <param name="attributes">File attributes, or zero if the archive does not support attributes.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <seealso cref="Stat" />
|
||||
ErrorNumber GetAttributes(int entryNumber, out FileAttributes attributes);
|
||||
|
||||
/// <summary>Lists all extended attributes, alternate data streams and forks of the given file.</summary>
|
||||
/// <param name="entryNumber">The entry in the archive for which to retrieve the list of attributes.</param>
|
||||
/// <param name="xattrs">List of extended attributes, alternate data streams and forks.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber ListXAttr(int entryNumber, out List<string> xattrs);
|
||||
|
||||
/// <summary>Reads an extended attribute, alternate data stream or fork from the given file.</summary>
|
||||
/// <param name="entryNumber">The entry in the archive for which to retrieve the XAttr.</param>
|
||||
/// <param name="xattr">Extended attribute, alternate data stream or fork name.</param>
|
||||
/// <param name="buffer">Buffer where the extended attribute data will be stored.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber GetXattr(int entryNumber, string xattr, ref byte[] buffer);
|
||||
|
||||
/// <summary>Gets information about an entry in the archive.</summary>
|
||||
/// <remarks>Note that some of the data might be incomplete or not available at all, depending on the type of archive.</remarks>
|
||||
/// <param name="entryNumber">The entry int he archive for which to get the information</param>
|
||||
/// <param name="stat">The available information about the entry in the archive</param>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <seealso cref="GetAttributes" />
|
||||
/// <seealso cref="GetFilename" />
|
||||
ErrorNumber Stat(int entryNumber, out FileEntryInfo stat);
|
||||
|
||||
/// <summary>
|
||||
/// Returns the Filter for the given entry. It will return <c>null</c> if the entry in question is not a regular
|
||||
/// file (i.e. directory, volume label, etc.)
|
||||
/// </summary>
|
||||
/// <param name="entryNumber">The entry for which the Filter should be returned.</param>
|
||||
/// <param name="filter">The Filter for the given entry.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber GetEntry(int entryNumber, out IFilter filter);
|
||||
|
||||
/// <summary>
|
||||
/// Gets user readable information about the archive. The exact contents depend on the archive plugin implementation.
|
||||
/// </summary>
|
||||
/// <param name="filter">Filter that handles the archive.</param>
|
||||
/// <param name="encoding">The encoding codepage to use with the archive.</param>
|
||||
/// <param name="information">Variable that holds the user readable information.</param>
|
||||
void GetInformation(IFilter filter, Encoding encoding, out string information);
|
||||
}
|
||||
81
Aaru.CommonTypes/Interfaces/IBaseImage.cs
Normal file
81
Aaru.CommonTypes/Interfaces/IBaseImage.cs
Normal file
@@ -0,0 +1,81 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IBaseImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Base interface for all images</summary>
|
||||
public interface IBaseImage
|
||||
{
|
||||
/// <summary>Plugin author</summary>
|
||||
string Author { get; }
|
||||
|
||||
/// <summary>Gets the Aaru Metadata for the image</summary>
|
||||
AaruMetadata.Metadata AaruMetadata { get; }
|
||||
|
||||
/// <summary>List of dump hardware used to create the image from real media</summary>
|
||||
List<DumpHardware> DumpHardware { get; }
|
||||
|
||||
/// <summary>Gets the image format.</summary>
|
||||
/// <value>The image format.</value>
|
||||
string Format { get; }
|
||||
|
||||
/// <summary>Plugin UUID.</summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>Image information</summary>
|
||||
ImageInfo Info { get; }
|
||||
|
||||
/// <summary>Plugin name.</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>Identifies the image.</summary>
|
||||
/// <returns><c>true</c>, if image was identified, <c>false</c> otherwise.</returns>
|
||||
/// <param name="imageFilter">Image filter.</param>
|
||||
bool Identify(IFilter imageFilter);
|
||||
|
||||
/// <summary>Opens the image.</summary>
|
||||
/// <returns><c>true</c>, if image was opened, <c>false</c> otherwise.</returns>
|
||||
/// <param name="imageFilter">Image filter.</param>
|
||||
ErrorNumber Open(IFilter imageFilter);
|
||||
}
|
||||
98
Aaru.CommonTypes/Interfaces/IBaseWritableImage.cs
Normal file
98
Aaru.CommonTypes/Interfaces/IBaseWritableImage.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IBaseWritableImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the base interface to be implemented by writable image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Base interface for all writable images</summary>
|
||||
public interface IBaseWritableImage : IBaseImage
|
||||
{
|
||||
/// <summary>Contains a description of the last error</summary>
|
||||
string ErrorMessage { get; }
|
||||
|
||||
/// <summary>If set to <c>true</c> means the image is opened for writing</summary>
|
||||
bool IsWriting { get; }
|
||||
|
||||
/// <summary>Gets a list of known extensions for format auto-choosing</summary>
|
||||
IEnumerable<string> KnownExtensions { get; }
|
||||
|
||||
/// <summary>Gets a list of <see cref="MediaTagType" /> that are supported by the media image format</summary>
|
||||
IEnumerable<MediaTagType> SupportedMediaTags { get; }
|
||||
|
||||
/// <summary>Gets a list of <see cref="MediaType" /> that are supported by the media image format</summary>
|
||||
IEnumerable<MediaType> SupportedMediaTypes { get; }
|
||||
|
||||
/// <summary>Retrieves a list of options supported by the filesystem, with name, type and description</summary>
|
||||
IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions { get; }
|
||||
|
||||
/// <summary>Gets a list of <see cref="SectorTagType" /> that are supported by the media image format</summary>
|
||||
IEnumerable<SectorTagType> SupportedSectorTags { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new image in the specified path, for the specified <see cref="MediaType" />, with the specified
|
||||
/// options to hold a media with the specified number of sectors
|
||||
/// </summary>
|
||||
/// <param name="path">Path to the new image, with extension</param>
|
||||
/// <param name="mediaType"><see cref="MediaType" /> that will be written in the image</param>
|
||||
/// <param name="options">Options to be used when creating new image</param>
|
||||
/// <param name="sectors">How many sectors the media has.</param>
|
||||
/// <param name="sectorSize"></param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool Create(string path, MediaType mediaType, Dictionary<string, string> options, ulong sectors, uint sectorSize);
|
||||
|
||||
/// <summary>Closes the image and flushes all data to disk</summary>
|
||||
/// <returns>Error number</returns>
|
||||
bool Close();
|
||||
|
||||
/// <summary>Sets the Aaru Metadata for the image</summary>
|
||||
bool SetMetadata(AaruMetadata.Metadata metadata);
|
||||
|
||||
/// <summary>Sets the list of dump hardware used to create the image from real media</summary>
|
||||
bool SetDumpHardware(List<DumpHardware> dumpHardware);
|
||||
|
||||
/// <summary>Sets image metadata</summary>
|
||||
/// <param name="imageInfo"><see cref="ImageInfo" /> containing image metadata</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool SetImageInfo(ImageInfo imageInfo);
|
||||
}
|
||||
141
Aaru.CommonTypes/Interfaces/IByteAddressableImage.cs
Normal file
141
Aaru.CommonTypes/Interfaces/IByteAddressableImage.cs
Normal file
@@ -0,0 +1,141 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IByteAddressableImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by byte-addressable image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Interface defining linear media (chips, game carts, etc) images</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedParameter.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
[SuppressMessage("ReSharper", "OutParameterValueIsAlwaysDiscarded.Global")]
|
||||
public interface IByteAddressableImage : IBaseWritableImage
|
||||
{
|
||||
/// <summary>Gets or sets the current position</summary>
|
||||
long Position { get; set; }
|
||||
|
||||
/// <summary>Creates a linear media image</summary>
|
||||
/// <param name="path">Path where to create the media image</param>
|
||||
/// <param name="mediaType">Media type</param>
|
||||
/// <param name="options">Image options</param>
|
||||
/// <param name="maximumSize">Maximum size in bytes</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber Create(string path, MediaType mediaType, Dictionary<string, string> options, long maximumSize);
|
||||
|
||||
/// <summary>Gets the linear memory mappings, e.g. interleaving, starting address, etc.</summary>
|
||||
/// <param name="mappings">Format still not decided</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber GetMappings(out LinearMemoryMap mappings);
|
||||
|
||||
/// <summary>Reads a byte from the image</summary>
|
||||
/// <param name="b">The byte read</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber ReadByte(out byte b, bool advance = true);
|
||||
|
||||
/// <summary>Reads a byte from the image at the specified position</summary>
|
||||
/// <param name="position">Position</param>
|
||||
/// <param name="b">The byte read</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber ReadByteAt(long position, out byte b, bool advance = true);
|
||||
|
||||
/// <summary>Reads several bytes from the image</summary>
|
||||
/// <param name="buffer">Buffer to store the data in</param>
|
||||
/// <param name="offset">Offset in buffer where to place the byte in</param>
|
||||
/// <param name="bytesToRead">How many bytes to read from image</param>
|
||||
/// <param name="bytesRead">How many bytes were read</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber ReadBytes(byte[] buffer, int offset, int bytesToRead, out int bytesRead, bool advance = true);
|
||||
|
||||
/// <summary>Reads several bytes from the image at the specified position</summary>
|
||||
/// <param name="position">Position</param>
|
||||
/// <param name="buffer">Buffer to store the data in</param>
|
||||
/// <param name="offset">Offset in buffer where to place the byte in</param>
|
||||
/// <param name="bytesToRead">How many bytes to read from image</param>
|
||||
/// <param name="bytesRead">How many bytes were read</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber ReadBytesAt(long position, byte[] buffer, int offset, int bytesToRead, out int bytesRead,
|
||||
bool advance = true);
|
||||
|
||||
/// <summary>Sets the linear memory mappings, e.g. interleaving, starting address, etc.</summary>
|
||||
/// <param name="mappings">Format still not decided</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber SetMappings(LinearMemoryMap mappings);
|
||||
|
||||
/// <summary>Writes a byte to the image</summary>
|
||||
/// <param name="b">The byte to be written</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber WriteByte(byte b, bool advance = true);
|
||||
|
||||
/// <summary>Writes a byte to the image at the specified position</summary>
|
||||
/// <param name="position">Position</param>
|
||||
/// <param name="b">The byte read</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber WriteByteAt(long position, byte b, bool advance = true);
|
||||
|
||||
/// <summary>Writes several bytes to the image</summary>
|
||||
/// <param name="buffer">Buffer to store the data in</param>
|
||||
/// <param name="offset">Offset in buffer where the bytes start in</param>
|
||||
/// <param name="bytesToWrite">How many bytes to write to image</param>
|
||||
/// <param name="bytesWritten">How many bytes were written</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber WriteBytes(byte[] buffer, int offset, int bytesToWrite, out int bytesWritten, bool advance = true);
|
||||
|
||||
/// <summary>Writes several bytes to the image at the specified position</summary>
|
||||
/// <param name="position">Position</param>
|
||||
/// <param name="buffer">Buffer to store the data in</param>
|
||||
/// <param name="offset">Offset in buffer where the bytes start in</param>
|
||||
/// <param name="bytesToWrite">How many bytes to write to image</param>
|
||||
/// <param name="bytesWritten">How many bytes were written</param>
|
||||
/// <param name="advance">Set to <c>true</c> to advance position, <c>false</c> otherwise.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber WriteBytesAt(long position, byte[] buffer, int offset, int bytesToWrite, out int bytesWritten,
|
||||
bool advance = true);
|
||||
}
|
||||
69
Aaru.CommonTypes/Interfaces/IChecksum.cs
Normal file
69
Aaru.CommonTypes/Interfaces/IChecksum.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IChecksum.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Checksums.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Provides an interface for implementing checksums and hashes.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines the interface to implement a checksum or hashing algorithm</summary>
|
||||
public interface IChecksum
|
||||
{
|
||||
/// <summary>Plugin author</summary>
|
||||
string Author { get; }
|
||||
|
||||
/// <summary>Plugin name.</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>Plugin UUID.</summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>Updates the hash with data.</summary>
|
||||
/// <param name="data">Data buffer.</param>
|
||||
/// <param name="len">Length of buffer to hash.</param>
|
||||
void Update(byte[] data, uint len);
|
||||
|
||||
/// <summary>Updates the hash with data.</summary>
|
||||
/// <param name="data">Data buffer.</param>
|
||||
void Update(byte[] data);
|
||||
|
||||
/// <summary>Returns a byte array of the hash value.</summary>
|
||||
byte[] Final();
|
||||
|
||||
/// <summary>Returns a hexadecimal representation of the hash value.</summary>
|
||||
string End();
|
||||
}
|
||||
71
Aaru.CommonTypes/Interfaces/IFilesystem.cs
Normal file
71
Aaru.CommonTypes/Interfaces/IFilesystem.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IFilesystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Filesystem plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Interface for filesystem plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Interface to implement filesystem plugins.</summary>
|
||||
public interface IFilesystem
|
||||
{
|
||||
/// <summary>Plugin name (translatable).</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>Plugin UUID.</summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>Plugin author</summary>
|
||||
string Author { get; }
|
||||
|
||||
/// <summary>Identifies the filesystem in the specified LBA</summary>
|
||||
/// <param name="imagePlugin">Disk image.</param>
|
||||
/// <param name="partition">Partition.</param>
|
||||
/// <returns><c>true</c>, if the filesystem is recognized, <c>false</c> otherwise.</returns>
|
||||
bool Identify(IMediaImage imagePlugin, Partition partition);
|
||||
|
||||
/// <summary>Gets information about the identified filesystem.</summary>
|
||||
/// <param name="imagePlugin">Disk image.</param>
|
||||
/// <param name="partition">Partition.</param>
|
||||
/// <param name="encoding">Which encoding to use for this filesystem.</param>
|
||||
/// <param name="information">Filesystem information.</param>
|
||||
/// <param name="metadata">Information about the filesystem as expected by Aaru Metadata</param>
|
||||
void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
||||
out FileSystem metadata);
|
||||
}
|
||||
154
Aaru.CommonTypes/Interfaces/IFilter.cs
Normal file
154
Aaru.CommonTypes/Interfaces/IFilter.cs
Normal file
@@ -0,0 +1,154 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IFilter.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Filters.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface for a Filter.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a filter, that is, a transformation of the data from a file, like, for example, a compressor (e.g.
|
||||
/// GZIP), or a container (e.g. AppleDouble)
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
public interface IFilter
|
||||
{
|
||||
/// <summary>Descriptive name of the plugin</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>Unique UUID of the plugin</summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>Plugin author</summary>
|
||||
string Author { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the path used to open this filter.<br /> UNIX: /path/to/archive.zip/path/to/file.bin =>
|
||||
/// /path/to/archive.zip/path/to/file.bin <br /> Windows: C:\path\to\archive.zip\path\to\file.bin =>
|
||||
/// C:\path\to\archive.zip\path\to\file.bin
|
||||
/// </summary>
|
||||
/// <returns>Path used to open this filter.</returns>
|
||||
string BasePath { get; }
|
||||
|
||||
/// <summary>Gets creation time of file referenced by this filter.</summary>
|
||||
/// <returns>The creation time.</returns>
|
||||
DateTime CreationTime { get; }
|
||||
|
||||
/// <summary>Gets length of this filter's data fork.</summary>
|
||||
/// <returns>The data fork length.</returns>
|
||||
long DataForkLength { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the filename for the file referenced by this filter.<br /> UNIX: /path/to/archive.zip/path/to/file.bin =
|
||||
/// > file.bin <br /> Windows: C:\path\to\archive.zip\path\to\file.bin => file.bin
|
||||
/// </summary>
|
||||
/// <returns>The filename.</returns>
|
||||
string Filename { get; }
|
||||
|
||||
/// <summary>Gets last write time of file referenced by this filter.</summary>
|
||||
/// <returns>The last write time.</returns>
|
||||
DateTime LastWriteTime { get; }
|
||||
|
||||
/// <summary>Gets length of file referenced by ths filter.</summary>
|
||||
/// <returns>The length.</returns>
|
||||
long Length { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets full path to file referenced by this filter. If it's an archive, it's the path inside the archive.<br />
|
||||
/// UNIX: /path/to/archive.zip/path/to/file.bin => /path/to/file.bin <br /> Windows:
|
||||
/// C:\path\to\archive.zip\path\to\file.bin => \path\to\file.bin
|
||||
/// </summary>
|
||||
/// <returns>The path.</returns>
|
||||
string Path { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets path to parent folder to the file referenced by this filter. If it's an archive, it's the full path to
|
||||
/// the archive itself. <br /> UNIX: /path/to/archive.zip/path/to/file.bin => /path/to/archive.zip <br /> Windows:
|
||||
/// C:\path\to\archive.zip\path\to\file.bin = > C:\path\to\archive.zip
|
||||
/// </summary>
|
||||
/// <returns>The parent folder.</returns>
|
||||
string ParentFolder { get; }
|
||||
|
||||
/// <summary>Gets length of this filter's resource fork.</summary>
|
||||
/// <returns>The resource fork length.</returns>
|
||||
long ResourceForkLength { get; }
|
||||
|
||||
/// <summary>Returns true if the file referenced by this filter has a resource fork</summary>
|
||||
bool HasResourceFork { get; }
|
||||
|
||||
/// <summary>Closes all opened streams.</summary>
|
||||
void Close();
|
||||
|
||||
/// <summary>Gets a stream to access the data fork contents.</summary>
|
||||
/// <returns>The data fork stream.</returns>
|
||||
Stream GetDataForkStream();
|
||||
|
||||
/// <summary>Gets a stream to access the resource fork contents.</summary>
|
||||
/// <returns>The resource fork stream.</returns>
|
||||
Stream GetResourceForkStream();
|
||||
|
||||
/// <summary>Identifies if the specified path contains data recognizable by this filter instance</summary>
|
||||
/// <param name="path">Path.</param>
|
||||
bool Identify(string path) => File.Exists(path) && Identify(new FileStream(path, FileMode.Open, FileAccess.Read));
|
||||
|
||||
/// <summary>Identifies if the specified stream contains data recognizable by this filter instance</summary>
|
||||
/// <param name="stream">Stream.</param>
|
||||
bool Identify(Stream stream);
|
||||
|
||||
/// <summary>Identifies if the specified buffer contains data recognizable by this filter instance</summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
bool Identify(byte[] buffer) => Identify(new MemoryStream(buffer));
|
||||
|
||||
/// <summary>Opens the specified path with this filter instance</summary>
|
||||
/// <param name="path">Path.</param>
|
||||
ErrorNumber Open(string path) => !File.Exists(path)
|
||||
? ErrorNumber.NoSuchFile
|
||||
: Open(new FileStream(path, FileMode.Open, FileAccess.Read));
|
||||
|
||||
/// <summary>Opens the specified stream with this filter instance</summary>
|
||||
/// <param name="stream">Stream.</param>
|
||||
ErrorNumber Open(Stream stream);
|
||||
|
||||
/// <summary>Opens the specified buffer with this filter instance</summary>
|
||||
/// <param name="buffer">Buffer.</param>
|
||||
ErrorNumber Open(byte[] buffer) => Open(new MemoryStream(buffer));
|
||||
}
|
||||
128
Aaru.CommonTypes/Interfaces/IFloppyImage.cs
Normal file
128
Aaru.CommonTypes/Interfaces/IFloppyImage.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IFloppyImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by floppy image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is
|
||||
/// needed because floppy formatting characteristics are not necessarily compatible with the whole. LBA-oriented
|
||||
/// interface is defined by <see cref="T:Aaru.CommonTypes.Interfaces.IMediaImage" />. All data returned by these
|
||||
/// methods is already decoded from its corresponding bitstream.
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public interface IFloppyImage : IMediaImage
|
||||
{
|
||||
/// <summary>
|
||||
/// Floppy info, contains information about physical characteristics of floppy, like size, bitrate, track density,
|
||||
/// etc...
|
||||
/// </summary>
|
||||
FloppyInfo FloppyInfo { get; }
|
||||
|
||||
/// <summary>Reads a sector's user data.</summary>
|
||||
/// <returns>
|
||||
/// If <see cref="status" /> is <see cref="FloppySectorStatus.Duplicated" /> one of the duplicates is returned
|
||||
/// randomly. If <see cref="status" /> is <see cref="FloppySectorStatus.Demagnetized" /> or
|
||||
/// <see cref="FloppySectorStatus.Hole" /> random data is returned. If <see cref="status" /> is
|
||||
/// <see cref="FloppySectorStatus.NotFound" /> <c>null</c> is returned. Otherwise, whatever is in the sector is
|
||||
/// returned.
|
||||
/// </returns>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
/// <param name="status">Status of request.</param>
|
||||
/// <param name="buffer">Buffer where the sector data will be stored.</param>
|
||||
ErrorNumber ReadSector(ushort track, byte head, ushort sector, out FloppySectorStatus status, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's tag.</summary>
|
||||
/// <returns>
|
||||
/// If <see cref="status" /> is <see cref="FloppySectorStatus.Duplicated" /> one of the duplicates is returned
|
||||
/// randomly. If <see cref="status" /> is <see cref="FloppySectorStatus.Demagnetized" /> or
|
||||
/// <see cref="FloppySectorStatus.Hole" /> random data is returned. If <see cref="status" /> is
|
||||
/// <see cref="FloppySectorStatus.NotFound" /> <c>null</c> is returned. Otherwise, whatever tag is in the sector is
|
||||
/// returned.
|
||||
/// </returns>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
/// <param name="status">Status of request.</param>
|
||||
/// <param name="tag">Sector tag</param>
|
||||
/// <param name="buffer">Buffer where the sector tag data will be stored.</param>
|
||||
ErrorNumber ReadSectorTag(ushort track, byte head, ushort sector, out FloppySectorStatus status, SectorTagType tag,
|
||||
out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a whole track. It includes all gaps, address marks, sectors data, etc.</summary>
|
||||
/// <returns>The track data.</returns>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="buffer">Buffer where the track data will be stored.</param>
|
||||
ErrorNumber ReadTrack(ushort track, byte head, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's data including all tags, address mark, and so, in a format dependent of represented media.</summary>
|
||||
/// <returns>
|
||||
/// If <see cref="status" /> is <see cref="FloppySectorStatus.Duplicated" /> one of the duplicates is returned
|
||||
/// randomly. If <see cref="status" /> is <see cref="FloppySectorStatus.Demagnetized" /> or
|
||||
/// <see cref="FloppySectorStatus.Hole" /> random data is returned. If <see cref="status" /> is
|
||||
/// <see cref="FloppySectorStatus.NotFound" /> <c>null</c> is returned. Otherwise, whatever is in the sector is
|
||||
/// returned.
|
||||
/// </returns>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
/// <param name="status">Status of request.</param>
|
||||
/// <param name="buffer">Buffer where the sector data will be stored.</param>
|
||||
ErrorNumber ReadSectorLong(ushort track, byte head, ushort sector, out FloppySectorStatus status,
|
||||
out byte[] buffer);
|
||||
|
||||
/// <summary>Verifies a track.</summary>
|
||||
/// <returns>True if correct, false if incorrect, null if uncheckable.</returns>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
bool? VerifyTrack(ushort track, byte head);
|
||||
|
||||
/// <summary>Verifies a sector, relative to track.</summary>
|
||||
/// <returns>True if correct, false if incorrect, null if uncheckable.</returns>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
bool? VerifySector(ushort track, byte head, ushort sector);
|
||||
}
|
||||
130
Aaru.CommonTypes/Interfaces/IFluxImage.cs
Normal file
130
Aaru.CommonTypes/Interfaces/IFluxImage.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IFluxImage.cs
|
||||
// Author(s) : Rebecca Wallander <sakcheen+github@gmail.com>
|
||||
//
|
||||
// Component : Flux image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by flux image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Rebecca Wallander
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Abstract class to implement flux reading plugins.</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
public interface IFluxImage : IBaseImage
|
||||
{
|
||||
/// <summary>
|
||||
/// An image may have more than one capture for a specific head/track/sub-track combination. This returns
|
||||
/// the amount of captures in the image for the specified head/track/sub-track combination.
|
||||
/// </summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="length">The number of captures</param>
|
||||
ErrorNumber CapturesLength(uint head, ushort track, byte subTrack, out uint length);
|
||||
|
||||
/// <summary>Reads the resolution (sample rate) of a index signal capture in picoseconds.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
/// <param name="resolution">The resolution of the index capture in picoseconds</param>
|
||||
ErrorNumber ReadFluxIndexResolution(uint head, ushort track, byte subTrack, uint captureIndex,
|
||||
out ulong resolution);
|
||||
|
||||
/// <summary>Reads the resolution (sample rate) of a data signal capture in picoseconds.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
/// <param name="resolution">The resolution of the data capture in picoseconds</param>
|
||||
ErrorNumber ReadFluxDataResolution(uint head, ushort track, byte subTrack, uint captureIndex, out ulong resolution);
|
||||
|
||||
/// <summary>Reads the resolution (sample rate) of a flux capture in picoseconds.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
/// <param name="indexResolution">The resolution of the index capture in picoseconds</param>
|
||||
/// <param name="dataResolution">The resolution of the data capture in picoseconds</param>
|
||||
ErrorNumber ReadFluxResolution(uint head, ushort track, byte subTrack, uint captureIndex, out ulong indexResolution,
|
||||
out ulong dataResolution);
|
||||
|
||||
/// <summary>Reads the entire flux capture with index and data streams, as well as its resolution.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
/// <param name="indexResolution">The resolution (sample rate) of the index capture in picoseconds</param>
|
||||
/// <param name="dataResolution">The resolution (sample rate) of the data capture in picoseconds</param>
|
||||
/// <param name="indexBuffer">Buffer to store the index stream in</param>
|
||||
/// <param name="dataBuffer">Buffer to store the data stream in</param>
|
||||
ErrorNumber ReadFluxCapture(uint head, ushort track, byte subTrack, uint captureIndex, out ulong indexResolution,
|
||||
out ulong dataResolution, out byte[] indexBuffer, out byte[] dataBuffer);
|
||||
|
||||
/// <summary>Reads a capture's index stream.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
/// <param name="buffer">Buffer to store the data in</param>
|
||||
ErrorNumber ReadFluxIndexCapture(uint head, ushort track, byte subTrack, uint captureIndex, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a capture's data stream.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
/// <param name="buffer">Buffer to store the data in</param>
|
||||
ErrorNumber ReadFluxDataCapture(uint head, ushort track, byte subTrack, uint captureIndex, out byte[] buffer);
|
||||
|
||||
/// <summary>
|
||||
/// An image may have tracks split into sub-steps. This returns the highest sub-step index for the track.
|
||||
/// </summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="length">The number of captures</param>
|
||||
ErrorNumber SubTrackLength(uint head, ushort track, out byte length);
|
||||
}
|
||||
133
Aaru.CommonTypes/Interfaces/IMediaGraph.cs
Normal file
133
Aaru.CommonTypes/Interfaces/IMediaGraph.cs
Normal file
@@ -0,0 +1,133 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IMediaGraph.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines the interface to draw the dump or verification status of a media in a picture.</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
public interface IMediaGraph
|
||||
{
|
||||
/// <summary>Paints the specified sector in green</summary>
|
||||
/// <param name="sector">Sector</param>
|
||||
public void PaintSectorGood(ulong sector);
|
||||
|
||||
/// <summary>Paints the specified sector in red</summary>
|
||||
/// <param name="sector">Sector</param>
|
||||
public void PaintSectorBad(ulong sector);
|
||||
|
||||
/// <summary>Paints the specified sector in yellow</summary>
|
||||
/// <param name="sector">Sector</param>
|
||||
public void PaintSectorUnknown(ulong sector);
|
||||
|
||||
/// <summary>Paints the specified sector in gray</summary>
|
||||
/// <param name="sector">Sector</param>
|
||||
public void PaintSectorUndumped(ulong sector);
|
||||
|
||||
/// <summary>Paints a sector with the specified color</summary>
|
||||
/// <param name="sector">Sector</param>
|
||||
/// <param name="red">Red from 0 to 255</param>
|
||||
/// <param name="green">Green from 0 to 255</param>
|
||||
/// <param name="blue">Blue from 0 to 255</param>
|
||||
/// <param name="opacity">Opacity from 0 to 255</param>
|
||||
public void PaintSector(ulong sector, byte red, byte green, byte blue, byte opacity = 0xFF);
|
||||
|
||||
/// <summary>Paints <see cref="length" /> sectors, staring at <see cref="startingSector" /> in gray</summary>
|
||||
/// <param name="startingSector">First sector to paint</param>
|
||||
/// <param name="length">How many sectors to paint</param>
|
||||
public void PaintSectorsUndumped(ulong startingSector, uint length);
|
||||
|
||||
/// <summary>Paints <see cref="length" /> sectors, staring at <see cref="startingSector" /> in green</summary>
|
||||
/// <param name="startingSector">First sector to paint</param>
|
||||
/// <param name="length">How many sectors to paint</param>
|
||||
public void PaintSectorsGood(ulong startingSector, uint length);
|
||||
|
||||
/// <summary>Paints <see cref="length" /> sectors, staring at <see cref="startingSector" /> in red</summary>
|
||||
/// <param name="startingSector">First sector to paint</param>
|
||||
/// <param name="length">How many sectors to paint</param>
|
||||
public void PaintSectorsBad(ulong startingSector, uint length);
|
||||
|
||||
/// <summary>Paints <see cref="length" /> sectors, staring at <see cref="startingSector" /> in yellow</summary>
|
||||
/// <param name="startingSector">First sector to paint</param>
|
||||
/// <param name="length">How many sectors to paint</param>
|
||||
public void PaintSectorsUnknown(ulong startingSector, uint length);
|
||||
|
||||
/// <summary>Paints <see cref="length" /> sectors, staring at <see cref="startingSector" /> in the specified color</summary>
|
||||
/// <param name="startingSector">First sector to paint</param>
|
||||
/// <param name="length">How many sectors to paint</param>
|
||||
/// <param name="red">Red from 0 to 255</param>
|
||||
/// <param name="green">Green from 0 to 255</param>
|
||||
/// <param name="blue">Blue from 0 to 255</param>
|
||||
/// <param name="opacity">Opacity from 0 to 255</param>
|
||||
public void PaintSectors(ulong startingSector, uint length, byte red, byte green, byte blue, byte opacity = 0xFF);
|
||||
|
||||
/// <summary>Paints the specified sectors in gray</summary>
|
||||
/// <param name="sectors">List of sectors to paint</param>
|
||||
public void PaintSectorsUndumped(IEnumerable<ulong> sectors);
|
||||
|
||||
/// <summary>Paints the specified sectors in green</summary>
|
||||
/// <param name="sectors">List of sectors to paint</param>
|
||||
public void PaintSectorsGood(IEnumerable<ulong> sectors);
|
||||
|
||||
/// <summary>Paints the specified sectors in red</summary>
|
||||
/// <param name="sectors">List of sectors to paint</param>
|
||||
public void PaintSectorsBad(IEnumerable<ulong> sectors);
|
||||
|
||||
/// <summary>Paints the specified sectors in yellow</summary>
|
||||
/// <param name="sectors">List of sectors to paint</param>
|
||||
public void PaintSectorsUnknown(IEnumerable<ulong> sectors);
|
||||
|
||||
/// <summary>Paints the specified sectors in the specified color</summary>
|
||||
/// <param name="sectors">List of sectors to paint</param>
|
||||
/// <param name="red">Red from 0 to 255</param>
|
||||
/// <param name="green">Green from 0 to 255</param>
|
||||
/// <param name="blue">Blue from 0 to 255</param>
|
||||
/// <param name="opacity">Opacity from 0 to 255</param>
|
||||
public void PaintSectorsUnknown(IEnumerable<ulong> sectors, byte red, byte green, byte blue, byte opacity = 0xFF);
|
||||
|
||||
/// <summary>Paints the information specific to recordable discs in green</summary>
|
||||
public void PaintRecordableInformationGood();
|
||||
|
||||
/// <summary>Writes the graph bitmap as a PNG into the specified stream</summary>
|
||||
/// <param name="stream">Stream that will receive the spiral bitmap</param>
|
||||
public void WriteTo(Stream stream);
|
||||
|
||||
/// <summary>Writes the graph bitmap as a PNG into the specified stream</summary>
|
||||
/// <param name="path">Path to the file to save the PNG to</param>
|
||||
public void WriteTo(string path);
|
||||
}
|
||||
94
Aaru.CommonTypes/Interfaces/IMediaImage.cs
Normal file
94
Aaru.CommonTypes/Interfaces/IMediaImage.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IMediaImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines interface to be implemented by block addressable disk image
|
||||
// plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Abstract class to implement disk image reading plugins.</summary>
|
||||
public interface IMediaImage : IBaseImage
|
||||
{
|
||||
/// <summary>Reads a disk tag.</summary>
|
||||
/// <returns></returns>
|
||||
/// <param name="tag">Tag type to read.</param>
|
||||
/// <param name="buffer">Disk tag</param>
|
||||
ErrorNumber ReadMediaTag(MediaTagType tag, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's user data.</summary>
|
||||
/// <returns>The sector's user data.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a complete sector (user data + all tags).</summary>
|
||||
/// <returns>The complete sector. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorLong(ulong sectorAddress, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads user data from several sectors.</summary>
|
||||
/// <returns>The sectors user data.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads several complete sector (user data + all tags).</summary>
|
||||
/// <returns>The complete sectors. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsLong(ulong sectorAddress, uint length, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads tag from several sectors.</summary>
|
||||
/// <returns>The sectors tag.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's tag.</summary>
|
||||
/// <returns>The sector's tag.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorTag(ulong sectorAddress, SectorTagType tag, out byte[] buffer);
|
||||
}
|
||||
127
Aaru.CommonTypes/Interfaces/IOpticalMediaImage.cs
Normal file
127
Aaru.CommonTypes/Interfaces/IOpticalMediaImage.cs
Normal file
@@ -0,0 +1,127 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IOpticalMediaImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by optical disc image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="IMediaImage" />
|
||||
/// <summary>Abstract class to implement disk image reading plugins.</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
public interface IOpticalMediaImage : IMediaImage, IPartitionableMediaImage, IVerifiableSectorsImage
|
||||
{
|
||||
/// <summary>Gets the disc track extents (start, length).</summary>
|
||||
/// <value>The track extents.</value>
|
||||
List<Track> Tracks { get; }
|
||||
|
||||
/// <summary>Gets the sessions (optical discs only).</summary>
|
||||
/// <value>The sessions.</value>
|
||||
List<Session> Sessions { get; }
|
||||
|
||||
/// <summary>Reads a sector's user data, relative to track.</summary>
|
||||
/// <returns>The sector's user data.</returns>
|
||||
/// <param name="sectorAddress">Sector address (relative LBA).</param>
|
||||
/// <param name="track">Track.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSector(ulong sectorAddress, uint track, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's tag, relative to track.</summary>
|
||||
/// <returns>The sector's tag.</returns>
|
||||
/// <param name="sectorAddress">Sector address (relative LBA).</param>
|
||||
/// <param name="track">Track.</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads user data from several sectors, relative to track.</summary>
|
||||
/// <returns>The sectors user data.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (relative LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="track">Track.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectors(ulong sectorAddress, uint length, uint track, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads tag from several sectors, relative to track.</summary>
|
||||
/// <returns>The sectors tag.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (relative LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="track">Track.</param>
|
||||
/// <param name="tag">Tag type.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a complete sector (user data + all tags), relative to track.</summary>
|
||||
/// <returns>The complete sector. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Sector address (relative LBA).</param>
|
||||
/// <param name="track">Track.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorLong(ulong sectorAddress, uint track, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads several complete sector (user data + all tags), relative to track.</summary>
|
||||
/// <returns>The complete sectors. Format depends on disk type.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (relative LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="track">Track.</param>
|
||||
/// <param name="buffer"></param>
|
||||
ErrorNumber ReadSectorsLong(ulong sectorAddress, uint length, uint track, out byte[] buffer);
|
||||
|
||||
/// <summary>Gets the disc track extents for a specified session.</summary>
|
||||
/// <returns>The track extents for that session.</returns>
|
||||
/// <param name="session">Session.</param>
|
||||
List<Track> GetSessionTracks(Session session);
|
||||
|
||||
/// <summary>Gets the disc track extents for a specified session.</summary>
|
||||
/// <returns>The track extents for that session.</returns>
|
||||
/// <param name="session">Session.</param>
|
||||
List<Track> GetSessionTracks(ushort session);
|
||||
|
||||
/// <summary>Verifies several sectors, relative to track.</summary>
|
||||
/// <returns>True if all are correct, false if any is incorrect, null if any is uncheckable.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (relative LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="track">Track.</param>
|
||||
/// <param name="failingLbas">List of incorrect sectors</param>
|
||||
/// <param name="unknownLbas">List of uncheckable sectors</param>
|
||||
bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List<ulong> failingLbas,
|
||||
out List<ulong> unknownLbas);
|
||||
}
|
||||
63
Aaru.CommonTypes/Interfaces/IPartition.cs
Normal file
63
Aaru.CommonTypes/Interfaces/IPartition.cs
Normal file
@@ -0,0 +1,63 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IPartition.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Partitioning scheme plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines methods to be used by partitioning scheme plugins and several
|
||||
// constants.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Abstract class to implement partitioning schemes interpreting plugins.</summary>
|
||||
public interface IPartition
|
||||
{
|
||||
/// <summary>Plugin name.</summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>Plugin UUID.</summary>
|
||||
Guid Id { get; }
|
||||
|
||||
/// <summary>Plugin author</summary>
|
||||
string Author { get; }
|
||||
|
||||
/// <summary>Interprets a partitioning scheme.</summary>
|
||||
/// <returns><c>true</c>, if partitioning scheme is recognized, <c>false</c> otherwise.</returns>
|
||||
/// <param name="imagePlugin">Disk image.</param>
|
||||
/// <param name="partitions">Returns list of partitions.</param>
|
||||
/// <param name="sectorOffset">At which sector to start searching for the partition scheme.</param>
|
||||
bool GetInformation(IMediaImage imagePlugin, out List<Partition> partitions, ulong sectorOffset);
|
||||
}
|
||||
53
Aaru.CommonTypes/Interfaces/IPartitionableMediaImage.cs
Normal file
53
Aaru.CommonTypes/Interfaces/IPartitionableMediaImage.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IPartitionableMediaImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Media image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by image plugins that can
|
||||
// contain partitioned medias, usually optical discs and some newer tapes.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines an image that can contain partitions</summary>
|
||||
public interface IPartitionableMediaImage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets an array partitions. Typically only useful for optical disc images where each track and index means a
|
||||
/// different partition, as reads can be relative to them.
|
||||
/// </summary>
|
||||
/// <value>The partitions.</value>
|
||||
List<Partition> Partitions { get; }
|
||||
}
|
||||
113
Aaru.CommonTypes/Interfaces/IPluginRegister.cs
Normal file
113
Aaru.CommonTypes/Interfaces/IPluginRegister.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IPluginsRegister.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Interfaces.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Interface that declares class and methods to call to register plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines a register of all known plugins</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public interface IPluginRegister
|
||||
{
|
||||
/// <summary>
|
||||
/// Registers all checksum plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterChecksumPlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all filesystem plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterFilesystemPlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all filter plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterFilterPlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all floppy image plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterFloppyImagePlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all media image plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterMediaImagePlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all partition plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterPartitionPlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all read-only filesystem plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterReadOnlyFilesystemPlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all writable floppy image plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterWritableFloppyImagePlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all writable media image plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterWritableImagePlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all archive plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterArchivePlugins(IServiceCollection services);
|
||||
|
||||
/// <summary>
|
||||
/// Registers all byte addressable media image plugins in the provided service collection
|
||||
/// </summary>
|
||||
/// <param name="services">Service collection</param>
|
||||
void RegisterByteAddressablePlugins(IServiceCollection services);
|
||||
}
|
||||
205
Aaru.CommonTypes/Interfaces/IReadOnlyFilesystem.cs
Normal file
205
Aaru.CommonTypes/Interfaces/IReadOnlyFilesystem.cs
Normal file
@@ -0,0 +1,205 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IReadOnlyFilesystem.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Filesystem plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Interface for filesystem plugins that offer read-only support of their
|
||||
// contents.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using FileAttributes = Aaru.CommonTypes.Structs.FileAttributes;
|
||||
using FileSystemInfo = Aaru.CommonTypes.Structs.FileSystemInfo;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Defines the interface to implement reading the contents of a filesystem</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
public interface IReadOnlyFilesystem : IFilesystem
|
||||
{
|
||||
/// <summary>Information about the filesystem as expected by Aaru Metadata</summary>
|
||||
FileSystem Metadata { get; }
|
||||
|
||||
/// <summary>Retrieves a list of options supported by the filesystem, with name, type and description</summary>
|
||||
IEnumerable<(string name, Type type, string description)> SupportedOptions { get; }
|
||||
|
||||
/// <summary>Supported namespaces</summary>
|
||||
Dictionary<string, string> Namespaces { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes whatever internal structures the filesystem plugin needs to be able to read files and directories
|
||||
/// from the filesystem.
|
||||
/// </summary>
|
||||
/// <param name="imagePlugin"></param>
|
||||
/// <param name="partition"></param>
|
||||
/// <param name="encoding">Which encoding to use for this filesystem.</param>
|
||||
/// <param name="options">Dictionary of key=value pairs containing options to pass to the filesystem</param>
|
||||
/// <param name="namespace">Filename namespace</param>
|
||||
ErrorNumber Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding,
|
||||
Dictionary<string, string> options, string @namespace);
|
||||
|
||||
/// <summary>Frees all internal structures created by <see cref="Mount" /></summary>
|
||||
ErrorNumber Unmount();
|
||||
|
||||
/// <summary>Gets the attributes of a file or directory</summary>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <param name="path">File path.</param>
|
||||
/// <param name="attributes">File attributes.</param>
|
||||
ErrorNumber GetAttributes(string path, out FileAttributes attributes);
|
||||
|
||||
/// <summary>Lists all extended attributes, alternate data streams and forks of the given file.</summary>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <param name="path">Path.</param>
|
||||
/// <param name="xattrs">List of extended attributes, alternate data streams and forks.</param>
|
||||
ErrorNumber ListXAttr(string path, out List<string> xattrs);
|
||||
|
||||
/// <summary>Reads an extended attribute, alternate data stream or fork from the given file.</summary>
|
||||
/// <returns>Error number.</returns>
|
||||
/// <param name="path">File path.</param>
|
||||
/// <param name="xattr">Extended attribute, alternate data stream or fork name.</param>
|
||||
/// <param name="buf">Buffer.</param>
|
||||
ErrorNumber GetXattr(string path, string xattr, ref byte[] buf);
|
||||
|
||||
/// <summary>Gets information about the mounted volume.</summary>
|
||||
/// <param name="stat">Information about the mounted volume.</param>
|
||||
ErrorNumber StatFs(out FileSystemInfo stat);
|
||||
|
||||
/// <summary>Gets information about a file or directory.</summary>
|
||||
/// <param name="path">File path.</param>
|
||||
/// <param name="stat">File information.</param>
|
||||
ErrorNumber Stat(string path, out FileEntryInfo stat);
|
||||
|
||||
/// <summary>Solves a symbolic link.</summary>
|
||||
/// <param name="path">Link path.</param>
|
||||
/// <param name="dest">Link destination.</param>
|
||||
ErrorNumber ReadLink(string path, out string dest);
|
||||
|
||||
/// <summary>Opens a file for reading.</summary>
|
||||
/// <param name="path">Path to the file.</param>
|
||||
/// <param name="node">Represents the opened file and is needed for other file-related operations.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber OpenFile(string path, out IFileNode node);
|
||||
|
||||
/// <summary>Closes a file, freeing any private data allocated on opening.</summary>
|
||||
/// <param name="node">The file node.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber CloseFile(IFileNode node);
|
||||
|
||||
/// <summary>Move the file node position pointer to the specified position with the specified origin</summary>
|
||||
/// <param name="node">The file node.</param>
|
||||
/// <param name="position">Desired position.</param>
|
||||
/// <param name="origin">From where in the file to move the position pointer to.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber Seek(IFileNode node, long position, SeekOrigin origin)
|
||||
{
|
||||
if(node is null)
|
||||
return ErrorNumber.InvalidArgument;
|
||||
|
||||
long desiredPosition = origin switch
|
||||
{
|
||||
SeekOrigin.Begin => position,
|
||||
SeekOrigin.End => node.Length + position,
|
||||
_ => node.Offset + position
|
||||
};
|
||||
|
||||
if(desiredPosition < 0)
|
||||
return ErrorNumber.InvalidArgument;
|
||||
|
||||
if(desiredPosition >= node.Length)
|
||||
return ErrorNumber.InvalidArgument;
|
||||
|
||||
node.Offset = desiredPosition;
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
/// <summary>Reads data from a file (main/only data stream or data fork).</summary>
|
||||
/// <param name="node">File node.</param>
|
||||
/// <param name="length">Bytes to read.</param>
|
||||
/// <param name="buffer">Buffer. Must exist and be of size equal or bigger than <see cref="length" /></param>
|
||||
/// <param name="read">How many bytes were read into the buffer</param>
|
||||
ErrorNumber ReadFile(IFileNode node, long length, byte[] buffer, out long read);
|
||||
|
||||
/// <summary>Opens a directory for listing.</summary>
|
||||
/// <param name="path">Path to the directory.</param>
|
||||
/// <param name="node">Represents the opened directory and is needed for other directory-related operations.</param>
|
||||
/// <returns>Error number</returns>
|
||||
ErrorNumber OpenDir(string path, out IDirNode node);
|
||||
|
||||
/// <summary>Closes a directory, freeing any private data allocated on opening.</summary>
|
||||
/// <param name="node">The directory node.</param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber CloseDir(IDirNode node);
|
||||
|
||||
/// <summary>Reads the next entry in the directory.</summary>
|
||||
/// <param name="node">Represent an opened directory.</param>
|
||||
/// <param name="filename">
|
||||
/// The next entry name.
|
||||
/// <value>null</value>
|
||||
/// if there are no more entries.
|
||||
/// </param>
|
||||
/// <returns>Error number.</returns>
|
||||
ErrorNumber ReadDir(IDirNode node, out string filename);
|
||||
}
|
||||
|
||||
/// <summary>Represents an opened file from a filesystem</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
public interface IFileNode
|
||||
{
|
||||
/// <summary>Path to the file</summary>
|
||||
string Path { get; }
|
||||
|
||||
/// <summary>File length</summary>
|
||||
long Length { get; }
|
||||
|
||||
/// <summary>Current position in file</summary>
|
||||
long Offset { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Represents an opened directory from a filesystem</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")]
|
||||
public interface IDirNode
|
||||
{
|
||||
/// <summary>Path to the directory</summary>
|
||||
string Path { get; }
|
||||
}
|
||||
57
Aaru.CommonTypes/Interfaces/ITapeImage.cs
Normal file
57
Aaru.CommonTypes/Interfaces/ITapeImage.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : ITapeImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by block addressable sequential
|
||||
// tape image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Defines an image that can store the information from streaming, digital, tapes</summary>
|
||||
public interface ITapeImage : IMediaImage
|
||||
{
|
||||
/// <summary>Gets a list of all the files registered in the image</summary>
|
||||
List<TapeFile> Files { get; }
|
||||
|
||||
/// <summary>Gets a list of all the partitions registered in the image</summary>
|
||||
List<TapePartition> TapePartitions { get; }
|
||||
|
||||
/// <summary>If the media is a really a tape, as some formats can store non-tapes</summary>
|
||||
bool IsTape { get; }
|
||||
}
|
||||
48
Aaru.CommonTypes/Interfaces/IVerifiableImage.cs
Normal file
48
Aaru.CommonTypes/Interfaces/IVerifiableImage.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IVerifiableImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines interface to be implemented by image plugins that can verify the
|
||||
// image itself.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines an image that can verify the integrity of the image itself, but not its contents</summary>
|
||||
public interface IVerifiableImage
|
||||
{
|
||||
/// <summary>Verifies media image internal checksum.</summary>
|
||||
/// <returns>True if correct, false if incorrect, null if there is no internal checksum available</returns>
|
||||
bool? VerifyMediaImage();
|
||||
}
|
||||
62
Aaru.CommonTypes/Interfaces/IVerifiableSectorsImage.cs
Normal file
62
Aaru.CommonTypes/Interfaces/IVerifiableSectorsImage.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IVerifiableSectorsImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines interface to be implemented by image plugins that can verify the
|
||||
// sectors contained in the image.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines an image that can verify the integrity of the sectors it contains</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
public interface IVerifiableSectorsImage
|
||||
{
|
||||
/// <summary>Verifies a sector.</summary>
|
||||
/// <returns>True if correct, false if incorrect, null if uncheckable.</returns>
|
||||
/// <param name="sectorAddress">Sector address (LBA).</param>
|
||||
bool? VerifySector(ulong sectorAddress);
|
||||
|
||||
/// <summary>Verifies several sectors.</summary>
|
||||
/// <returns>True if all are correct, false if any is incorrect, null if any is uncheckable.</returns>
|
||||
/// <param name="sectorAddress">Starting sector address (LBA).</param>
|
||||
/// <param name="length">How many sectors to read.</param>
|
||||
/// <param name="failingLbas">List of incorrect sectors</param>
|
||||
/// <param name="unknownLbas">List of uncheckable sectors</param>
|
||||
bool? VerifySectors(ulong sectorAddress, uint length, out List<ulong> failingLbas, out List<ulong> unknownLbas);
|
||||
}
|
||||
98
Aaru.CommonTypes/Interfaces/IWritableFloppyImage.cs
Normal file
98
Aaru.CommonTypes/Interfaces/IWritableFloppyImage.cs
Normal file
@@ -0,0 +1,98 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IFloppyImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by floppy image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="IWritableImage" />
|
||||
/// <summary>
|
||||
/// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is
|
||||
/// needed because floppy formatting characteristics are not necessarily compatible with the whole LBA-oriented
|
||||
/// interface defined by <see cref="T:Aaru.CommonTypes.Interfaces.IMediaImage" />. All data expected by these methods
|
||||
/// is already decoded from its corresponding bitstream.
|
||||
/// </summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
public interface IWritableFloppyImage : IFloppyImage, IWritableImage
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates the image plugin the floppy physical characteristics and must be called before following methods are
|
||||
/// called. Once this is called, LBA-based methods should not be used.
|
||||
/// </summary>
|
||||
/// <param name="info">
|
||||
/// Floppy info, contains information about physical characteristics of floppy, like size, bitrate,
|
||||
/// track density, etc...
|
||||
/// </param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool SetFloppyCharacteristics(FloppyInfo info);
|
||||
|
||||
/// <summary>Writes a sector's user data.</summary>
|
||||
/// <param name="data">
|
||||
/// If <see cref="status" /> is <see cref="FloppySectorStatus.Duplicated" /> one of the duplicates. If
|
||||
/// <see cref="status" /> is <see cref="FloppySectorStatus.Demagnetized" />, <see cref="FloppySectorStatus.Hole" />,
|
||||
/// <see cref="FloppySectorStatus.NotFound" /> it will be ignored. Otherwise, whatever data should be in the sector.
|
||||
/// </param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
/// <param name="status">Status of sector.</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSector(byte[] data, ushort track, byte head, ushort sector, FloppySectorStatus status);
|
||||
|
||||
/// <summary>Writes a whole track, including all gaps, address marks, sectors data, etc.</summary>
|
||||
/// <param name="data">The track data.</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteTrack(byte[] data, ushort track, byte head);
|
||||
|
||||
/// <summary>Writes a sector's data including all tags, address mark, and so, in a format dependent of represented media.</summary>
|
||||
/// <param name="data">
|
||||
/// If <see cref="status" /> is <see cref="FloppySectorStatus.Duplicated" /> one of the duplicates. If
|
||||
/// <see cref="status" /> is <see cref="FloppySectorStatus.Demagnetized" />, <see cref="FloppySectorStatus.Hole" />,
|
||||
/// <see cref="FloppySectorStatus.NotFound" /> it will be ignored. Otherwise, whatever data should be in the sector.
|
||||
/// </param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based).</param>
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
/// <param name="status">Status of request.</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSectorLong(byte[] data, ushort track, byte head, ushort sector, out FloppySectorStatus status);
|
||||
}
|
||||
85
Aaru.CommonTypes/Interfaces/IWritableFluxImage.cs
Normal file
85
Aaru.CommonTypes/Interfaces/IWritableFluxImage.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IWritableFluxImage.cs
|
||||
// Author(s) : Rebecca Wallander <sakcheen+github@gmail.com>
|
||||
//
|
||||
// Component : Writable flux image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by writable flux image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Rebecca Wallander
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="IWritableImage" />
|
||||
/// <summary>Abstract class to implement flux writing plugins.</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedParameter.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
public interface IWritableFluxImage : IFluxImage, IWritableImage
|
||||
{
|
||||
/// <summary>Writes a flux capture.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="indexResolution">The index capture's resolution (sample rate) in picoseconds</param>
|
||||
/// <param name="dataResolution">The capture's resolution (sample rate) in picoseconds</param>
|
||||
/// <param name="indexBuffer">Flux representation of the index signal</param>
|
||||
/// <param name="dataBuffer">Flux representation of the data signal</param>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture slot to write to. See also <see cref="IFluxImage.CapturesLength" /></param>
|
||||
ErrorNumber WriteFluxCapture(ulong indexResolution, ulong dataResolution, byte[] indexBuffer, byte[] dataBuffer,
|
||||
uint head, ushort track, byte subTrack, uint captureIndex);
|
||||
|
||||
/// <summary>Writes a capture's index stream.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="resolution">The capture's resolution (sample rate) in picoseconds</param>
|
||||
/// <param name="index">Flux representation of the index signal</param>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
ErrorNumber WriteFluxIndexCapture(ulong resolution, byte[] index, uint head, ushort track, byte subTrack,
|
||||
uint captureIndex);
|
||||
|
||||
/// <summary>Writes a capture's data stream.</summary>
|
||||
/// <returns>Error number</returns>
|
||||
/// <param name="resolution">The capture's resolution (sample rate) in picoseconds</param>
|
||||
/// <param name="data">Flux representation of the data signal</param>
|
||||
/// <param name="head">Physical head (0-based)</param>
|
||||
/// <param name="track">Physical track (position of the heads over the floppy media, 0-based)</param>
|
||||
/// <param name="subTrack">Physical sub-step of track (e.g. half-track)</param>
|
||||
/// <param name="captureIndex">Which capture to read. See also <see cref="CapturesLength" /></param>
|
||||
ErrorNumber WriteFluxDataCapture(ulong resolution, byte[] data, uint head, ushort track, byte subTrack,
|
||||
uint captureIndex);
|
||||
}
|
||||
105
Aaru.CommonTypes/Interfaces/IWritableImage.cs
Normal file
105
Aaru.CommonTypes/Interfaces/IWritableImage.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IWritableImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by writable block addressable image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="Aaru.CommonTypes.Interfaces.IMediaImage" />
|
||||
/// <summary>
|
||||
/// Abstract class to implement disk image writing plugins. TODO: This interface is subject to change until
|
||||
/// notice.
|
||||
/// </summary>
|
||||
public interface IWritableImage : IMediaImage, IBaseWritableImage
|
||||
{
|
||||
/// <summary>Sets media geometry</summary>
|
||||
/// <param name="cylinders">Cylinders</param>
|
||||
/// <param name="heads">Heads</param>
|
||||
/// <param name="sectorsPerTrack">Sectors per track</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack);
|
||||
|
||||
/// <summary>Writes a media tag to the image</summary>
|
||||
/// <param name="data">Media tag</param>
|
||||
/// <param name="tag">
|
||||
/// <see cref="MediaTagType" />
|
||||
/// </param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteMediaTag(byte[] data, MediaTagType tag);
|
||||
|
||||
/// <summary>Writes a sector to the image</summary>
|
||||
/// <param name="data">Sector data</param>
|
||||
/// <param name="sectorAddress">Sector address</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSector(byte[] data, ulong sectorAddress);
|
||||
|
||||
/// <summary>Writes a sector to the image with main channel tags attached</summary>
|
||||
/// <param name="data">Sector data with its main channel tags attached</param>
|
||||
/// <param name="sectorAddress">Sector address</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSectorLong(byte[] data, ulong sectorAddress);
|
||||
|
||||
/// <summary>Writes several sectors to the image</summary>
|
||||
/// <param name="data">Sectors data</param>
|
||||
/// <param name="sectorAddress">Sector starting address</param>
|
||||
/// <param name="length">How many sectors to write</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSectors(byte[] data, ulong sectorAddress, uint length);
|
||||
|
||||
/// <summary>Writes several sectors to the image</summary>
|
||||
/// <param name="data">Sector data with their main channel tags attached</param>
|
||||
/// <param name="sectorAddress">Sector starting address</param>
|
||||
/// <param name="length">How many sectors to write</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length);
|
||||
|
||||
/// <summary>Writes parallel or subchannel sector tag for several sector</summary>
|
||||
/// <param name="data">Tag data to write</param>
|
||||
/// <param name="sectorAddress">Starting sector address</param>
|
||||
/// <param name="length">How many sectors to write</param>
|
||||
/// <param name="tag">Tag type</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag);
|
||||
|
||||
/// <summary>Writes parallel or subchannel sector tag for one sector</summary>
|
||||
/// <param name="data">Tag data to write</param>
|
||||
/// <param name="sectorAddress">Sector address</param>
|
||||
/// <param name="tag">Tag type</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag);
|
||||
}
|
||||
56
Aaru.CommonTypes/Interfaces/IWritableOpticalImage.cs
Normal file
56
Aaru.CommonTypes/Interfaces/IWritableOpticalImage.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IWritableOpticalImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by writable image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="Aaru.CommonTypes.Interfaces.IOpticalMediaImage" />
|
||||
/// <summary>Defines an image that is writable and can store an optical disc (CD, DVD, etc)</summary>
|
||||
public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage
|
||||
{
|
||||
/// <summary>Image format capabilities</summary>
|
||||
OpticalImageCapabilities OpticalCapabilities { get; }
|
||||
|
||||
/// <summary>Sets tracks for optical media</summary>
|
||||
/// <param name="tracks">List of tracks</param>
|
||||
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
|
||||
bool SetTracks(List<Track> tracks);
|
||||
}
|
||||
66
Aaru.CommonTypes/Interfaces/IWritableTapeImage.cs
Normal file
66
Aaru.CommonTypes/Interfaces/IWritableTapeImage.cs
Normal file
@@ -0,0 +1,66 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : IWritableTapeImage.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disc image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines the interface to be implemented by writable block addressable
|
||||
// sequential tape image plugins.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="Aaru.CommonTypes.Interfaces.ITapeImage" />
|
||||
/// <summary>Defines an image that is writable and can store information about a streaming, digital, tape</summary>
|
||||
[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")]
|
||||
public interface IWritableTapeImage : ITapeImage, IWritableImage
|
||||
{
|
||||
/// <summary>Registers a new file in the image</summary>
|
||||
/// <param name="file">Tape file descriptor</param>
|
||||
/// <returns><c>true</c> if successful, <c>false</c> otherwise</returns>
|
||||
bool AddFile(TapeFile file);
|
||||
|
||||
/// <summary>Registers a new partition</summary>
|
||||
/// <param name="partition">Tape partition descriptor</param>
|
||||
/// <returns><c>true</c> if successful, <c>false</c> otherwise</returns>
|
||||
bool AddPartition(TapePartition partition);
|
||||
|
||||
/// <summary>
|
||||
/// Tells the image plugin to set the internal structures to expect a tape (e.g. unknown block count and size).
|
||||
/// Must be called before <see cref="IWritableImage.Create" />
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if successful, <c>false</c> otherwise</returns>
|
||||
bool SetTape();
|
||||
}
|
||||
449
Aaru.CommonTypes/Interop/DetectOS.cs
Normal file
449
Aaru.CommonTypes/Interop/DetectOS.cs
Normal file
@@ -0,0 +1,449 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DetectOS.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Interop services.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Detects underlying operating system.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
/// <summary>Detects the underlying execution framework and operating system</summary>
|
||||
public static class DetectOS
|
||||
{
|
||||
/// <summary>Are we running under Mono?</summary>
|
||||
public static readonly bool IsMono =
|
||||
RuntimeInformation.FrameworkDescription.StartsWith("Mono", StringComparison.Ordinal);
|
||||
/// <summary>Are we running under .NET Core?</summary>
|
||||
public static readonly bool IsNetCore =
|
||||
RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal);
|
||||
|
||||
/// <summary>Checks if the underlying runtime runs in 64-bit mode</summary>
|
||||
public static readonly bool Is64Bit = IntPtr.Size == 8;
|
||||
|
||||
/// <summary>Are we running under Windows?</summary>
|
||||
public static bool IsWindows => GetRealPlatformID() == PlatformID.Win32NT ||
|
||||
GetRealPlatformID() == PlatformID.Win32S ||
|
||||
GetRealPlatformID() == PlatformID.Win32Windows ||
|
||||
GetRealPlatformID() == PlatformID.WinCE ||
|
||||
GetRealPlatformID() == PlatformID.WindowsPhone ||
|
||||
GetRealPlatformID() == PlatformID.Xbox;
|
||||
|
||||
/// <summary>Are we running with administrative (root) privileges?</summary>
|
||||
public static bool IsAdmin
|
||||
{
|
||||
get
|
||||
{
|
||||
if(!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
return Environment.UserName == "root";
|
||||
|
||||
bool isAdmin;
|
||||
WindowsIdentity user = null;
|
||||
|
||||
try
|
||||
{
|
||||
user = WindowsIdentity.GetCurrent();
|
||||
var principal = new WindowsPrincipal(user);
|
||||
isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator);
|
||||
}
|
||||
catch(UnauthorizedAccessException)
|
||||
{
|
||||
isAdmin = false;
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
isAdmin = false;
|
||||
}
|
||||
finally
|
||||
{
|
||||
user?.Dispose();
|
||||
}
|
||||
|
||||
return isAdmin;
|
||||
}
|
||||
}
|
||||
|
||||
[DllImport("libc", SetLastError = true)]
|
||||
static extern int uname(out UtsName name);
|
||||
|
||||
[DllImport("libc", SetLastError = true, EntryPoint = "sysctlbyname", CharSet = CharSet.Ansi)]
|
||||
static extern int OSX_sysctlbyname(string name, IntPtr oldp, IntPtr oldlenp, IntPtr newp, uint newlen);
|
||||
|
||||
/// <summary>Gets the real platform ID, not the incomplete .NET framework one</summary>
|
||||
/// <returns>Platform ID</returns>
|
||||
/// <exception cref="Exception">Unhandled exception</exception>
|
||||
public static PlatformID GetRealPlatformID()
|
||||
{
|
||||
if((int)Environment.OSVersion.Platform < 4 || (int)Environment.OSVersion.Platform == 5)
|
||||
return (PlatformID)(int)Environment.OSVersion.Platform;
|
||||
|
||||
int error = uname(out UtsName unixname);
|
||||
|
||||
if(error != 0)
|
||||
{
|
||||
throw new Exception(string.Format(Localization.Unhandled_exception_calling_uname_0,
|
||||
Marshal.GetLastWin32Error()));
|
||||
}
|
||||
|
||||
switch(unixname.sysname)
|
||||
{
|
||||
// TODO: Differentiate Linux, Android, Tizen
|
||||
case "Linux":
|
||||
{
|
||||
#if __ANDROID__
|
||||
return PlatformID.Android;
|
||||
#else
|
||||
return PlatformID.Linux;
|
||||
#endif
|
||||
}
|
||||
|
||||
case "Darwin":
|
||||
{
|
||||
IntPtr pLen = Marshal.AllocHGlobal(sizeof(int));
|
||||
int osxError = OSX_sysctlbyname("hw.machine", IntPtr.Zero, pLen, IntPtr.Zero, 0);
|
||||
|
||||
if(osxError != 0)
|
||||
{
|
||||
Marshal.FreeHGlobal(pLen);
|
||||
|
||||
throw new Exception(string.Format(Localization.Unhandled_exception_calling_uname_0,
|
||||
Marshal.GetLastWin32Error()));
|
||||
}
|
||||
|
||||
int length = Marshal.ReadInt32(pLen);
|
||||
IntPtr pStr = Marshal.AllocHGlobal(length);
|
||||
osxError = OSX_sysctlbyname("hw.machine", pStr, pLen, IntPtr.Zero, 0);
|
||||
|
||||
if(osxError != 0)
|
||||
{
|
||||
Marshal.FreeHGlobal(pStr);
|
||||
Marshal.FreeHGlobal(pLen);
|
||||
|
||||
throw new Exception(string.Format(Localization.Unhandled_exception_calling_uname_0,
|
||||
Marshal.GetLastWin32Error()));
|
||||
}
|
||||
|
||||
string machine = Marshal.PtrToStringAnsi(pStr);
|
||||
|
||||
Marshal.FreeHGlobal(pStr);
|
||||
Marshal.FreeHGlobal(pLen);
|
||||
|
||||
if(machine != null &&
|
||||
(machine.StartsWith("iPad", StringComparison.Ordinal) ||
|
||||
machine.StartsWith("iPod", StringComparison.Ordinal) ||
|
||||
machine.StartsWith("iPhone", StringComparison.Ordinal)))
|
||||
return PlatformID.iOS;
|
||||
|
||||
return PlatformID.MacOSX;
|
||||
}
|
||||
|
||||
case "GNU":
|
||||
return PlatformID.Hurd;
|
||||
case "FreeBSD":
|
||||
case "GNU/kFreeBSD":
|
||||
return PlatformID.FreeBSD;
|
||||
case "DragonFly":
|
||||
return PlatformID.DragonFly;
|
||||
case "Haiku":
|
||||
return PlatformID.Haiku;
|
||||
case "HP-UX":
|
||||
return PlatformID.HPUX;
|
||||
case "AIX":
|
||||
return PlatformID.AIX;
|
||||
case "OS400":
|
||||
return PlatformID.OS400;
|
||||
case "IRIX":
|
||||
case "IRIX64":
|
||||
return PlatformID.IRIX;
|
||||
case "Minix":
|
||||
return PlatformID.Minix;
|
||||
case "NetBSD":
|
||||
return PlatformID.NetBSD;
|
||||
case "NONSTOP_KERNEL":
|
||||
return PlatformID.NonStop;
|
||||
case "OpenBSD":
|
||||
return PlatformID.OpenBSD;
|
||||
case "QNX":
|
||||
return PlatformID.QNX;
|
||||
case "SINIX-Y":
|
||||
return PlatformID.SINIX;
|
||||
case "SunOS":
|
||||
return PlatformID.Solaris;
|
||||
case "OSF1":
|
||||
return PlatformID.Tru64;
|
||||
case "ULTRIX":
|
||||
return PlatformID.Ultrix;
|
||||
case "SCO_SV":
|
||||
return PlatformID.OpenServer;
|
||||
case "UnixWare":
|
||||
return PlatformID.UnixWare;
|
||||
case "Interix":
|
||||
case "UWIN-W7":
|
||||
return PlatformID.Win32NT;
|
||||
default:
|
||||
{
|
||||
if(unixname.sysname.StartsWith("CYGWIN_NT", StringComparison.Ordinal) ||
|
||||
unixname.sysname.StartsWith("MINGW32_NT", StringComparison.Ordinal) ||
|
||||
unixname.sysname.StartsWith("MSYS_NT", StringComparison.Ordinal) ||
|
||||
unixname.sysname.StartsWith("UWIN", StringComparison.Ordinal))
|
||||
return PlatformID.Win32NT;
|
||||
|
||||
return PlatformID.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>Gets a string for the current operating system REAL version (handles Darwin 1.4 and Windows 10 falsifying)</summary>
|
||||
/// <returns>Current operating system version</returns>
|
||||
public static string GetVersion()
|
||||
{
|
||||
var environ = Environment.OSVersion.Version.ToString();
|
||||
|
||||
switch(GetRealPlatformID())
|
||||
{
|
||||
case PlatformID.MacOSX:
|
||||
if(Environment.OSVersion.Version.Major >= 11)
|
||||
return environ;
|
||||
|
||||
if(Environment.OSVersion.Version.Major != 1)
|
||||
return $"10.{Environment.OSVersion.Version.Major - 4}.{Environment.OSVersion.Version.Minor}";
|
||||
|
||||
switch(Environment.OSVersion.Version.Minor)
|
||||
{
|
||||
case 3:
|
||||
return "10.0";
|
||||
case 4:
|
||||
return "10.1";
|
||||
}
|
||||
|
||||
goto default;
|
||||
case PlatformID.Win32NT:
|
||||
// From Windows 8.1 the reported version is simply falsified...
|
||||
if(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor >= 2 ||
|
||||
Environment.OSVersion.Version.Major > 6)
|
||||
{
|
||||
return FileVersionInfo.
|
||||
GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
|
||||
"KERNEL32.DLL")).
|
||||
ProductVersion;
|
||||
}
|
||||
|
||||
return environ;
|
||||
default:
|
||||
return environ;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>From a platform ID and version returns a human-readable version</summary>
|
||||
/// <param name="id">Platform ID</param>
|
||||
/// <param name="version">Version number</param>
|
||||
/// <returns>Operating system name</returns>
|
||||
public static string GetPlatformName(PlatformID id, string version = null)
|
||||
{
|
||||
switch(id)
|
||||
{
|
||||
case PlatformID.AIX:
|
||||
return "AIX";
|
||||
case PlatformID.Android:
|
||||
return "Android";
|
||||
case PlatformID.DragonFly:
|
||||
return "DragonFly BSD";
|
||||
case PlatformID.FreeBSD:
|
||||
return "FreeBSD";
|
||||
case PlatformID.Haiku:
|
||||
return "Haiku";
|
||||
case PlatformID.HPUX:
|
||||
return "HP/UX";
|
||||
case PlatformID.Hurd:
|
||||
return "Hurd";
|
||||
case PlatformID.iOS:
|
||||
return "iOS";
|
||||
case PlatformID.IRIX:
|
||||
return "IRIX";
|
||||
case PlatformID.Linux:
|
||||
if(!File.Exists("/proc/version"))
|
||||
return "Linux";
|
||||
|
||||
string s = File.ReadAllText("/proc/version");
|
||||
|
||||
return s.Contains("Microsoft") || s.Contains("WSL") ? "Windows Subsystem for Linux" : "Linux";
|
||||
|
||||
case PlatformID.MacOSX:
|
||||
if(string.IsNullOrEmpty(version))
|
||||
return "macOS";
|
||||
|
||||
string[] pieces = version.Split('.');
|
||||
|
||||
if(pieces.Length < 2 || !int.TryParse(pieces[1], out int minor))
|
||||
return "macOS";
|
||||
|
||||
int.TryParse(pieces[0], out int major);
|
||||
|
||||
if(minor >= 12 || major >= 11)
|
||||
return "macOS";
|
||||
|
||||
return minor >= 8 ? "OS X" : "Mac OS X";
|
||||
|
||||
case PlatformID.Minix:
|
||||
return "MINIX";
|
||||
case PlatformID.NetBSD:
|
||||
return "NetBSD";
|
||||
case PlatformID.NonStop:
|
||||
return "NonStop OS";
|
||||
case PlatformID.OpenBSD:
|
||||
return "OpenBSD";
|
||||
case PlatformID.OpenServer:
|
||||
return "SCO OpenServer";
|
||||
case PlatformID.OS400:
|
||||
return "OS/400";
|
||||
case PlatformID.PlayStation3:
|
||||
return "Sony CellOS";
|
||||
case PlatformID.PlayStation4:
|
||||
return "Sony Orbis OS";
|
||||
case PlatformID.QNX:
|
||||
return "QNX";
|
||||
case PlatformID.SINIX:
|
||||
return "SINIX";
|
||||
case PlatformID.Solaris:
|
||||
return "Sun Solaris";
|
||||
case PlatformID.Tizen:
|
||||
return "Samsung Tizen";
|
||||
case PlatformID.Tru64:
|
||||
return "Tru64 UNIX";
|
||||
case PlatformID.Ultrix:
|
||||
return "Ultrix";
|
||||
case PlatformID.Unix:
|
||||
return "UNIX";
|
||||
case PlatformID.UnixWare:
|
||||
return "SCO UnixWare";
|
||||
case PlatformID.Wii:
|
||||
return "Nintendo Wii";
|
||||
case PlatformID.WiiU:
|
||||
return "Nintendo Wii U";
|
||||
case PlatformID.Win32NT:
|
||||
if(string.IsNullOrEmpty(version))
|
||||
return "Windows NT/2000/XP/Vista/7/10";
|
||||
|
||||
if(version.StartsWith("3.", StringComparison.Ordinal) ||
|
||||
version.StartsWith("4.", StringComparison.Ordinal))
|
||||
return "Windows NT";
|
||||
|
||||
if(version.StartsWith("5.0", StringComparison.Ordinal))
|
||||
return "Windows 2000";
|
||||
|
||||
if(version.StartsWith("5.1", StringComparison.Ordinal))
|
||||
return "Windows XP";
|
||||
|
||||
if(version.StartsWith("5.2", StringComparison.Ordinal))
|
||||
return "Windows 2003";
|
||||
|
||||
if(version.StartsWith("6.0", StringComparison.Ordinal))
|
||||
return "Windows Vista";
|
||||
|
||||
if(version.StartsWith("6.1", StringComparison.Ordinal))
|
||||
return "Windows 7";
|
||||
|
||||
if(version.StartsWith("6.2", StringComparison.Ordinal))
|
||||
return "Windows 8";
|
||||
|
||||
if(version.StartsWith("6.3", StringComparison.Ordinal))
|
||||
return "Windows 8.1";
|
||||
|
||||
if(version.StartsWith("10.0", StringComparison.Ordinal))
|
||||
return "Windows 10";
|
||||
|
||||
return version.StartsWith("11.0", StringComparison.Ordinal)
|
||||
? "Windows 11"
|
||||
: "Windows NT/2000/XP/Vista/7/10/11";
|
||||
|
||||
case PlatformID.Win32S:
|
||||
return "Windows 3.x with win32s";
|
||||
case PlatformID.Win32Windows:
|
||||
if(string.IsNullOrEmpty(version))
|
||||
return "Windows 9x/Me";
|
||||
|
||||
if(version.StartsWith("4.0", StringComparison.Ordinal))
|
||||
return "Windows 95";
|
||||
|
||||
if(version.StartsWith("4.10.2222", StringComparison.Ordinal))
|
||||
return "Windows 98 SE";
|
||||
|
||||
if(version.StartsWith("4.1", StringComparison.Ordinal))
|
||||
return "Windows 98";
|
||||
|
||||
return version.StartsWith("4.9", StringComparison.Ordinal) ? "Windows Me" : "Windows 9x/Me";
|
||||
|
||||
case PlatformID.WinCE:
|
||||
return "Windows CE/Mobile";
|
||||
case PlatformID.WindowsPhone:
|
||||
return "Windows Phone";
|
||||
case PlatformID.Xbox:
|
||||
return "Xbox OS";
|
||||
case PlatformID.zOS:
|
||||
return "z/OS";
|
||||
default:
|
||||
return id.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
#region Nested type: UtsName
|
||||
|
||||
/// <summary>POSIX uname structure, size from OSX, big enough to handle extra fields</summary>
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
|
||||
struct UtsName
|
||||
{
|
||||
/// <summary>System name</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public readonly string sysname;
|
||||
/// <summary>Node name</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public readonly string nodename;
|
||||
/// <summary>Release level</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public readonly string release;
|
||||
/// <summary>Version level</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public readonly string version;
|
||||
/// <summary>Hardware level</summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
|
||||
public readonly string machine;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
121
Aaru.CommonTypes/Interop/PlatformID.cs
Normal file
121
Aaru.CommonTypes/Interop/PlatformID.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : PlatformID.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Interop services.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Contains an enhanced PlatformID enumeration.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
/// <summary>Contains an arbitrary list of OSes, even if .NET does not run on them</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum PlatformID
|
||||
{
|
||||
/// <summary>Win32s</summary>
|
||||
Win32S = 0,
|
||||
/// <summary>Win32 (Windows 9x)</summary>
|
||||
Win32Windows = 1,
|
||||
/// <summary>Windows NT</summary>
|
||||
Win32NT = 2,
|
||||
/// <summary>Windows Mobile</summary>
|
||||
WinCE = 3,
|
||||
/// <summary>UNIX (do not use, too generic)</summary>
|
||||
Unix = 4,
|
||||
/// <summary>Xbox 360</summary>
|
||||
Xbox = 5,
|
||||
/// <summary>OS X</summary>
|
||||
MacOSX = 6,
|
||||
/// <summary>iOS is not OS X</summary>
|
||||
iOS = 7,
|
||||
/// <summary>Linux</summary>
|
||||
Linux = 8,
|
||||
/// <summary>Sun Solaris</summary>
|
||||
Solaris = 9,
|
||||
/// <summary>NetBSD</summary>
|
||||
NetBSD = 10,
|
||||
/// <summary>OpenBSD</summary>
|
||||
OpenBSD = 11,
|
||||
/// <summary>FreeBSD</summary>
|
||||
FreeBSD = 12,
|
||||
/// <summary>DragonFly BSD</summary>
|
||||
DragonFly = 13,
|
||||
/// <summary>Nintendo Wii</summary>
|
||||
Wii = 14,
|
||||
/// <summary>Nintendo Wii U</summary>
|
||||
WiiU = 15,
|
||||
/// <summary>Sony PlayStation 3</summary>
|
||||
PlayStation3 = 16,
|
||||
/// <summary>Sony Playstation 4</summary>
|
||||
PlayStation4 = 17,
|
||||
/// <summary>Google Android</summary>
|
||||
Android = 18,
|
||||
/// <summary>Samsung Tizen</summary>
|
||||
Tizen = 19,
|
||||
/// <summary>Windows Phone</summary>
|
||||
WindowsPhone = 20,
|
||||
/// <summary>GNU/Hurd</summary>
|
||||
Hurd = 21,
|
||||
/// <summary>Haiku</summary>
|
||||
Haiku = 22,
|
||||
/// <summary>HP-UX</summary>
|
||||
HPUX = 23,
|
||||
/// <summary>AIX</summary>
|
||||
AIX = 24,
|
||||
/// <summary>OS/400</summary>
|
||||
OS400 = 25,
|
||||
/// <summary>IRIX</summary>
|
||||
IRIX = 26,
|
||||
/// <summary>Minix</summary>
|
||||
Minix = 27,
|
||||
/// <summary>NonStop</summary>
|
||||
NonStop = 28,
|
||||
/// <summary>QNX</summary>
|
||||
QNX = 29,
|
||||
/// <summary>SINIX</summary>
|
||||
SINIX = 30,
|
||||
/// <summary>Tru64 UNIX</summary>
|
||||
Tru64 = 31,
|
||||
/// <summary>Ultrix</summary>
|
||||
Ultrix = 32,
|
||||
/// <summary>SCO OpenServer / SCO UNIX</summary>
|
||||
OpenServer = 33,
|
||||
/// <summary>SCO UnixWare</summary>
|
||||
UnixWare = 34,
|
||||
/// <summary>IBM z/OS</summary>
|
||||
zOS = 35,
|
||||
/// <summary>Unknown</summary>
|
||||
Unknown = -1
|
||||
}
|
||||
89
Aaru.CommonTypes/Interop/Version.cs
Normal file
89
Aaru.CommonTypes/Interop/Version.cs
Normal file
@@ -0,0 +1,89 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Version.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Interop services.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Returns Aaru version.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
/// <summary>Gets our own, or the runtime's version</summary>
|
||||
public static class Version
|
||||
{
|
||||
/// <summary>Gets version string</summary>
|
||||
/// <returns>Version</returns>
|
||||
public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString();
|
||||
|
||||
/// <summary>Gets .NET Core version</summary>
|
||||
/// <returns>Version</returns>
|
||||
public static string GetNetCoreVersion()
|
||||
{
|
||||
Assembly assembly = typeof(GCSettings).Assembly;
|
||||
|
||||
string[] assemblyPath = assembly.CodeBase?.Split(new[]
|
||||
{
|
||||
'/', '\\'
|
||||
}, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if(assemblyPath is null)
|
||||
return null;
|
||||
|
||||
int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App");
|
||||
|
||||
if(netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2)
|
||||
return assemblyPath[netCoreAppIndex + 1];
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>Gets Mono version</summary>
|
||||
/// <returns>Version</returns>
|
||||
public static string GetMonoVersion()
|
||||
{
|
||||
if(!DetectOS.IsMono)
|
||||
return null;
|
||||
|
||||
MethodInfo monoDisplayName = Type.GetType("Mono.Runtime")?.
|
||||
GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
|
||||
if(monoDisplayName != null)
|
||||
return (string)monoDisplayName.Invoke(null, null);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
1886
Aaru.CommonTypes/Localization/Localization.Designer.cs
generated
Normal file
1886
Aaru.CommonTypes/Localization/Localization.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
631
Aaru.CommonTypes/Localization/Localization.es.resx
Normal file
631
Aaru.CommonTypes/Localization/Localization.es.resx
Normal file
@@ -0,0 +1,631 @@
|
||||
<root>
|
||||
<!-- ReSharper disable MarkupTextTypo -->
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<data name="Drive_manufacturer_is_SyQuest_media_has_1961069_blocks_of_512_bytes_setting_media_type_to_SparQ"
|
||||
xml:space="preserve">
|
||||
<value>El fabricante es SyQuest, el medio tiene 1961069 bloques de 512 bytes, estableciendo tipo como SparQ.</value>
|
||||
</data>
|
||||
<data name="Exception_0" xml:space="preserve">
|
||||
<value>Excepción {0}</value>
|
||||
</data>
|
||||
<data name="IDENTIFY_response_is_different_than_512_bytes_not_decoding" xml:space="preserve">
|
||||
<value>La respuesta a IDENTIFY es diferente de 512, no se decodificará.</value>
|
||||
</data>
|
||||
<data name="INQUIRY_response_is_0_bytes_less_than_minimum_of_36_bytes" xml:space="preserve">
|
||||
<value>La respuesta a INQUIRY es de {0} bytes, menor del mínimo de 36 bytes, los datos decodificados podrían ser incorrect, no se decodificará.</value>
|
||||
</data>
|
||||
<data name="INQUIRY_response_length_0_bytes_is_different_than_specified_in_length_field" xml:space="preserve">
|
||||
<value>El tamaño de la respuesta a INQUIRY ({0} bytes) es diferente a la especificada en el campo de longitud ({1} bytes), los datos decodificados podrían ser incorrectos, no se decodificará.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MD1DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 5¼" en formato Acorn.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MD1DD_80" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 5¼" y 80 pistas en formato Acorn.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MD1SD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de densidad sencilla de 5¼" en formato Acorn.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MF2DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 3½" en formato Acorn.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MF2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 3½" en formato Acorn.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Amiga_MF2DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 3½" en formato Amiga.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Amiga_MF2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 3½" en formato Amiga.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS32" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" en formato Apple DOS 3.2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS32_DS" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" de doble cara en formato Apple DOS 3.2</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS33" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" en formato Apple DOS 3.3</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS33_DS" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" de doble cara en formato Apple DOS 3.3</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_MF1DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad y una cara de 3½" en formato Apple.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apricot_MF2DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 3½" en formato Apricot.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Atari_MD1SD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de densidad sencilla de 5¼" en formato Atari.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Atari_MD1DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 5¼" en formato Acorn.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli10" xml:space="preserve">
|
||||
<value>El fabricante es IOMEGA, el medio tiene {0} bloques de 256 bytes, estableciendo tipo como Bernoulli Box de 10Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli2_150" xml:space="preserve">
|
||||
<value>El fabricante es IOMEGA, el medio tiene 294918 bloques de 512 bytes, estableciendo tipo como Bernoulli Box II de 150Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli2_44" xml:space="preserve">
|
||||
<value>El fabricante es IOMEGA, el medio tiene 87040 bloques de 512 bytes, estableciendo tipo como Bernoulli Box II de 44Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli2_90" xml:space="preserve">
|
||||
<value>El fabricante es IOMEGA, el medio tiene 175856 bloques de 512 bytes, estableciendo tipo como Bernoulli Box II de 90Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_CompactTape" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dlt", estableciendo tipo como CompacTape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_CompactTapeII" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dlt", estableciendo tipo como CompacTape II.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DLTtapeIII" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dlt", estableciendo tipo como DLTtapeIII.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DLTtapeIIIxt" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dlt", estableciendo tipo como DLTtape IIIxt.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DLTtapeIV" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dlt", estableciendo tipo como DLTtape IV.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DAT72_dat" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dat", estableciendo tipo como DAT72.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS2_dat" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dat", estableciendo tipo como DDS-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS3_dat" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dat", estableciendo tipo como DDS-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS4_alt" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, el modelo de la unidad comienza con "dat", estableciendo tipo como DDS-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS2" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS3" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS4" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DEC_RX02" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete DEC RX02.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DMF_MF2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 3½" en formato Microsoft DMF.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA154" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 3½" conforme con ECMA-154 / ISO 10090.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA201" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 3½" conforme con ECMA-201 / ISO 13963.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA201_embossed" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico estampado de 3½" conforme con ECMA-201 / ISO 13963.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA223" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 3½" conforme con ECMA-223.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA239" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 3½" conforme con ECMA-239 / ISO 15498.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FDFORMAT_MF2DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 3½" en formato FDFORMAT.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FDFORMAT_MF2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 3½" en formato FDFORMAT.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_GigaMO" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 3½" modelo GigaMO.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_GigaMO2" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 3½" modelo GigaMO 2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF1DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad y una cara de 3½" con formato IBM.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF1DD_8" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad y una cara de 3½" con formato IBM (8 sectores).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 3½" con formato IBM.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2DD_8" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 3½" con formato IBM (8 sectores).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2ED" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de densidad extra de 3½" con formato IBM.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 3½" con formato IBM.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LS_PC98_MF2HD" xml:space="preserve">
|
||||
<value>El modelo de la unidad es LS (SuperDisk), el medio tiene 2880 bloques de 512 bytes, estableciendo tipo como disquete de alta densidad de 3½" con formato PC-98.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_PC98_MF2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 3½" con formato PC-98.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA183" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ECMA-183 / ISO 13481.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA184" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ECMA-184 / ISO 13549.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA195" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ECMA-195 / ISO 13482.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA238" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ECMA-238 / ISO 15486.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA280" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ECMA-280 / ISO 18093.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA322" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ECMA-322 / ISO 22092.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA260" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 356mm conforme con ECMA-260 / ISO 15898.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA317" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 300mm conforme con ECMA-317 / ISO 20162.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA56" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 5¼" en formato ECMA-56.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA66" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" en formato ECMA-66.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA70" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" en formato ECMA-70.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA78" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" en formato ECMA-78.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA99" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 5¼" en formato ECMA-99.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA54" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 8" en formato ECMA-54.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA59" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 8" en formato ECMA-59.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA69" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 8" en formato ECMA-69.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FDFORMAT_MD2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 5¼" en formato FDFORMAT.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD1DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad y una cara de 5¼" en formato IBM.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD1DD_8" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad y una cara de 5¼" en formato IBM (8 sectores).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD2DD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 5¼" en formato IBM.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD2DD_8" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad de 5¼" en formato IBM (8 sectores.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 5¼" en formato IBM.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO10089" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ISO 10089.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO14517" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ISO 14517.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO15041" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 3½" conforme con ISO 15041.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO15286" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico de 5¼" conforme con ISO 15286.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LS120" xml:space="preserve">
|
||||
<value>El modelo de la unidad es LS (SuperDisk), el medio tiene 246528 bloques de 512 bytes, estableciendo tipo como LS-120.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LS240" xml:space="preserve">
|
||||
<value>El modelo de la unidad es LS (SuperDisk), el medio tiene 469504 bloques de 512 bytes, estableciendo tipo como LS-120.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_JAZ" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es IOMEGA, el modelo es JAZ y el medio tiene 2091050 bloques de 512 bytes, estableciendo tipo como JAZ de 1Gb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_JAZ2" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es IOMEGA, el modelo es JAZ y el medio tiene 3915600 bloques de 512 bytes, estableciendo tipo como JAZ de 2Gb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ZIP100" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es IOMEGA, el modelo es ZIP y el medio tiene 196608 bloques de 512 bytes, estableciendo tipo como ZIP de 100Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ZIP250" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es IOMEGA, el modelo es ZIP y el medio tiene 196608 bloques de 512 bytes, estableciendo tipo como ZIP de 250Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como LTO.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO2" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como LTO-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC11" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-11.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC120" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-120.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC150" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-150.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC24" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-24.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan5" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como Travan 5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan4" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como Travan 4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000A" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T10000A.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000B" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T10000B.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000C" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T10000C.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000D" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T10000D.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9840A" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T9840A.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9840D" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T9840D.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9940A" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T9940A.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9940B" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T9940B.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9940C" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante es StorageTek, estableciendo tipo como T9840C.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_106m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 106m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_112m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 112m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_125m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 125m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_150m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 150m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_15m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 15m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_160m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape XL de 160m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_170m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 170m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_225m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 225m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_22m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 22m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_22m_AME" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape AME de 22m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_28m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 28m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_40m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 40m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_45m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 45m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_54m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 54m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_75m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 75m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_76m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 76.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_80m" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "exb", estableciendo tipo como Exatape de 80m.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO2_ult" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO3" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO4" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO5" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO6_ult" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-6.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO7_ult" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-7.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO_ult" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SAIT" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "sdz", estableciendo tipo como Super AIT.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SDLT" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "dlt", estableciendo tipo como SuperDLT.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SDLT2" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "dlt", estableciendo tipo como SuperDLT 2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan5_stt" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "stt", estableciendo tipo como Travan 5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan7" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "stt", estableciendo tipo como Travan 7.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VStape" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "dlt", estableciendo tipo como VStape I.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VXA" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "vxa", estableciendo tipo como VXA.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VXA2" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "vxa", estableciendo tipo como VXA 2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VXA3" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "vxa", estableciendo tipo como VXA 3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO3" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como WORM LTO-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO4" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como WORM LTO-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO5" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como WORM LTO-5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO6_ult" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como WORM LTO-6.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO7_ult" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "uly", estableciendo tipo como WORM LTO-7.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO2"
|
||||
xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO3"
|
||||
xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO4"
|
||||
xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO5"
|
||||
xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el modelo de la unidad comienza por "ult", estableciendo tipo como LTO-5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Floptical" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como Floptical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HiMD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como Sony HiMD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD60" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 60 minutos.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD74" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 74 minutos.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD80" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 80 minutos.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_REV120" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como REV de 120Gb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_REV35" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como REV de 35Gb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_REV70" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como REV de 70Gb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_UDO" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como UDO.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_UDO2" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como UDO2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Unknown" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como desconocido.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Unknown_MO" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico desconocido.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_UDO2" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como WORM UDO 2.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_PD_650" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como PD-650.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_WORM_PD_650"
|
||||
xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como WORM PD-650.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_23FD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 8" en formato IBM 23FD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_33FD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 8" en formato IBM 33FD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_43FD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 8" en formato IBM 43FD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_53FD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de 8" en formato IBM 53FD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_PC98_MD2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 5¼" en formato PC-98.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Sharp_MF2HD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de alta densidad de 3½" con formato Sharp.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HF12" xml:space="preserve">
|
||||
<value>El medio tiene 46956 bloques de 256 bytes, estableciendo tipo como HyperFlex de 12Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HF24" xml:space="preserve">
|
||||
<value>El medio tiene 46956 bloques de 256 bytes, estableciendo tipo como HyperFlex de 24Mb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Orb" xml:space="preserve">
|
||||
<value>El modelo de la unidad es Castlewood Orb, el medio tiene 4307184 bloques de 512 bytes, estableciendo tipo como Orb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_RDX320" xml:space="preserve">
|
||||
<value>El modelo de la unidad es RDX, el medio tiene {0} bloques de {1} bytes, estableciendo tipo como RDX320.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ2000" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es SyQuest, el medio tiene 390696 bloques de 512 bytes, estableciendo tipo como SQ2000.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ310" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es SyQuest, el medio tiene 215440 bloques de 512 bytes, estableciendo tipo como SQ310.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ327" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es SyQuest, el medio tiene 524288 bloques de 512 bytes, estableciendo tipo como SQ327.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ400" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es SyQuest, el medio tiene 87600 bloques de 512 bytes, estableciendo tipo como SQ400.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ800" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es SyQuest, el medio tiene 173456 bloques de 512 bytes, estableciendo tipo como SQ800.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SyJet" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es SyQuest, el medio tiene 2929800 bloques de 512 bytes, estableciendo tipo como SyJet.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_PocketZIP" xml:space="preserve">
|
||||
<value>El fabricante de la unidad es IOMEGA, el medio tiene 78882 bloques de 512 bytes, estableciendo tipo como PocketZIP.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HiFD" xml:space="preserve">
|
||||
<value>El modelo de la unidad es HiFD, el medio tiene 393380 bloques de 512 bytes, estableciendo tipo como HiFD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FD32MB" xml:space="preserve">
|
||||
<value>El modelo de la unidad es LS (SuperDisk), el medio tiene 65536 bloques de 512 bytes, estableciendo tipo como FD32MB.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_EZ135" xml:space="preserve">
|
||||
<value>El fabricante es SyQuest, el medio tiene 262144 bloques de 512 bytes, estableciendo tipo como EZ135.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_EZ230" xml:space="preserve">
|
||||
<value>El fabricante es SyQuest, el medio tiene 450560 bloques de 512 bytes, estableciendo tipo como EZ230.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM3490" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como IBM 3490.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM3490E" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como IBM 3490E.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM3592" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h y el fabricante de la unidad es IBM, estableciendo tipo como IBM 3592.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD60_MDDATA" xml:space="preserve">
|
||||
<value>El tipo de periférico SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 60 minutos.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD74_MDDATA" xml:space="preserve">
|
||||
<value>El tipo de periférico SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 74 minutos.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD80_MDDATA" xml:space="preserve">
|
||||
<value>El tipo de periférico SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 80 minutos.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MDDATA" xml:space="preserve">
|
||||
<value>El tipo de periférico SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc for Data.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MetaFloppy" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete de doble densidad y una cara de 5¼" en formato MetaFloppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ZBC_Host_Managed" xml:space="preserve">
|
||||
<value>El tipo de periférico SCSI es {0:X2}h, estableciendo tipo como dispositivo de zonas de bloques gestionado.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_and_device_is_USB_setting_media_type_to_Flash_Drive" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h y el dispositivo es USB, estableciendo tipo como unidad Flash.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CDR" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD-R.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CDRW" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD-RW.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CD_Plus" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD+.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CD_ROM" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD-ROM.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como Compact Disc.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc_Digital_Audio" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como Compact Disc Digital Audio.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_Photo_CD" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como Photo CD.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_unknown_magneto_optical" xml:space="preserve">
|
||||
<value>El tipo de medio SCSI es {0:X2}h, estableciendo tipo como magneto-óptico desconocido.</value>
|
||||
</data>
|
||||
<data name="Unhandled_exception_calling_uname_0" xml:space="preserve">
|
||||
<value>Excepción no manejada llamando a uname: {0}</value>
|
||||
</data>
|
||||
</root>
|
||||
638
Aaru.CommonTypes/Localization/Localization.resx
Normal file
638
Aaru.CommonTypes/Localization/Localization.resx
Normal file
@@ -0,0 +1,638 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
|
||||
<root>
|
||||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
|
||||
id="root"
|
||||
xmlns="">
|
||||
<xsd:element name="root" msdata:IsDataSet="true"></xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>1.3</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
|
||||
PublicKeyToken=b77a5c561934e089
|
||||
</value>
|
||||
</resheader>
|
||||
<data name="Unhandled_exception_calling_uname_0" xml:space="preserve">
|
||||
<value>Unhandled exception calling uname: {0}</value>
|
||||
</data>
|
||||
<data name="Drive_manufacturer_is_SyQuest_media_has_1961069_blocks_of_512_bytes_setting_media_type_to_SparQ"
|
||||
xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 1961069 blocks of 512 bytes, setting media type to SparQ.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_WORM_PD_650"
|
||||
xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to WORM PD-650.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_PD_650" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to PD-650.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to Compact Disc.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CD_ROM" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to CD-ROM.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc_Digital_Audio" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to Compact Disc Digital Audio.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CD_Plus" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to CD+.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_Photo_CD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to Photo CD.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CDR" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to CD-R.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_CDRW" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to CD-RW.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_and_device_is_USB_setting_media_type_to_Flash_Drive" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h and device is USB, setting media type to Flash Drive.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO2"
|
||||
xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO3"
|
||||
xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO4"
|
||||
xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO5"
|
||||
xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-5.</value>
|
||||
</data>
|
||||
<data name="SCSI_medium_type_is_0_setting_media_type_to_unknown_magneto_optical" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, setting media type to unknown magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA154" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-154 / ISO 10090 conforming 3½" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA201_embossed" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-201 / ISO 13963 conforming 3½" embossed magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA201" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-201 / ISO 13963 conforming 3½" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA223" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-223 conforming 3½" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA183" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-183 / ISO 13481 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO15041" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 15041 conforming 3½" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA184" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-184 / ISO 13549 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA195" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-195 / ISO 13842 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO14517" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 14517 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Unknown_MO" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to unknown magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO10089" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 10089 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA238" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-238 / ISO 15486 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ISO15286" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 15286 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA322" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-322 / ISO 22092 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA260" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-260 / ISO 15898 conforming 356mm magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA239" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-239 / ISO 15498 conforming 3½" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_GigaMO" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to GigaMO 3½" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_GigaMO2" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to GigaMO 2 3½" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA280" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-280 / ISO 18093 conforming 5¼" magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA317" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-317 / ISO 20162 conforming 300mm magneto-optical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_UDO" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to UDO.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_UDO2" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to WORM UDO2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_UDO2" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to UDO2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA54" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-54 formatted 8" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA59" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-59 formatted 8" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA69" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-69 formatted 8" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Unknown" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to unknown.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA66" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-66 formatted 5¼" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA70" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-70 formatted 5¼" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA78" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-78 formatted 5¼" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA99" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-99 formatted 5¼" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_REV120" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 120Gb REV.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_REV70" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 70Gb REV.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_REV35" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 35Gb REV.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_PC98_MF2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to PC-98 formatted 3½" high density floppy (15 sectors).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Atari_MD1SD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Atari formatted 5¼" single density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Atari_MD1DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Atari formatted 5¼" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_33FD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (33FD) floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_43FD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (43FD) floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ECMA56" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-56 formatted 5¼" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MD1SD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 5¼" single density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS32" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apple DOS 3.2 formatted 5¼" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS33" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apple DOS 3.3 formatted 5¼" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MD1DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 5¼" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS32_DS" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apple DOS 3.2 formatted 5¼" double sided floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_DOS33_DS" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apple DOS 3.3 formatted 5¼" double sided floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MetaFloppy" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to MetaFloppy formatted 5¼" double density single sided floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MD1DD_80" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 5¼" double density floppy with 80 tracks.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DEC_RX02" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to DEC RX02 floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_53FD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (53FD) floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli10" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, media has {0} blocks of 256 bytes, setting media type to 10Mb Bernoulli Box.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_23FD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (23FD) floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD1DD_8" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" double density single sided floppy (8 sectors).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD1DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" double density single sided floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apricot_MF2DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apricot formatted 3½" floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF1DD_8" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" double density single sided floppy (8 sectors).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD2DD_8" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" double density floppy (8 sectors).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF1DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" double density single sided floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD2DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Apple_MF1DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apple formatted 3½" double density single sided floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2DD_8" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" double density floppy (8 sectors).</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FDFORMAT_MF2DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 3½" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Amiga_MF2DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Amiga formatted 3½" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MD2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FDFORMAT_MD2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 5¼" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DMF_MF2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Microsoft DMF formatted 3½" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FDFORMAT_MF2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 3½" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Amiga_MF2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Amiga formatted 3½" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM_MF2ED" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" extra density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Floptical" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Floptical.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_FD32MB" xml:space="preserve">
|
||||
<value>Drive model is LS (SuperDisk), media has 65536 blocks of 512 bytes, setting media type to FD32MB.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_PocketZIP" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, media has 78882 blocks of 512 bytes, setting media type to PocketZIP.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ400" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 86700 blocks of 512 bytes, setting media type to SQ400.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli2_44" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, media has 87040 blocks of 512 bytes, setting media type to 44Mb Bernoulli Box II.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ800" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 173456 blocks of 512 bytes, setting media type to SQ800.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli2_90" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, media has 175856 blocks of 512 bytes, setting media type to 90Mb Bernoulli Box II.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ZIP100" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, drive model is ZIP, media has 196608 blocks of 512 bytes, setting media type to 100Mb ZIP.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ310" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 215440 blocks of 512 bytes, setting media type to SQ310.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LS120" xml:space="preserve">
|
||||
<value>Drive model is LS (SuperDisk), media has 246528 blocks of 512 bytes, setting media type to LS-120.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_EZ135" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 262144 blocks of 512 bytes, setting media type to EZ135.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Bernoulli2_150" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, media has 294918 blocks of 512 bytes, setting media type to 150Mb Bernoulli Box II.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ2000" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 390696 blocks of 512 bytes, setting media type to SQ2000.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HiFD" xml:space="preserve">
|
||||
<value>Drive model is HiFD, media has 393380 blocks of 512 bytes, setting media type to HiFD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_EZ230" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 450560 blocks of 512 bytes, setting media type to EZ230.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LS240" xml:space="preserve">
|
||||
<value>Drive model is LS (SuperDisk), media has 469504 blocks of 512 bytes, setting media type to LS-240.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ZIP250" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, drive model is ZIP, media has 489532 blocks of 512 bytes, setting media type to 250Mb ZIP.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SQ327" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 524288 blocks of 512 bytes, setting media type to SQ327.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_JAZ" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, drive model is JAZ, media has 2091050 blocks of 512 bytes, setting media type to 1Gb JAZ.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SyJet" xml:space="preserve">
|
||||
<value>Drive manufacturer is SyQuest, media has 2929800 blocks of 512 bytes, setting media type to SyJet.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_JAZ2" xml:space="preserve">
|
||||
<value>Drive manufacturer is IOMEGA, drive model is JAZ, media has 3915600 blocks of 512 bytes, setting media type to 2Gb JAZ.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Orb" xml:space="preserve">
|
||||
<value>Drive model is Castlewood Orb, media has 4307184 blocks of 512 bytes, setting media type to Orb.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_RDX320" xml:space="preserve">
|
||||
<value>Drive model is RDX, media has {0} blocks of {1} bytes, setting media type to RDX320.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MF2DD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 3½" double density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LS_PC98_MF2HD" xml:space="preserve">
|
||||
<value>Drive model is LS (SuperDisk), media has 2880 blocks of 512 bytes, setting media type to PC-98 formatted 3½" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Sharp_MF2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Sharp formatted 3½" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_PC98_MD2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to PC-98 formatted 5¼" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Acorn_MF2HD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 3½" high density floppy.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD60" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 60 minute MiniDisc.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD74" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 74 minute MiniDisc.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD80" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 80 minute MiniDisc.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HiMD" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Sony HiMD.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MDDATA" xml:space="preserve">
|
||||
<value>SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to MiniDisc for Data.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD60_MDDATA" xml:space="preserve">
|
||||
<value>SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 60 minute MiniDisc.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD74_MDDATA" xml:space="preserve">
|
||||
<value>SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 74 minute MiniDisc.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_MD80_MDDATA" xml:space="preserve">
|
||||
<value>SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 80 minute MiniDisc.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_ZBC_Host_Managed" xml:space="preserve">
|
||||
<value>SCSI peripheral type is {0:X2}h, setting media type to host managed zoned block device.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC11" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-11.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC24" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-24.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM3490" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to IBM 3490.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC120" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-120.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_QIC150" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-150.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS2" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS3" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS4" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM3490E" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to IBM 3490E.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO_ult" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SAIT" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "sdz" setting media type to Super AIT.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO2_ult" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9840A" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840A.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9940A" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9940A.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO3" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9940B" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9940B.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9940C" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840C.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO4" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T9840D" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840D.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000A" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000A.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000B" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000B.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000C" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000C.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_T10000D" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000D.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO5" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO3" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to WORM LTO-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO4" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to WORM LTO-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO5" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to WORM LTO-5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to LTO.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO2" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to LTO-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS3_dat" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS4_alt" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DAT72_dat" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DAT72.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DDS2_dat" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO6_ult" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-6.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO6_ult" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to WORM LTO-6.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_LTO7_ult" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-7.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_WORM_LTO7_ult" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to WORM LTO-7.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_15m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 15m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_IBM3592" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is IBM, setting media type to IBM 3592.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VXA" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_28m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 28m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_CompactTape" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to CompactTape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_CompactTapeII" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to CompactTape II.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VXA2" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA 2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VXA3" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA 3.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_54m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 54m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DLTtapeIII" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape III.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DLTtapeIIIxt" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape IIIxt.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_106m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 106m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_DLTtapeIV" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape IV.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan5_stt" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "stt" setting media type to Travan 5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_160m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 160m Exatape XL.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SDLT" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to SuperDLT.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_SDLT2" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to SuperDLT 2.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_VStape" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to VStape I.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan7" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "stt" setting media type to Travan 7.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan4" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to Travan 4.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Travan5" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to Travan 5.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_22m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 22m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_40m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 40m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_76m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 76m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_112m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 112m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_22m_AME" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 22m Exatape AME.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_170m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 170m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_125m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 125m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_45m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 45m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_225m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 225m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_150m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 150m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_75m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 75m Exatape.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_Exatape_80m" xml:space="preserve">
|
||||
<value>SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 80m Exatape.</value>
|
||||
</data>
|
||||
<data name="IDENTIFY_response_is_different_than_512_bytes_not_decoding" xml:space="preserve">
|
||||
<value>IDENTIFY response is different than 512 bytes, not decoding.</value>
|
||||
</data>
|
||||
<data name="INQUIRY_response_is_0_bytes_less_than_minimum_of_36_bytes" xml:space="preserve">
|
||||
<value>INQUIRY response is {0} bytes, less than minimum of 36 bytes, decoded data can be incorrect, not decoding.</value>
|
||||
</data>
|
||||
<data name="INQUIRY_response_length_0_bytes_is_different_than_specified_in_length_field" xml:space="preserve">
|
||||
<value>INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, not decoding.</value>
|
||||
</data>
|
||||
<data name="Exception_0" xml:space="preserve">
|
||||
<value>Exception {0}</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HF12" xml:space="preserve">
|
||||
<value>Media has 46956 blocks of 256 bytes, setting media type to 12Mb HyperFlex.</value>
|
||||
</data>
|
||||
<data name="SCSI_Media_Type_Description_HF24" xml:space="preserve">
|
||||
<value>Media has 78936 blocks of 256 bytes, setting media type to 24Mb HyperFlex.</value>
|
||||
</data>
|
||||
</root>
|
||||
1323
Aaru.CommonTypes/MediaType.cs
Normal file
1323
Aaru.CommonTypes/MediaType.cs
Normal file
File diff suppressed because it is too large
Load Diff
542
Aaru.CommonTypes/MediaType.csv
Normal file
542
Aaru.CommonTypes/MediaType.csv
Normal file
@@ -0,0 +1,542 @@
|
||||
Enum,Value,Summary
|
||||
"Unknown",0,"Unknown disk type"
|
||||
"UnknownMO",1,"Unknown magneto-optical"
|
||||
"GENERIC_HDD",2,"Generic hard disk"
|
||||
"Microdrive",3,"Microdrive type hard disk"
|
||||
"Zone_HDD",4,"Zoned hard disk"
|
||||
"FlashDrive",5,"USB flash drives"
|
||||
"UnknownTape",6,"Unknown data tape"
|
||||
"CD",10,"Any unknown or standard violating CD"
|
||||
"CDDA",11,"CD Digital Audio (Red Book)"
|
||||
"CDG",12,"CD+G (Red Book)"
|
||||
"CDEG",13,"CD+EG (Red Book)"
|
||||
"CDI",14,"CD-i (Green Book)"
|
||||
"CDROM",15,"CD-ROM (Yellow Book)"
|
||||
"CDROMXA",16,"CD-ROM XA (Yellow Book)"
|
||||
"CDPLUS",17,"CD+ (Blue Book)"
|
||||
"CDMO",18,"CD-MO (Orange Book)"
|
||||
"CDR",19,"CD-Recordable (Orange Book)"
|
||||
"CDRW",20,"CD-ReWritable (Orange Book)"
|
||||
"CDMRW",21,"Mount-Rainier CD-RW"
|
||||
"VCD",22,"Video CD (White Book)"
|
||||
"SVCD",23,"Super Video CD (White Book)"
|
||||
"PCD",24,"Photo CD (Beige Book)"
|
||||
"SACD",25,"Super Audio CD (Scarlet Book)"
|
||||
"DDCD",26,"Double-Density CD-ROM (Purple Book)"
|
||||
"DDCDR",27,"DD CD-R (Purple Book)"
|
||||
"DDCDRW",28,"DD CD-RW (Purple Book)"
|
||||
"DTSCD",29,"DTS audio CD (non-standard)"
|
||||
"CDMIDI",30,"CD-MIDI (Red Book)"
|
||||
"CDV",31,"CD-Video (ISO/IEC 61104)"
|
||||
"PD650",32,"120mm, Phase-Change, 1298496 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485"
|
||||
"PD650_WORM",33,"120mm, Write-Once, 1281856 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485"
|
||||
"CDIREADY",34,"CD-i Ready, contains a track before the first TOC track, in mode 2, and all TOC tracks are Audio. Subchannel marks track as audio pause."
|
||||
"FMTOWNS",35,
|
||||
"DVDROM",40,"DVD-ROM (applies to DVD Video and DVD Audio)"
|
||||
"DVDR",41,"DVD-R"
|
||||
"DVDRW",42,"DVD-RW"
|
||||
"DVDPR",43,"DVD+R"
|
||||
"DVDPRW",44,"DVD+RW"
|
||||
"DVDPRWDL",45,"DVD+RW DL"
|
||||
"DVDRDL",46,"DVD-R DL"
|
||||
"DVDPRDL",47,"DVD+R DL"
|
||||
"DVDRAM",48,"DVD-RAM"
|
||||
"DVDRWDL",49,"DVD-RW DL"
|
||||
"DVDDownload",50,"DVD-Download"
|
||||
"HDDVDROM",51,"HD DVD-ROM (applies to HD DVD Video)"
|
||||
"HDDVDRAM",52,"HD DVD-RAM"
|
||||
"HDDVDR",53,"HD DVD-R"
|
||||
"HDDVDRW",54,"HD DVD-RW"
|
||||
"HDDVDRDL",55,"HD DVD-R DL"
|
||||
"HDDVDRWDL",56,"HD DVD-RW DL"
|
||||
"BDROM",60,"BD-ROM (and BD Video)"
|
||||
"BDR",61,"BD-R"
|
||||
"BDRE",62,"BD-RE"
|
||||
"BDRXL",63,"BD-R XL"
|
||||
"BDREXL",64,"BD-RE XL"
|
||||
"UHDBD",65,"Ultra HD Blu-ray"
|
||||
"EVD",70,"Enhanced Versatile Disc"
|
||||
"FVD",71,"Forward Versatile Disc"
|
||||
"HVD",72,"Holographic Versatile Disc"
|
||||
"CBHD",73,"China Blue High Definition"
|
||||
"HDVMD",74,"High Definition Versatile Multilayer Disc"
|
||||
"VCDHD",75,"Versatile Compact Disc High Density"
|
||||
"SVOD",76,"Stacked Volumetric Optical Disc"
|
||||
"FDDVD",77,"Five Dimensional disc"
|
||||
"CVD",78,"China Video Disc"
|
||||
"LD",80,"Pioneer LaserDisc"
|
||||
"LDROM",81,"Pioneer LaserDisc data"
|
||||
"LDROM2",82,
|
||||
"LVROM",83,
|
||||
"MegaLD",84,
|
||||
"CRVdisc",85,"Writable LaserDisc with support for component video"
|
||||
"HiMD",90,"Sony Hi-MD"
|
||||
"MD",91,"Sony MiniDisc"
|
||||
"MDData",92,"Sony MD-Data"
|
||||
"MDData2",93,"Sony MD-Data2"
|
||||
"MD60",94,"Sony MiniDisc, 60 minutes, formatted with Hi-MD format"
|
||||
"MD74",95,"Sony MiniDisc, 74 minutes, formatted with Hi-MD format"
|
||||
"MD80",96,"Sony MiniDisc, 80 minutes, formatted with Hi-MD format"
|
||||
"UDO",100,"5.25"", Phase-Change, 1834348 sectors, 8192 bytes/sector, Ultra Density Optical, ECMA-350, ISO 17345"
|
||||
"UDO2",101,"5.25"", Phase-Change, 3669724 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976"
|
||||
"UDO2_WORM",102,"5.25"", Write-Once, 3668759 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976"
|
||||
"PlayStationMemoryCard",110,
|
||||
"PlayStationMemoryCard2",111,
|
||||
"PS1CD",112,"Sony PlayStation game CD"
|
||||
"PS2CD",113,"Sony PlayStation 2 game CD"
|
||||
"PS2DVD",114,"Sony PlayStation 2 game DVD"
|
||||
"PS3DVD",115,"Sony PlayStation 3 game DVD"
|
||||
"PS3BD",116,"Sony PlayStation 3 game Blu-ray"
|
||||
"PS4BD",117,"Sony PlayStation 4 game Blu-ray"
|
||||
"UMD",118,"Sony PlayStation Portable Universal Media Disc (ECMA-365)"
|
||||
"PlayStationVitaGameCard",119,
|
||||
"PS5BD",120,"Sony PlayStation 5 game Ultra HD Blu-ray"
|
||||
"XGD",130,"Microsoft X-box Game Disc"
|
||||
"XGD2",131,"Microsoft X-box 360 Game Disc"
|
||||
"XGD3",132,"Microsoft X-box 360 Game Disc"
|
||||
"XGD4",133,"Microsoft X-box One Game Disc"
|
||||
"MEGACD",150,"Sega MegaCD"
|
||||
"SATURNCD",151,"Sega Saturn disc"
|
||||
"GDROM",152,"Sega/Yamaha Gigabyte Disc"
|
||||
"GDR",153,"Sega/Yamaha recordable Gigabyte Disc"
|
||||
"SegaCard",154,
|
||||
"MilCD",155,
|
||||
"MegaDriveCartridge",156,
|
||||
"_32XCartridge",157,
|
||||
"SegaPicoCartridge",158,
|
||||
"MasterSystemCartridge",159,
|
||||
"GameGearCartridge",160,
|
||||
"SegaSaturnCartridge",161,
|
||||
"HuCard",170,"PC-Engine / TurboGrafx cartridge"
|
||||
"SuperCDROM2",171,"PC-Engine / TurboGrafx CD"
|
||||
"JaguarCD",172,"Atari Jaguar CD"
|
||||
"ThreeDO",173,"3DO CD"
|
||||
"PCFX",174,"NEC PC-FX"
|
||||
"NeoGeoCD",175,"NEO-GEO CD"
|
||||
"CDTV",176,"Commodore CDTV"
|
||||
"CD32",177,"Amiga CD32"
|
||||
"Nuon",178,"Nuon (DVD based videogame console)"
|
||||
"Playdia",179,"Bandai Playdia"
|
||||
"Apple32SS",180,"5.25"", SS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR"
|
||||
"Apple32DS",181,"5.25"", DS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR"
|
||||
"Apple33SS",182,"5.25"", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR"
|
||||
"Apple33DS",183,"5.25"", DS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR"
|
||||
"AppleSonySS",184,"3.5"", SS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR"
|
||||
"AppleSonyDS",185,"3.5"", DS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR"
|
||||
"AppleFileWare",186,"5.25"", DS, ?D, ?? tracks, ?? spt, 512 bytes/sector, GCR, opposite side heads, aka Twiggy"
|
||||
"DOS_525_SS_DD_8",190,"5.25"", SS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM"
|
||||
"DOS_525_SS_DD_9",191,"5.25"", SS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM"
|
||||
"DOS_525_DS_DD_8",192,"5.25"", DS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM"
|
||||
"DOS_525_DS_DD_9",193,"5.25"", DS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM"
|
||||
"DOS_525_HD",194,"5.25"", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM"
|
||||
"DOS_35_SS_DD_8",195,"3.5"", SS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM"
|
||||
"DOS_35_SS_DD_9",196,"3.5"", SS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM"
|
||||
"DOS_35_DS_DD_8",197,"3.5"", DS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM"
|
||||
"DOS_35_DS_DD_9",198,"3.5"", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM"
|
||||
"DOS_35_HD",199,"3.5"", DS, HD, 80 tracks, 18 spt, 512 bytes/sector, MFM"
|
||||
"DOS_35_ED",200,"3.5"", DS, ED, 80 tracks, 36 spt, 512 bytes/sector, MFM"
|
||||
"DMF",201,"3.5"", DS, HD, 80 tracks, 21 spt, 512 bytes/sector, MFM"
|
||||
"DMF_82",202,"3.5"", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM"
|
||||
"XDF_525",203,"5.25"", DS, HD, 80 tracks, ? spt, ??? + ??? + ??? bytes/sector, MFM track 0 = ??15 sectors, 512 bytes/sector, falsified to DOS as 19 spt, 512 bps"
|
||||
"XDF_35",204,"3.5"", DS, HD, 80 tracks, 4 spt, 8192 + 2048 + 1024 + 512 bytes/sector, MFM track 0 = 19 sectors, 512 bytes/sector, falsified to DOS as 23 spt, 512 bps"
|
||||
"IBM23FD",210,"8"", SS, SD, 32 tracks, 8 spt, 319 bytes/sector, FM"
|
||||
"IBM33FD_128",211,"8"", SS, SD, 73 tracks, 26 spt, 128 bytes/sector, FM"
|
||||
"IBM33FD_256",212,"8"", SS, SD, 74 tracks, 15 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector"
|
||||
"IBM33FD_512",213,"8"", SS, SD, 74 tracks, 8 spt, 512 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector"
|
||||
"IBM43FD_128",214,"8"", DS, SD, 74 tracks, 26 spt, 128 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector"
|
||||
"IBM43FD_256",215,"8"", DS, SD, 74 tracks, 26 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector"
|
||||
"IBM53FD_256",216,"8"", DS, DD, 74 tracks, 26 spt, 256 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"IBM53FD_512",217,"8"", DS, DD, 74 tracks, 15 spt, 512 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"IBM53FD_1024",218,"8"", DS, DD, 74 tracks, 8 spt, 1024 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"RX01",220,"8"", SS, DD, 77 tracks, 26 spt, 128 bytes/sector, FM"
|
||||
"RX02",221,"8"", SS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM"
|
||||
"RX03",222,"8"", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM"
|
||||
"RX50",223,"5.25"", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM"
|
||||
"ACORN_525_SS_SD_40",230,"5,25"", SS, SD, 40 tracks, 10 spt, 256 bytes/sector, FM"
|
||||
"ACORN_525_SS_SD_80",231,"5,25"", SS, SD, 80 tracks, 10 spt, 256 bytes/sector, FM"
|
||||
"ACORN_525_SS_DD_40",232,"5,25"", SS, DD, 40 tracks, 16 spt, 256 bytes/sector, MFM"
|
||||
"ACORN_525_SS_DD_80",233,"5,25"", SS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM"
|
||||
"ACORN_525_DS_DD",234,"5,25"", DS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM"
|
||||
"ACORN_35_DS_DD",235,"3,5"", DS, DD, 80 tracks, 5 spt, 1024 bytes/sector, MFM"
|
||||
"ACORN_35_DS_HD",236,"3,5"", DS, HD, 80 tracks, 10 spt, 1024 bytes/sector, MFM"
|
||||
"ATARI_525_SD",240,"5,25"", SS, SD, 40 tracks, 18 spt, 128 bytes/sector, FM"
|
||||
"ATARI_525_ED",241,"5,25"", SS, ED, 40 tracks, 26 spt, 128 bytes/sector, MFM"
|
||||
"ATARI_525_DD",242,"5,25"", SS, DD, 40 tracks, 18 spt, 256 bytes/sector, MFM"
|
||||
"ATARI_35_SS_DD",243,"3,5"", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM"
|
||||
"ATARI_35_DS_DD",244,"3,5"", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM"
|
||||
"ATARI_35_SS_DD_11",245,"3,5"", SS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM"
|
||||
"ATARI_35_DS_DD_11",246,"3,5"", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM"
|
||||
"CBM_35_DD",250,"3,5"", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM (1581)"
|
||||
"CBM_AMIGA_35_DD",251,"3,5"", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM (Amiga)"
|
||||
"CBM_AMIGA_35_HD",252,"3,5"", DS, HD, 80 tracks, 22 spt, 512 bytes/sector, MFM (Amiga)"
|
||||
"CBM_1540",253,"5,25"", SS, DD, 35 tracks, GCR"
|
||||
"CBM_1540_Ext",254,"5,25"", SS, DD, 40 tracks, GCR"
|
||||
"CBM_1571",255,"5,25"", DS, DD, 35 tracks, GCR"
|
||||
"NEC_8_SD",260,"8"", DS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM"
|
||||
"NEC_8_DD",261,"8"", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, MFM"
|
||||
"NEC_525_SS",262,"5.25"", SS, SD, 80 tracks, 16 spt, 256 bytes/sector, FM"
|
||||
"NEC_525_DS",263,"5.25"", DS, SD, 80 tracks, 16 spt, 256 bytes/sector, MFM"
|
||||
"NEC_525_HD",264,"5,25"", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM"
|
||||
"NEC_35_HD_8",265,"3,5"", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM, aka mode 3"
|
||||
"NEC_35_HD_15",266,"3,5"", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM"
|
||||
"NEC_35_TD",267,"3,5"", DS, TD, 240 tracks, 38 spt, 512 bytes/sector, MFM"
|
||||
"SHARP_525",NEC_525_HD,"5,25"", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM"
|
||||
"SHARP_525_9",268,"3,5"", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM"
|
||||
"SHARP_35",NEC_35_HD_8,"3,5"", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM"
|
||||
"SHARP_35_9",269,"3,5"", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM"
|
||||
"ECMA_99_8",270,"5,25"", DS, DD, 80 tracks, 8 spt, 1024 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"ECMA_99_15",271,"5,25"", DS, DD, 77 tracks, 15 spt, 512 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"ECMA_99_26",272,"5,25"", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, MFM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"ECMA_100",DOS_35_DS_DD_9,"3,5"", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM"
|
||||
"ECMA_125",DOS_35_HD,"3,5"", DS, HD, 80 tracks, 18 spt, 512 bytes/sector, MFM"
|
||||
"ECMA_147",DOS_35_ED,"3,5"", DS, ED, 80 tracks, 36 spt, 512 bytes/sector, MFM"
|
||||
"ECMA_54",273,"8"", SS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM"
|
||||
"ECMA_59",274,"8"", DS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM"
|
||||
"ECMA_66",275,"5,25"", SS, DD, 35 tracks, 9 spt, 256 bytes/sector, FM, track 0 side 0 = 16 sectors, 128 bytes/sector"
|
||||
"ECMA_69_8",276,"8"", DS, DD, 77 tracks, 8 spt, 1024 bytes/sector, FM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"ECMA_69_15",277,"8"", DS, DD, 77 tracks, 15 spt, 512 bytes/sector, FM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"ECMA_69_26",278,"8"", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM, track 0 side 0 = 26 sectors, 128 bytes/sector, track 0 side 1 = 26 sectors, 256 bytes/sector"
|
||||
"ECMA_70",279,"5,25"", DS, DD, 40 tracks, 16 spt, 256 bytes/sector, FM, track 0 side 0 = 16 sectors, 128 bytes/sector, track 0 side 1 = 16 sectors, 256 bytes/sector"
|
||||
"ECMA_78",280,"5,25"", DS, DD, 80 tracks, 16 spt, 256 bytes/sector, FM, track 0 side 0 = 16 sectors, 128 bytes/sector, track 0 side 1 = 16 sectors, 256 bytes/sector"
|
||||
"ECMA_78_2",281,"5,25"", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, FM"
|
||||
"FDFORMAT_525_DD",290,"5,25"", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM"
|
||||
"FDFORMAT_525_HD",291,"5,25"", DS, HD, 82 tracks, 17 spt, 512 bytes/sector, MFM"
|
||||
"FDFORMAT_35_DD",292,"3,5"", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM"
|
||||
"FDFORMAT_35_HD",293,"3,5"", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM"
|
||||
"Apricot_35",309,"3.5"", DS, DD, 70 tracks, 9 spt, 512 bytes/sector, MFM"
|
||||
"ADR2120",310,
|
||||
"ADR260",311,
|
||||
"ADR30",312,
|
||||
"ADR50",313,
|
||||
"AIT1",320,
|
||||
"AIT1Turbo",321,
|
||||
"AIT2",322,
|
||||
"AIT2Turbo",323,
|
||||
"AIT3",324,
|
||||
"AIT3Ex",325,
|
||||
"AIT3Turbo",326,
|
||||
"AIT4",327,
|
||||
"AIT5",328,
|
||||
"AITETurbo",329,
|
||||
"SAIT1",330,
|
||||
"SAIT2",331,
|
||||
"Bernoulli",340,"Obsolete type for 8""x11"" Bernoulli Box disk"
|
||||
"Bernoulli2",341,"Obsolete type for 5⅓"" Bernoulli Box II disks"
|
||||
"Ditto",342,
|
||||
"DittoMax",343,
|
||||
"Jaz",344,
|
||||
"Jaz2",345,
|
||||
"PocketZip",346,
|
||||
"REV120",347,
|
||||
"REV35",348,
|
||||
"REV70",349,
|
||||
"ZIP100",350,
|
||||
"ZIP250",351,
|
||||
"ZIP750",352,
|
||||
"Bernoulli35",353,"5⅓"" Bernoulli Box II disk with 35Mb capacity"
|
||||
"Bernoulli44",354,"5⅓"" Bernoulli Box II disk with 44Mb capacity"
|
||||
"Bernoulli65",355,"5⅓"" Bernoulli Box II disk with 65Mb capacity"
|
||||
"Bernoulli90",356,"5⅓"" Bernoulli Box II disk with 90Mb capacity"
|
||||
"Bernoulli105",357,"5⅓"" Bernoulli Box II disk with 105Mb capacity"
|
||||
"Bernoulli150",358,"5⅓"" Bernoulli Box II disk with 150Mb capacity"
|
||||
"Bernoulli230",359,"5⅓"" Bernoulli Box II disk with 230Mb capacity"
|
||||
"CompactCassette",360,
|
||||
"Data8",361,
|
||||
"MiniDV",362,
|
||||
"Dcas25",363,"D/CAS-25: Digital data on Compact Cassette form factor, special magnetic media, 9-track"
|
||||
"Dcas85",364,"D/CAS-85: Digital data on Compact Cassette form factor, special magnetic media, 17-track"
|
||||
"Dcas103",365,"D/CAS-103: Digital data on Compact Cassette form factor, special magnetic media, 21-track"
|
||||
"CFast",370,
|
||||
"CompactFlash",371,
|
||||
"CompactFlashType2",372,
|
||||
"DigitalAudioTape",380,
|
||||
"DAT160",381,
|
||||
"DAT320",382,
|
||||
"DAT72",383,
|
||||
"DDS1",384,
|
||||
"DDS2",385,
|
||||
"DDS3",386,
|
||||
"DDS4",387,
|
||||
"CompactTapeI",390,
|
||||
"CompactTapeII",391,
|
||||
"DECtapeII",392,
|
||||
"DLTtapeIII",393,
|
||||
"DLTtapeIIIxt",394,
|
||||
"DLTtapeIV",395,
|
||||
"DLTtapeS4",396,
|
||||
"SDLT1",397,
|
||||
"SDLT2",398,
|
||||
"VStapeI",399,
|
||||
"Exatape15m",400,
|
||||
"Exatape22m",401,
|
||||
"Exatape22mAME",402,
|
||||
"Exatape28m",403,
|
||||
"Exatape40m",404,
|
||||
"Exatape45m",405,
|
||||
"Exatape54m",406,
|
||||
"Exatape75m",407,
|
||||
"Exatape76m",408,
|
||||
"Exatape80m",409,
|
||||
"Exatape106m",410,
|
||||
"Exatape160mXL",411,
|
||||
"Exatape112m",412,
|
||||
"Exatape125m",413,
|
||||
"Exatape150m",414,
|
||||
"Exatape170m",415,
|
||||
"Exatape225m",416,
|
||||
"ExpressCard34",420,
|
||||
"ExpressCard54",421,
|
||||
"PCCardTypeI",422,
|
||||
"PCCardTypeII",423,
|
||||
"PCCardTypeIII",424,
|
||||
"PCCardTypeIV",425,
|
||||
"EZ135",430,"SyQuest 135Mb cartridge for use in EZ135 and EZFlyer drives"
|
||||
"EZ230",431,"SyQuest EZFlyer 230Mb cartridge for use in EZFlyer drive"
|
||||
"Quest",432,"SyQuest 4.7Gb for use in Quest drive"
|
||||
"SparQ",433,"SyQuest SparQ 1Gb cartridge"
|
||||
"SQ100",434,"SyQuest 5Mb cartridge for SQ306RD drive"
|
||||
"SQ200",435,"SyQuest 10Mb cartridge for SQ312RD drive"
|
||||
"SQ300",436,"SyQuest 15Mb cartridge for SQ319RD drive"
|
||||
"SQ310",437,"SyQuest 105Mb cartridge for SQ3105 and SQ3270 drives"
|
||||
"SQ327",438,"SyQuest 270Mb cartridge for SQ3270 drive"
|
||||
"SQ400",439,"SyQuest 44Mb cartridge for SQ555, SQ5110 and SQ5200C/SQ200 drives"
|
||||
"SQ800",440,"SyQuest 88Mb cartridge for SQ5110 and SQ5200C/SQ200 drives"
|
||||
"SQ1500",441,"SyQuest 1.5Gb cartridge for SyJet drive"
|
||||
"SQ2000",442,"SyQuest 200Mb cartridge for use in SQ5200C drive"
|
||||
"SyJet",443,"SyQuest 1.5Gb cartridge for SyJet drive"
|
||||
"FamicomGamePak",450,
|
||||
"GameBoyAdvanceGamePak",451,
|
||||
"GameBoyGamePak",452,
|
||||
"GOD",453,"Nintendo GameCube Optical Disc"
|
||||
"N64DD",454,
|
||||
"N64GamePak",455,
|
||||
"NESGamePak",456,
|
||||
"Nintendo3DSGameCard",457,
|
||||
"NintendoDiskCard",458,
|
||||
"NintendoDSGameCard",459,
|
||||
"NintendoDSiGameCard",460,
|
||||
"SNESGamePak",461,
|
||||
"SNESGamePakUS",462,
|
||||
"WOD",463,"Nintendo Wii Optical Disc"
|
||||
"WUOD",464,"Nintendo Wii U Optical Disc"
|
||||
"SwitchGameCard",465,
|
||||
"IBM3470",470,
|
||||
"IBM3480",471,
|
||||
"IBM3490",472,
|
||||
"IBM3490E",473,
|
||||
"IBM3592",474,
|
||||
"LTO",480,
|
||||
"LTO2",481,
|
||||
"LTO3",482,
|
||||
"LTO3WORM",483,
|
||||
"LTO4",484,
|
||||
"LTO4WORM",485,
|
||||
"LTO5",486,
|
||||
"LTO5WORM",487,
|
||||
"LTO6",488,
|
||||
"LTO6WORM",489,
|
||||
"LTO7",490,
|
||||
"LTO7WORM",491,
|
||||
"MemoryStick",510,
|
||||
"MemoryStickDuo",511,
|
||||
"MemoryStickMicro",512,
|
||||
"MemoryStickPro",513,
|
||||
"MemoryStickProDuo",514,
|
||||
"microSD",520,
|
||||
"miniSD",521,
|
||||
"SecureDigital",522,
|
||||
"MMC",530,
|
||||
"MMCmicro",531,
|
||||
"RSMMC",532,
|
||||
"MMCplus",533,
|
||||
"MMCmobile",534,
|
||||
"MLR1",540,
|
||||
"MLR1SL",541,
|
||||
"MLR3",542,
|
||||
"SLR1",543,
|
||||
"SLR2",544,
|
||||
"SLR3",545,
|
||||
"SLR32",546,
|
||||
"SLR32SL",547,
|
||||
"SLR4",548,
|
||||
"SLR5",549,
|
||||
"SLR5SL",550,
|
||||
"SLR6",551,
|
||||
"SLRtape7",552,
|
||||
"SLRtape7SL",553,
|
||||
"SLRtape24",554,
|
||||
"SLRtape24SL",555,
|
||||
"SLRtape40",556,
|
||||
"SLRtape50",557,
|
||||
"SLRtape60",558,
|
||||
"SLRtape75",559,
|
||||
"SLRtape100",560,
|
||||
"SLRtape140",561,
|
||||
"QIC11",570,
|
||||
"QIC120",571,
|
||||
"QIC1350",572,
|
||||
"QIC150",573,
|
||||
"QIC24",574,
|
||||
"QIC3010",575,
|
||||
"QIC3020",576,
|
||||
"QIC3080",577,
|
||||
"QIC3095",578,
|
||||
"QIC320",579,
|
||||
"QIC40",580,
|
||||
"QIC525",581,
|
||||
"QIC80",582,
|
||||
"STK4480",590,
|
||||
"STK4490",591,
|
||||
"STK9490",592,
|
||||
"T9840A",593,
|
||||
"T9840B",594,
|
||||
"T9840C",595,
|
||||
"T9840D",596,
|
||||
"T9940A",597,
|
||||
"T9940B",598,
|
||||
"T10000A",599,
|
||||
"T10000B",600,
|
||||
"T10000C",601,
|
||||
"T10000D",602,
|
||||
"Travan",610,
|
||||
"Travan1Ex",611,
|
||||
"Travan3",612,
|
||||
"Travan3Ex",613,
|
||||
"Travan4",614,
|
||||
"Travan5",615,
|
||||
"Travan7",616,
|
||||
"VXA1",620,
|
||||
"VXA2",621,
|
||||
"VXA3",622,
|
||||
"ECMA_153",630,"5,25"", M.O., WORM, 650Mb, 318750 sectors, 1024 bytes/sector, ECMA-153, ISO 11560"
|
||||
"ECMA_153_512",631,"5,25"", M.O., WORM, 600Mb, 581250 sectors, 512 bytes/sector, ECMA-153, ISO 11560"
|
||||
"ECMA_154",632,"3,5"", M.O., RW, 128Mb, 248826 sectors, 512 bytes/sector, ECMA-154, ISO 10090"
|
||||
"ECMA_183_512",633,"5,25"", M.O., RW/WORM, 1Gb, 904995 sectors, 512 bytes/sector, ECMA-183, ISO 13481"
|
||||
"ECMA_183",634,"5,25"", M.O., RW/WORM, 1Gb, 498526 sectors, 1024 bytes/sector, ECMA-183, ISO 13481"
|
||||
"ECMA_184_512",635,"5,25"", M.O., RW/WORM, 1.2Gb, 1165600 sectors, 512 bytes/sector, ECMA-184, ISO 13549"
|
||||
"ECMA_184",636,"5,25"", M.O., RW/WORM, 1.3Gb, 639200 sectors, 1024 bytes/sector, ECMA-184, ISO 13549"
|
||||
"ECMA_189",637,"300mm, M.O., WORM, ??? sectors, 1024 bytes/sector, ECMA-189, ISO 13614"
|
||||
"ECMA_190",638,"300mm, M.O., WORM, ??? sectors, 1024 bytes/sector, ECMA-190, ISO 13403"
|
||||
"ECMA_195",639,"5,25"", M.O., RW/WORM, 936921 or 948770 sectors, 1024 bytes/sector, ECMA-195, ISO 13842"
|
||||
"ECMA_195_512",640,"5,25"", M.O., RW/WORM, 1644581 or 1647371 sectors, 512 bytes/sector, ECMA-195, ISO 13842"
|
||||
"ECMA_201",641,"3,5"", M.O., 446325 sectors, 512 bytes/sector, ECMA-201, ISO 13963"
|
||||
"ECMA_201_ROM",642,"3,5"", M.O., 429975 sectors, 512 bytes/sector, embossed, ISO 13963"
|
||||
"ECMA_223",643,"3,5"", M.O., 371371 sectors, 1024 bytes/sector, ECMA-223"
|
||||
"ECMA_223_512",644,"3,5"", M.O., 694929 sectors, 512 bytes/sector, ECMA-223"
|
||||
"ECMA_238",645,"5,25"", M.O., 1244621 sectors, 1024 bytes/sector, ECMA-238, ISO 15486"
|
||||
"ECMA_239",646,"3,5"", M.O., 310352, 320332 or 321100 sectors, 2048 bytes/sector, ECMA-239, ISO 15498"
|
||||
"ECMA_260",647,"356mm, M.O., 14476734 sectors, 1024 bytes/sector, ECMA-260, ISO 15898"
|
||||
"ECMA_260_Double",648,"356mm, M.O., 24445990 sectors, 1024 bytes/sector, ECMA-260, ISO 15898"
|
||||
"ECMA_280",649,"5,25"", M.O., 1128134 sectors, 2048 bytes/sector, ECMA-280, ISO 18093"
|
||||
"ECMA_317",650,"300mm, M.O., 7355716 sectors, 2048 bytes/sector, ECMA-317, ISO 20162"
|
||||
"ECMA_322",651,"5,25"", M.O., 1095840 sectors, 4096 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart"
|
||||
"ECMA_322_2k",652,"5,25"", M.O., 2043664 sectors, 2048 bytes/sector, ECMA-322, ISO 22092, 8.6Gb/cart"
|
||||
"GigaMo",653,"3,5"", M.O., 605846 sectors, 2048 bytes/sector, Cherry Book, GigaMo, ECMA-351, ISO 17346"
|
||||
"GigaMo2",654,"3,5"", M.O., 1063146 sectors, 2048 bytes/sector, Cherry Book 2, GigaMo 2, ECMA-353, ISO 22533"
|
||||
"ISO_15286",655,"5,25"", M.O., 1263472 sectors, 2048 bytes/sector, ISO 15286, 5.2Gb/cart"
|
||||
"ISO_15286_1024",656,"5,25"", M.O., 2319786 sectors, 1024 bytes/sector, ISO 15286, 4.8Gb/cart"
|
||||
"ISO_15286_512",657,"5,25"", M.O., ??????? sectors, 512 bytes/sector, ISO 15286, 4.1Gb/cart"
|
||||
"ISO_10089",658,"5,25"", M.O., 314569 sectors, 1024 bytes/sector, ISO 10089, 650Mb/cart"
|
||||
"ISO_10089_512",659,"5,25"", M.O., ?????? sectors, 512 bytes/sector, ISO 10089, 594Mb/cart"
|
||||
"CompactFloppy",660,
|
||||
"DemiDiskette",661,
|
||||
"Floptical",662,"3.5"", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169"
|
||||
"HiFD",663,
|
||||
"QuickDisk",664,
|
||||
"UHD144",665,
|
||||
"VideoFloppy",666,
|
||||
"Wafer",667,
|
||||
"ZXMicrodrive",668,
|
||||
"MetaFloppy_Mod_II",669,"5.25"", SS, DD, 77 tracks, 16 spt, 256 bytes/sector, MFM, 100 tpi, 300rpm"
|
||||
"BeeCard",670,
|
||||
"Borsu",671,
|
||||
"DataStore",672,
|
||||
"DIR",673,
|
||||
"DST",674,
|
||||
"DTF",675,
|
||||
"DTF2",676,
|
||||
"Flextra3020",677,
|
||||
"Flextra3225",678,
|
||||
"HiTC1",679,
|
||||
"HiTC2",680,
|
||||
"LT1",681,
|
||||
"MiniCard",872,
|
||||
"Orb",683,
|
||||
"Orb5",684,
|
||||
"SmartMedia",685,
|
||||
"xD",686,
|
||||
"XQD",687,
|
||||
"DataPlay",688,
|
||||
"AppleProfile",690,
|
||||
"AppleWidget",691,
|
||||
"AppleHD20",692,
|
||||
"PriamDataTower",693,
|
||||
"Pippin",694,
|
||||
"RA60",700,"2382 cylinders, 4 tracks/cylinder, 42 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 204890112 bytes"
|
||||
"RA80",701,"546 cylinders, 14 tracks/cylinder, 31 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 121325568 bytes"
|
||||
"RA81",702,"1248 cylinders, 14 tracks/cylinder, 51 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 456228864 bytes"
|
||||
"RC25",703,"302 cylinders, 4 tracks/cylinder, 42 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 25976832 bytes"
|
||||
"RD31",704,"615 cylinders, 4 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 21411840 bytes"
|
||||
"RD32",705,"820 cylinders, 6 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 42823680 bytes"
|
||||
"RD51",706,"306 cylinders, 4 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 10653696 bytes"
|
||||
"RD52",707,"480 cylinders, 7 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 30965760 bytes"
|
||||
"RD53",708,"1024 cylinders, 7 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 75497472 bytes"
|
||||
"RD54",709,"1225 cylinders, 8 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 159936000 bytes"
|
||||
"RK06",710,"411 cylinders, 3 tracks/cylinder, 22 sectors/track, 256 words/sector, 16 bits/word, 512 bytes/sector, 13888512 bytes"
|
||||
"RK06_18",711,"411 cylinders, 3 tracks/cylinder, 20 sectors/track, 256 words/sector, 18 bits/word, 576 bytes/sector, 14204160 bytes"
|
||||
"RK07",712,"815 cylinders, 3 tracks/cylinder, 22 sectors/track, 256 words/sector, 16 bits/word, 512 bytes/sector, 27540480 bytes"
|
||||
"RK07_18",713,"815 cylinders, 3 tracks/cylinder, 20 sectors/track, 256 words/sector, 18 bits/word, 576 bytes/sector, 28166400 bytes"
|
||||
"RM02",714,"823 cylinders, 5 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 67420160 bytes"
|
||||
"RM03",715,"823 cylinders, 5 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 67420160 bytes"
|
||||
"RM05",716,"823 cylinders, 19 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 256196608 bytes"
|
||||
"RP02",717,"203 cylinders, 10 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 22865920 bytes"
|
||||
"RP02_18",718,"203 cylinders, 10 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, 23385600 bytes"
|
||||
"RP03",719,"400 cylinders, 10 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 45056000 bytes"
|
||||
"RP03_18",720,"400 cylinders, 10 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, 46080000 bytes"
|
||||
"RP04",721,"411 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 87960576 bytes"
|
||||
"RP04_18",722,"411 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, 89959680 bytes"
|
||||
"RP05",723,"411 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 87960576 bytes"
|
||||
"RP05_18",724,"411 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, 89959680 bytes"
|
||||
"RP06",725,"815 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 174423040 bytes"
|
||||
"RP06_18",726,"815 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, 178387200 bytes"
|
||||
"LS120",730,
|
||||
"LS240",731,
|
||||
"FD32MB",732,
|
||||
"RDX",733,
|
||||
"RDX320",734,"Imation 320Gb RDX"
|
||||
"VideoNow",740,
|
||||
"VideoNowColor",741,
|
||||
"VideoNowXp",742,
|
||||
"Bernoulli10",750,"8""x11"" Bernoulli Box disk with 10Mb capacity"
|
||||
"Bernoulli20",751,"8""x11"" Bernoulli Box disk with 20Mb capacity"
|
||||
"BernoulliBox2_20",752,"5⅓"" Bernoulli Box II disk with 20Mb capacity"
|
||||
"KodakVerbatim3",760,
|
||||
"KodakVerbatim6",761,
|
||||
"KodakVerbatim12",762,
|
||||
"ProfessionalDisc",770,"Professional Disc for video, single layer, rewritable, 23Gb"
|
||||
"ProfessionalDiscDual",771,"Professional Disc for video, dual layer, rewritable, 50Gb"
|
||||
"ProfessionalDiscTriple",772,"Professional Disc for video, triple layer, rewritable, 100Gb"
|
||||
"ProfessionalDiscQuad",773,"Professional Disc for video, quad layer, write once, 128Gb"
|
||||
"PDD",774,"Professional Disc for DATA, single layer, rewritable, 23Gb"
|
||||
"PDD_WORM",775,"Professional Disc for DATA, single layer, write once, 23Gb"
|
||||
"ArchivalDisc",776,"Archival Disc, 1st gen., 300Gb"
|
||||
"ArchivalDisc2",777,"Archival Disc, 2nd gen., 500Gb"
|
||||
"ArchivalDisc3",778,"Archival Disc, 3rd gen., 1Tb"
|
||||
"ODC300R",779,"Optical Disc archive, 1st gen., write once, 300Gb"
|
||||
"ODC300RE",780,"Optical Disc archive, 1st gen., rewritable, 300Gb"
|
||||
"ODC600R",781,"Optical Disc archive, 2nd gen., write once, 600Gb"
|
||||
"ODC600RE",782,"Optical Disc archive, 2nd gen., rewritable, 600Gb"
|
||||
"ODC1200RE",783,"Optical Disc archive, 3rd gen., rewritable, 1200Gb"
|
||||
"ODC1500R",784,"Optical Disc archive, 3rd gen., write once, 1500Gb"
|
||||
"ODC3300R",785,"Optical Disc archive, 4th gen., write once, 3300Gb"
|
||||
"ODC5500R",786,"Optical Disc archive, 5th gen., write once, 5500Gb"
|
||||
"ECMA_322_1k",800,"5,25"", M.O., 4383356 sectors, 1024 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart"
|
||||
"ECMA_322_512",801,"5,25"", M.O., ??????? sectors, 512 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart"
|
||||
"ISO_14517",802,"5,25"", M.O., 1273011 sectors, 1024 bytes/sector, ISO 14517, 2.6Gb/cart"
|
||||
"ISO_14517_512",803,"5,25"", M.O., 2244958 sectors, 512 bytes/sector, ISO 14517, 2.3Gb/cart"
|
||||
"ISO_15041_512",804,"3,5"", M.O., 1041500 sectors, 512 bytes/sector, ISO 15041, 540Mb/cart"
|
||||
"MetaFloppy_Mod_I",820,"5.25"", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, MFM, 48 tpi, ???rpm"
|
||||
"AtariLynxCard",821,
|
||||
"AtariJaguarCartridge",822,
|
||||
"HF12",823,"HyperFlex (12Mb), 5.25"", DS, 301 tracks, 78 spt, 256 bytes/sector, MFM, 333 tpi, 600rpm",
|
||||
"HF24",824,"HyperFlex (24Mb), 5.25"", DS, 506 tracks, 78 spt, 256 bytes/sector, MFM, 666 tpi, 720rpm",
|
||||
|
Can't render this file because it has a wrong number of fields in line 541.
|
72
Aaru.CommonTypes/MediaTypeFromDevice/FromAta.cs
Normal file
72
Aaru.CommonTypes/MediaTypeFromDevice/FromAta.cs
Normal file
@@ -0,0 +1,72 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FromAta.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru common types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the media type from an ATA (not ATAPI) device</summary>
|
||||
/// <param name="manufacturer">Manufacturer string</param>
|
||||
/// <param name="model">Model string</param>
|
||||
/// <param name="removable">Is the device removable?</param>
|
||||
/// <param name="compactFlash">Does the device self-identify as CompactFlash?</param>
|
||||
/// <param name="pcmcia">Is the device attached thru PCMCIA or CardBus?</param>
|
||||
/// <param name="blocks">Number of blocks in device</param>
|
||||
/// <returns>The media type</returns>
|
||||
public static MediaType GetFromAta(string manufacturer, string model, bool removable, bool compactFlash,
|
||||
bool pcmcia, ulong blocks)
|
||||
{
|
||||
if(!removable)
|
||||
{
|
||||
if(compactFlash)
|
||||
return MediaType.CompactFlash;
|
||||
|
||||
return pcmcia ? MediaType.PCCardTypeI : MediaType.GENERIC_HDD;
|
||||
}
|
||||
|
||||
if(!manufacturer.Equals("syquest", StringComparison.InvariantCultureIgnoreCase) ||
|
||||
!model.Equals("sparq", StringComparison.InvariantCultureIgnoreCase) ||
|
||||
blocks != 1961069)
|
||||
return MediaType.Unknown;
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
Drive_manufacturer_is_SyQuest_media_has_1961069_blocks_of_512_bytes_setting_media_type_to_SparQ);
|
||||
|
||||
return MediaType.SparQ;
|
||||
}
|
||||
}
|
||||
186
Aaru.CommonTypes/MediaTypeFromDevice/FromMmc.cs
Normal file
186
Aaru.CommonTypes/MediaTypeFromDevice/FromMmc.cs
Normal file
@@ -0,0 +1,186 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FromMmc.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru common types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
/// <summary>Gets the media type from a real device</summary>
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the media type from an SCSI MultiMedia Commands compliant device</summary>
|
||||
/// <param name="model">Model string</param>
|
||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||
/// <param name="densityCode">Density code from MODE SENSE</param>
|
||||
/// <param name="blocks">Number of blocks in media</param>
|
||||
/// <param name="blockSize">Size of a block in bytes</param>
|
||||
/// <param name="isUsb">Is the device USB attached</param>
|
||||
/// <param name="opticalDisc">Is the media an optical disc</param>
|
||||
/// <returns>Media type</returns>
|
||||
static MediaType GetFromMmc(string model, byte mediumType, byte densityCode, ulong blocks, uint blockSize,
|
||||
bool isUsb, bool opticalDisc)
|
||||
{
|
||||
switch(mediumType)
|
||||
{
|
||||
case 0x00:
|
||||
if(blockSize == 512)
|
||||
{
|
||||
if(blocks == 1281856)
|
||||
{
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_WORM_PD_650,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.PD650_WORM;
|
||||
}
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_PD_650,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.PD650;
|
||||
}
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc,
|
||||
mediumType);
|
||||
|
||||
return MediaType.CD;
|
||||
case 0x01:
|
||||
case 0x05:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_medium_type_is_0_setting_media_type_to_CD_ROM,
|
||||
mediumType);
|
||||
|
||||
return MediaType.CDROM;
|
||||
case 0x02:
|
||||
case 0x06:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc_Digital_Audio,
|
||||
mediumType);
|
||||
|
||||
return MediaType.CDDA;
|
||||
case 0x03:
|
||||
case 0x07:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.SCSI_medium_type_is_0_setting_media_type_to_CD_Plus,
|
||||
mediumType);
|
||||
|
||||
return MediaType.CDPLUS;
|
||||
case 0x04:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.SCSI_medium_type_is_0_setting_media_type_to_Photo_CD,
|
||||
mediumType);
|
||||
|
||||
return MediaType.PCD;
|
||||
case 0x10:
|
||||
case 0x11:
|
||||
case 0x12:
|
||||
case 0x13:
|
||||
case 0x14:
|
||||
case 0x15:
|
||||
case 0x16:
|
||||
case 0x17:
|
||||
case 0x18:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_medium_type_is_0_setting_media_type_to_CDR,
|
||||
mediumType);
|
||||
|
||||
return MediaType.CDR;
|
||||
case 0x20:
|
||||
case 0x21:
|
||||
case 0x22:
|
||||
case 0x23:
|
||||
case 0x24:
|
||||
case 0x25:
|
||||
case 0x26:
|
||||
case 0x27:
|
||||
case 0x28:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_medium_type_is_0_setting_media_type_to_CDRW,
|
||||
mediumType);
|
||||
|
||||
return MediaType.CDRW;
|
||||
case 0x40 when isUsb && !opticalDisc:
|
||||
case 0x41 when isUsb && !opticalDisc:
|
||||
case 0x42 when isUsb && !opticalDisc:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_and_device_is_USB_setting_media_type_to_Flash_Drive,
|
||||
mediumType);
|
||||
|
||||
return MediaType.FlashDrive;
|
||||
case 0x80:
|
||||
if(model.ToLowerInvariant().StartsWith("ult", StringComparison.Ordinal))
|
||||
{
|
||||
switch(densityCode)
|
||||
{
|
||||
case 0x42:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO2,
|
||||
mediumType, densityCode);
|
||||
|
||||
return MediaType.LTO2;
|
||||
case 0x44:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO3,
|
||||
mediumType, densityCode);
|
||||
|
||||
return MediaType.LTO3;
|
||||
case 0x46:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO4,
|
||||
mediumType, densityCode);
|
||||
|
||||
return MediaType.LTO4;
|
||||
case 0x58:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO5,
|
||||
mediumType, densityCode);
|
||||
|
||||
return MediaType.LTO5;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return MediaType.Unknown;
|
||||
}
|
||||
}
|
||||
303
Aaru.CommonTypes/MediaTypeFromDevice/FromOdc.cs
Normal file
303
Aaru.CommonTypes/MediaTypeFromDevice/FromOdc.cs
Normal file
@@ -0,0 +1,303 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FromOdc.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru common types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the device type from a SCSI Optical Device</summary>
|
||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||
/// <param name="blocks">Number of blocks in device</param>
|
||||
/// <param name="blockSize">Size in bytes of a block</param>
|
||||
/// <returns>Media type</returns>
|
||||
static MediaType GetFromOdc(byte mediumType, ulong blocks, uint blockSize)
|
||||
{
|
||||
if(mediumType != 0x01 && mediumType != 0x02 && mediumType != 0x03 && mediumType != 0x05 && mediumType != 0x07)
|
||||
{
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.SCSI_medium_type_is_0_setting_media_type_to_unknown_magneto_optical,
|
||||
mediumType);
|
||||
|
||||
return MediaType.UnknownMO;
|
||||
}
|
||||
|
||||
switch(blockSize)
|
||||
{
|
||||
case 512:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 248826:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA154,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_154;
|
||||
case 429975:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.SCSI_Media_Type_Description_ECMA201_embossed,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_201_ROM;
|
||||
case 446325:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA201,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_201;
|
||||
case 694929:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA223,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_223_512;
|
||||
case 904995:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA183,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_183_512;
|
||||
case 1041500:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO15041,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_15041_512;
|
||||
case 1128772:
|
||||
case 1163337:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA184,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_184_512;
|
||||
case 1281856:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_WORM_PD_650,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.PD650_WORM;
|
||||
case 1298496:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_PD_650,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.PD650;
|
||||
case 1644581:
|
||||
case 1647371:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA195,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_195_512;
|
||||
case 2244958:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO14517,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_14517_512;
|
||||
default:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown_MO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UnknownMO;
|
||||
}
|
||||
}
|
||||
|
||||
case 1024:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 314569:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO10089,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_10089;
|
||||
case 371371:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA223,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_223;
|
||||
case 498526:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA184,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_183;
|
||||
case 603466:
|
||||
case 637041:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA184,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_184;
|
||||
case 936921:
|
||||
case 948770:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA195,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_195;
|
||||
case 1244621:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA238,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_238;
|
||||
case 1273011:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO14517,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_14517;
|
||||
case 2319786:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO15286,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_15286_1024;
|
||||
case 4383356:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA322,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_322_1k;
|
||||
case 14476734:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA260,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_260;
|
||||
case 24445990:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA260,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_260_Double;
|
||||
default:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown_MO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UnknownMO;
|
||||
}
|
||||
}
|
||||
|
||||
case 2048:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 310352: // Found in real media
|
||||
case 318988:
|
||||
case 320332:
|
||||
case 321100:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA239,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_239;
|
||||
case 605846:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_GigaMO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.GigaMo;
|
||||
case 1063146:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_GigaMO2,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.GigaMo2;
|
||||
case 1128134:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA280,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_280;
|
||||
case 1263472:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO15286,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_15286;
|
||||
case 2043664:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA322,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_322_2k;
|
||||
case 7355716:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA317,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_317;
|
||||
default:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown_MO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UnknownMO;
|
||||
}
|
||||
}
|
||||
|
||||
case 4096:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 1095840:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA322,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_322;
|
||||
default:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown_MO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UnknownMO;
|
||||
}
|
||||
}
|
||||
|
||||
case 8192:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 1834348:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_UDO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UDO;
|
||||
case 3668759:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_UDO2,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UDO2_WORM;
|
||||
case 3669724:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_UDO2,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UDO2;
|
||||
default:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown_MO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UnknownMO;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown_MO, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.UnknownMO;
|
||||
}
|
||||
}
|
||||
}
|
||||
827
Aaru.CommonTypes/MediaTypeFromDevice/FromSbc.cs
Normal file
827
Aaru.CommonTypes/MediaTypeFromDevice/FromSbc.cs
Normal file
@@ -0,0 +1,827 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FromSbc.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru common types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the media type from a SCSI Block Commands compliant device</summary>
|
||||
/// <param name="vendor">Vendor string</param>
|
||||
/// <param name="model">Model string</param>
|
||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||
/// <param name="blocks">Number of blocks in device</param>
|
||||
/// <param name="blockSize">Size of a block in bytes</param>
|
||||
/// <returns>Media type</returns>
|
||||
static MediaType GetFromSbc(string vendor, string model, byte mediumType, ulong blocks, uint blockSize)
|
||||
{
|
||||
switch(mediumType)
|
||||
{
|
||||
case 0x09:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA54, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_54;
|
||||
case 0x0A:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA59, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_59;
|
||||
case 0x0B:
|
||||
switch(blockSize)
|
||||
{
|
||||
case 256:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA69,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_69_26;
|
||||
case 512:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA69,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_69_15;
|
||||
case 1024:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA69,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_69_8;
|
||||
}
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.Unknown;
|
||||
case 0x0E:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA66, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_66;
|
||||
case 0x12:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA70, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_70;
|
||||
case 0x16:
|
||||
switch(blockSize)
|
||||
{
|
||||
case 256:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA78,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_78;
|
||||
case 512:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA78,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_78_2;
|
||||
}
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.Unknown;
|
||||
case 0x1A:
|
||||
switch(blockSize)
|
||||
{
|
||||
case 256:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA99,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_99_26;
|
||||
case 512:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA99,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_99_15;
|
||||
case 1024:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA99,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_99_8;
|
||||
}
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Unknown, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.Unknown;
|
||||
case 0x1E:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF2DD, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_DS_DD_9;
|
||||
case 0x41:
|
||||
switch(blocks)
|
||||
{
|
||||
case 58620544:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_REV120,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.REV120;
|
||||
case 34185728:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_REV70,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.REV70;
|
||||
case 17090880:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_REV35,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.REV35;
|
||||
}
|
||||
|
||||
break;
|
||||
case 0x93:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_PC98_MF2HD, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.NEC_35_HD_15;
|
||||
case 0x94:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF2HD, mediumType,
|
||||
blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_HD;
|
||||
}
|
||||
|
||||
switch(blockSize)
|
||||
{
|
||||
case 128:
|
||||
switch(blocks)
|
||||
{
|
||||
case 720:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Atari_MD1SD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ATARI_525_SD;
|
||||
case 1040:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Atari_MD1DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ATARI_525_DD;
|
||||
case 1898:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_33FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM33FD_128;
|
||||
case 2002:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA54,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_54;
|
||||
case 3848:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_43FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM43FD_128;
|
||||
case 4004:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA59,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_59;
|
||||
}
|
||||
|
||||
break;
|
||||
case 256:
|
||||
switch(blocks)
|
||||
{
|
||||
case 322:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA56,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_66;
|
||||
case 400:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Acorn_MD1SD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ACORN_525_SS_SD_40;
|
||||
case 455:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Apple_DOS32,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.Apple32SS;
|
||||
case 560:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Apple_DOS33,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.Apple33SS;
|
||||
case 640:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Acorn_MD1DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ACORN_525_SS_DD_40;
|
||||
case 720:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Atari_MD1DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ATARI_525_DD;
|
||||
case 800:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Acorn_MD1DD_80,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ACORN_525_SS_SD_80;
|
||||
case 910:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Apple_DOS32_DS,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.Apple32DS;
|
||||
case 1120:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Apple_DOS33_DS,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.Apple33DS;
|
||||
case 1121:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_33FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM33FD_256;
|
||||
case 1232:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MetaFloppy,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.MetaFloppy_Mod_II;
|
||||
case 1280 when mediumType == 0x01:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Acorn_MD1DD_80,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ACORN_525_SS_DD_80;
|
||||
case 1280:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA70,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_70;
|
||||
case 2002:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DEC_RX02,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.RX02;
|
||||
case 2560:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA78,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_78;
|
||||
case 3848:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_53FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM53FD_256;
|
||||
case 4004:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA99,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_99_26;
|
||||
case 39168 when vendor.StartsWith("iomega", StringComparison.OrdinalIgnoreCase):
|
||||
case 41004 when vendor.StartsWith("iomega", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Bernoulli10,
|
||||
blocks);
|
||||
|
||||
return MediaType.Bernoulli10;
|
||||
case 46956:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_HF12);
|
||||
|
||||
return MediaType.HF12;
|
||||
case 78936:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_HF24);
|
||||
|
||||
return MediaType.HF12;
|
||||
}
|
||||
|
||||
break;
|
||||
case 319:
|
||||
switch(blocks)
|
||||
{
|
||||
case 256:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_23FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM23FD;
|
||||
}
|
||||
|
||||
break;
|
||||
case 512:
|
||||
switch(blocks)
|
||||
{
|
||||
case 320:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MD1DD_8,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_525_SS_DD_8;
|
||||
case 360:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MD1DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_525_SS_DD_9;
|
||||
case 610:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_33FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM33FD_512;
|
||||
case 630 when mediumType == 0x01:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Apricot_MF2DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.Apricot_35;
|
||||
case 640 when mediumType == 0x01:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF1DD_8,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_SS_DD_8;
|
||||
case 640:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MD2DD_8,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_525_DS_DD_8;
|
||||
case 720 when mediumType == 0x01:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF1DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_SS_DD_9;
|
||||
case 720:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MD2DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_525_DS_DD_9;
|
||||
case 800:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Apple_MF1DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.AppleSonySS;
|
||||
case 1280:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF2DD_8,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_DS_DD_8;
|
||||
case 1440:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF2DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_DS_DD_9;
|
||||
case 1640:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_FDFORMAT_MF2DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.FDFORMAT_35_DD;
|
||||
case 1760:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Amiga_MF2DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.CBM_AMIGA_35_DD;
|
||||
case 2242:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_53FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM53FD_512;
|
||||
case 2332:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA99,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_99_15;
|
||||
case 2400:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MD2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_525_HD;
|
||||
case 2788:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_FDFORMAT_MD2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.FDFORMAT_525_HD;
|
||||
case 2880:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_HD;
|
||||
case 3360:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DMF_MF2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DMF;
|
||||
case 3444:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_FDFORMAT_MF2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.FDFORMAT_35_HD;
|
||||
case 3520:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Amiga_MF2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.CBM_AMIGA_35_HD;
|
||||
case 5760:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_MF2ED,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.DOS_35_ED;
|
||||
case 40662 when mediumType == 0x20:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Floptical,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.Floptical;
|
||||
case 65536 when model.ToLowerInvariant().StartsWith("ls-", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_FD32MB);
|
||||
|
||||
return MediaType.FD32MB;
|
||||
case 78882 when vendor.StartsWith("iomega", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_PocketZIP);
|
||||
|
||||
return MediaType.PocketZip;
|
||||
case 86700 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SQ400);
|
||||
|
||||
return MediaType.SQ400;
|
||||
case 87040 when vendor.StartsWith("iomega", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Bernoulli2_44);
|
||||
|
||||
return MediaType.Bernoulli44;
|
||||
case 173456 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SQ800);
|
||||
|
||||
return MediaType.SQ800;
|
||||
case 175856 when vendor.StartsWith("iomega", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Bernoulli2_90);
|
||||
|
||||
return MediaType.Bernoulli90;
|
||||
case 196608 when model.ToLowerInvariant().StartsWith("zip", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ZIP100);
|
||||
|
||||
return MediaType.ZIP100;
|
||||
|
||||
case 215440 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SQ310);
|
||||
|
||||
return MediaType.SQ310;
|
||||
case 246528 when model.ToLowerInvariant().StartsWith("ls-", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LS120);
|
||||
|
||||
return MediaType.LS120;
|
||||
case 248826 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA154,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_154;
|
||||
case 262144 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_EZ135);
|
||||
|
||||
return MediaType.EZ135;
|
||||
case 294918 when vendor.StartsWith("iomega", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.SCSI_Media_Type_Description_Bernoulli2_150);
|
||||
|
||||
return MediaType.Bernoulli150;
|
||||
case 390696 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SQ2000);
|
||||
|
||||
return MediaType.SQ2000;
|
||||
case 393380 when model.ToLowerInvariant().StartsWith("hifd", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_HiFD, blocks,
|
||||
blockSize);
|
||||
|
||||
return MediaType.HiFD;
|
||||
case 429975 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.SCSI_Media_Type_Description_ECMA201_embossed,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_201_ROM;
|
||||
case 446325 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA201,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_201;
|
||||
case 450560 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_EZ230);
|
||||
|
||||
return MediaType.EZ230;
|
||||
case 469504 when model.ToLowerInvariant().StartsWith("ls-", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LS240);
|
||||
|
||||
return MediaType.LS240;
|
||||
case 489532 when model.ToLowerInvariant().StartsWith("zip", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ZIP250);
|
||||
|
||||
return MediaType.ZIP250;
|
||||
case 524288 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SQ327);
|
||||
|
||||
return MediaType.SQ327;
|
||||
case 694929 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA223,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_223_512;
|
||||
case 904995 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA183,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_183_512;
|
||||
case 1041500 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO15041,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_15041_512;
|
||||
case 1128772 when mediumType is 0x01 or 0x02:
|
||||
case 1163337 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA184,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_184_512;
|
||||
case 1281856 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_WORM_PD_650,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.PD650_WORM;
|
||||
case 1298496 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_PD_650,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.PD650;
|
||||
case 1470500 when model.ToLowerInvariant().StartsWith("zip", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ZIP250);
|
||||
|
||||
return MediaType.ZIP750;
|
||||
case 1644581 when mediumType is 0x01 or 0x02:
|
||||
case 1647371 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA195,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_195_512;
|
||||
case 1961069 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME,
|
||||
Localization.
|
||||
Drive_manufacturer_is_SyQuest_media_has_1961069_blocks_of_512_bytes_setting_media_type_to_SparQ);
|
||||
|
||||
return MediaType.SparQ;
|
||||
case 2091050 when model.ToLowerInvariant().StartsWith("jaz", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_JAZ);
|
||||
|
||||
return MediaType.Jaz;
|
||||
case 2244958 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO14517,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_14517_512;
|
||||
case 2929800 when vendor.Equals("syquest", StringComparison.InvariantCultureIgnoreCase):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SyJet);
|
||||
|
||||
return MediaType.SyJet;
|
||||
case 3915600 when model.ToLowerInvariant().StartsWith("jaz", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_JAZ2);
|
||||
|
||||
return MediaType.Jaz2;
|
||||
case 4307184 when vendor.ToLowerInvariant().StartsWith("cws orb", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Orb);
|
||||
|
||||
return MediaType.Orb;
|
||||
case 625134256 when model.ToLowerInvariant().StartsWith("rdx", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_RDX320, blocks,
|
||||
blockSize);
|
||||
|
||||
return MediaType.RDX320;
|
||||
}
|
||||
|
||||
break;
|
||||
case 1024:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 800 when mediumType == 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Acorn_MF2DD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ACORN_35_DS_DD;
|
||||
case 1220:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM_53FD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.IBM53FD_1024;
|
||||
case 1232 when model.ToLowerInvariant().StartsWith("ls-", StringComparison.Ordinal):
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LS_PC98_MF2HD);
|
||||
|
||||
return MediaType.NEC_35_HD_8;
|
||||
case 1232:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Sharp_MF2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.SHARP_35;
|
||||
case 1268:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA69,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_69_8;
|
||||
case 1280:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_PC98_MD2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.NEC_525_HD;
|
||||
case 1316:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA99,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_99_8;
|
||||
case 1600 when mediumType == 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Acorn_MF2HD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ACORN_35_DS_HD;
|
||||
case 314569 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO10089,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_10089;
|
||||
case 371371 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA223,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_223;
|
||||
case 498526 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA183,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_183;
|
||||
case 603466 when mediumType is 0x01 or 0x02:
|
||||
case 637041 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA184,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_184;
|
||||
case 936921 when mediumType is 0x01 or 0x02:
|
||||
case 948770 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA195,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_195;
|
||||
case 1244621 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA238,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_238;
|
||||
case 1273011 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO14517,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_14517;
|
||||
case 2319786 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO15286,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_15286_1024;
|
||||
case 4383356 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA322,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_322_1k;
|
||||
case 14476734 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA260,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_260;
|
||||
case 24445990 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA260,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_260_Double;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 2048:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 112311:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MD60,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.MD60;
|
||||
case 138363:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MD74,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.MD74;
|
||||
case 149373:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MD80,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.MD80;
|
||||
case 310352 when mediumType is 0x01 or 0x02: // Found in real media
|
||||
case 318988 when mediumType is 0x01 or 0x02:
|
||||
case 320332 when mediumType is 0x01 or 0x02:
|
||||
case 321100 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA239,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_239;
|
||||
case 494023:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_HiMD,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.HiMD;
|
||||
case 605846 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_GigaMO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.GigaMo;
|
||||
case 1063146 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_GigaMO2,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.GigaMo2;
|
||||
case 1128134 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA280,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_280;
|
||||
case 1263472 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ISO15286,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ISO_15286;
|
||||
case 2043664 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA322,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_322_2k;
|
||||
case 7355716 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA317,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_317;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 4096:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 1095840 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ECMA322,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.ECMA_322;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case 8192:
|
||||
{
|
||||
switch(blocks)
|
||||
{
|
||||
case 1834348 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_UDO,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UDO;
|
||||
case 3668759 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_UDO2,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UDO2_WORM;
|
||||
case 3669724 when mediumType is 0x01 or 0x02:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_UDO2,
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.UDO2;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return MediaType.Unknown;
|
||||
}
|
||||
}
|
||||
128
Aaru.CommonTypes/MediaTypeFromDevice/FromScsi.cs
Normal file
128
Aaru.CommonTypes/MediaTypeFromDevice/FromScsi.cs
Normal file
@@ -0,0 +1,128 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FromScsi.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru common types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
const string MODULE_NAME = "Media detection";
|
||||
|
||||
/// <summary>Tries to guess, from SCSI information, the media type of a device and/or its inserted media</summary>
|
||||
/// <param name="scsiPeripheralType">The SCSI Peripheral Type as indicated in the INQUIRY response</param>
|
||||
/// <param name="vendor">The vendor string of the device</param>
|
||||
/// <param name="model">The model string of the device</param>
|
||||
/// <param name="mediumType">The medium type byte from MODE SENSE</param>
|
||||
/// <param name="densityCode">The density type byte from MODE SENSE</param>
|
||||
/// <param name="blocks">How many blocks are on the media</param>
|
||||
/// <param name="blockSize">Size in bytes of each block</param>
|
||||
/// <param name="isUsb">Device is USB</param>
|
||||
/// <param name="opticalDisc">Is media an optical disc?</param>
|
||||
/// <returns>The media type</returns>
|
||||
public static MediaType GetFromScsi(byte scsiPeripheralType, string vendor, string model, byte mediumType,
|
||||
byte densityCode, ulong blocks, uint blockSize, bool isUsb, bool opticalDisc)
|
||||
{
|
||||
switch(scsiPeripheralType)
|
||||
{
|
||||
// Direct access device
|
||||
case 0x00:
|
||||
// Simplified access device
|
||||
case 0x0E:
|
||||
if(mediumType is 0x03 or 0x05 or 0x07)
|
||||
goto case 0x07;
|
||||
|
||||
return GetFromSbc(vendor, model, mediumType, blocks, blockSize);
|
||||
|
||||
// Sequential access device
|
||||
case 0x01:
|
||||
return GetFromSsc(vendor, model, mediumType, densityCode);
|
||||
|
||||
// Write-once device
|
||||
case 0x04:
|
||||
// Optical device
|
||||
case 0x07:
|
||||
return GetFromOdc(mediumType, blocks, blockSize);
|
||||
|
||||
// MultiMedia Device
|
||||
case 0x05:
|
||||
return GetFromMmc(model, mediumType, densityCode, blocks, blockSize, isUsb, opticalDisc);
|
||||
|
||||
// MD DATA drives
|
||||
case 0x10 when model.StartsWith("MDM", StringComparison.Ordinal) ||
|
||||
model.StartsWith("MDH", StringComparison.Ordinal):
|
||||
if(blockSize == 2048)
|
||||
{
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MDDATA,
|
||||
scsiPeripheralType, blocks, blockSize);
|
||||
|
||||
return MediaType.MDData;
|
||||
}
|
||||
|
||||
switch(blocks)
|
||||
{
|
||||
case 57312:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MD60_MDDATA,
|
||||
scsiPeripheralType, blocks, blockSize);
|
||||
|
||||
return MediaType.MD60;
|
||||
case 70464:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MD74_MDDATA,
|
||||
scsiPeripheralType, blocks, blockSize);
|
||||
|
||||
return MediaType.MD74;
|
||||
case 76096:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MD80_MDDATA,
|
||||
scsiPeripheralType, blocks, blockSize);
|
||||
|
||||
return MediaType.MD80;
|
||||
}
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_MD60_MDDATA,
|
||||
scsiPeripheralType, blocks, blockSize);
|
||||
|
||||
return MediaType.MD;
|
||||
|
||||
// Host managed zoned block device
|
||||
case 0x14:
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_ZBC_Host_Managed,
|
||||
scsiPeripheralType, blocks, blockSize);
|
||||
|
||||
return MediaType.Zone_HDD;
|
||||
}
|
||||
|
||||
return MediaType.Unknown;
|
||||
}
|
||||
}
|
||||
1541
Aaru.CommonTypes/MediaTypeFromDevice/FromSsc.cs
Normal file
1541
Aaru.CommonTypes/MediaTypeFromDevice/FromSsc.cs
Normal file
File diff suppressed because it is too large
Load Diff
61
Aaru.CommonTypes/Metadata/CdOffset.cs
Normal file
61
Aaru.CommonTypes/Metadata/CdOffset.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : CdOffset.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Device database.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Models Compact Disc read offset entries from AccurateRip database.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
/// <summary>Describes CD reading offset</summary>
|
||||
public class CdOffset
|
||||
{
|
||||
/// <summary>Drive manufacturer</summary>
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
/// <summary>Drive model</summary>
|
||||
public string Model { get; set; }
|
||||
|
||||
/// <summary>Reading offset</summary>
|
||||
public short Offset { get; set; }
|
||||
|
||||
/// <summary>Number of times this offset has been submitted</summary>
|
||||
public int Submissions { get; set; }
|
||||
|
||||
/// <summary>Percentage of submissions in agreement with this offset</summary>
|
||||
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:P0}")]
|
||||
public float Agreement { get; set; }
|
||||
}
|
||||
1533
Aaru.CommonTypes/Metadata/DeviceReport.cs
Normal file
1533
Aaru.CommonTypes/Metadata/DeviceReport.cs
Normal file
File diff suppressed because it is too large
Load Diff
2568
Aaru.CommonTypes/Metadata/MediaType.cs
Normal file
2568
Aaru.CommonTypes/Metadata/MediaType.cs
Normal file
File diff suppressed because it is too large
Load Diff
93
Aaru.CommonTypes/Metadata/Resume.cs
Normal file
93
Aaru.CommonTypes/Metadata/Resume.cs
Normal file
@@ -0,0 +1,93 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Resume.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : XML metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Defines XML format of a dump resume file.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
IncludeFields = true)]
|
||||
[JsonSerializable(typeof(ResumeJson))]
|
||||
// ReSharper disable once PartialTypeWithSinglePart
|
||||
public partial class ResumeJsonContext : JsonSerializerContext;
|
||||
|
||||
public class ResumeJson
|
||||
{
|
||||
[JsonPropertyName("AaruResume")]
|
||||
public Resume Resume { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Information that allows to resume a dump</summary>
|
||||
[Serializable]
|
||||
[XmlRoot("DicResume", Namespace = "", IsNullable = false)]
|
||||
public class Resume
|
||||
{
|
||||
/// <summary>List of blocks that returned an error on reading</summary>
|
||||
[XmlArrayItem("Block")]
|
||||
public List<ulong> BadBlocks;
|
||||
/// <summary>List of CD subchannels that did not read correctly</summary>
|
||||
[XmlArrayItem("Block")]
|
||||
public List<int> BadSubchannels;
|
||||
/// <summary>Extents of BLANK sectors for magneto-opticals</summary>
|
||||
[XmlArrayItem("Extent")]
|
||||
public Extent[] BlankExtents;
|
||||
/// <summary>Date/time this resume file was created</summary>
|
||||
[XmlElement(DataType = "dateTime")]
|
||||
public DateTime CreationDate;
|
||||
/// <summary>Last block on media</summary>
|
||||
public ulong LastBlock;
|
||||
/// <summary>Date/time this resume file was last written to</summary>
|
||||
[XmlElement(DataType = "dateTime")]
|
||||
public DateTime LastWriteDate;
|
||||
/// <summary>Title keys that has not been read</summary>
|
||||
[XmlArrayItem("Block")]
|
||||
public List<ulong> MissingTitleKeys;
|
||||
/// <summary>Next block to read</summary>
|
||||
public ulong NextBlock;
|
||||
/// <summary>Is media removable?</summary>
|
||||
public bool Removable;
|
||||
/// <summary>Is media a tape?</summary>
|
||||
public bool Tape;
|
||||
/// <summary>List of dump tries</summary>
|
||||
[XmlArrayItem("DumpTry")]
|
||||
public List<DumpHardware> Tries;
|
||||
}
|
||||
345
Aaru.CommonTypes/Metadata/Statistics.cs
Normal file
345
Aaru.CommonTypes/Metadata/Statistics.cs
Normal file
@@ -0,0 +1,345 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Statistics.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : XML metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Define XML for statistics.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
/// <summary>Statistics</summary>
|
||||
[XmlRoot("DicStats", Namespace = "", IsNullable = false)]
|
||||
public class Stats
|
||||
{
|
||||
/// <summary>Executed commands</summary>
|
||||
public CommandsStats Commands;
|
||||
|
||||
/// <summary>Operating systems Aaru has run from</summary>
|
||||
[XmlArrayItem("OperatingSystem")]
|
||||
public List<OsStats> OperatingSystems { get; set; }
|
||||
|
||||
/// <summary>Aaru versions</summary>
|
||||
[XmlArrayItem("Version")]
|
||||
public List<NameValueStats> Versions { get; set; }
|
||||
|
||||
/// <summary>Detected filesystems</summary>
|
||||
[XmlArrayItem("Filesystem")]
|
||||
public List<NameValueStats> Filesystems { get; set; }
|
||||
|
||||
/// <summary>Detected partitioning schemes</summary>
|
||||
[XmlArrayItem("Scheme")]
|
||||
public List<NameValueStats> Partitions { get; set; }
|
||||
|
||||
/// <summary>Media image formats</summary>
|
||||
[XmlArrayItem("Format")]
|
||||
public List<NameValueStats> MediaImages { get; set; }
|
||||
|
||||
/// <summary>Used filters</summary>
|
||||
[XmlArrayItem("Filter", IsNullable = true)]
|
||||
public List<NameValueStats> Filters { get; set; }
|
||||
|
||||
/// <summary>Found devices</summary>
|
||||
[XmlArrayItem("Device", IsNullable = true)]
|
||||
public List<DeviceStats> Devices { get; set; }
|
||||
|
||||
/// <summary>Found media types, real, and in image</summary>
|
||||
[XmlArrayItem("Media")]
|
||||
public List<MediaStats> Medias { get; set; }
|
||||
|
||||
/// <summary>Benchmark statistics</summary>
|
||||
public BenchmarkStats Benchmark { get; set; }
|
||||
|
||||
/// <summary>Media scanning statistics</summary>
|
||||
public MediaScanStats MediaScan { get; set; }
|
||||
|
||||
/// <summary>Image verification statistics</summary>
|
||||
public VerifyStats Verify { get; set; }
|
||||
}
|
||||
|
||||
[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
IncludeFields = true)]
|
||||
[JsonSerializable(typeof(StatsDto))]
|
||||
// ReSharper disable once PartialTypeWithSinglePart
|
||||
public partial class StatsDtoContext : JsonSerializerContext;
|
||||
|
||||
/// <summary>DTO for statistics</summary>
|
||||
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
||||
public class StatsDto
|
||||
{
|
||||
/// <summary>Executed commands</summary>
|
||||
public List<NameValueStats> Commands { get; set; }
|
||||
|
||||
/// <summary>Operating systems Aaru has run from</summary>
|
||||
public List<OsStats> OperatingSystems { get; set; }
|
||||
|
||||
/// <summary>Aaru versions</summary>
|
||||
public List<NameValueStats> Versions { get; set; }
|
||||
|
||||
/// <summary>Detected filesystems</summary>
|
||||
public List<NameValueStats> Filesystems { get; set; }
|
||||
|
||||
/// <summary>Detected partitioning schemes</summary>
|
||||
public List<NameValueStats> Partitions { get; set; }
|
||||
|
||||
/// <summary>Media image formats</summary>
|
||||
public List<NameValueStats> MediaFormats { get; set; }
|
||||
|
||||
/// <summary>Used filters</summary>
|
||||
public List<NameValueStats> Filters { get; set; }
|
||||
|
||||
/// <summary>Found devices</summary>
|
||||
public List<DeviceStats> Devices { get; set; }
|
||||
|
||||
/// <summary>Found media types, real, and in image</summary>
|
||||
public List<MediaStats> Medias { get; set; }
|
||||
|
||||
/// <summary>Remote applications</summary>
|
||||
public List<OsStats> RemoteApplications { get; set; }
|
||||
|
||||
/// <summary>Remote application architectures</summary>
|
||||
public List<NameValueStats> RemoteArchitectures { get; set; }
|
||||
|
||||
/// <summary>Operating systems where a remote application has been running</summary>
|
||||
public List<OsStats> RemoteOperatingSystems { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Command execution statistics</summary>
|
||||
[SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||
public class CommandsStats
|
||||
{
|
||||
/// <summary>Number of times the filesystem info command has been used</summary>
|
||||
public long Analyze;
|
||||
/// <summary>Number of times the benchmark command has been used</summary>
|
||||
public long Benchmark;
|
||||
/// <summary>Number of times the image checksum command has been used</summary>
|
||||
public long Checksum;
|
||||
/// <summary>Number of times the image compare command has been used</summary>
|
||||
public long Compare;
|
||||
/// <summary>Number of times the image convert command has been used</summary>
|
||||
public long ConvertImage;
|
||||
/// <summary>Number of times the image create-sidecar command has been used</summary>
|
||||
public long CreateSidecar;
|
||||
/// <summary>Number of times the image decode command has been used</summary>
|
||||
public long Decode;
|
||||
/// <summary>Number of times the device info command has been used</summary>
|
||||
public long DeviceInfo;
|
||||
/// <summary>Number of times the device report command has been used</summary>
|
||||
public long DeviceReport;
|
||||
/// <summary>Number of times the media dump command has been used</summary>
|
||||
public long DumpMedia;
|
||||
/// <summary>Number of times the image entropy command has been used</summary>
|
||||
public long Entropy;
|
||||
/// <summary>Number of times the filesystem extract command has been used</summary>
|
||||
public long ExtractFiles;
|
||||
/// <summary>Number of times the list formats command has been used</summary>
|
||||
public long Formats;
|
||||
/// <summary>Number of times the image info command has been used</summary>
|
||||
public long ImageInfo;
|
||||
/// <summary>Number of times the device list command has been used</summary>
|
||||
public long ListDevices;
|
||||
/// <summary>Number of times the list encodings command has been used</summary>
|
||||
public long ListEncodings;
|
||||
/// <summary>Number of times the filesystem ls command has been used</summary>
|
||||
public long Ls;
|
||||
/// <summary>Number of times the media info command has been used</summary>
|
||||
public long MediaInfo;
|
||||
/// <summary>Number of times the media scan command has been used</summary>
|
||||
public long MediaScan;
|
||||
/// <summary>Number of times the image printhex command has been used</summary>
|
||||
public long PrintHex;
|
||||
/// <summary>Number of times the image verify command has been used</summary>
|
||||
public long Verify;
|
||||
}
|
||||
|
||||
/// <summary>Statistics of verified media</summary>
|
||||
public class VerifiedItems
|
||||
{
|
||||
/// <summary>Number of correct images</summary>
|
||||
public long Correct;
|
||||
/// <summary>Number of failed images</summary>
|
||||
public long Failed;
|
||||
}
|
||||
|
||||
/// <summary>Verification statistics</summary>
|
||||
public class VerifyStats
|
||||
{
|
||||
/// <summary>Image verification statistics</summary>
|
||||
public VerifiedItems MediaImages;
|
||||
/// <summary>Image contents verification statistics</summary>
|
||||
public ScannedSectors Sectors;
|
||||
}
|
||||
|
||||
/// <summary>Image contents verification statistics</summary>
|
||||
public class ScannedSectors
|
||||
{
|
||||
/// <summary>Sectors found to be correct</summary>
|
||||
public long Correct;
|
||||
/// <summary>Sectors found to be incorrect</summary>
|
||||
public long Error;
|
||||
/// <summary>Total number of verified sectors</summary>
|
||||
public long Total;
|
||||
/// <summary>Total number of sectors that could not be verified</summary>
|
||||
public long Unverifiable;
|
||||
}
|
||||
|
||||
/// <summary>Media scanning time statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class TimeStats
|
||||
{
|
||||
/// <summary>Number of sectors that took more than 3ms but less than 100ms to read</summary>
|
||||
public long LessThan10ms;
|
||||
/// <summary>Number of sectors that took more than 50ms but less than 150ms to read</summary>
|
||||
public long LessThan150ms;
|
||||
/// <summary>Number of sectors that took less than 3ms to read</summary>
|
||||
public long LessThan3ms;
|
||||
/// <summary>Number of sectors that took more than 150ms but less than 500ms to read</summary>
|
||||
public long LessThan500ms;
|
||||
/// <summary>Number of sectors that took more than 10ms but less than 50ms to read</summary>
|
||||
public long LessThan50ms;
|
||||
/// <summary>Number of sectors that took more than 500ms to read</summary>
|
||||
public long MoreThan500ms;
|
||||
}
|
||||
|
||||
/// <summary>Media scanning statistics</summary>
|
||||
public class MediaScanStats
|
||||
{
|
||||
/// <summary>Statistics of scanned sectors</summary>
|
||||
public ScannedSectors Sectors;
|
||||
/// <summary>Scan time statistics</summary>
|
||||
public TimeStats Times;
|
||||
}
|
||||
|
||||
/// <summary>Checksum type statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class ChecksumStats
|
||||
{
|
||||
/// <summary>Checksum algorithm</summary>
|
||||
[XmlAttribute]
|
||||
public string algorithm;
|
||||
/// <summary>Time taken to execute algorithm</summary>
|
||||
[XmlText]
|
||||
public double Value;
|
||||
}
|
||||
|
||||
/// <summary>Benchmark statistics</summary>
|
||||
public class BenchmarkStats
|
||||
{
|
||||
/// <summary>Total time taken to run the checksum algorithms in parallel</summary>
|
||||
public double All;
|
||||
/// <summary>List of time taken by each checksum algorithm</summary>
|
||||
[XmlElement("Checksum")]
|
||||
public List<ChecksumStats> Checksum;
|
||||
/// <summary>Time taken to benchmark entropy calculation</summary>
|
||||
public double Entropy;
|
||||
/// <summary>Maximum amount of memory used while running the benchmark</summary>
|
||||
public long MaxMemory;
|
||||
/// <summary>Minimum amount of memory used while running the benchmark</summary>
|
||||
public long MinMemory;
|
||||
/// <summary>Total time taken to run the checksum algorithms sequentially</summary>
|
||||
public double Sequential;
|
||||
}
|
||||
|
||||
/// <summary>Media statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class MediaStats
|
||||
{
|
||||
/// <summary>Media type</summary>
|
||||
[XmlAttribute(AttributeName = "type")]
|
||||
[JsonPropertyName("type")]
|
||||
public string MediaType;
|
||||
/// <summary>Found in a real device?</summary>
|
||||
[XmlAttribute]
|
||||
public bool real;
|
||||
/// <summary>Number of times it has been found</summary>
|
||||
[XmlText]
|
||||
public long Value;
|
||||
}
|
||||
|
||||
/// <summary>Device statistics</summary>
|
||||
public class DeviceStats
|
||||
{
|
||||
/// <summary>Is manufacturer null?</summary>
|
||||
[XmlIgnore]
|
||||
public bool ManufacturerSpecified;
|
||||
|
||||
/// <summary>Manufacturer string</summary>
|
||||
public string Manufacturer { get; set; }
|
||||
|
||||
/// <summary>Model string</summary>
|
||||
public string Model { get; set; }
|
||||
|
||||
/// <summary>Revision or firmware version</summary>
|
||||
public string Revision { get; set; }
|
||||
|
||||
/// <summary>Bus the device was attached to</summary>
|
||||
public string Bus { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Name=value pair statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class NameValueStats
|
||||
{
|
||||
/// <summary>Name</summary>
|
||||
[XmlAttribute]
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>Number of times it has been used/found</summary>
|
||||
[XmlText]
|
||||
public long Value { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Operating system statistics</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public class OsStats
|
||||
{
|
||||
/// <summary>Operating system name</summary>
|
||||
[XmlAttribute]
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>Operating system version</summary>
|
||||
[XmlAttribute]
|
||||
public string version { get; set; }
|
||||
|
||||
/// <summary>Number of times Aaru run on it</summary>
|
||||
[XmlText]
|
||||
public long Value { get; set; }
|
||||
}
|
||||
55
Aaru.CommonTypes/Metadata/Version.cs
Normal file
55
Aaru.CommonTypes/Metadata/Version.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Statistics.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : XML metadata.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Returns Aaru version in XML software type format.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Interop;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
/// <summary>Manages Aaru's version for metadata</summary>
|
||||
public static class Version
|
||||
{
|
||||
/// <summary>Gets XML software type for the running version</summary>
|
||||
/// <returns>XML software type</returns>
|
||||
public static Software GetSoftware() => new()
|
||||
{
|
||||
Name = "Aaru",
|
||||
OperatingSystem = DetectOS.GetRealPlatformID().ToString(),
|
||||
Version = typeof(Version).Assembly.GetName().Version?.ToString()
|
||||
};
|
||||
}
|
||||
7390
Aaru.CommonTypes/Metadata/cicm.cs
Normal file
7390
Aaru.CommonTypes/Metadata/cicm.cs
Normal file
File diff suppressed because it is too large
Load Diff
120
Aaru.CommonTypes/Partition.cs
Normal file
120
Aaru.CommonTypes/Partition.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Partition.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Aaru common types.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Contains common partition types.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
// copy of this software and associated documentation files (the
|
||||
// "Software"), to deal in the Software without restriction, including
|
||||
// without limitation the rights to use, copy, modify, merge, publish,
|
||||
// distribute, sublicense, and/or sell copies of the Software, and to
|
||||
// permit persons to whom the Software is furnished to do so, subject to
|
||||
// the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included
|
||||
// in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2023 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
#pragma warning disable CS1591
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
/// <inheritdoc cref="System.IComparable<Partition>" />
|
||||
/// <summary>Partition structure.</summary>
|
||||
public struct Partition : IEquatable<Partition>, IComparable<Partition>
|
||||
{
|
||||
/// <summary>Partition number, 0-started</summary>
|
||||
public ulong Sequence;
|
||||
/// <summary>Partition type</summary>
|
||||
public string Type;
|
||||
/// <summary>Partition name (if the scheme supports it)</summary>
|
||||
public string Name;
|
||||
/// <summary>Start of the partition, in bytes</summary>
|
||||
public ulong Offset;
|
||||
/// <summary>LBA of partition start</summary>
|
||||
public ulong Start;
|
||||
/// <summary>Length in bytes of the partition</summary>
|
||||
public ulong Size;
|
||||
/// <summary>Length in sectors of the partition</summary>
|
||||
public ulong Length;
|
||||
/// <summary>Information that does not find space in this struct</summary>
|
||||
public string Description;
|
||||
|
||||
/// <summary>LBA of last partition sector</summary>
|
||||
public readonly ulong End => Start + Length - 1;
|
||||
|
||||
/// <summary>Name of partition scheme that contains this partition</summary>
|
||||
public string Scheme;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Compares two partitions</summary>
|
||||
/// <param name="other">Partition to compare with</param>
|
||||
/// <returns>0 if both partitions start and end at the same sector</returns>
|
||||
public bool Equals(Partition other) => Start == other.Start && Length == other.Length;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool Equals(object obj) => obj is Partition partition && Equals(partition);
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
// ReSharper disable once NonReadonlyMemberInGetHashCode
|
||||
public readonly override int GetHashCode() => Start.GetHashCode() + End.GetHashCode();
|
||||
|
||||
/// <summary>
|
||||
/// Compares this partition with another and returns an integer that indicates whether the current partition
|
||||
/// precedes, follows, or is in the same place as the other partition.
|
||||
/// </summary>
|
||||
/// <param name="other">Partition to compare with</param>
|
||||
/// <returns>A value that indicates the relative equality of the partitions being compared.</returns>
|
||||
/// <inheritdoc />
|
||||
public int CompareTo(Partition other)
|
||||
{
|
||||
if(Start == other.Start && End == other.End)
|
||||
return 0;
|
||||
|
||||
if(Start > other.Start || End > other.End)
|
||||
return 1;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Define the equality operator.
|
||||
public static bool operator ==(Partition operand1, Partition operand2) => operand1.Equals(operand2);
|
||||
|
||||
// Define the inequality operator.
|
||||
public static bool operator !=(Partition operand1, Partition operand2) => !operand1.Equals(operand2);
|
||||
|
||||
// Define the is greater than operator.
|
||||
public static bool operator >(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) == 1;
|
||||
|
||||
// Define the is less than operator.
|
||||
public static bool operator <(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) == -1;
|
||||
|
||||
// Define the is greater than or equal to operator.
|
||||
public static bool operator >=(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) >= 0;
|
||||
|
||||
// Define the is less than or equal to operator.
|
||||
public static bool operator <=(Partition operand1, Partition operand2) => operand1.CompareTo(operand2) <= 0;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user