diff --git a/Aaru.CommonTypes/.editorconfig b/Aaru.CommonTypes/.editorconfig new file mode 100644 index 000000000..103a5d927 --- /dev/null +++ b/Aaru.CommonTypes/.editorconfig @@ -0,0 +1,1342 @@ +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +indent_style = space +insert_final_newline = false +max_line_length = 120 +tab_width = 2 +trim_trailing_whitespace = false +ij_continuation_indent_size = 4 +ij_formatter_off_tag = @formatter:off +ij_formatter_on_tag = @formatter:on +ij_formatter_tags_enabled = true +ij_smart_tabs = false +ij_visual_guides = +ij_wrap_on_typing = false + +# Microsoft .NET properties +csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion +csharp_space_after_keywords_in_control_flow_statements = false +csharp_style_namespace_declarations = file_scoped:warning +csharp_style_prefer_utf8_string_literals = true:warning +csharp_style_var_elsewhere = false:suggestion +csharp_style_var_for_built_in_types = false:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_using_directive_placement = outside_namespace:silent +dotnet_naming_rule.private_constants_rule.import_to_resharper = as_predefined +dotnet_naming_rule.private_constants_rule.severity = warning +dotnet_naming_rule.private_constants_rule.style = all_upper_style +dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols +dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True +dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field +dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef +dotnet_naming_rule.unity_serialized_field_rule.severity = warning +dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style +dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols +dotnet_naming_style.all_upper_style.capitalization = all_upper +dotnet_naming_style.all_upper_style.word_separator = _ +dotnet_naming_style.lower_camel_case_style.capitalization = camel_case +dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private +dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field +dotnet_naming_symbols.private_constants_symbols.required_modifiers = const +dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = * +dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds = +dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field +dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance +dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:warning +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning +dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:warning +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion +dotnet_style_qualification_for_event = false:suggestion +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_require_accessibility_modifiers = never:suggestion + +# ReSharper properties +resharper_align_first_arg_by_paren = false +resharper_align_linq_query = true +resharper_align_multiline_argument = true +resharper_align_multiline_array_and_object_initializer = false +resharper_align_multiline_binary_expressions_chain = true +resharper_align_multiline_binary_patterns = true +resharper_align_multiline_calls_chain = true +resharper_align_multiline_expression = true +resharper_align_multiline_expression_braces = true +resharper_align_multiline_extends_list = true +resharper_align_multiline_for_stmt = true +resharper_align_multiline_list_pattern = true +resharper_align_multiline_parameter = true +resharper_align_multiline_property_pattern = true +resharper_align_multiline_switch_expression = true +resharper_align_multiple_declaration = true +resharper_align_multline_type_parameter_constrains = true +resharper_align_multline_type_parameter_list = true +resharper_align_ternary = align_all +resharper_align_tuple_components = true +resharper_autodetect_indent_settings = true +resharper_braces_for_for = required_for_multiline +resharper_braces_for_foreach = required_for_multiline +resharper_braces_for_ifelse = required_for_multiline +resharper_braces_for_while = required_for_multiline +resharper_builtin_type_apply_to_native_integer = false +resharper_constructor_or_destructor_body = expression_body +resharper_csharp_align_first_arg_by_paren = true +resharper_csharp_empty_block_style = together_same_line +resharper_csharp_place_comments_at_first_column = true +resharper_csharp_prefer_qualified_reference = false +resharper_default_value_when_type_not_evident = default_expression +resharper_enforce_line_ending_style = true +resharper_formatter_off_tag = @formatter:off +resharper_formatter_on_tag = @formatter:on +resharper_formatter_tags_enabled = true +resharper_for_built_in_types = use_var_when_evident +resharper_function_declaration_return_type_style = on_single_line +resharper_function_definition_return_type_style = on_single_line +resharper_html_pi_attribute_style = first_attribute_on_single_line +resharper_indent_anonymous_method_block = false +resharper_indent_preprocessor_if = outdent +resharper_indent_preprocessor_other = outdent +resharper_indent_preprocessor_region = outdent +resharper_int_align = true +resharper_int_align_bitfield_sizes = true +resharper_int_align_comments = true +resharper_int_align_declaration_names = true +resharper_int_align_enum_initializers = true +resharper_int_align_eq = true +resharper_keep_existing_embedded_arrangement = false +resharper_keep_existing_initializer_arrangement = false +resharper_keep_existing_linebreaks = false +resharper_keep_existing_list_patterns_arrangement = false +resharper_keep_existing_property_patterns_arrangement = false +resharper_keep_existing_switch_expression_arrangement = false +resharper_line_break_after_colon_in_member_initializer_lists = on_single_line +resharper_line_break_before_requires_clause = on_single_line +resharper_linkage_specification_indentation = all +resharper_local_function_body = expression_body +resharper_member_initializer_list_style = on_single_line +resharper_method_or_operator_body = expression_body +resharper_outdent_binary_ops = true +resharper_outdent_binary_pattern_ops = true +resharper_outdent_commas = true +resharper_outdent_dots = true +resharper_outdent_statement_labels = true +resharper_parentheses_redundancy_style = remove +resharper_place_attribute_on_same_line = false +resharper_place_simple_embedded_statement_on_same_line = false +resharper_place_simple_initializer_on_single_line = false +resharper_qualified_using_at_nested_scope = true +resharper_show_autodetect_configure_formatting_tip = false +resharper_simple_block_style = on_single_line +resharper_simple_case_statement_style = line_break +resharper_simple_embedded_statement_style = on_single_line +resharper_space_after_ptr_in_data_member = false +resharper_space_after_ptr_in_method = false +resharper_space_after_ref_in_data_member = false +resharper_space_after_ref_in_method = false +resharper_space_before_ptr_in_data_member = true +resharper_space_before_ptr_in_method = true +resharper_space_before_ref_in_data_member = true +resharper_space_before_ref_in_method = true +resharper_space_before_template_params = false +resharper_space_within_empty_braces = false +resharper_toplevel_function_declaration_return_type_style = on_single_line +resharper_toplevel_function_definition_return_type_style = on_single_line +resharper_use_indent_from_vs = false +resharper_wrap_after_dot_in_method_calls = true +resharper_wrap_base_clause_style = chop_if_long +resharper_wrap_braced_init_list_style = chop_if_long +resharper_wrap_chained_binary_expressions = chop_if_long +resharper_wrap_chained_method_calls = chop_if_long +resharper_wrap_ctor_initializer_style = chop_if_long +resharper_wrap_lines = true +resharper_xmldoc_attribute_indent = align_by_first_attribute +resharper_xmldoc_attribute_style = first_attribute_on_single_line +resharper_xmldoc_pi_attribute_style = first_attribute_on_single_line + +# ReSharper inspection severities +resharper_annotate_can_be_null_parameter_highlighting = warning +resharper_annotate_can_be_null_type_member_highlighting = warning +resharper_annotate_not_null_parameter_highlighting = warning +resharper_annotate_not_null_type_member_highlighting = warning +resharper_arguments_style_anonymous_function_highlighting = warning +resharper_arguments_style_literal_highlighting = warning +resharper_arguments_style_named_expression_highlighting = warning +resharper_arguments_style_other_highlighting = warning +resharper_arguments_style_string_literal_highlighting = warning +resharper_arrange_accessor_owner_body_highlighting = warning +resharper_arrange_constructor_or_destructor_body_highlighting = warning +resharper_arrange_local_function_body_highlighting = warning +resharper_arrange_method_or_operator_body_highlighting = warning +resharper_arrange_redundant_parentheses_highlighting = hint +resharper_arrange_static_member_qualifier_highlighting = warning +resharper_arrange_this_qualifier_highlighting = hint +resharper_arrange_trailing_comma_in_multiline_lists_highlighting = warning +resharper_arrange_trailing_comma_in_singleline_lists_highlighting = warning +resharper_arrange_type_member_modifiers_highlighting = hint +resharper_arrange_type_modifiers_highlighting = hint +resharper_arrange_var_keywords_in_deconstructing_declaration_highlighting = warning +resharper_async_void_method_highlighting = warning +resharper_auto_property_can_be_made_get_only_global_highlighting = warning +resharper_auto_property_can_be_made_get_only_local_highlighting = warning +resharper_bad_attribute_brackets_spaces_highlighting = warning +resharper_bad_braces_spaces_highlighting = warning +resharper_bad_colon_spaces_highlighting = warning +resharper_bad_comma_spaces_highlighting = warning +resharper_bad_control_braces_indent_highlighting = warning +resharper_bad_control_braces_line_breaks_highlighting = warning +resharper_bad_declaration_braces_indent_highlighting = warning +resharper_bad_declaration_braces_line_breaks_highlighting = warning +resharper_bad_empty_braces_line_breaks_highlighting = warning +resharper_bad_expression_braces_indent_highlighting = warning +resharper_bad_expression_braces_line_breaks_highlighting = warning +resharper_bad_generic_brackets_spaces_highlighting = warning +resharper_bad_indent_highlighting = warning +resharper_bad_linq_line_breaks_highlighting = warning +resharper_bad_member_access_spaces_highlighting = warning +resharper_bad_namespace_braces_indent_highlighting = warning +resharper_bad_parens_line_breaks_highlighting = warning +resharper_bad_parens_spaces_highlighting = warning +resharper_bad_preprocessor_indent_highlighting = warning +resharper_bad_semicolon_spaces_highlighting = warning +resharper_bad_spaces_after_keyword_highlighting = warning +resharper_bad_square_brackets_spaces_highlighting = warning +resharper_bad_switch_braces_indent_highlighting = warning +resharper_bad_symbol_spaces_highlighting = warning +resharper_built_in_type_reference_style_for_member_access_highlighting = hint +resharper_built_in_type_reference_style_highlighting = hint +resharper_check_for_reference_equality_instead_1_highlighting = warning +resharper_check_for_reference_equality_instead_2_highlighting = warning +resharper_check_for_reference_equality_instead_3_highlighting = warning +resharper_check_for_reference_equality_instead_4_highlighting = warning +resharper_class_can_be_sealed_global_highlighting = warning +resharper_class_can_be_sealed_local_highlighting = warning +resharper_class_never_instantiated_global_highlighting = warning +resharper_class_never_instantiated_local_highlighting = warning +resharper_class_with_virtual_members_never_inherited_global_highlighting = warning +resharper_class_with_virtual_members_never_inherited_local_highlighting = warning +resharper_comment_typo_highlighting = none +resharper_compare_non_constrained_generic_with_null_highlighting = warning +resharper_convert_closure_to_method_group_highlighting = warning +resharper_convert_conditional_ternary_expression_to_switch_expression_highlighting = warning +resharper_convert_if_do_to_while_highlighting = warning +resharper_convert_if_statement_to_conditional_ternary_expression_highlighting = warning +resharper_convert_if_statement_to_null_coalescing_assignment_highlighting = warning +resharper_convert_if_statement_to_null_coalescing_expression_highlighting = warning +resharper_convert_if_statement_to_return_statement_highlighting = warning +resharper_convert_if_statement_to_switch_statement_highlighting = warning +resharper_convert_if_to_or_expression_highlighting = warning +resharper_convert_nullable_to_short_form_highlighting = warning +resharper_convert_switch_statement_to_switch_expression_highlighting = warning +resharper_convert_to_auto_property_highlighting = warning +resharper_convert_to_auto_property_when_possible_highlighting = warning +resharper_convert_to_auto_property_with_private_setter_highlighting = warning +resharper_convert_to_compound_assignment_highlighting = warning +resharper_convert_to_constant_global_highlighting = warning +resharper_convert_to_constant_local_highlighting = warning +resharper_convert_to_lambda_expression_highlighting = warning +resharper_convert_to_local_function_highlighting = warning +resharper_convert_to_null_coalescing_compound_assignment_highlighting = warning +resharper_convert_to_primary_constructor_highlighting = warning +resharper_convert_to_static_class_highlighting = warning +resharper_convert_to_using_declaration_highlighting = warning +resharper_cpp_enforce_cv_qualifiers_order_highlighting = hint +resharper_cpp_enforce_cv_qualifiers_placement_highlighting = hint +resharper_cpp_enforce_do_statement_braces_highlighting = hint +resharper_cpp_enforce_for_statement_braces_highlighting = hint +resharper_cpp_enforce_function_declaration_style_highlighting = hint +resharper_cpp_enforce_if_statement_braces_highlighting = hint +resharper_cpp_enforce_type_alias_code_style_highlighting = hint +resharper_cpp_enforce_while_statement_braces_highlighting = hint +resharper_cpp_remove_redundant_braces_highlighting = hint +resharper_double_negation_in_pattern_highlighting = warning +resharper_double_negation_operator_highlighting = warning +resharper_event_never_invoked_global_highlighting = warning +resharper_event_never_subscribed_to_global_highlighting = warning +resharper_event_never_subscribed_to_local_highlighting = warning +resharper_field_can_be_made_read_only_global_highlighting = warning +resharper_field_can_be_made_read_only_local_highlighting = warning +resharper_foreach_can_be_converted_to_query_using_another_get_enumerator_highlighting = warning +resharper_foreach_can_be_partly_converted_to_query_using_another_get_enumerator_highlighting = none +resharper_for_can_be_converted_to_foreach_highlighting = warning +resharper_heap_view_boxing_allocation_highlighting = none +resharper_heap_view_closure_allocation_highlighting = none +resharper_heap_view_delegate_allocation_highlighting = none +resharper_heap_view_object_allocation_evident_highlighting = none +resharper_heap_view_object_allocation_highlighting = none +resharper_identifier_typo_highlighting = none +resharper_incorrect_blank_lines_near_braces_highlighting = warning +resharper_inheritdoc_consider_usage_highlighting = warning +resharper_inline_out_variable_declaration_highlighting = warning +resharper_inline_temporary_variable_highlighting = warning +resharper_introduce_optional_parameters_global_highlighting = warning +resharper_introduce_optional_parameters_local_highlighting = warning +resharper_invert_condition_1_highlighting = warning +resharper_invert_if_highlighting = warning +resharper_invocation_is_skipped_highlighting = warning +resharper_invoke_as_extension_method_highlighting = warning +resharper_join_declaration_and_initializer_highlighting = warning +resharper_join_null_check_with_usage_highlighting = warning +resharper_lambda_expression_must_be_static_highlighting = warning +resharper_local_function_can_be_made_static_highlighting = warning +resharper_loop_can_be_converted_to_query_highlighting = warning +resharper_loop_can_be_partly_converted_to_query_highlighting = warning +resharper_member_can_be_file_local_highlighting = warning +resharper_member_can_be_internal_highlighting = warning +resharper_member_can_be_made_static_global_highlighting = warning +resharper_member_can_be_made_static_local_highlighting = warning +resharper_member_can_be_private_global_highlighting = warning +resharper_member_can_be_private_local_highlighting = warning +resharper_member_can_be_protected_global_highlighting = warning +resharper_member_can_be_protected_local_highlighting = warning +resharper_merge_and_pattern_highlighting = warning +resharper_merge_cast_with_type_check_highlighting = warning +resharper_merge_conditional_expression_highlighting = warning +resharper_merge_into_logical_pattern_highlighting = warning +resharper_merge_into_negated_pattern_highlighting = warning +resharper_merge_into_pattern_highlighting = warning +resharper_merge_nested_property_patterns_highlighting = warning +resharper_merge_sequential_checks_highlighting = warning +resharper_method_has_async_overload_highlighting = warning +resharper_method_has_async_overload_with_cancellation_highlighting = warning +resharper_method_supports_cancellation_highlighting = warning +resharper_missing_blank_lines_highlighting = warning +resharper_missing_linebreak_highlighting = warning +resharper_missing_space_highlighting = warning +resharper_more_specific_foreach_variable_type_available_highlighting = warning +resharper_move_to_existing_positional_deconstruction_pattern_highlighting = warning +resharper_move_variable_declaration_inside_loop_condition_highlighting = warning +resharper_multiple_spaces_highlighting = warning +resharper_multiple_statements_on_one_line_highlighting = warning +resharper_multiple_type_members_on_one_line_highlighting = warning +resharper_negation_of_relational_pattern_highlighting = warning +resharper_negative_equality_expression_highlighting = warning +resharper_nested_string_interpolation_highlighting = warning +resharper_not_accessed_field_global_highlighting = warning +resharper_nullable_warning_suppression_is_used_highlighting = warning +resharper_outdent_is_off_prev_level_highlighting = warning +resharper_out_parameter_value_is_always_discarded_global_highlighting = warning +resharper_parameter_only_used_for_precondition_check_global_highlighting = warning +resharper_parameter_type_can_be_enumerable_global_highlighting = warning +resharper_parameter_type_can_be_enumerable_local_highlighting = warning +resharper_pass_string_interpolation_highlighting = warning +resharper_possible_unintended_queryable_as_enumerable_highlighting = warning +resharper_property_can_be_made_init_only_global_highlighting = warning +resharper_property_can_be_made_init_only_local_highlighting = warning +resharper_public_constructor_in_abstract_class_highlighting = warning +resharper_raw_string_can_be_simplified_highlighting = warning +resharper_redundant_accessor_body_highlighting = warning +resharper_redundant_always_match_subpattern_highlighting = warning +resharper_redundant_array_creation_expression_highlighting = warning +resharper_redundant_attribute_parentheses_highlighting = warning +resharper_redundant_attribute_usage_property_highlighting = warning +resharper_redundant_base_qualifier_highlighting = warning +resharper_redundant_blank_lines_highlighting = warning +resharper_redundant_collection_initializer_element_braces_highlighting = warning +resharper_redundant_configure_await_highlighting = warning +resharper_redundant_declaration_semicolon_highlighting = warning +resharper_redundant_discard_designation_highlighting = warning +resharper_redundant_empty_object_creation_argument_list_highlighting = warning +resharper_redundant_enum_case_label_for_default_section_highlighting = warning +resharper_redundant_explicit_params_array_creation_highlighting = warning +resharper_redundant_fixed_pointer_declaration_highlighting = warning +resharper_redundant_if_else_block_highlighting = warning +resharper_redundant_immediate_delegate_invocation_highlighting = warning +resharper_redundant_is_before_relational_pattern_highlighting = warning +resharper_redundant_lambda_signature_parentheses_highlighting = warning +resharper_redundant_overload_global_highlighting = warning +resharper_redundant_overload_local_highlighting = warning +resharper_redundant_pattern_parentheses_highlighting = warning +resharper_redundant_property_pattern_clause_highlighting = warning +resharper_redundant_query_order_by_ascending_keyword_highlighting = warning +resharper_redundant_range_bound_highlighting = warning +resharper_redundant_readonly_modifier_highlighting = warning +resharper_redundant_space_highlighting = warning +resharper_redundant_string_interpolation_highlighting = warning +resharper_redundant_to_string_call_for_value_type_highlighting = warning +resharper_redundant_verbatim_prefix_highlighting = warning +resharper_redundant_verbatim_string_prefix_highlighting = warning +resharper_redundant_with_expression_highlighting = warning +resharper_remove_constructor_invocation_highlighting = warning +resharper_remove_redundant_braces_highlighting = warning +resharper_remove_redundant_or_statement_false_highlighting = warning +resharper_remove_redundant_or_statement_true_highlighting = warning +resharper_remove_to_list_1_highlighting = warning +resharper_remove_to_list_2_highlighting = warning +resharper_replace_auto_property_with_computed_property_highlighting = warning +resharper_replace_conditional_expression_with_null_coalescing_highlighting = warning +resharper_replace_object_pattern_with_var_pattern_highlighting = warning +resharper_replace_slice_with_range_indexer_highlighting = warning +resharper_replace_substring_with_range_indexer_highlighting = warning +resharper_replace_with_field_keyword_highlighting = warning +resharper_replace_with_first_or_default_1_highlighting = warning +resharper_replace_with_first_or_default_2_highlighting = warning +resharper_replace_with_first_or_default_3_highlighting = warning +resharper_replace_with_first_or_default_4_highlighting = warning +resharper_replace_with_last_or_default_1_highlighting = warning +resharper_replace_with_last_or_default_2_highlighting = warning +resharper_replace_with_last_or_default_3_highlighting = warning +resharper_replace_with_last_or_default_4_highlighting = warning +resharper_replace_with_of_type_1_highlighting = warning +resharper_replace_with_of_type_2_highlighting = warning +resharper_replace_with_of_type_3_highlighting = warning +resharper_replace_with_of_type_any_1_highlighting = warning +resharper_replace_with_of_type_any_2_highlighting = warning +resharper_replace_with_of_type_count_1_highlighting = warning +resharper_replace_with_of_type_count_2_highlighting = warning +resharper_replace_with_of_type_first_1_highlighting = warning +resharper_replace_with_of_type_first_2_highlighting = warning +resharper_replace_with_of_type_first_or_default_1_highlighting = warning +resharper_replace_with_of_type_first_or_default_2_highlighting = warning +resharper_replace_with_of_type_last_1_highlighting = warning +resharper_replace_with_of_type_last_2_highlighting = warning +resharper_replace_with_of_type_last_or_default_1_highlighting = warning +resharper_replace_with_of_type_last_or_default_2_highlighting = warning +resharper_replace_with_of_type_long_count_highlighting = warning +resharper_replace_with_of_type_single_1_highlighting = warning +resharper_replace_with_of_type_single_2_highlighting = warning +resharper_replace_with_of_type_single_or_default_1_highlighting = warning +resharper_replace_with_of_type_single_or_default_2_highlighting = warning +resharper_replace_with_of_type_where_highlighting = warning +resharper_replace_with_simple_assignment_false_highlighting = warning +resharper_replace_with_simple_assignment_true_highlighting = warning +resharper_replace_with_single_assignment_false_highlighting = warning +resharper_replace_with_single_assignment_true_highlighting = warning +resharper_replace_with_single_call_to_any_highlighting = warning +resharper_replace_with_single_call_to_count_highlighting = warning +resharper_replace_with_single_call_to_first_highlighting = warning +resharper_replace_with_single_call_to_first_or_default_highlighting = warning +resharper_replace_with_single_call_to_last_highlighting = warning +resharper_replace_with_single_call_to_last_or_default_highlighting = warning +resharper_replace_with_single_call_to_single_highlighting = warning +resharper_replace_with_single_call_to_single_or_default_highlighting = warning +resharper_replace_with_single_or_default_1_highlighting = warning +resharper_replace_with_single_or_default_2_highlighting = warning +resharper_replace_with_single_or_default_3_highlighting = warning +resharper_replace_with_single_or_default_4_highlighting = warning +resharper_replace_with_string_is_null_or_empty_highlighting = warning +resharper_return_type_can_be_enumerable_global_highlighting = warning +resharper_return_type_can_be_enumerable_local_highlighting = warning +resharper_safe_cast_is_used_as_type_check_highlighting = warning +resharper_separate_control_transfer_statement_highlighting = warning +resharper_similar_anonymous_type_nearby_highlighting = warning +resharper_simplify_conditional_ternary_expression_highlighting = warning +resharper_simplify_linq_expression_use_all_highlighting = warning +resharper_simplify_linq_expression_use_any_highlighting = warning +resharper_simplify_linq_expression_use_min_by_and_max_by_highlighting = warning +resharper_simplify_string_interpolation_highlighting = warning +resharper_specify_string_comparison_highlighting = warning +resharper_string_ends_with_is_culture_specific_highlighting = warning +resharper_string_literal_as_interpolation_argument_highlighting = warning +resharper_string_literal_typo_highlighting = warning +resharper_string_starts_with_is_culture_specific_highlighting = warning +resharper_struct_can_be_made_read_only_highlighting = warning +resharper_struct_member_can_be_made_read_only_highlighting = warning +resharper_suggest_base_type_for_parameter_highlighting = none +resharper_suggest_base_type_for_parameter_in_constructor_highlighting = warning +resharper_suggest_var_or_type_built_in_types_highlighting = hint +resharper_suggest_var_or_type_deconstruction_declarations_highlighting = warning +resharper_suggest_var_or_type_elsewhere_highlighting = hint +resharper_suggest_var_or_type_simple_types_highlighting = hint +resharper_swap_via_deconstruction_highlighting = warning +resharper_switch_expression_handles_some_known_enum_values_with_exception_in_default_highlighting = warning +resharper_switch_statement_handles_some_known_enum_values_with_default_highlighting = none +resharper_switch_statement_missing_some_enum_cases_no_default_highlighting = none +resharper_tabs_and_spaces_mismatch_highlighting = warning +resharper_tabs_are_disallowed_highlighting = warning +resharper_tabs_outside_indent_highlighting = warning +resharper_tail_recursive_call_highlighting = warning +resharper_too_wide_local_variable_scope_highlighting = warning +resharper_try_cast_always_succeeds_highlighting = warning +resharper_try_statements_can_be_merged_highlighting = warning +resharper_type_parameter_can_be_variant_highlighting = warning +resharper_unnecessary_whitespace_highlighting = warning +resharper_unused_member_global_highlighting = warning +resharper_unused_member_hierarchy_global_highlighting = warning +resharper_unused_member_in_super_global_highlighting = warning +resharper_unused_method_return_value_global_highlighting = warning +resharper_unused_parameter_global_highlighting = warning +resharper_unused_type_global_highlighting = warning +resharper_use_array_creation_expression_1_highlighting = warning +resharper_use_array_creation_expression_2_highlighting = warning +resharper_use_array_empty_method_highlighting = warning +resharper_use_await_using_highlighting = warning +resharper_use_cancellation_token_for_i_async_enumerable_highlighting = warning +resharper_use_collection_count_property_highlighting = warning +resharper_use_configure_await_false_highlighting = warning +resharper_use_deconstruction_highlighting = warning +resharper_use_empty_types_field_highlighting = warning +resharper_use_event_args_empty_field_highlighting = warning +resharper_use_format_specifier_in_format_string_highlighting = warning +resharper_use_indexed_property_highlighting = warning +resharper_use_index_from_end_expression_highlighting = warning +resharper_use_is_operator_1_highlighting = warning +resharper_use_is_operator_2_highlighting = warning +resharper_use_method_any_0_highlighting = warning +resharper_use_method_any_1_highlighting = warning +resharper_use_method_any_2_highlighting = warning +resharper_use_method_any_3_highlighting = warning +resharper_use_method_any_4_highlighting = warning +resharper_use_method_is_instance_of_type_highlighting = warning +resharper_use_nameof_expression_for_part_of_the_string_highlighting = warning +resharper_use_nameof_expression_highlighting = warning +resharper_use_nameof_for_dependency_property_highlighting = warning +resharper_use_name_of_instead_of_type_of_highlighting = warning +resharper_use_negated_pattern_in_is_expression_highlighting = warning +resharper_use_negated_pattern_matching_highlighting = warning +resharper_use_nullable_annotation_instead_of_attribute_highlighting = warning +resharper_use_nullable_attributes_supported_by_compiler_highlighting = warning +resharper_use_null_propagation_highlighting = warning +resharper_use_object_or_collection_initializer_highlighting = warning +resharper_use_pattern_matching_highlighting = warning +resharper_use_positional_deconstruction_pattern_highlighting = warning +resharper_use_raw_string_highlighting = warning +resharper_use_string_interpolation_highlighting = warning +resharper_use_switch_case_pattern_variable_highlighting = warning +resharper_use_throw_if_null_method_highlighting = warning +resharper_use_unsigned_right_shift_operator_highlighting = warning +resharper_use_verbatim_string_highlighting = warning +resharper_use_with_expression_to_copy_anonymous_object_highlighting = warning +resharper_use_with_expression_to_copy_record_highlighting = warning +resharper_use_with_expression_to_copy_struct_highlighting = warning +resharper_use_with_expression_to_copy_tuple_highlighting = warning +resharper_virtual_member_never_overridden_global_highlighting = warning +resharper_virtual_member_never_overridden_local_highlighting = warning +resharper_web_config_module_not_resolved_highlighting = warning +resharper_web_config_type_not_resolved_highlighting = warning +resharper_web_config_wrong_module_highlighting = warning +resharper_with_expression_instead_of_initializer_highlighting = warning +resharper_wrong_indent_size_highlighting = warning + +[*.css] +ij_css_align_closing_brace_with_properties = false +ij_css_blank_lines_around_nested_selector = 1 +ij_css_blank_lines_between_blocks = 1 +ij_css_block_comment_add_space = false +ij_css_brace_placement = end_of_line +ij_css_enforce_quotes_on_format = false +ij_css_hex_color_long_format = false +ij_css_hex_color_lower_case = false +ij_css_hex_color_short_format = false +ij_css_hex_color_upper_case = false +ij_css_keep_blank_lines_in_code = 2 +ij_css_keep_indents_on_empty_lines = false +ij_css_keep_single_line_blocks = false +ij_css_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow +ij_css_space_after_colon = true +ij_css_space_before_opening_brace = true +ij_css_use_double_quotes = true +ij_css_value_alignment = do_not_align + +[*.csv] +max_line_length = 2147483647 +ij_csv_wrap_long_lines = false +indent_style = tab +tab_width = 1 + +[*.dart] +max_line_length = 80 + +[*.less] +indent_size = 2 +ij_less_align_closing_brace_with_properties = false +ij_less_blank_lines_around_nested_selector = 1 +ij_less_blank_lines_between_blocks = 1 +ij_less_block_comment_add_space = false +ij_less_brace_placement = 0 +ij_less_enforce_quotes_on_format = false +ij_less_hex_color_long_format = false +ij_less_hex_color_lower_case = false +ij_less_hex_color_short_format = false +ij_less_hex_color_upper_case = false +ij_less_keep_blank_lines_in_code = 2 +ij_less_keep_indents_on_empty_lines = false +ij_less_keep_single_line_blocks = false +ij_less_line_comment_add_space = false +ij_less_line_comment_at_first_column = false +ij_less_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow +ij_less_space_after_colon = true +ij_less_space_before_opening_brace = true +ij_less_use_double_quotes = true +ij_less_value_alignment = 0 + +[*.pp] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 2 +ij_puppet_keep_indents_on_empty_lines = false + +[*.properties] +ij_properties_align_group_field_declarations = true +ij_properties_keep_blank_lines = false +ij_properties_key_value_delimiter = equals +ij_properties_spaces_around_key_value_delimiter = true + +[*.sass] +indent_size = 2 +ij_sass_align_closing_brace_with_properties = false +ij_sass_blank_lines_around_nested_selector = 1 +ij_sass_blank_lines_between_blocks = 1 +ij_sass_brace_placement = 0 +ij_sass_enforce_quotes_on_format = false +ij_sass_hex_color_long_format = false +ij_sass_hex_color_lower_case = false +ij_sass_hex_color_short_format = false +ij_sass_hex_color_upper_case = false +ij_sass_keep_blank_lines_in_code = 2 +ij_sass_keep_indents_on_empty_lines = false +ij_sass_keep_single_line_blocks = false +ij_sass_line_comment_add_space = false +ij_sass_line_comment_at_first_column = false +ij_sass_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow +ij_sass_space_after_colon = true +ij_sass_space_before_opening_brace = true +ij_sass_use_double_quotes = true +ij_sass_value_alignment = 0 + +[*.scss] +indent_size = 2 +ij_scss_align_closing_brace_with_properties = false +ij_scss_blank_lines_around_nested_selector = 1 +ij_scss_blank_lines_between_blocks = 1 +ij_scss_block_comment_add_space = false +ij_scss_brace_placement = 0 +ij_scss_enforce_quotes_on_format = false +ij_scss_hex_color_long_format = false +ij_scss_hex_color_lower_case = false +ij_scss_hex_color_short_format = false +ij_scss_hex_color_upper_case = false +ij_scss_keep_blank_lines_in_code = 2 +ij_scss_keep_indents_on_empty_lines = false +ij_scss_keep_single_line_blocks = false +ij_scss_line_comment_add_space = false +ij_scss_line_comment_at_first_column = false +ij_scss_properties_order = font, font-family, font-size, font-weight, font-style, font-variant, font-size-adjust, font-stretch, line-height, position, z-index, top, right, bottom, left, display, visibility, float, clear, overflow, overflow-x, overflow-y, clip, zoom, align-content, align-items, align-self, flex, flex-flow, flex-basis, flex-direction, flex-grow, flex-shrink, flex-wrap, justify-content, order, box-sizing, width, min-width, max-width, height, min-height, max-height, margin, margin-top, margin-right, margin-bottom, margin-left, padding, padding-top, padding-right, padding-bottom, padding-left, table-layout, empty-cells, caption-side, border-spacing, border-collapse, list-style, list-style-position, list-style-type, list-style-image, content, quotes, counter-reset, counter-increment, resize, cursor, user-select, nav-index, nav-up, nav-right, nav-down, nav-left, transition, transition-delay, transition-timing-function, transition-duration, transition-property, transform, transform-origin, animation, animation-name, animation-duration, animation-play-state, animation-timing-function, animation-delay, animation-iteration-count, animation-direction, text-align, text-align-last, vertical-align, white-space, text-decoration, text-emphasis, text-emphasis-color, text-emphasis-style, text-emphasis-position, text-indent, text-justify, letter-spacing, word-spacing, text-outline, text-transform, text-wrap, text-overflow, text-overflow-ellipsis, text-overflow-mode, word-wrap, word-break, tab-size, hyphens, pointer-events, opacity, color, border, border-width, border-style, border-color, border-top, border-top-width, border-top-style, border-top-color, border-right, border-right-width, border-right-style, border-right-color, border-bottom, border-bottom-width, border-bottom-style, border-bottom-color, border-left, border-left-width, border-left-style, border-left-color, border-radius, border-top-left-radius, border-top-right-radius, border-bottom-right-radius, border-bottom-left-radius, border-image, border-image-source, border-image-slice, border-image-width, border-image-outset, border-image-repeat, outline, outline-width, outline-style, outline-color, outline-offset, background, background-color, background-image, background-repeat, background-attachment, background-position, background-position-x, background-position-y, background-clip, background-origin, background-size, box-decoration-break, box-shadow, text-shadow +ij_scss_space_after_colon = true +ij_scss_space_before_opening_brace = true +ij_scss_use_double_quotes = true +ij_scss_value_alignment = 0 + +[*.slim] +indent_size = 2 +ij_slim_keep_indents_on_empty_lines = false + +[*.twig] +ij_twig_keep_indents_on_empty_lines = false +ij_twig_spaces_inside_comments_delimiters = true +ij_twig_spaces_inside_delimiters = true +ij_twig_spaces_inside_variable_delimiters = true + +[*.vue] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_vue_indent_children_of_top_level = template +ij_vue_interpolation_new_line_after_start_delimiter = true +ij_vue_interpolation_new_line_before_end_delimiter = true +ij_vue_interpolation_wrap = off +ij_vue_keep_indents_on_empty_lines = false +ij_vue_spaces_within_interpolation_expressions = true + +[.editorconfig] +ij_editorconfig_align_group_field_declarations = true +ij_editorconfig_space_after_colon = false +ij_editorconfig_space_after_comma = true +ij_editorconfig_space_before_colon = false +ij_editorconfig_space_before_comma = false +ij_editorconfig_spaces_around_assignment_operators = true + +[{*.ad,*.adoc,*.asciidoc,.asciidoctorconfig}] +ij_asciidoc_blank_lines_after_header = 1 +ij_asciidoc_blank_lines_keep_after_header = 1 +ij_asciidoc_formatting_enabled = true +ij_asciidoc_one_sentence_per_line = true + +[{*.ant,*.appxmanifest,*.axml,*.cscfg,*.csdef,*.disco,*.dotsettings,*.filelayout,*.fxml,*.jhm,*.jnlp,*.jrxml,*.manifest,*.myapp,*.nuspec,*.rng,*.sdef,*.stylecop,*.svcmap,*.tld,*.wadcfgx,*.webref,*.wsdl,*.xml,*.xsd,*.xsl,*.xslt,*.xul,StyleCop.Cache}] +ij_xml_align_attributes = true +ij_xml_align_text = false +ij_xml_attribute_wrap = on_every_item +ij_xml_block_comment_add_space = false +ij_xml_block_comment_at_first_column = true +ij_xml_keep_blank_lines = 2 +ij_xml_keep_indents_on_empty_lines = false +ij_xml_keep_line_breaks = true +ij_xml_keep_line_breaks_in_text = true +ij_xml_keep_whitespaces = false +ij_xml_keep_whitespaces_around_cdata = preserve +ij_xml_keep_whitespaces_inside_cdata = false +ij_xml_line_comment_at_first_column = true +ij_xml_space_after_tag_name = false +ij_xml_space_around_equals_in_attribute = false +ij_xml_space_inside_empty_tag = false +ij_xml_text_wrap = normal +ij_xml_use_custom_settings = false +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 + +[{*.applescript,*.scpt}] +indent_size = 2 +tab_width = 2 +ij_continuation_indent_size = 4 +ij_applescript_align_multiline_binary_operation = true +ij_applescript_align_multiline_parameters = true +ij_applescript_align_multiline_parameters_in_calls = true +ij_applescript_binary_operation_sign_on_next_line = false +ij_applescript_binary_operation_wrap = off +ij_applescript_block_brace_style = next_line +ij_applescript_call_parameters_new_line_after_left_paren = false +ij_applescript_call_parameters_right_paren_on_new_line = false +ij_applescript_call_parameters_wrap = off +ij_applescript_else_on_new_line = true +ij_applescript_keep_blank_lines_in_code = 2 +ij_applescript_keep_first_column_comment = true +ij_applescript_keep_indents_on_empty_lines = false +ij_applescript_keep_line_breaks = true +ij_applescript_method_brace_style = next_line +ij_applescript_method_parameters_new_line_after_left_paren = false +ij_applescript_method_parameters_right_paren_on_new_line = false +ij_applescript_method_parameters_wrap = off +ij_applescript_parentheses_expression_new_line_after_left_paren = false +ij_applescript_parentheses_expression_right_paren_on_new_line = false +ij_applescript_space_after_colon = true +ij_applescript_space_after_comma = true +ij_applescript_space_after_comma_in_type_arguments = true +ij_applescript_space_before_colon = true +ij_applescript_space_before_comma = false +ij_applescript_space_before_else_keyword = true +ij_applescript_space_before_else_left_brace = true +ij_applescript_space_before_if_parentheses = false +ij_applescript_space_before_method_call_parentheses = false +ij_applescript_space_before_method_left_brace = true +ij_applescript_space_before_method_parentheses = false +ij_applescript_space_before_while_keyword = true +ij_applescript_spaces_around_additive_operators = true +ij_applescript_spaces_around_assignment_operators = true +ij_applescript_spaces_around_equality_operators = true +ij_applescript_spaces_around_logical_operators = true +ij_applescript_spaces_around_multiplicative_operators = true +ij_applescript_spaces_around_relational_operators = true +ij_applescript_spaces_around_shift_operators = true +ij_applescript_spaces_around_unary_operator = false +ij_applescript_spaces_within_if_parentheses = false +ij_applescript_spaces_within_method_call_parentheses = false +ij_applescript_spaces_within_method_parentheses = false +ij_applescript_special_else_if_treatment = true + +[{*.ats,*.cts,*.mts,*.ts}] +ij_continuation_indent_size = 4 +ij_typescript_align_imports = true +ij_typescript_align_multiline_array_initializer_expression = true +ij_typescript_align_multiline_binary_operation = true +ij_typescript_align_multiline_chained_methods = true +ij_typescript_align_multiline_extends_list = false +ij_typescript_align_multiline_for = true +ij_typescript_align_multiline_parameters = true +ij_typescript_align_multiline_parameters_in_calls = true +ij_typescript_align_multiline_ternary_operation = true +ij_typescript_align_object_properties = 1 +ij_typescript_align_union_types = true +ij_typescript_align_var_statements = 2 +ij_typescript_array_initializer_new_line_after_left_brace = false +ij_typescript_array_initializer_right_brace_on_new_line = false +ij_typescript_array_initializer_wrap = on_every_item +ij_typescript_assignment_wrap = on_every_item +ij_typescript_binary_operation_sign_on_next_line = false +ij_typescript_binary_operation_wrap = on_every_item +ij_typescript_blacklist_imports = rxjs/Rx, node_modules/**, **/node_modules/**, @angular/material, @angular/material/typings/** +ij_typescript_blank_lines_after_imports = 1 +ij_typescript_blank_lines_around_class = 1 +ij_typescript_blank_lines_around_field = 0 +ij_typescript_blank_lines_around_field_in_interface = 0 +ij_typescript_blank_lines_around_function = 1 +ij_typescript_blank_lines_around_method = 1 +ij_typescript_blank_lines_around_method_in_interface = 1 +ij_typescript_block_brace_style = next_line +ij_typescript_block_comment_add_space = false +ij_typescript_block_comment_at_first_column = true +ij_typescript_call_parameters_new_line_after_left_paren = false +ij_typescript_call_parameters_right_paren_on_new_line = false +ij_typescript_call_parameters_wrap = on_every_item +ij_typescript_catch_on_new_line = true +ij_typescript_chained_call_dot_on_new_line = true +ij_typescript_class_brace_style = next_line +ij_typescript_comma_on_new_line = false +ij_typescript_do_while_brace_force = always +ij_typescript_else_on_new_line = false +ij_typescript_enforce_trailing_comma = keep +ij_typescript_enum_constants_wrap = on_every_item +ij_typescript_extends_keyword_wrap = normal +ij_typescript_extends_list_wrap = on_every_item +ij_typescript_field_prefix = _ +ij_typescript_file_name_style = relaxed +ij_typescript_finally_on_new_line = true +ij_typescript_for_brace_force = if_multiline +ij_typescript_for_statement_new_line_after_left_paren = false +ij_typescript_for_statement_right_paren_on_new_line = false +ij_typescript_for_statement_wrap = on_every_item +ij_typescript_force_quote_style = true +ij_typescript_force_semicolon_style = true +ij_typescript_function_expression_brace_style = next_line +ij_typescript_if_brace_force = never +ij_typescript_import_merge_members = global +ij_typescript_import_prefer_absolute_path = true +ij_typescript_import_sort_members = true +ij_typescript_import_sort_module_name = true +ij_typescript_import_use_node_resolution = true +ij_typescript_imports_wrap = on_every_item +ij_typescript_indent_case_from_switch = true +ij_typescript_indent_chained_calls = true +ij_typescript_indent_package_children = 0 +ij_typescript_jsdoc_include_types = false +ij_typescript_jsx_attribute_value = braces +ij_typescript_keep_blank_lines_in_code = 2 +ij_typescript_keep_first_column_comment = true +ij_typescript_keep_indents_on_empty_lines = false +ij_typescript_keep_line_breaks = true +ij_typescript_keep_simple_blocks_in_one_line = false +ij_typescript_keep_simple_methods_in_one_line = false +ij_typescript_line_comment_add_space = true +ij_typescript_line_comment_at_first_column = false +ij_typescript_method_brace_style = next_line +ij_typescript_method_call_chain_wrap = on_every_item +ij_typescript_method_parameters_new_line_after_left_paren = false +ij_typescript_method_parameters_right_paren_on_new_line = false +ij_typescript_method_parameters_wrap = on_every_item +ij_typescript_object_literal_wrap = on_every_item +ij_typescript_object_types_wrap = on_every_item +ij_typescript_parentheses_expression_new_line_after_left_paren = false +ij_typescript_parentheses_expression_right_paren_on_new_line = false +ij_typescript_place_assignment_sign_on_next_line = false +ij_typescript_prefer_as_type_cast = false +ij_typescript_prefer_explicit_types_function_expression_returns = false +ij_typescript_prefer_explicit_types_function_returns = false +ij_typescript_prefer_explicit_types_vars_fields = false +ij_typescript_prefer_parameters_wrap = false +ij_typescript_property_prefix = +ij_typescript_reformat_c_style_comments = false +ij_typescript_space_after_colon = true +ij_typescript_space_after_comma = true +ij_typescript_space_after_dots_in_rest_parameter = false +ij_typescript_space_after_generator_mult = true +ij_typescript_space_after_property_colon = true +ij_typescript_space_after_quest = true +ij_typescript_space_after_type_colon = true +ij_typescript_space_after_unary_not = false +ij_typescript_space_before_async_arrow_lparen = false +ij_typescript_space_before_catch_keyword = true +ij_typescript_space_before_catch_left_brace = false +ij_typescript_space_before_catch_parentheses = false +ij_typescript_space_before_class_lbrace = false +ij_typescript_space_before_class_left_brace = true +ij_typescript_space_before_colon = true +ij_typescript_space_before_comma = false +ij_typescript_space_before_do_left_brace = false +ij_typescript_space_before_else_keyword = true +ij_typescript_space_before_else_left_brace = false +ij_typescript_space_before_finally_keyword = true +ij_typescript_space_before_finally_left_brace = false +ij_typescript_space_before_for_left_brace = false +ij_typescript_space_before_for_parentheses = false +ij_typescript_space_before_for_semicolon = false +ij_typescript_space_before_function_left_parenth = false +ij_typescript_space_before_generator_mult = false +ij_typescript_space_before_if_left_brace = false +ij_typescript_space_before_if_parentheses = false +ij_typescript_space_before_method_call_parentheses = false +ij_typescript_space_before_method_left_brace = false +ij_typescript_space_before_method_parentheses = false +ij_typescript_space_before_property_colon = false +ij_typescript_space_before_quest = true +ij_typescript_space_before_switch_left_brace = false +ij_typescript_space_before_switch_parentheses = false +ij_typescript_space_before_try_left_brace = false +ij_typescript_space_before_type_colon = false +ij_typescript_space_before_unary_not = false +ij_typescript_space_before_while_keyword = true +ij_typescript_space_before_while_left_brace = false +ij_typescript_space_before_while_parentheses = false +ij_typescript_spaces_around_additive_operators = true +ij_typescript_spaces_around_arrow_function_operator = true +ij_typescript_spaces_around_assignment_operators = true +ij_typescript_spaces_around_bitwise_operators = true +ij_typescript_spaces_around_equality_operators = true +ij_typescript_spaces_around_logical_operators = true +ij_typescript_spaces_around_multiplicative_operators = true +ij_typescript_spaces_around_relational_operators = true +ij_typescript_spaces_around_shift_operators = true +ij_typescript_spaces_around_unary_operator = false +ij_typescript_spaces_within_array_initializer_brackets = false +ij_typescript_spaces_within_brackets = false +ij_typescript_spaces_within_catch_parentheses = false +ij_typescript_spaces_within_for_parentheses = false +ij_typescript_spaces_within_if_parentheses = false +ij_typescript_spaces_within_imports = false +ij_typescript_spaces_within_interpolation_expressions = false +ij_typescript_spaces_within_method_call_parentheses = false +ij_typescript_spaces_within_method_parentheses = false +ij_typescript_spaces_within_object_literal_braces = false +ij_typescript_spaces_within_object_type_braces = true +ij_typescript_spaces_within_parentheses = false +ij_typescript_spaces_within_switch_parentheses = false +ij_typescript_spaces_within_type_assertion = false +ij_typescript_spaces_within_union_types = true +ij_typescript_spaces_within_while_parentheses = false +ij_typescript_special_else_if_treatment = true +ij_typescript_ternary_operation_signs_on_next_line = false +ij_typescript_ternary_operation_wrap = on_every_item +ij_typescript_union_types_wrap = on_every_item +ij_typescript_use_chained_calls_group_indents = false +ij_typescript_use_double_quotes = true +ij_typescript_use_explicit_js_extension = auto +ij_typescript_use_path_mapping = always +ij_typescript_use_public_modifier = false +ij_typescript_use_semicolon_after_statement = true +ij_typescript_var_declaration_wrap = normal +ij_typescript_while_brace_force = always +ij_typescript_while_on_new_line = false +ij_typescript_wrap_comments = false + +[{*.bash,*.sh,*.zsh}] +indent_size = 2 +tab_width = 2 +ij_shell_binary_ops_start_line = false +ij_shell_keep_column_alignment_padding = false +ij_shell_minify_program = false +ij_shell_redirect_followed_by_space = false +ij_shell_switch_cases_indented = true +ij_shell_use_unix_line_separator = true +indent_style = space + +[{*.cjs,*.js}] +ij_continuation_indent_size = 4 +ij_javascript_align_imports = true +ij_javascript_align_multiline_array_initializer_expression = true +ij_javascript_align_multiline_binary_operation = true +ij_javascript_align_multiline_chained_methods = false +ij_javascript_align_multiline_extends_list = true +ij_javascript_align_multiline_for = true +ij_javascript_align_multiline_parameters = true +ij_javascript_align_multiline_parameters_in_calls = true +ij_javascript_align_multiline_ternary_operation = true +ij_javascript_align_object_properties = 1 +ij_javascript_align_union_types = false +ij_javascript_align_var_statements = 2 +ij_javascript_array_initializer_new_line_after_left_brace = false +ij_javascript_array_initializer_right_brace_on_new_line = false +ij_javascript_array_initializer_wrap = on_every_item +ij_javascript_assignment_wrap = on_every_item +ij_javascript_binary_operation_sign_on_next_line = false +ij_javascript_binary_operation_wrap = on_every_item +ij_javascript_blacklist_imports = rxjs/Rx, node_modules/**, **/node_modules/**, @angular/material, @angular/material/typings/** +ij_javascript_blank_lines_after_imports = 1 +ij_javascript_blank_lines_around_class = 1 +ij_javascript_blank_lines_around_field = 0 +ij_javascript_blank_lines_around_function = 1 +ij_javascript_blank_lines_around_method = 1 +ij_javascript_block_brace_style = next_line +ij_javascript_block_comment_add_space = false +ij_javascript_block_comment_at_first_column = true +ij_javascript_call_parameters_new_line_after_left_paren = false +ij_javascript_call_parameters_right_paren_on_new_line = false +ij_javascript_call_parameters_wrap = on_every_item +ij_javascript_catch_on_new_line = true +ij_javascript_chained_call_dot_on_new_line = true +ij_javascript_class_brace_style = next_line +ij_javascript_comma_on_new_line = false +ij_javascript_do_while_brace_force = always +ij_javascript_else_on_new_line = true +ij_javascript_enforce_trailing_comma = remove +ij_javascript_extends_keyword_wrap = normal +ij_javascript_extends_list_wrap = on_every_item +ij_javascript_field_prefix = _ +ij_javascript_file_name_style = relaxed +ij_javascript_finally_on_new_line = true +ij_javascript_for_brace_force = if_multiline +ij_javascript_for_statement_new_line_after_left_paren = false +ij_javascript_for_statement_right_paren_on_new_line = false +ij_javascript_for_statement_wrap = on_every_item +ij_javascript_force_quote_style = true +ij_javascript_force_semicolon_style = true +ij_javascript_function_expression_brace_style = next_line +ij_javascript_if_brace_force = if_multiline +ij_javascript_import_merge_members = global +ij_javascript_import_prefer_absolute_path = true +ij_javascript_import_sort_members = true +ij_javascript_import_sort_module_name = true +ij_javascript_import_use_node_resolution = true +ij_javascript_imports_wrap = on_every_item +ij_javascript_indent_case_from_switch = true +ij_javascript_indent_chained_calls = true +ij_javascript_indent_package_children = 0 +ij_javascript_jsx_attribute_value = braces +ij_javascript_keep_blank_lines_in_code = 2 +ij_javascript_keep_first_column_comment = true +ij_javascript_keep_indents_on_empty_lines = false +ij_javascript_keep_line_breaks = true +ij_javascript_keep_simple_blocks_in_one_line = false +ij_javascript_keep_simple_methods_in_one_line = false +ij_javascript_line_comment_add_space = true +ij_javascript_line_comment_at_first_column = false +ij_javascript_method_brace_style = next_line +ij_javascript_method_call_chain_wrap = on_every_item +ij_javascript_method_parameters_new_line_after_left_paren = false +ij_javascript_method_parameters_right_paren_on_new_line = false +ij_javascript_method_parameters_wrap = on_every_item +ij_javascript_object_literal_wrap = on_every_item +ij_javascript_object_types_wrap = on_every_item +ij_javascript_parentheses_expression_new_line_after_left_paren = false +ij_javascript_parentheses_expression_right_paren_on_new_line = false +ij_javascript_place_assignment_sign_on_next_line = true +ij_javascript_prefer_as_type_cast = false +ij_javascript_prefer_explicit_types_function_expression_returns = false +ij_javascript_prefer_explicit_types_function_returns = false +ij_javascript_prefer_explicit_types_vars_fields = false +ij_javascript_prefer_parameters_wrap = false +ij_javascript_property_prefix = +ij_javascript_reformat_c_style_comments = true +ij_javascript_space_after_colon = true +ij_javascript_space_after_comma = true +ij_javascript_space_after_dots_in_rest_parameter = false +ij_javascript_space_after_generator_mult = true +ij_javascript_space_after_property_colon = true +ij_javascript_space_after_quest = true +ij_javascript_space_after_type_colon = true +ij_javascript_space_after_unary_not = false +ij_javascript_space_before_async_arrow_lparen = false +ij_javascript_space_before_catch_keyword = true +ij_javascript_space_before_catch_left_brace = false +ij_javascript_space_before_catch_parentheses = false +ij_javascript_space_before_class_lbrace = false +ij_javascript_space_before_class_left_brace = true +ij_javascript_space_before_colon = true +ij_javascript_space_before_comma = false +ij_javascript_space_before_do_left_brace = false +ij_javascript_space_before_else_keyword = true +ij_javascript_space_before_else_left_brace = false +ij_javascript_space_before_finally_keyword = true +ij_javascript_space_before_finally_left_brace = false +ij_javascript_space_before_for_left_brace = false +ij_javascript_space_before_for_parentheses = false +ij_javascript_space_before_for_semicolon = false +ij_javascript_space_before_function_left_parenth = false +ij_javascript_space_before_generator_mult = false +ij_javascript_space_before_if_left_brace = false +ij_javascript_space_before_if_parentheses = false +ij_javascript_space_before_method_call_parentheses = false +ij_javascript_space_before_method_left_brace = false +ij_javascript_space_before_method_parentheses = false +ij_javascript_space_before_property_colon = false +ij_javascript_space_before_quest = true +ij_javascript_space_before_switch_left_brace = false +ij_javascript_space_before_switch_parentheses = false +ij_javascript_space_before_try_left_brace = false +ij_javascript_space_before_type_colon = false +ij_javascript_space_before_unary_not = false +ij_javascript_space_before_while_keyword = true +ij_javascript_space_before_while_left_brace = false +ij_javascript_space_before_while_parentheses = false +ij_javascript_spaces_around_additive_operators = true +ij_javascript_spaces_around_arrow_function_operator = true +ij_javascript_spaces_around_assignment_operators = true +ij_javascript_spaces_around_bitwise_operators = true +ij_javascript_spaces_around_equality_operators = true +ij_javascript_spaces_around_logical_operators = true +ij_javascript_spaces_around_multiplicative_operators = true +ij_javascript_spaces_around_relational_operators = true +ij_javascript_spaces_around_shift_operators = true +ij_javascript_spaces_around_unary_operator = false +ij_javascript_spaces_within_array_initializer_brackets = false +ij_javascript_spaces_within_brackets = false +ij_javascript_spaces_within_catch_parentheses = false +ij_javascript_spaces_within_for_parentheses = false +ij_javascript_spaces_within_if_parentheses = false +ij_javascript_spaces_within_imports = false +ij_javascript_spaces_within_interpolation_expressions = false +ij_javascript_spaces_within_method_call_parentheses = false +ij_javascript_spaces_within_method_parentheses = false +ij_javascript_spaces_within_object_literal_braces = false +ij_javascript_spaces_within_object_type_braces = true +ij_javascript_spaces_within_parentheses = false +ij_javascript_spaces_within_switch_parentheses = false +ij_javascript_spaces_within_type_assertion = false +ij_javascript_spaces_within_union_types = true +ij_javascript_spaces_within_while_parentheses = false +ij_javascript_special_else_if_treatment = true +ij_javascript_ternary_operation_signs_on_next_line = false +ij_javascript_ternary_operation_wrap = on_every_item +ij_javascript_union_types_wrap = on_every_item +ij_javascript_use_chained_calls_group_indents = true +ij_javascript_use_double_quotes = true +ij_javascript_use_explicit_js_extension = auto +ij_javascript_use_path_mapping = always +ij_javascript_use_public_modifier = false +ij_javascript_use_semicolon_after_statement = true +ij_javascript_var_declaration_wrap = normal +ij_javascript_while_brace_force = always +ij_javascript_while_on_new_line = false +ij_javascript_wrap_comments = false + +[{*.comp,*.frag,*.fsh,*.geom,*.glsl,*.tesc,*.tese,*.vert,*.vsh}] +ij_glsl_keep_indents_on_empty_lines = false + +[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}] +indent_size = 2 +ij_json_array_wrapping = normal +ij_json_keep_blank_lines_in_code = 0 +ij_json_keep_indents_on_empty_lines = false +ij_json_keep_line_breaks = true +ij_json_keep_trailing_comma = false +ij_json_object_wrapping = normal +ij_json_property_alignment = align_on_value +ij_json_space_after_colon = true +ij_json_space_after_comma = true +ij_json_space_before_colon = false +ij_json_space_before_comma = false +ij_json_spaces_within_braces = false +ij_json_spaces_within_brackets = false +ij_json_wrap_long_lines = false +indent_style = space + +[{*.htm,*.html,*.ng,*.sht,*.shtm,*.shtml}] +ij_html_add_new_line_before_tags = body, div, p, form, h1, h2, h3 +ij_html_align_attributes = true +ij_html_align_text = false +ij_html_attribute_wrap = normal +ij_html_block_comment_add_space = false +ij_html_block_comment_at_first_column = true +ij_html_do_not_align_children_of_min_lines = 0 +ij_html_do_not_break_if_inline_tags = title, h1, h2, h3, h4, h5, h6, p +ij_html_do_not_indent_children_of_tags = html, body, thead, tbody, tfoot +ij_html_enforce_quotes = false +ij_html_inline_tags = a, abbr, acronym, b, basefont, bdo, big, br, cite, cite, code, dfn, em, font, i, img, input, kbd, label, q, s, samp, select, small, span, strike, strong, sub, sup, textarea, tt, u, var +ij_html_keep_blank_lines = 2 +ij_html_keep_indents_on_empty_lines = false +ij_html_keep_line_breaks = true +ij_html_keep_line_breaks_in_text = true +ij_html_keep_whitespaces = false +ij_html_keep_whitespaces_inside = span, pre, textarea +ij_html_line_comment_at_first_column = true +ij_html_new_line_after_last_attribute = never +ij_html_new_line_before_first_attribute = never +ij_html_quote_style = double +ij_html_remove_new_line_before_tags = br +ij_html_space_after_tag_name = false +ij_html_space_around_equality_in_attribute = false +ij_html_space_inside_empty_tag = false +ij_html_text_wrap = normal + +[{*.http,*.rest}] +indent_size = 0 +ij_continuation_indent_size = 4 +ij_http-request_call_parameters_wrap = normal +ij_http-request_method_parameters_wrap = split_into_lines +ij_http-request_space_before_comma = true +ij_http-request_spaces_around_assignment_operators = true + +[{*.markdown,*.md}] +ij_markdown_force_one_space_after_blockquote_symbol = true +ij_markdown_force_one_space_after_header_symbol = true +ij_markdown_force_one_space_after_list_bullet = true +ij_markdown_force_one_space_between_words = true +ij_markdown_format_tables = true +ij_markdown_insert_quote_arrows_on_wrap = true +ij_markdown_keep_indents_on_empty_lines = false +ij_markdown_keep_line_breaks_inside_text_blocks = true +ij_markdown_max_lines_around_block_elements = 1 +ij_markdown_max_lines_around_header = 1 +ij_markdown_max_lines_between_paragraphs = 1 +ij_markdown_min_lines_around_block_elements = 1 +ij_markdown_min_lines_around_header = 1 +ij_markdown_min_lines_between_paragraphs = 1 +ij_markdown_wrap_text_if_long = true +ij_markdown_wrap_text_inside_blockquotes = true + +[{*.ps1,*.psd1,*.psm1}] +max_line_length = 115 +ij_powershell_align_multiline_binary_operation = true +ij_powershell_align_multiline_chained_methods = false +ij_powershell_align_multiline_for = true +ij_powershell_align_multiline_parameters = true +ij_powershell_align_multiline_parameters_in_calls = false +ij_powershell_binary_operation_wrap = on_every_item +ij_powershell_block_brace_style = next_line +ij_powershell_call_parameters_new_line_after_left_paren = false +ij_powershell_call_parameters_right_paren_on_new_line = false +ij_powershell_call_parameters_wrap = on_every_item +ij_powershell_catch_on_new_line = true +ij_powershell_class_annotation_wrap = split_into_lines +ij_powershell_class_brace_style = next_line +ij_powershell_else_on_new_line = true +ij_powershell_field_annotation_wrap = off +ij_powershell_finally_on_new_line = true +ij_powershell_for_statement_new_line_after_left_paren = false +ij_powershell_for_statement_right_paren_on_new_line = false +ij_powershell_for_statement_wrap = on_every_item +ij_powershell_keep_blank_lines_in_code = 2 +ij_powershell_keep_first_column_comment = true +ij_powershell_keep_line_breaks = true +ij_powershell_keep_simple_blocks_in_one_line = true +ij_powershell_keep_simple_classes_in_one_line = false +ij_powershell_keep_simple_lambdas_in_one_line = true +ij_powershell_keep_simple_methods_in_one_line = true +ij_powershell_method_annotation_wrap = split_into_lines +ij_powershell_method_brace_style = next_line +ij_powershell_method_call_chain_wrap = on_every_item +ij_powershell_method_parameters_new_line_after_left_paren = false +ij_powershell_method_parameters_right_paren_on_new_line = false +ij_powershell_method_parameters_wrap = on_every_item +ij_powershell_parameter_annotation_wrap = off +ij_powershell_parentheses_expression_new_line_after_left_paren = false +ij_powershell_parentheses_expression_right_paren_on_new_line = false +ij_powershell_space_after_colon = true +ij_powershell_space_after_comma = true +ij_powershell_space_after_for_semicolon = true +ij_powershell_space_after_type_cast = false +ij_powershell_space_before_annotation_parameter_list = false +ij_powershell_space_before_array_initializer_left_brace = false +ij_powershell_space_before_catch_keyword = true +ij_powershell_space_before_catch_left_brace = false +ij_powershell_space_before_class_left_brace = false +ij_powershell_space_before_colon = true +ij_powershell_space_before_comma = false +ij_powershell_space_before_do_left_brace = false +ij_powershell_space_before_else_keyword = true +ij_powershell_space_before_else_left_brace = false +ij_powershell_space_before_finally_keyword = true +ij_powershell_space_before_finally_left_brace = false +ij_powershell_space_before_for_left_brace = false +ij_powershell_space_before_for_parentheses = false +ij_powershell_space_before_for_semicolon = false +ij_powershell_space_before_if_left_brace = false +ij_powershell_space_before_if_parentheses = false +ij_powershell_space_before_method_call_parentheses = false +ij_powershell_space_before_method_left_brace = false +ij_powershell_space_before_method_parentheses = false +ij_powershell_space_before_switch_left_brace = false +ij_powershell_space_before_switch_parentheses = false +ij_powershell_space_before_try_left_brace = false +ij_powershell_space_before_while_keyword = true +ij_powershell_space_before_while_left_brace = false +ij_powershell_space_before_while_parentheses = false +ij_powershell_space_within_empty_method_call_parentheses = false +ij_powershell_space_within_empty_method_parentheses = false +ij_powershell_spaces_around_additive_operators = true +ij_powershell_spaces_around_assignment_operators = true +ij_powershell_spaces_around_bitwise_operators = true +ij_powershell_spaces_around_logical_operators = true +ij_powershell_spaces_around_method_ref_dbl_colon = false +ij_powershell_spaces_around_multiplicative_operators = true +ij_powershell_spaces_around_relational_operators = true +ij_powershell_spaces_around_unary_operator = false +ij_powershell_spaces_within_annotation_parentheses = false +ij_powershell_spaces_within_braces = true +ij_powershell_spaces_within_brackets = false +ij_powershell_spaces_within_cast_parentheses = false +ij_powershell_spaces_within_for_parentheses = false +ij_powershell_spaces_within_if_parentheses = false +ij_powershell_spaces_within_method_call_parentheses = false +ij_powershell_spaces_within_method_parentheses = false +ij_powershell_spaces_within_parentheses = false +ij_powershell_spaces_within_switch_parentheses = false +ij_powershell_spaces_within_while_parentheses = false +ij_powershell_special_else_if_treatment = true +ij_powershell_while_on_new_line = false +ij_powershell_wrap_first_method_in_call_chain = false +ij_powershell_wrap_long_lines = false + +[{*.py,*.pyw}] +ij_python_align_collections_and_comprehensions = true +ij_python_align_multiline_imports = true +ij_python_align_multiline_parameters = true +ij_python_align_multiline_parameters_in_calls = true +ij_python_blank_line_at_file_end = false +ij_python_blank_lines_after_imports = 1 +ij_python_blank_lines_after_local_imports = 0 +ij_python_blank_lines_around_class = 1 +ij_python_blank_lines_around_method = 1 +ij_python_blank_lines_around_top_level_classes_functions = 2 +ij_python_blank_lines_before_first_method = 0 +ij_python_call_parameters_new_line_after_left_paren = false +ij_python_call_parameters_right_paren_on_new_line = false +ij_python_call_parameters_wrap = on_every_item +ij_python_dict_alignment = 0 +ij_python_dict_new_line_after_left_brace = false +ij_python_dict_new_line_before_right_brace = false +ij_python_dict_wrapping = 5 +ij_python_from_import_new_line_after_left_parenthesis = false +ij_python_from_import_new_line_before_right_parenthesis = false +ij_python_from_import_parentheses_force_if_multiline = false +ij_python_from_import_trailing_comma_if_multiline = false +ij_python_from_import_wrapping = 5 +ij_python_hang_closing_brackets = true +ij_python_keep_blank_lines_in_code = 1 +ij_python_keep_blank_lines_in_declarations = 1 +ij_python_keep_indents_on_empty_lines = false +ij_python_keep_line_breaks = true +ij_python_method_parameters_new_line_after_left_paren = false +ij_python_method_parameters_right_paren_on_new_line = false +ij_python_method_parameters_wrap = on_every_item +ij_python_new_line_after_colon = false +ij_python_new_line_after_colon_multi_clause = true +ij_python_optimize_imports_always_split_from_imports = false +ij_python_optimize_imports_case_insensitive_order = true +ij_python_optimize_imports_join_from_imports_with_same_source = false +ij_python_optimize_imports_sort_by_type_first = true +ij_python_optimize_imports_sort_imports = true +ij_python_optimize_imports_sort_names_in_from_imports = true +ij_python_space_after_comma = true +ij_python_space_after_number_sign = true +ij_python_space_after_py_colon = true +ij_python_space_before_backslash = true +ij_python_space_before_comma = false +ij_python_space_before_for_semicolon = false +ij_python_space_before_lbracket = false +ij_python_space_before_method_call_parentheses = false +ij_python_space_before_method_parentheses = false +ij_python_space_before_number_sign = true +ij_python_space_before_py_colon = false +ij_python_space_within_empty_method_call_parentheses = false +ij_python_space_within_empty_method_parentheses = false +ij_python_spaces_around_additive_operators = true +ij_python_spaces_around_assignment_operators = true +ij_python_spaces_around_bitwise_operators = true +ij_python_spaces_around_eq_in_keyword_argument = false +ij_python_spaces_around_eq_in_named_parameter = false +ij_python_spaces_around_equality_operators = true +ij_python_spaces_around_multiplicative_operators = true +ij_python_spaces_around_power_operator = true +ij_python_spaces_around_relational_operators = true +ij_python_spaces_around_shift_operators = true +ij_python_spaces_within_braces = false +ij_python_spaces_within_brackets = false +ij_python_spaces_within_method_call_parentheses = false +ij_python_spaces_within_method_parentheses = false +ij_python_use_continuation_indent_for_arguments = false +ij_python_use_continuation_indent_for_collection_and_comprehensions = false +ij_python_use_continuation_indent_for_parameters = true +ij_python_wrap_long_lines = false + +[{*.toml,Cargo.lock,Cargo.toml.orig,Gopkg.lock,Pipfile,poetry.lock}] +ij_toml_keep_indents_on_empty_lines = false + +[{*.yaml,*.yml,pubspec.lock}] +indent_size = 2 +ij_yaml_align_values_properties = on_value +ij_yaml_autoinsert_sequence_marker = true +ij_yaml_block_mapping_on_new_line = false +ij_yaml_indent_sequence_value = true +ij_yaml_keep_indents_on_empty_lines = false +ij_yaml_keep_line_breaks = true +ij_yaml_sequence_on_new_line = false +ij_yaml_space_before_colon = false +ij_yaml_spaces_within_braces = true +ij_yaml_spaces_within_brackets = true +indent_style = space + +[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cppm,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,uxml,vb,xaml,xamlx,xoml,xsd}] +indent_style = space +indent_size = 4 +tab_width = 4 diff --git a/Aaru.CommonTypes/.gitignore b/Aaru.CommonTypes/.gitignore new file mode 100644 index 000000000..05c540d38 --- /dev/null +++ b/Aaru.CommonTypes/.gitignore @@ -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 \ No newline at end of file diff --git a/Aaru.CommonTypes/Aaru.CommonTypes.csproj b/Aaru.CommonTypes/Aaru.CommonTypes.csproj new file mode 100644 index 000000000..36105ec37 --- /dev/null +++ b/Aaru.CommonTypes/Aaru.CommonTypes.csproj @@ -0,0 +1,70 @@ + + + + 2.0 + {F2B84194-26EB-4227-B1C5-6602517E85AE} + Library + Aaru.CommonTypes + Aaru.CommonTypes + $(Version) + true + 6.0.0-alpha9 + Claunia.com + Copyright © 2011-2023 Natalia Portillo + Aaru Data Preservation Suite + Aaru.CommonTypes + $(Version) + net8.0 + 12 + Contains common types defined by the Aaru Data Preservation Suite. + https://github.com/aaru-dps/ + MIT + https://github.com/aaru-dps/Aaru.CommonTypes + true + en-US + true + true + snupkg + Natalia Portillo <claunia@claunia.com> + true + true + + + CS1591;CS1574 + + + + + + + $(Version)+{chash:8} + true + true + + + + + + + + + + + + + + LICENSE.MIT + + + + + + + + + + ResXFileCodeGenerator + Localization.Designer.cs + + + diff --git a/Aaru.CommonTypes/Aaru.CommonTypes.csproj.DotSettings b/Aaru.CommonTypes/Aaru.CommonTypes.csproj.DotSettings new file mode 100644 index 000000000..c2586551b --- /dev/null +++ b/Aaru.CommonTypes/Aaru.CommonTypes.csproj.DotSettings @@ -0,0 +1,7 @@ + + True + True \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/ATA.cs b/Aaru.CommonTypes/AaruMetadata/ATA.cs new file mode 100644 index 000000000..3e70696a6 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/ATA.cs @@ -0,0 +1,58 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ATA.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/AaruMetadata.cs b/Aaru.CommonTypes/AaruMetadata/AaruMetadata.cs new file mode 100644 index 000000000..123aa68de --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/AaruMetadata.cs @@ -0,0 +1,219 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : AaruMetadata.cs +// Author(s) : Natalia Portillo +// +// 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 Developers { get; set; } + public List Publishers { get; set; } + public List Authors { get; set; } + public List 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 Barcodes { get; set; } + public string PartNumber { get; set; } + public string SerialNumber { get; set; } + public List Keywords { get; set; } + public List Magazines { get; set; } + public List Books { get; set; } + public List Categories { get; set; } + public List Subcategories { get; set; } + public List Languages { get; set; } + public List Systems { get; set; } + public List Architectures { get; set; } + public List RequiredOperatingSystems { get; set; } + public List UserManuals { get; set; } + public List OpticalDiscs { get; set; } + public List Advertisements { get; set; } + public List LinearMedias { get; set; } + public List PciCards { get; set; } + public List BlockMedias { get; set; } + public List 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(cicm.Developer), + Publishers = cicm.Publisher is null ? null : new List(cicm.Publisher), + Authors = cicm.Author is null ? null : new List(cicm.Author), + Performers = cicm.Performer is null ? null : new List(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(cicm.Keywords), + Categories = cicm.Categories is null ? null : new List(cicm.Categories), + Subcategories = cicm.Subcategories is null ? null : new List(cicm.Subcategories), + Systems = cicm.Systems is null ? null : new List(cicm.Systems) + }; + + if(cicm.Barcodes is not null) + { + metadata.Barcodes = new List(); + + foreach(Schemas.BarcodeType code in cicm.Barcodes) + metadata.Barcodes.Add(code); + } + + if(cicm.Magazine is not null) + { + metadata.Magazines = new List(); + + foreach(MagazineType magazine in cicm.Magazine) + metadata.Magazines.Add(magazine); + } + + if(cicm.Book is not null) + { + metadata.Books = new List(); + + foreach(BookType book in cicm.Book) + metadata.Books.Add(book); + } + + if(cicm.Languages is not null) + { + metadata.Languages = new List(); + + foreach(LanguagesTypeLanguage lng in cicm.Languages) + metadata.Languages.Add((Language)lng); + } + + if(cicm.Architectures is not null) + { + metadata.Architectures = new List(); + + foreach(ArchitecturesTypeArchitecture arch in cicm.Architectures) + metadata.Architectures.Add((Architecture)arch); + } + + if(cicm.RequiredOperatingSystems is not null) + { + metadata.RequiredOperatingSystems = new List(); + + foreach(RequiredOperatingSystemType os in cicm.RequiredOperatingSystems) + metadata.RequiredOperatingSystems.Add(os); + } + + if(cicm.UserManual is not null) + { + metadata.UserManuals = new List(); + + foreach(UserManualType manual in cicm.UserManual) + metadata.UserManuals.Add(manual); + } + + if(cicm.OpticalDisc is not null) + { + metadata.OpticalDiscs = new List(); + + foreach(OpticalDiscType disc in cicm.OpticalDisc) + metadata.OpticalDiscs.Add(disc); + } + + if(cicm.Advertisement is not null) + { + metadata.Advertisements = new List(); + + foreach(AdvertisementType adv in cicm.Advertisement) + metadata.Advertisements.Add(adv); + } + + if(cicm.LinearMedia is not null) + { + metadata.LinearMedias = new List(); + + foreach(LinearMediaType media in cicm.LinearMedia) + metadata.LinearMedias.Add(media); + } + + if(cicm.PCICard is not null) + { + metadata.PciCards = new List(); + + foreach(PCIType pci in cicm.PCICard) + metadata.PciCards.Add(pci); + } + + if(cicm.BlockMedia is not null) + { + metadata.BlockMedias = new List(); + + foreach(BlockMediaType media in cicm.BlockMedia) + metadata.BlockMedias.Add(media); + } + + if(cicm.AudioMedia is null) + return metadata; + + metadata.AudioMedias = new List(); + + foreach(AudioMediaType media in cicm.AudioMedia) + metadata.AudioMedias.Add(media); + + return metadata; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Advertisement.cs b/Aaru.CommonTypes/AaruMetadata/Advertisement.cs new file mode 100644 index 000000000..6b0584de3 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Advertisement.cs @@ -0,0 +1,117 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Advertisement.cs +// Author(s) : Natalia Portillo +// +// 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 Checksums { get; set; } + public List AudioTracks { get; set; } + public List VideoTracks { get; set; } + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + adv.Checksums.Add(chk); + } + + if(cicm.AudioTrack is not null) + { + adv.AudioTracks = new List(); + + foreach(AudioTracksType trk in cicm.AudioTrack) + adv.AudioTracks.Add(trk); + } + + if(cicm.VideoTrack is not null) + { + adv.VideoTracks = new List(); + + foreach(VideoTracksType trk in cicm.VideoTrack) + adv.VideoTracks.Add(trk); + } + + if(cicm.SubtitleTrack is null) + return adv; + + { + adv.SubtitleTracks = new List(); + + foreach(SubtitleTracksType trk in cicm.SubtitleTrack) + adv.SubtitleTracks.Add(trk); + } + + return adv; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Architecture.cs b/Aaru.CommonTypes/AaruMetadata/Architecture.cs new file mode 100644 index 000000000..e41ebe1a1 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Architecture.cs @@ -0,0 +1,129 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Architecture.cs +// Author(s) : Natalia Portillo +// +// 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 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/AudioMedia.cs b/Aaru.CommonTypes/AaruMetadata/AudioMedia.cs new file mode 100644 index 000000000..12ea1397f --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/AudioMedia.cs @@ -0,0 +1,146 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : AudioMedia.cs +// Author(s) : Natalia Portillo +// +// 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 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 Blocks { get; set; } + public string CopyProtection { get; set; } + public Dimensions Dimensions { get; set; } + public Scans Scans { get; set; } + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + media.Checksums.Add(chk); + } + + if(cicm.Block is not null) + { + media.Blocks = new List(); + + foreach(AudioBlockType blk in cicm.Block) + media.Blocks.Add(blk); + } + + if(cicm.DumpHardwareArray is null) + return media; + + media.DumpHardware = new List(); + + 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 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + blk.Checksums.Add(chk); + + return blk; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/AudioVideo.cs b/Aaru.CommonTypes/AaruMetadata/AudioVideo.cs new file mode 100644 index 000000000..d2a682f32 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/AudioVideo.cs @@ -0,0 +1,333 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : AudioVideo.cs +// Author(s) : Natalia Portillo +// +// 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 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(); + + foreach(LanguagesTypeLanguage lng in cicm.Languages) + trk.Languages.Add((Language)lng); + + return trk; + } +} + +public class VideoTrack +{ + public List 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(); + + foreach(LanguagesTypeLanguage lng in cicm.Languages) + trk.Languages.Add((Language)lng); + + return trk; + } +} + +public class SubtitleTrack +{ + public List 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(); + + 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 { 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(); + + 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 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Barcode.cs b/Aaru.CommonTypes/AaruMetadata/Barcode.cs new file mode 100644 index 000000000..3764547aa --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Barcode.cs @@ -0,0 +1,95 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Barcode.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/BlockMedia.cs b/Aaru.CommonTypes/AaruMetadata/BlockMedia.cs new file mode 100644 index 000000000..037bf8e89 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/BlockMedia.cs @@ -0,0 +1,220 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : BlockMedia.cs +// Author(s) : Natalia Portillo +// +// 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 Checksums { get; set; } + public List 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 VariableBlockSize { get; set; } + public List 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 Track { get; set; } + public string CopyProtection { get; set; } + public Dimensions Dimensions { get; set; } + public List FileSystemInformation { get; set; } + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + media.Checksums.Add(chk); + } + + if(cicm.ContentChecksums is not null) + { + media.ContentChecksums = new List(); + + foreach(Schemas.ChecksumType chk in cicm.ContentChecksums) + media.ContentChecksums.Add(chk); + } + + if(cicm.VariableBlockSize is not null) + { + media.VariableBlockSize = new List(); + + foreach(BlockSizeType blkSize in cicm.VariableBlockSize) + media.VariableBlockSize.Add(blkSize); + } + + if(cicm.TapeInformation is not null) + { + media.TapeInformation = new List(); + + foreach(TapePartitionType tapeInformation in cicm.TapeInformation) + media.TapeInformation.Add(tapeInformation); + } + + if(cicm.FileSystemInformation is not null) + { + media.FileSystemInformation = new List(); + + foreach(PartitionType fsInfo in cicm.FileSystemInformation) + media.FileSystemInformation.Add(fsInfo); + } + + if(cicm.DumpHardwareArray is null) + return media; + + media.DumpHardware = new List(); + + 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 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + trk.Checksums.Add(chk); + + return trk; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Book.cs b/Aaru.CommonTypes/AaruMetadata/Book.cs new file mode 100644 index 000000000..960b749d6 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Book.cs @@ -0,0 +1,97 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Book.cs +// Author(s) : Natalia Portillo +// +// 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 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 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(); + + foreach(Schemas.BarcodeType code in cicm.Barcodes) + book.Barcodes.Add(code); + } + + if(cicm.Language is null) + return book; + + book.Languages = new List(); + + foreach(LanguagesTypeLanguage lng in cicm.Language) + book.Languages.Add((Language)lng); + + return book; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Checksum.cs b/Aaru.CommonTypes/AaruMetadata/Checksum.cs new file mode 100644 index 000000000..5b90f982a --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Checksum.cs @@ -0,0 +1,91 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Checksum.cs +// Author(s) : Natalia Portillo +// +// 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 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Contents.cs b/Aaru.CommonTypes/AaruMetadata/Contents.cs new file mode 100644 index 000000000..ffca286fa --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Contents.cs @@ -0,0 +1,237 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Contents.cs +// Author(s) : Natalia Portillo +// +// 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 Files { get; set; } + public List 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(); + + foreach(ContentsFileType file in cicm.File) + fs.Files.Add(file); + } + + if(cicm.Directory is null) + return fs; + + fs.Directories = new List(); + + foreach(DirectoryType dir in cicm.Directory) + fs.Directories.Add(dir); + + return fs; + } +} + +public class ContentsFile +{ + public List Checksums { get; set; } + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + file.Checksums.Add(chk); + } + + if(cicm.ExtendedAttributes is null) + return file; + + file.ExtendedAttributes = new List(); + + foreach(ExtendedAttributeType xa in cicm.ExtendedAttributes) + file.ExtendedAttributes.Add(xa); + + return file; + } +} + +public class ExtendedAttribute +{ + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + xa.Checksums.Add(chk); + + return xa; + } +} + +public class Directory +{ + public List Files { get; set; } + public List 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(); + + foreach(DirectoryType d in cicm.Directory) + dir.Directories.Add(d); + } + + if(cicm.File is null) + return dir; + + dir.Files = new List(); + + foreach(ContentsFileType file in cicm.File) + dir.Files.Add(file); + + return dir; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Dimensions.cs b/Aaru.CommonTypes/AaruMetadata/Dimensions.cs new file mode 100644 index 000000000..cc5017f1b --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Dimensions.cs @@ -0,0 +1,1159 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Dimensions.cs +// Author(s) : Natalia Portillo +// +// 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 Dimensions +{ + public double? Diameter { get; set; } + public double? Height { get; set; } + public double? Width { get; set; } + public double Thickness { get; set; } + + [Obsolete("Will be removed in Aaru 7")] + public static implicit operator Dimensions(DimensionsType cicm) => cicm is null + ? null + : new Dimensions + { + Diameter = cicm.DiameterSpecified + ? cicm.Diameter + : null, + Height = cicm.HeightSpecified + ? cicm.Height + : null, + Width = cicm.WidthSpecified + ? cicm.Width + : null, + Thickness = cicm.Thickness + }; + + /// Gets the physical dimensions, in metadata expected format, for a given media type + /// Media type + /// Dimensions metadata + public static Dimensions FromMediaType(MediaType mediaType) + { + var dmns = new Dimensions(); + + switch(mediaType) + { + #region 5.25" floppy disk + + case MediaType.Apple32SS: + case MediaType.Apple32DS: + case MediaType.Apple33SS: + case MediaType.Apple33DS: + case MediaType.AppleFileWare: + case MediaType.DOS_525_SS_DD_8: + case MediaType.DOS_525_SS_DD_9: + case MediaType.DOS_525_DS_DD_8: + case MediaType.DOS_525_DS_DD_9: + case MediaType.DOS_525_HD: + case MediaType.XDF_525: + case MediaType.ACORN_525_SS_SD_40: + case MediaType.ACORN_525_SS_SD_80: + case MediaType.ACORN_525_SS_DD_40: + case MediaType.ACORN_525_SS_DD_80: + case MediaType.ACORN_525_DS_DD: + case MediaType.ATARI_525_SD: + case MediaType.ATARI_525_ED: + case MediaType.ATARI_525_DD: + case MediaType.CBM_1540: + case MediaType.CBM_1540_Ext: + case MediaType.CBM_1571: + case MediaType.ECMA_66: + case MediaType.ECMA_70: + case MediaType.NEC_525_HD: + case MediaType.ECMA_78: + case MediaType.ECMA_78_2: + case MediaType.ECMA_99_8: + case MediaType.ECMA_99_15: + case MediaType.ECMA_99_26: + case MediaType.FDFORMAT_525_DD: + case MediaType.FDFORMAT_525_HD: + case MediaType.MetaFloppy_Mod_I: + case MediaType.MetaFloppy_Mod_II: + // According to ECMA-99 et al + dmns.Height = 133.3; + + dmns.Width = 133.3; + + dmns.Thickness = 1.65; + + return dmns; + + #endregion 5.25" floppy disk + + #region 3.5" floppy disk + + case MediaType.AppleSonySS: + case MediaType.AppleSonyDS: + case MediaType.DOS_35_SS_DD_8: + case MediaType.DOS_35_SS_DD_9: + case MediaType.DOS_35_DS_DD_8: + case MediaType.DOS_35_DS_DD_9: + case MediaType.DOS_35_HD: + case MediaType.DOS_35_ED: + case MediaType.DMF: + case MediaType.DMF_82: + case MediaType.XDF_35: + case MediaType.ACORN_35_DS_DD: + case MediaType.CBM_35_DD: + case MediaType.CBM_AMIGA_35_DD: + case MediaType.CBM_AMIGA_35_HD: + case MediaType.FDFORMAT_35_DD: + case MediaType.FDFORMAT_35_HD: + case MediaType.NEC_35_HD_8: + case MediaType.NEC_35_HD_15: + case MediaType.Floptical: + case MediaType.HiFD: + case MediaType.UHD144: + case MediaType.Apricot_35: + case MediaType.FD32MB: + // According to ECMA-100 et al + dmns.Height = 94; + + dmns.Width = 90; + + dmns.Thickness = 3.3; + + return dmns; + + #endregion 3.5" floppy disk + + #region 8" floppy disk + + case MediaType.IBM23FD: + case MediaType.IBM33FD_128: + case MediaType.IBM33FD_256: + case MediaType.IBM33FD_512: + case MediaType.IBM43FD_128: + case MediaType.IBM43FD_256: + case MediaType.IBM53FD_256: + case MediaType.IBM53FD_512: + case MediaType.IBM53FD_1024: + case MediaType.RX01: + case MediaType.RX02: + case MediaType.NEC_8_SD: + case MediaType.NEC_8_DD: + case MediaType.ECMA_54: + case MediaType.ECMA_59: + case MediaType.ECMA_69_8: + case MediaType.ECMA_69_15: + case MediaType.ECMA_69_26: + // According to ECMA-59 et al + dmns.Height = 203.2; + + dmns.Width = 203.2; + + dmns.Thickness = 1.65; + + return dmns; + + #endregion 8" floppy disk + + #region 356mm magneto optical + + case MediaType.ECMA_260: + case MediaType.ECMA_260_Double: + // According to ECMA-260 et al + dmns.Height = 421.84; + + dmns.Width = 443.76; + + dmns.Thickness = 25.4; + + return dmns; + + #endregion 356mm magneto optical + + #region 300mm magneto optical + + case MediaType.ECMA_189: + case MediaType.ECMA_190: + case MediaType.ECMA_317: + // According to ECMA-317 et al + dmns.Height = 340; + + dmns.Width = 320; + + dmns.Thickness = 17; + + return dmns; + + #endregion 300mm magneto optical + + #region 5.25" magneto optical + + case MediaType.ECMA_153: + case MediaType.ECMA_153_512: + case MediaType.ECMA_183_512: + case MediaType.ECMA_183: + case MediaType.ECMA_184_512: + case MediaType.ECMA_184: + case MediaType.ECMA_195: + case MediaType.ECMA_195_512: + case MediaType.ECMA_238: + case MediaType.ECMA_280: + case MediaType.ECMA_322: + case MediaType.ECMA_322_2k: + case MediaType.UDO: + case MediaType.UDO2: + case MediaType.UDO2_WORM: + case MediaType.ISO_15286: + case MediaType.ISO_15286_1024: + case MediaType.ISO_15286_512: + case MediaType.ISO_10089: + case MediaType.ISO_10089_512: + case MediaType.ECMA_322_1k: + case MediaType.ECMA_322_512: + case MediaType.ISO_14517: + case MediaType.ISO_14517_512: + // According to ECMA-183 et al + dmns.Height = 153; + + dmns.Width = 135; + + dmns.Thickness = 11; + + return dmns; + + #endregion 5.25" magneto optical + + #region 3.5" magneto optical + + case MediaType.ECMA_154: + case MediaType.ECMA_201: + case MediaType.ECMA_201_ROM: + case MediaType.ECMA_223: + case MediaType.ECMA_223_512: + case MediaType.GigaMo: + case MediaType.GigaMo2: + case MediaType.ISO_15041_512: + // According to ECMA-154 et al + dmns.Height = 94; + + dmns.Width = 90; + + dmns.Thickness = 6; + + return dmns; + + #endregion 3.5" magneto optical + + case MediaType.PD650: + case MediaType.PD650_WORM: + dmns.Height = 135; + + dmns.Width = 124; + + dmns.Thickness = 7.8; + + return dmns; + case MediaType.ECMA_239: + dmns.Height = 97; + + dmns.Width = 92; + + dmns.Thickness = 5; + + return dmns; + case MediaType.MMCmicro: + dmns.Height = 14; + + dmns.Width = 12; + + dmns.Thickness = 1.1; + + return dmns; + case MediaType.MemoryStickMicro: + dmns.Height = 15; + + dmns.Width = 12.5; + + dmns.Thickness = 1.2; + + return dmns; + case MediaType.microSD: + dmns.Height = 11; + + dmns.Width = 15; + + dmns.Thickness = 1; + + return dmns; + case MediaType.miniSD: + dmns.Height = 21.5; + + dmns.Width = 20; + + dmns.Thickness = 1.4; + + return dmns; + case MediaType.QIC3010: + case MediaType.QIC3020: + case MediaType.QIC3080: + case MediaType.QIC3095: + case MediaType.QIC320: + case MediaType.QIC40: + case MediaType.QIC80: + dmns.Height = 20; + + dmns.Width = 21.5; + + dmns.Thickness = 1.6; + + return dmns; + case MediaType.RSMMC: + dmns.Height = 18; + + dmns.Width = 24; + + dmns.Thickness = 1.4; + + return dmns; + case MediaType.MMC: + dmns.Height = 32; + + dmns.Width = 24; + + dmns.Thickness = 1.4; + + return dmns; + case MediaType.SecureDigital: + dmns.Height = 32; + + dmns.Width = 24; + + dmns.Thickness = 2.1; + + return dmns; + case MediaType.xD: + dmns.Height = 20; + + dmns.Width = 25; + + dmns.Thickness = 1.78; + + return dmns; + case MediaType.XQD: + dmns.Height = 38.5; + + dmns.Width = 29.8; + + dmns.Thickness = 3.8; + + return dmns; + case MediaType.MemoryStickDuo: + case MediaType.MemoryStickProDuo: + dmns.Height = 20; + + dmns.Width = 31; + + dmns.Thickness = 1.6; + + return dmns; + case MediaType.Nintendo3DSGameCard: + case MediaType.NintendoDSGameCard: + case MediaType.NintendoDSiGameCard: + dmns.Height = 35; + + dmns.Width = 33; + + dmns.Thickness = 3.8; + + return dmns; + case MediaType.DataPlay: + dmns.Height = 42; + + dmns.Width = 33.5; + + dmns.Thickness = 3; + + return dmns; + case MediaType.Microdrive: + dmns.Height = 44; + + dmns.Width = 34; + + dmns.Thickness = 8; + + return dmns; + case MediaType.ExpressCard34: + dmns.Height = 75; + + dmns.Width = 34; + + dmns.Thickness = 5; + + return dmns; + case MediaType.SmartMedia: + dmns.Height = 45; + + dmns.Width = 37; + + dmns.Thickness = 0.76; + + return dmns; + case MediaType.MiniCard: + dmns.Height = 45; + + dmns.Width = 37; + + dmns.Thickness = 3.5; + + return dmns; + case MediaType.PlayStationMemoryCard: + case MediaType.PlayStationMemoryCard2: + dmns.Height = 55.7; + + dmns.Width = 41.5; + + dmns.Thickness = 7; + + return dmns; + case MediaType.CFast: + case MediaType.CompactFlash: + dmns.Height = 36; + + dmns.Width = 43; + + dmns.Thickness = 3.3; + + return dmns; + case MediaType.CompactFlashType2: + dmns.Height = 36; + + dmns.Width = 43; + + dmns.Thickness = 5; + + return dmns; + case MediaType.ZXMicrodrive: + dmns.Height = 36; + + dmns.Width = 43; + + dmns.Thickness = 5; + + return dmns; + case MediaType.MemoryStick: + case MediaType.MemoryStickPro: + dmns.Height = 21; + + dmns.Width = 50; + + dmns.Thickness = 2.6; + + return dmns; + case MediaType.PocketZip: + dmns.Height = 54.5; + + dmns.Width = 50; + + dmns.Thickness = 2; + + return dmns; + case MediaType.ExpressCard54: + dmns.Height = 75; + + dmns.Width = 54; + + dmns.Thickness = 5; + + return dmns; + case MediaType.PCCardTypeI: + dmns.Height = 85.6; + + dmns.Width = 54; + + dmns.Thickness = 3.3; + + return dmns; + case MediaType.PCCardTypeII: + dmns.Height = 85.6; + + dmns.Width = 54; + + dmns.Thickness = 5; + + return dmns; + case MediaType.PCCardTypeIII: + dmns.Height = 85.6; + + dmns.Width = 54; + + dmns.Thickness = 10.5; + + return dmns; + case MediaType.PCCardTypeIV: + dmns.Height = 85.6; + + dmns.Width = 54; + + dmns.Thickness = 16; + + return dmns; + case MediaType.DataStore: + dmns.Height = 86.5; + + dmns.Width = 54; + + dmns.Thickness = 2.5; + + return dmns; + case MediaType.VideoFloppy: + dmns.Height = 54; + + dmns.Width = 60; + + dmns.Thickness = 3.5; + + return dmns; + case MediaType.VXA1: + case MediaType.VXA2: + case MediaType.VXA3: + dmns.Height = 95; + + dmns.Width = 62.5; + + dmns.Thickness = 15; + + return dmns; + case MediaType.MiniDV: + dmns.Height = 47.5; + + dmns.Width = 66; + + dmns.Thickness = 12; + + return dmns; + case MediaType.Wafer: + dmns.Height = 46.8; + + dmns.Width = 67.1; + + dmns.Thickness = 7.9; + + return dmns; + case MediaType.NintendoDiskCard: + dmns.Height = 76.2; + + dmns.Width = 71.12; + + dmns.Thickness = 0; + + return dmns; + case MediaType.HiMD: + case MediaType.MD: + case MediaType.MDData: + case MediaType.MDData2: + case MediaType.MD60: + case MediaType.MD74: + case MediaType.MD80: + dmns.Height = 68; + + dmns.Width = 71.5; + + dmns.Thickness = 4.8; + + return dmns; + case MediaType.DAT160: + case MediaType.DAT320: + case MediaType.DAT72: + case MediaType.DDS1: + case MediaType.DDS2: + case MediaType.DDS3: + case MediaType.DDS4: + case MediaType.DigitalAudioTape: + dmns.Height = 54; + + dmns.Width = 73; + + dmns.Thickness = 10.5; + + return dmns; + case MediaType.CompactFloppy: + dmns.Height = 100; + + dmns.Width = 80; + + dmns.Thickness = 5; + + return dmns; + case MediaType.DECtapeII: + dmns.Height = 60; + + dmns.Width = 81; + + dmns.Thickness = 13; + + return dmns; + case MediaType.Ditto: + dmns.Height = 60; + + dmns.Width = 81; + + dmns.Thickness = 14; + + return dmns; + case MediaType.DittoMax: + dmns.Height = 126; + + dmns.Width = 81; + + dmns.Thickness = 14; + + return dmns; + case MediaType.RDX: + case MediaType.RDX320: + dmns.Height = 119; + + dmns.Width = 87; + + dmns.Thickness = 23; + + return dmns; + case MediaType.LS120: + case MediaType.LS240: + dmns.Height = 94; + + dmns.Width = 90; + + dmns.Thickness = 3.5; + + return dmns; + case MediaType.Travan: + case MediaType.Travan3: + case MediaType.Travan4: + case MediaType.Travan5: + case MediaType.Travan7: + dmns.Height = 72; + + dmns.Width = 92; + + dmns.Thickness = 15; + + return dmns; + case MediaType.Travan1Ex: + dmns.Height = 0; + + dmns.Width = 92; + + dmns.Thickness = 15; + + return dmns; + case MediaType.Travan3Ex: + dmns.Height = 0; + + dmns.Width = 92; + + dmns.Thickness = 15; + + return dmns; + case MediaType.ADR2120: + case MediaType.ADR260: + case MediaType.ADR30: + case MediaType.ADR50: + dmns.Height = 129; + + dmns.Width = 93; + + dmns.Thickness = 14.5; + + return dmns; + case MediaType.Data8: + case MediaType.AIT1: + case MediaType.AIT1Turbo: + case MediaType.AIT2: + case MediaType.AIT2Turbo: + case MediaType.AIT3: + case MediaType.AIT3Ex: + case MediaType.AIT3Turbo: + case MediaType.AIT4: + case MediaType.AIT5: + case MediaType.AITETurbo: + case MediaType.Exatape106m: + case MediaType.Exatape160mXL: + case MediaType.Exatape112m: + case MediaType.Exatape125m: + case MediaType.Exatape150m: + case MediaType.Exatape15m: + case MediaType.Exatape170m: + case MediaType.Exatape225m: + case MediaType.Exatape22m: + case MediaType.Exatape22mAME: + case MediaType.Exatape28m: + case MediaType.Exatape40m: + case MediaType.Exatape45m: + case MediaType.Exatape54m: + case MediaType.Exatape75m: + case MediaType.Exatape76m: + case MediaType.Exatape80m: + dmns.Height = 62.5; + + dmns.Width = 95; + + dmns.Thickness = 15; + + return dmns; + case MediaType.EZ135: + case MediaType.EZ230: + case MediaType.SQ327: + dmns.Height = 97; + + dmns.Width = 98; + + dmns.Thickness = 9.5; + + return dmns; + case MediaType.SQ400: + case MediaType.SQ800: + case MediaType.SQ2000: + dmns.Height = 137; + + dmns.Width = 137; + + dmns.Thickness = 12; + + return dmns; + case MediaType.ZIP100: + case MediaType.ZIP250: + case MediaType.ZIP750: + dmns.Height = 98.5; + + dmns.Width = 98; + + dmns.Thickness = 6.5; + + return dmns; + case MediaType.Jaz: + case MediaType.Jaz2: + dmns.Height = 102; + + dmns.Width = 98; + + dmns.Thickness = 12; + + return dmns; + case MediaType.Orb: + case MediaType.Orb5: + dmns.Height = 104; + + dmns.Width = 98; + + dmns.Thickness = 8; + + return dmns; + case MediaType.SparQ: + dmns.Height = 98; + + dmns.Width = 100; + + dmns.Thickness = 9.7; + + return dmns; + case MediaType.ProfessionalDisc: + case MediaType.ProfessionalDiscDual: + case MediaType.ProfessionalDiscTriple: + case MediaType.ProfessionalDiscQuad: + case MediaType.PDD: + case MediaType.PDD_WORM: + dmns.Height = 130; + + dmns.Width = 128.5; + + dmns.Thickness = 9; + + return dmns; + case MediaType.SLR1: + case MediaType.SLR2: + case MediaType.SLR3: + case MediaType.SLR32: + case MediaType.SLR32SL: + case MediaType.SLR4: + case MediaType.SLR5: + case MediaType.SLR5SL: + case MediaType.SLR6: + case MediaType.SLRtape100: + case MediaType.SLRtape140: + case MediaType.SLRtape24: + case MediaType.SLRtape24SL: + case MediaType.SLRtape40: + case MediaType.SLRtape50: + case MediaType.SLRtape60: + case MediaType.SLRtape7: + case MediaType.SLRtape75: + case MediaType.SLRtape7SL: + dmns.Height = 150; + + dmns.Width = 100; + + dmns.Thickness = 18; + + return dmns; + case MediaType.N64DD: + dmns.Height = 103.124; + + dmns.Width = 101.092; + + dmns.Thickness = 10.16; + + return dmns; + case MediaType.CompactTapeI: + case MediaType.CompactTapeII: + case MediaType.DLTtapeIII: + case MediaType.DLTtapeIIIxt: + case MediaType.DLTtapeIV: + case MediaType.DLTtapeS4: + case MediaType.SDLT1: + case MediaType.SDLT2: + case MediaType.VStapeI: + dmns.Height = 105; + + dmns.Width = 105; + + dmns.Thickness = 25; + + return dmns; + case MediaType.LTO: + case MediaType.LTO2: + case MediaType.LTO3: + case MediaType.LTO3WORM: + case MediaType.LTO4: + case MediaType.LTO4WORM: + case MediaType.LTO5: + case MediaType.LTO5WORM: + case MediaType.LTO6: + case MediaType.LTO6WORM: + case MediaType.LTO7: + case MediaType.LTO7WORM: + dmns.Height = 101.6; + + dmns.Width = 105.41; + + dmns.Thickness = 21.59; + + return dmns; + case MediaType.IBM3480: + case MediaType.IBM3490: + case MediaType.IBM3490E: + case MediaType.IBM3592: + dmns.Height = 125.73; + + dmns.Width = 107.95; + + dmns.Thickness = 25.4; + + return dmns; + case MediaType.T9840A: + case MediaType.T9840B: + case MediaType.T9840C: + case MediaType.T9840D: + case MediaType.T9940A: + case MediaType.T9940B: + dmns.Height = 124.46; + + dmns.Width = 109.22; + + dmns.Thickness = 25.4; + + return dmns; + case MediaType.CompactCassette: + case MediaType.Dcas25: + case MediaType.Dcas85: + case MediaType.Dcas103: + dmns.Height = 63.5; + + dmns.Width = 128; + + dmns.Thickness = 12; + + return dmns; + case MediaType.IBM3470: + dmns.Height = 58.42; + + dmns.Width = 137.16; + + dmns.Thickness = 16.51; + + return dmns; + case MediaType.MLR1: + case MediaType.MLR3: + case MediaType.MLR1SL: + dmns.Height = 101.6; + + dmns.Width = 152.4; + + dmns.Thickness = 15.24; + + return dmns; + case MediaType.QIC11: + case MediaType.QIC120: + case MediaType.QIC1350: + case MediaType.QIC150: + case MediaType.QIC24: + case MediaType.QIC525: + dmns.Height = 101.6; + + dmns.Width = 154.2; + + dmns.Thickness = 16.6; + + return dmns; + #pragma warning disable CS0612 // Type or member is obsolete + case MediaType.Bernoulli: + #pragma warning restore CS0612 // Type or member is obsolete + case MediaType.Bernoulli10: + case MediaType.Bernoulli20: + dmns.Height = 280; + + dmns.Width = 209; + + dmns.Thickness = 18; + + return dmns; + #pragma warning disable CS0612 // Type or member is obsolete + case MediaType.Bernoulli2: + #pragma warning restore CS0612 // Type or member is obsolete + case MediaType.BernoulliBox2_20: + case MediaType.Bernoulli35: + case MediaType.Bernoulli44: + case MediaType.Bernoulli65: + case MediaType.Bernoulli90: + case MediaType.Bernoulli105: + case MediaType.Bernoulli150: + case MediaType.Bernoulli230: + dmns.Height = 138; + + dmns.Width = 136; + + dmns.Thickness = 9; + + return dmns; + case MediaType.DTF: + case MediaType.DTF2: + dmns.Height = 144.78; + + dmns.Width = 254; + + dmns.Thickness = 25.4; + + return dmns; + case MediaType.LD: + case MediaType.LDROM: + case MediaType.LDROM2: + case MediaType.MegaLD: + case MediaType.LVROM: + dmns.Diameter = 300; + + dmns.Thickness = 2.5; + + return dmns; + case MediaType.CRVdisc: + dmns.Height = 344; + + dmns.Width = 325; + + dmns.Thickness = 15.6; + + return dmns; + case MediaType.REV35: + case MediaType.REV70: + case MediaType.REV120: + dmns.Height = 74.8; + + dmns.Width = 76.8; + + dmns.Thickness = 10; + + return dmns; + + #region CD/DVD/BD + + case MediaType.CDDA: + case MediaType.CDG: + case MediaType.CDEG: + case MediaType.CDI: + case MediaType.CDROM: + case MediaType.CDROMXA: + case MediaType.CDPLUS: + case MediaType.CDMO: + case MediaType.CDR: + case MediaType.CDRW: + case MediaType.CDMRW: + case MediaType.VCD: + case MediaType.SVCD: + case MediaType.PCD: + case MediaType.SACD: + case MediaType.DDCD: + case MediaType.DDCDR: + case MediaType.DDCDRW: + case MediaType.DTSCD: + case MediaType.CDMIDI: + case MediaType.CDV: + case MediaType.CD: + case MediaType.DVDROM: + case MediaType.DVDR: + case MediaType.DVDRW: + case MediaType.DVDPR: + case MediaType.DVDPRW: + case MediaType.DVDPRWDL: + case MediaType.DVDRDL: + case MediaType.DVDPRDL: + case MediaType.DVDRAM: + case MediaType.DVDRWDL: + case MediaType.DVDDownload: + case MediaType.HDDVDROM: + case MediaType.HDDVDRAM: + case MediaType.HDDVDR: + case MediaType.HDDVDRW: + case MediaType.HDDVDRDL: + case MediaType.HDDVDRWDL: + case MediaType.BDROM: + case MediaType.BDR: + case MediaType.BDRE: + case MediaType.BDRXL: + case MediaType.BDREXL: + case MediaType.PS1CD: + case MediaType.PS2CD: + case MediaType.PS2DVD: + case MediaType.PS3DVD: + case MediaType.PS3BD: + case MediaType.PS4BD: + case MediaType.PS5BD: + case MediaType.XGD: + case MediaType.XGD2: + case MediaType.XGD3: + case MediaType.XGD4: + case MediaType.MEGACD: + case MediaType.SATURNCD: + case MediaType.GDROM: + case MediaType.GDR: + case MediaType.SuperCDROM2: + case MediaType.JaguarCD: + case MediaType.ThreeDO: + case MediaType.WOD: + case MediaType.WUOD: + case MediaType.PCFX: + case MediaType.CDIREADY: + case MediaType.FMTOWNS: + case MediaType.CDTV: + case MediaType.CD32: + case MediaType.Nuon: + case MediaType.Playdia: + case MediaType.Pippin: + case MediaType.MilCD: + case MediaType.CVD: + case MediaType.UHDBD: + dmns.Diameter = 120; + + dmns.Thickness = 1.2; + + return dmns; + case MediaType.GOD: + dmns.Diameter = 80; + + dmns.Thickness = 1.2; + + return dmns; + case MediaType.VideoNow: + dmns.Diameter = 85; + + dmns.Thickness = 1.2; + + return dmns; + case MediaType.VideoNowColor: + case MediaType.VideoNowXp: + dmns.Diameter = 108; + + dmns.Thickness = 1.2; + + return dmns; + + #endregion CD/DVD/BD + + #region Apple Hard Disks + + // TODO: Find Apple Widget size + case MediaType.AppleProfile: + dmns.Height = 223.8; + + dmns.Width = 438.9; + + dmns.Thickness = 111.5; + + return dmns; + case MediaType.AppleHD20: + dmns.Height = 246.4; + + dmns.Width = 266.7; + + dmns.Thickness = 78.7; + + return dmns; + + #endregion Apple Hard Disks + + case MediaType.UMD: + dmns.Height = 64; + + dmns.Width = 63; + + dmns.Thickness = 4; + + return dmns; + case MediaType.HF12: + case MediaType.HF24: + dmns.Height = 137.5; + + dmns.Width = 135.9; + + dmns.Thickness = 5.64; + + return dmns; + default: + return null; + } + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Dump.cs b/Aaru.CommonTypes/AaruMetadata/Dump.cs new file mode 100644 index 000000000..0f7e6144e --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Dump.cs @@ -0,0 +1,155 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Dump.cs +// Author(s) : Natalia Portillo +// +// 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 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(); + + 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 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(); + + 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/DumpHardware.cs b/Aaru.CommonTypes/AaruMetadata/DumpHardware.cs new file mode 100644 index 000000000..ec28aae1a --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/DumpHardware.cs @@ -0,0 +1,116 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : DumpHardware.cs +// Author(s) : Natalia Portillo +// +// 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 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(); + + 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/FileSystem.cs b/Aaru.CommonTypes/AaruMetadata/FileSystem.cs new file mode 100644 index 000000000..c437bb789 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/FileSystem.cs @@ -0,0 +1,120 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : FileSystem.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Language.cs b/Aaru.CommonTypes/AaruMetadata/Language.cs new file mode 100644 index 000000000..bb522eeab --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Language.cs @@ -0,0 +1,538 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Language.cs +// Author(s) : Natalia Portillo +// +// 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 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Layers.cs b/Aaru.CommonTypes/AaruMetadata/Layers.cs new file mode 100644 index 000000000..83c949028 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Layers.cs @@ -0,0 +1,117 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Layers.cs +// Author(s) : Natalia Portillo +// +// 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 { 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(); + + 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/LinearMedia.cs b/Aaru.CommonTypes/AaruMetadata/LinearMedia.cs new file mode 100644 index 000000000..37533b534 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/LinearMedia.cs @@ -0,0 +1,122 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : LinearMedia.cs +// Author(s) : Natalia Portillo +// +// 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 ImageChecksums { get; set; } + public List 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 { 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(); + + foreach(Schemas.ChecksumType chk in cicm.ImageChecksums) + linearMedia.ImageChecksums.Add(chk); + } + + if(cicm.Checksums is not null) + { + linearMedia.Checksums = new List(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + linearMedia.Checksums.Add(chk); + } + + if(cicm.DumpHardwareArray is null) + return linearMedia; + + linearMedia.DumpHardware = new List(); + + foreach(DumpHardwareType hw in cicm.DumpHardwareArray) + linearMedia.DumpHardware.Add(hw); + + return linearMedia; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Magazine.cs b/Aaru.CommonTypes/AaruMetadata/Magazine.cs new file mode 100644 index 000000000..31fd8280b --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Magazine.cs @@ -0,0 +1,94 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Magazine.cs +// Author(s) : Natalia Portillo +// +// 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 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 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(); + + 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; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/MultiMediaCard.cs b/Aaru.CommonTypes/AaruMetadata/MultiMediaCard.cs new file mode 100644 index 000000000..24d0ee602 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/MultiMediaCard.cs @@ -0,0 +1,64 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : MultiMediaCard.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/OpticalDisc.cs b/Aaru.CommonTypes/AaruMetadata/OpticalDisc.cs new file mode 100644 index 000000000..37e4206a4 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/OpticalDisc.cs @@ -0,0 +1,398 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : OpticalDisc.cs +// Author(s) : Natalia Portillo +// +// 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 Checksums { get; set; } + public string PartNumber { get; set; } + public string SerialNumber { get; set; } + public List RingCode { get; set; } + public List MasteringSid { get; set; } + public List Toolstamp { get; set; } + public List MouldSid { get; set; } + public List 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 FirstTrackPregrap { get; set; } + public List LeadIn { get; set; } + public List LeadOut { get; set; } + public Xbox Xbox { get; set; } + public Ps3Encryption Ps3Encryption { get; set; } + public string MediaCatalogueNumber { get; set; } + public List Track { get; set; } + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + disc.Checksums.Add(chk); + } + + if(cicm.RingCode is not null) + { + disc.RingCode = new List(); + + foreach(LayeredTextType lt in cicm.RingCode) + disc.RingCode.Add(lt); + } + + if(cicm.MasteringSID is not null) + { + disc.MasteringSid = new List(); + + foreach(LayeredTextType lt in cicm.MasteringSID) + disc.MasteringSid.Add(lt); + } + + if(cicm.Toolstamp is not null) + { + disc.Toolstamp = new List(); + + foreach(LayeredTextType lt in cicm.Toolstamp) + disc.Toolstamp.Add(lt); + } + + if(cicm.MouldSID is not null) + { + disc.MouldSid = new List(); + + foreach(LayeredTextType lt in cicm.MouldSID) + disc.MouldSid.Add(lt); + } + + if(cicm.MouldText is not null) + { + disc.MouldText = new List(); + + foreach(LayeredTextType lt in cicm.MouldText) + disc.MouldText.Add(lt); + } + + if(cicm.FirstTrackPregrap is not null) + { + disc.FirstTrackPregrap = new List(); + + foreach(BorderType lt in cicm.FirstTrackPregrap) + disc.FirstTrackPregrap.Add(lt); + } + + if(cicm.LeadIn is not null) + { + disc.LeadIn = new List(); + + foreach(BorderType lt in cicm.LeadIn) + disc.LeadIn.Add(lt); + } + + if(cicm.LeadOut is not null) + { + disc.LeadOut = new List(); + + foreach(BorderType lt in cicm.LeadOut) + disc.LeadOut.Add(lt); + } + + if(cicm.Track is not null) + { + disc.Track = new List(); + + foreach(Schemas.TrackType lt in cicm.Track) + disc.Track.Add(lt); + } + + if(cicm.DumpHardwareArray is null) + return disc; + + disc.DumpHardware = new List(); + + 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 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 Checksums { get; set; } + public SubChannel SubChannel { get; set; } + public List 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(); + + foreach(TrackIndexType idx in cicm.Indexes) + trk.Indexes.Add(idx); + } + + if(cicm.Checksums is not null) + { + trk.Checksums = new List(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + trk.Checksums.Add(chk); + } + + if(cicm.FileSystemInformation is null) + return trk; + + trk.FileSystemInformation = new List(); + + 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 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + subchannel.Checksums.Add(chk); + + return subchannel; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/PCI.cs b/Aaru.CommonTypes/AaruMetadata/PCI.cs new file mode 100644 index 000000000..b3bfae717 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/PCI.cs @@ -0,0 +1,67 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : PCI.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/PCMCIA.cs b/Aaru.CommonTypes/AaruMetadata/PCMCIA.cs new file mode 100644 index 000000000..fab5b3dbf --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/PCMCIA.cs @@ -0,0 +1,80 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : PCMCIA.cs +// Author(s) : Natalia Portillo +// +// 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 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(cicm. + AdditionalInformation) + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/PS3.cs b/Aaru.CommonTypes/AaruMetadata/PS3.cs new file mode 100644 index 000000000..bd3d1fca6 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/PS3.cs @@ -0,0 +1,60 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : PS3.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Partition.cs b/Aaru.CommonTypes/AaruMetadata/Partition.cs new file mode 100644 index 000000000..9927b3784 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Partition.cs @@ -0,0 +1,84 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Partition.cs +// Author(s) : Natalia Portillo +// +// 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 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(); + + foreach(FileSystemType fs in cicm.FileSystems) + part.FileSystems.Add(fs); + + return part; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/ReleaseType.cs b/Aaru.CommonTypes/AaruMetadata/ReleaseType.cs new file mode 100644 index 000000000..d62146de1 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/ReleaseType.cs @@ -0,0 +1,63 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ReleaseType.cs +// Author(s) : Natalia Portillo +// +// 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 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/RequiredOperatingSystem.cs b/Aaru.CommonTypes/AaruMetadata/RequiredOperatingSystem.cs new file mode 100644 index 000000000..de486ed02 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/RequiredOperatingSystem.cs @@ -0,0 +1,62 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : RequiredOperatingSystem.cs +// Author(s) : Natalia Portillo +// +// 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 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(cicm.Version) + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/SCSI.cs b/Aaru.CommonTypes/AaruMetadata/SCSI.cs new file mode 100644 index 000000000..de503f48e --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/SCSI.cs @@ -0,0 +1,112 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : SCSI.cs +// Author(s) : Natalia Portillo +// +// 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 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(); + + 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 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + evpd.Checksums.Add(chk); + + return evpd; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Scanning.cs b/Aaru.CommonTypes/AaruMetadata/Scanning.cs new file mode 100644 index 000000000..0fdd943c3 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Scanning.cs @@ -0,0 +1,324 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Scanning.cs +// Author(s) : Natalia Portillo +// +// 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 Checksums { get; set; } + public List Scanner { get; set; } + public List ScanProcessing { get; set; } + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + scan.Checksums.Add(chk); + } + + if(cicm.Scanner is not null) + { + scan.Scanner = new List(); + + foreach(ScannerType scanner in cicm.Scanner) + scan.Scanner.Add(scanner); + } + + if(cicm.ScanProcessing is not null) + { + scan.ScanProcessing = new List(); + + foreach(ScanProcessingType processing in cicm.ScanProcessing) + scan.ScanProcessing.Add(processing); + } + + if(cicm.OCR is null) + return scan; + + scan.OCR = new List(); + + foreach(OCRType ocr in cicm.OCR) + scan.OCR.Add(ocr); + + return scan; + } +} + +public class Cover +{ + public File File { get; set; } + public List 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(); + + 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 { 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(); + + foreach(Language lng in cicm.Language) + ocr.Language.Add(lng); + + return ocr; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/SecureDigital.cs b/Aaru.CommonTypes/AaruMetadata/SecureDigital.cs new file mode 100644 index 000000000..c72ad3f9a --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/SecureDigital.cs @@ -0,0 +1,64 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : SecureDigital.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Sequence.cs b/Aaru.CommonTypes/AaruMetadata/Sequence.cs new file mode 100644 index 000000000..eeb03d959 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Sequence.cs @@ -0,0 +1,68 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Sequence.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Tape.cs b/Aaru.CommonTypes/AaruMetadata/Tape.cs new file mode 100644 index 000000000..e6c012562 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Tape.cs @@ -0,0 +1,129 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Tape.cs +// Author(s) : Natalia Portillo +// +// 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 Checksums { get; set; } + public List 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + partition.Checksums.Add(chk); + } + + if(cicm.File is null) + return partition; + + partition.Files = new List(); + + 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 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(); + + foreach(Schemas.ChecksumType chk in cicm.Checksums) + file.Checksums.Add(chk); + + return file; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/USB.cs b/Aaru.CommonTypes/AaruMetadata/USB.cs new file mode 100644 index 000000000..6ed63cd9e --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/USB.cs @@ -0,0 +1,62 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : USB.cs +// Author(s) : Natalia Portillo +// +// 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/UserManual.cs b/Aaru.CommonTypes/AaruMetadata/UserManual.cs new file mode 100644 index 000000000..023d10936 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/UserManual.cs @@ -0,0 +1,78 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : UserManual.cs +// Author(s) : Natalia Portillo +// +// 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 { 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(); + + foreach(LanguagesTypeLanguage lng in cicm.Language) + manual.Language.Add((Language)lng); + + return manual; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/AaruMetadata/Xbox.cs b/Aaru.CommonTypes/AaruMetadata/Xbox.cs new file mode 100644 index 000000000..f538f2f41 --- /dev/null +++ b/Aaru.CommonTypes/AaruMetadata/Xbox.cs @@ -0,0 +1,92 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Xbox.cs +// Author(s) : Natalia Portillo +// +// 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 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 + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Delegates.cs b/Aaru.CommonTypes/Delegates.cs new file mode 100644 index 000000000..f648a1389 --- /dev/null +++ b/Aaru.CommonTypes/Delegates.cs @@ -0,0 +1,91 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Delegates.cs +// Author(s) : Natalia Portillo +// +// 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2023 Natalia Portillo +// ****************************************************************************/ + +// ReSharper disable UnusedType.Global + +namespace Aaru.CommonTypes; + +/// Initializes a progress indicator (e.g. makes a progress bar visible) +public delegate void InitProgressHandler(); + +/// Updates a progress indicator with text +public delegate void UpdateProgressHandler(string text, long current, long maximum); + +/// Pulses a progress indicator with indeterminate boundaries +public delegate void PulseProgressHandler(string text); + +/// Uninitializes a progress indicator (e.g. adds a newline to the console) +public delegate void EndProgressHandler(); + +/// Initializes a secondary progress indicator (e.g. makes a progress bar visible) +public delegate void InitProgressHandler2(); + +/// Updates a secondary progress indicator with text +public delegate void UpdateProgressHandler2(string text, long current, long maximum); + +/// Pulses a secondary progress indicator with indeterminate boundaries +public delegate void PulseProgressHandler2(string text); + +/// Uninitializes a secondary progress indicator (e.g. adds a newline to the console) +public delegate void EndProgressHandler2(); + +/// Initializes two progress indicators (e.g. makes a progress bar visible) +public delegate void InitTwoProgressHandler(); + +/// Updates two progress indicators with text +public delegate void UpdateTwoProgressHandler(string text, long current, long maximum, string text2, long current2, + long maximum2); + +/// Pulses a progress indicator with indeterminate boundaries +public delegate void PulseTwoProgressHandler(string text, string text2); + +/// Uninitializes a progress indicator (e.g. adds a newline to the console) +public delegate void EndTwoProgressHandler(); + +/// Updates a status indicator +public delegate void UpdateStatusHandler(string text); + +/// Shows an error message +public delegate void ErrorMessageHandler(string text); + +/// Initializes a block map that's going to be filled with a media scan +public delegate void InitBlockMapHandler(ulong blocks, ulong blockSize, ulong blocksToRead, ushort currentProfile); + +/// Updates lists of time taken on scanning from the specified sector +/// Time in milliseconds +public delegate void ScanTimeHandler(ulong sector, double duration); + +/// Specified a number of blocks could not be read on scan +public delegate void ScanUnreadableHandler(ulong sector); + +/// Sends the speed of scanning a specific sector +public delegate void ScanSpeedHandler(ulong sector, double currentSpeed); \ No newline at end of file diff --git a/Aaru.CommonTypes/Enums/DeviceType.cs b/Aaru.CommonTypes/Enums/DeviceType.cs new file mode 100644 index 000000000..858cf6693 --- /dev/null +++ b/Aaru.CommonTypes/Enums/DeviceType.cs @@ -0,0 +1,58 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : DeviceType.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Device types +public enum DeviceType +{ + /// Unknown device type + Unknown = -1, + /// ATA device + ATA = 1, + /// ATA Packet device (aka SCSI over ATA) + ATAPI = 2, + /// SCSI device (or USB-MSC, SBP2, FC, UAS, etc) + SCSI = 3, + /// SecureDigital memory card + SecureDigital = 4, + /// MultiMediaCard memory card + MMC = 5, + /// NVMe device + NVMe = 6 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Enums/ErrorNumber.cs b/Aaru.CommonTypes/Enums/ErrorNumber.cs new file mode 100644 index 000000000..9f8107176 --- /dev/null +++ b/Aaru.CommonTypes/Enums/ErrorNumber.cs @@ -0,0 +1,287 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ErrorNumber.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Enumerates error codes. Negative for UNIX error number equivalents, positive for Aaru error numbers. +[SuppressMessage("ReSharper", "InconsistentNaming")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "IdentifierTypo")] +public enum ErrorNumber +{ + /// Operation not permitted + NotPermitted = -1, + /// No such file or directory + NoSuchFile = -2, + /// No such process + NoSuchProcess = -3, + /// System call interrupted + InterruptedSyscall = -4, + /// I/O error + InOutError = -5, + /// No such device or address + NoSuchDeviceOrAddress = -6, + /// The argument list is too long + ArgumentListTooLong = -7, + /// Error loading the executable format + ExecutableFormatError = -8, + /// Bad file descriptor + BadFileNumber = -9, + /// No child process + NoChildProcess = -10, + /// Try again + TryAgain = -11, + /// Process ran out of memory + OutOfMemory = -12, + /// Access denied + AccessDenied = -13, + /// Bad address + BadAddress = -14, + /// File is not a block device + NotABlockDevice = -15, + /// Busy, cannot complete + Busy = -16, + /// File already exists + FileExists = -17, + /// Tried to create a link that crosses devices + CrossDeviceLink = -18, + /// No such device + NoSuchDevice = -19, + /// Is not a directory (e.g.: trying to ReadDir() a file) + NotDirectory = -20, + /// Is a directory (e.g.: trying to Read() a dir) + IsDirectory = -21, + /// Invalid argument + InvalidArgument = -22, + /// File table overflow + FileTableOverflow = -23, + /// Too many open files + TooManyOpenFiles = -24, + /// Destination is not a TTY + NotTypewriter = -25, + /// Text file busy + TextFileBusy = -26, + /// File is too large + FileTooLarge = -27, + /// No space left on volume + NoSpaceLeft = -28, + /// Illegal seek requested + IllegalSeek = -29, + /// Tried a write operation on a read-only device + ReadOnly = -30, + /// Too many links + TooManyLinks = -31, + /// Broken pipe + BrokenPipe = -32, + /// Out of domain + OutOfDomain = -33, + /// Out of range + OutOfRange = -34, + /// Operation would incur in a deadlock + DeadlockWouldOccur = -35, + /// Name is too long + NameTooLong = -36, + /// There are no available locks + NoLocksAvailable = -37, + /// Not implemented + NotImplemented = -38, + /// There is no data available + NoData = -61, + /// Link is severed + SeveredLink = -67, + /// There is no such attribute + NoSuchExtendedAttribute = NoData, + /// Not supported + NotSupported = -252, + /// Operation not permitted + EPERM = NotPermitted, + /// No such file or directory + ENOENT = NoSuchFile, + /// No such process + ESRCH = NoSuchProcess, + /// System call interrupted + EINTR = InterruptedSyscall, + /// I/O error + EIO = InOutError, + /// No such device or address + ENXIO = NoSuchDeviceOrAddress, + /// The argument list is too long + E2BIG = ArgumentListTooLong, + /// Error loading the executable format + ENOEXEC = ExecutableFormatError, + /// Bad file descriptor + EBADF = BadFileNumber, + /// No child process + ECHILD = NoChildProcess, + /// Try again + EAGAIN = TryAgain, + /// Process ran out of memory + ENOMEM = OutOfMemory, + /// Access denied + EACCES = AccessDenied, + /// Bad address + EFAULT = BadAddress, + /// File is not a block device + ENOTBLK = NotABlockDevice, + /// Busy, cannot complete + EBUSY = Busy, + /// File already exists + EEXIST = FileExists, + /// Tried to create a link that crosses devices + EXDEV = CrossDeviceLink, + /// No such device + ENODEV = NoSuchDevice, + /// Is not a directory (e.g.: trying to ReadDir() a file) + ENOTDIR = NotDirectory, + /// Is a directory (e.g.: trying to Read() a dir) + EISDIR = IsDirectory, + /// Invalid argument + EINVAL = InvalidArgument, + /// File table overflow + ENFILE = FileTableOverflow, + /// Too many open files + EMFILE = TooManyOpenFiles, + /// Destination is not a TTY + ENOTTY = NotTypewriter, + /// Text file busy + ETXTBSY = TextFileBusy, + /// File is too large + EFBIG = FileTooLarge, + /// No space left on volume + ENOSPC = NoSpaceLeft, + /// Illegal seek requested + ESPIPE = IllegalSeek, + /// Tried a write operation on a read-only device + EROFS = ReadOnly, + /// Too many links + EMLINK = TooManyLinks, + /// Broken pipe + EPIPE = BrokenPipe, + /// Out of domain + EDOM = OutOfDomain, + /// Out of range + ERANGE = OutOfRange, + /// Operation would incur in a deadlock + EDEADLK = DeadlockWouldOccur, + /// Name is too long + ENAMETOOLONG = NameTooLong, + /// There are no available locks + ENOLCK = NoLocksAvailable, + /// Not implemented + ENOSYS = NotImplemented, + /// Link is severed + ENOLINK = SeveredLink, + /// Not supported + ENOTSUP = NotSupported, + /// Directory is not empty + DirectoryNotEmpty = -39, + /// Too many symbolic links encountered + TooManySymbolicLinks = -40, + /// Directory is not empty + ENOTEMPTY = DirectoryNotEmpty, + /// Too many symbolic links encountered + ELOOP = TooManySymbolicLinks, + /// There is no such attribute + ENOATTR = NoSuchExtendedAttribute, + /// There is no data available + ENODATA = NoData, + /// No error + NoError = 0, + /// User requested help to be shown + HelpRequested = 1, + /// Command found nothing + NothingFound = 2, + /// Media has been already dumped completely + AlreadyDumped = 3, + /// Image and its sectors cannot be verified + NotVerifiable = 4, + /// There are bad sectors and image cannot be verified + BadSectorsImageNotVerified = 5, + /// All sectors are good and image cannot be verified + CorrectSectorsImageNotVerified = 6, + /// Image is bad and sectors cannot be verified + BadImageSectorsNotVerified = 7, + /// Image is bad and there are bad sectors + BadImageBadSectors = 8, + /// All sectors are good and image is bad + CorrectSectorsBadImage = 9, + /// Image is good and sectors cannot be verified + CorrectImageSectorsNotVerified = 10, + /// Image is good and there are bad sectors + CorrectImageBadSectors = 11, + /// Exception has been raised + UnexpectedException = 12, + /// The number of arguments is not as expected + UnexpectedArgumentCount = 13, + /// A required argument is not present + MissingArgument = 14, + /// The specified file cannot be opened + CannotOpenFile = 15, + /// The specified encoding cannot be found + EncodingUnknown = 16, + /// The image format has not been recognized + UnrecognizedFormat = 17, + /// The image format failed to open + CannotOpenFormat = 18, + /// The specified metadata sidecar does not have the correct format + InvalidSidecar = 19, + /// The specified resume map does not have the correct format + InvalidResume = 20, + /// The specified image format cannot be found + FormatNotFound = 21, + /// More than one format found for the specified search criteria + TooManyFormats = 22, + /// The specified format does not support the specified media + UnsupportedMedia = 23, + /// Data will be lost writing the specified format + DataWillBeLost = 24, + /// Cannot create destination format + CannotCreateFormat = 25, + /// Error writing data + WriteError = 26, + /// Cannot open device + CannotOpenDevice = 27, + /// Cannot remove the existing database + CannotRemoveDatabase = 28, + /// Specified sector could not be found + SectorNotFound = 29, + /// Image or device has not been opened + NotOpened = 30 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Enums/Images.cs b/Aaru.CommonTypes/Enums/Images.cs new file mode 100644 index 000000000..8d065eb39 --- /dev/null +++ b/Aaru.CommonTypes/Enums/Images.cs @@ -0,0 +1,436 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Images.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Track (as partitioning element) types. +public enum TrackType : byte +{ + /// Audio track + Audio = 0, + /// Data track (not any of the below defined ones) + Data = 1, + /// Data track, compact disc mode 1 + CdMode1 = 2, + /// Data track, compact disc mode 2, formless + CdMode2Formless = 3, + /// Data track, compact disc mode 2, form 1 + CdMode2Form1 = 4, + /// Data track, compact disc mode 2, form 2 + CdMode2Form2 = 5 +} + +/// Type of subchannel in track +public enum TrackSubchannelType : byte +{ + /// Track does not has subchannel dumped, or it's not a CD + None = 0, + /// Subchannel is packed and error corrected + Packed = 1, + /// Subchannel is interleaved + Raw = 2, + /// Subchannel is packed and comes interleaved with main channel in same file + PackedInterleaved = 3, + /// Subchannel is interleaved and comes interleaved with main channel in same file + RawInterleaved = 4, + /// Only Q subchannel is stored as 16 bytes + Q16 = 5, + /// Only Q subchannel is stored as 16 bytes and comes interleaved with main channel in same file + Q16Interleaved = 6 +} + +/// Metadata present for each sector (aka, "tag"). +public enum SectorTagType +{ + /// Apple's GCR sector tags, 12 bytes + AppleSectorTag = 0, + /// Sync frame from CD sector, 12 bytes + CdSectorSync = 1, + /// CD sector header, 4 bytes + CdSectorHeader = 2, + /// CD mode 2 sector subheader + CdSectorSubHeader = 3, + /// CD sector EDC, 4 bytes + CdSectorEdc = 4, + /// CD sector ECC P, 172 bytes + CdSectorEccP = 5, + /// CD sector ECC Q, 104 bytes + CdSectorEccQ = 6, + /// CD sector ECC (P and Q), 276 bytes + CdSectorEcc = 7, + /// CD sector subchannel, 96 bytes + CdSectorSubchannel = 8, + /// CD track ISRC, string, 12 bytes + CdTrackIsrc = 9, + /// CD track text, string, 13 bytes + CdTrackText = 10, + /// CD track flags, 1 byte + CdTrackFlags = 11, + /// DVD sector copyright information + DvdSectorCmi = 12, + /// Floppy address mark (contents depend on underlying floppy format) + FloppyAddressMark = 13, + /// DVD sector title key, 5 bytes + DvdSectorTitleKey = 14, + /// Decrypted DVD sector title key, 5 bytes + DvdTitleKeyDecrypted = 15, + /// DVD sector information, 1 bytes + DvdSectorInformation = 16, + /// DVD sector number, 3 bytes + DvdSectorNumber = 17, + /// DVD sector ID error detection, 2 bytes + DvdSectorIed = 18, + /// DVD sector EDC, 4 bytes + DvdSectorEdc = 19 +} + +/// Metadata present for each media. +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum MediaTagType +{ + /// CD table of contents + CD_TOC = 0, + /// CD session information + CD_SessionInfo = 1, + /// CD full table of contents + CD_FullTOC = 2, + /// CD PMA + CD_PMA = 3, + /// CD Address-Time-In-Pregroove + CD_ATIP = 4, + /// CD-Text + CD_TEXT = 5, + /// CD Media Catalogue Number + CD_MCN = 6, + /// DVD/HD DVD Physical Format Information + DVD_PFI = 7, + /// DVD Lead-in Copyright Management Information + DVD_CMI = 8, + /// DVD disc key + DVD_DiscKey = 9, + /// DVD/HD DVD Burst Cutting Area + DVD_BCA = 10, + /// DVD/HD DVD Lead-in Disc Manufacturer Information + DVD_DMI = 11, + /// Media identifier + DVD_MediaIdentifier = 12, + /// Media key block + DVD_MKB = 13, + /// DVD-RAM/HD DVD-RAM DDS information + DVDRAM_DDS = 14, + /// DVD-RAM/HD DVD-RAM Medium status + DVDRAM_MediumStatus = 15, + /// DVD-RAM/HD DVD-RAM Spare area information + DVDRAM_SpareArea = 16, + /// DVD-R/-RW/HD DVD-R RMD in last border-out + DVDR_RMD = 17, + /// Pre-recorded information from DVD-R/-RW lead-in + DVDR_PreRecordedInfo = 18, + /// DVD-R/-RW/HD DVD-R media identifier + DVDR_MediaIdentifier = 19, + /// DVD-R/-RW/HD DVD-R physical format information + DVDR_PFI = 20, + /// ADIP information + DVD_ADIP = 21, + /// HD DVD Lead-in copyright protection information + HDDVD_CPI = 22, + /// HD DVD-R Medium Status + HDDVD_MediumStatus = 23, + /// DVD+/-R DL Layer capacity + DVDDL_LayerCapacity = 24, + /// DVD-R DL Middle Zone start address + DVDDL_MiddleZoneAddress = 25, + /// DVD-R DL Jump Interval Size + DVDDL_JumpIntervalSize = 26, + /// DVD-R DL Start LBA of the manual layer jump + DVDDL_ManualLayerJumpLBA = 27, + /// Blu-ray Disc Information + BD_DI = 28, + /// Blu-ray Burst Cutting Area + BD_BCA = 29, + /// Blu-ray Disc Definition Structure + BD_DDS = 30, + /// Blu-ray Cartridge Status + BD_CartridgeStatus = 31, + /// Blu-ray Status of Spare Area + BD_SpareArea = 32, + /// AACS volume identifier + AACS_VolumeIdentifier = 33, + /// AACS pre-recorded media serial number + AACS_SerialNumber = 34, + /// AACS media identifier + AACS_MediaIdentifier = 35, + /// Lead-in AACS media key block + AACS_MKB = 36, + /// AACS data keys + AACS_DataKeys = 37, + /// LBA extents flagged for bus encryption by AACS + AACS_LBAExtents = 38, + /// CPRM media key block in Lead-in + AACS_CPRM_MKB = 39, + /// Recognized layer formats in hybrid discs + Hybrid_RecognizedLayers = 40, + /// Disc write protection status + MMC_WriteProtection = 41, + /// Disc standard information + MMC_DiscInformation = 42, + /// Disc track resources information + MMC_TrackResourcesInformation = 43, + /// BD-R Pseudo-overwrite information + MMC_POWResourcesInformation = 44, + /// SCSI INQUIRY response + SCSI_INQUIRY = 45, + /// SCSI MODE PAGE 2Ah + SCSI_MODEPAGE_2A = 46, + /// ATA IDENTIFY DEVICE response + ATA_IDENTIFY = 47, + /// ATA IDENTIFY PACKET DEVICE response + ATAPI_IDENTIFY = 48, + /// PCMCIA/CardBus Card Information Structure + PCMCIA_CIS = 49, + /// SecureDigital CID + SD_CID = 50, + /// SecureDigital CSD + SD_CSD = 51, + /// SecureDigital SCR + SD_SCR = 52, + /// SecureDigital OCR + SD_OCR = 53, + /// MultiMediaCard CID + MMC_CID = 54, + /// MultiMediaCard CSD + MMC_CSD = 55, + /// MultiMediaCard OCR + MMC_OCR = 56, + /// MultiMediaCard Extended CSD + MMC_ExtendedCSD = 57, + /// Xbox Security Sector + Xbox_SecuritySector = 58, + /// + /// On floppy disks, data in last cylinder usually in a different format that contains duplication or + /// manufacturing information + /// + Floppy_LeadOut = 59, + /// DVD Disc Control Blocks + DCB = 60, + /// Compact Disc First Track Pregap + CD_FirstTrackPregap = 61, + /// Compact Disc Lead-out + CD_LeadOut = 62, + /// SCSI MODE SENSE (6) + SCSI_MODESENSE_6 = 63, + /// SCSI MODE SENSE (10) + SCSI_MODESENSE_10 = 64, + /// USB descriptors + USB_Descriptors = 65, + /// XGD unlocked DMI + Xbox_DMI = 66, + /// XDG unlocked PFI + Xbox_PFI = 67, + /// Compact Disc Lead-in + CD_LeadIn = 68, + /// 8 bytes response that seems to define type of MiniDisc + MiniDiscType = 69, + /// 4 bytes response to vendor command D5h + MiniDiscD5 = 70, + /// User TOC, contains fragments, track names, and can be from 1 to 3 sectors of 2336 bytes + MiniDiscUTOC = 71, + /// Not entirely clear kind of TOC that only appears on MD-DATA discs + MiniDiscDTOC = 72, + /// Decrypted DVD disc key + DVD_DiscKey_Decrypted = 73 +} + +/// Enumeration of media types defined in metadata +public enum MetadataMediaType : byte +{ + /// Purely optical discs + OpticalDisc = 0, + /// Media that is physically block-based or abstracted like that + BlockMedia = 1, + /// Media that can be accessed by-byte or by-bit, like chips + LinearMedia = 2, + /// Media that can only store data when it is modulated to audio + AudioMedia = 3 +} + +/// CD flags bitmask +[Flags] +public enum CdFlags : byte +{ + /// Track is quadraphonic. + FourChannel = 0x08, + /// Track is non-audio (data). + DataTrack = 0x04, + /// Track is copy protected. + CopyPermitted = 0x02, + /// Track has pre-emphasis. + PreEmphasis = 0x01 +} + +/// Status of a requested floppy sector +[Flags] +public enum FloppySectorStatus : byte +{ + /// Both address mark and data checksums are correct. + Correct = 0x01, + /// Data checksum is incorrect. + DataError = 0x02, + /// Address mark checksum is incorrect. + AddressMarkError = 0x04, + /// There is another sector in the same track/head with same sector id. + Duplicated = 0x08, + /// Sector data section is not magnetized. + Demagnetized = 0x10, + /// Sector data section has a physically visible hole. + Hole = 0x20, + /// There is no address mark containing the requested sector id in the track/head. + NotFound = 0x40 +} + +/// Types of floppy disks +public enum FloppyTypes : byte +{ + /// 8" floppy + Floppy, + /// 5.25" floppy + MiniFloppy, + /// 3.5" floppy + MicroFloppy, + /// 3" floppy + CompactFloppy, + /// 5.25" twiggy + FileWare, + /// 2.5" quickdisk + QuickDisk +} + +/// Enumeration of floppy densities +public enum FloppyDensities : byte +{ + /// Standard coercivity (about 300Oe as found in 8" and 5.25"-double-density disks). + Standard, + /// Double density coercivity (about 600Oe as found in 5.25" HD and 3.5" DD disks). + Double, + /// High density coercivity (about 700Oe as found in 3.5" HD disks). + High, + /// Extended density coercivity (about 750Oe as found in 3.5" ED disks). + Extended +} + +/// Capabilities for optical media image formats +[Flags] +public enum OpticalImageCapabilities : ulong +{ + /// Can store Red Book audio tracks? + CanStoreAudioTracks = 0x01, + /// Can store CD-V analogue video tracks? + CanStoreVideoTracks = 0x02, + /// Can store Yellow Book data tracks? + CanStoreDataTracks = 0x03, + /// Can store pregaps without needing to interpret the subchannel? + CanStorePregaps = 0x04, + /// Can store indexes without needing to interpret the subchannel? + CanStoreIndexes = 0x08, + /// Can store raw P to W subchannel data? + CanStoreSubchannelRw = 0x10, + /// Can store more than one session? + CanStoreSessions = 0x20, + /// Can store track ISRCs without needing to interpret the subchannel? + CanStoreIsrc = 0x40, + /// Can store Lead-In's CD-TEXT? + CanStoreCdText = 0x80, + /// Can store the MCN without needing to interpret the subchannel? + CanStoreMcn = 0x100, + /// Can store the whole 2352 bytes of a sector? + CanStoreRawData = 0x200, + /// Can store more than 1 session in media that is not CD based (DVD et al)? + CanStoreNotCdSessions = 0x2000, + /// Can store more than 1 track in media that is not CD based (DVD et al)? + CanStoreNotCdTracks = 0x4000, + /// Can store hidden tracks with a type different from track 1? + CanStoreHiddenTracks = 0x8000, + + // TODO: Implement + /// Can store scrambled data? + CanStoreScrambledData = 0x400, + /// Can store only the user area of a sector (2048, 2324, etc)? + CanStoreCookedData = 0x800, + /// Can store more than 1 track? + CanStoreMultipleTracks = 0x1000 +} + +/// Enumeration of linear memory device types +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum LinearMemoryType +{ + /// Unknown device type + Unknown = 0, + /// Read-only memory + ROM = 1, + /// Read-write memory, power-off persistent, used to save data + SaveRAM = 2, + /// Read-write volatile memory + WorkRAM = 3, + /// NOR flash memory + NOR = 4, + /// NAND flash memory + NAND = 5, + /// Memory mapper device + Mapper = 6, + /// Processor, CPU, DSP, etc + Processor = 7, + /// Programmable Array Logic + PAL = 8, + /// Generic Array Logic + GAL = 9, + /// Electronically Erasable Programmable Read Only Memory + EEPROM = 10, + /// Read-only memory, character + CharacterROM = 11, + /// Read-write volatile memory for character + CharacterRAM = 12, + /// Trainer, or hack + Trainer = 13 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Enums/Nes.cs b/Aaru.CommonTypes/Enums/Nes.cs new file mode 100644 index 000000000..1f602b089 --- /dev/null +++ b/Aaru.CommonTypes/Enums/Nes.cs @@ -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 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsByte.cs b/Aaru.CommonTypes/Extents/ExtentsByte.cs new file mode 100644 index 000000000..b7f5a5a5b --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsByte.cs @@ -0,0 +1,250 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsByte.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedType.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public sealed class ExtentsByte +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsByte() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsByte(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(byte item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(byte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(byte item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, (byte)(item - 1)); + toAddTwo = new Tuple((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)(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(byte item, out byte start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsConverter.cs b/Aaru.CommonTypes/Extents/ExtentsConverter.cs new file mode 100644 index 000000000..0a3c3e036 --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsConverter.cs @@ -0,0 +1,84 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsConverter.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Converts extents +public static class ExtentsConverter +{ + /// Converts unsigned long integer extents into XML based extents + /// Extents + /// XML based extents + public static List ToMetadata(ExtentsULong extents) + { + if(extents == null) + return null; + + Tuple[] tuples = extents.ToArray(); + List 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; + } + + /// Converts XML based extents into unsigned long integer extents + /// XML based extents + /// Extents + public static ExtentsULong FromMetadata(IEnumerable extents) + { + if(extents == null) + return null; + + var tuples = extents.Select(extent => new Tuple(extent.Start, extent.End)).ToList(); + + return new ExtentsULong(tuples); + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsInt.cs b/Aaru.CommonTypes/Extents/ExtentsInt.cs new file mode 100644 index 000000000..0b8275ea4 --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsInt.cs @@ -0,0 +1,250 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsInt.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedType.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public sealed class ExtentsInt +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsInt() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsInt(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(int item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(int item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(int item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, item - 1); + toAddTwo = new Tuple(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(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(int item, out int start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsLong.cs b/Aaru.CommonTypes/Extents/ExtentsLong.cs new file mode 100644 index 000000000..f5d12551b --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsLong.cs @@ -0,0 +1,249 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsLong.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsLong +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsLong() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsLong(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(long item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(long item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(long item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, item - 1); + toAddTwo = new Tuple(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(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(long item, out long start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsSByte.cs b/Aaru.CommonTypes/Extents/ExtentsSByte.cs new file mode 100644 index 000000000..c5133fba1 --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsSByte.cs @@ -0,0 +1,250 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsSByte.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsSByte +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsSByte() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsSByte(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(sbyte item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(sbyte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(sbyte item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, (sbyte)(item - 1)); + toAddTwo = new Tuple((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)(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(sbyte item, out sbyte start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsShort.cs b/Aaru.CommonTypes/Extents/ExtentsShort.cs new file mode 100644 index 000000000..69ea3bc07 --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsShort.cs @@ -0,0 +1,250 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsShort.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsShort +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsShort() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsShort(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(short item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(short item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(short item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, (short)(item - 1)); + toAddTwo = new Tuple((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)(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(short item, out short start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsUInt.cs b/Aaru.CommonTypes/Extents/ExtentsUInt.cs new file mode 100644 index 000000000..e6ffa6310 --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsUInt.cs @@ -0,0 +1,250 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsUInt.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public sealed class ExtentsUInt +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsUInt() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsUInt(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(uint item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(uint item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(uint item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, item - 1); + toAddTwo = new Tuple(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(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(uint item, out uint start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsULong.cs b/Aaru.CommonTypes/Extents/ExtentsULong.cs new file mode 100644 index 000000000..45374bea4 --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsULong.cs @@ -0,0 +1,250 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsULong.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +public sealed class ExtentsULong +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsULong() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsULong(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(ulong item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(ulong item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(ulong item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, item - 1); + toAddTwo = new Tuple(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(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(ulong item, out ulong start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Extents/ExtentsUShort.cs b/Aaru.CommonTypes/Extents/ExtentsUShort.cs new file mode 100644 index 000000000..e96143ade --- /dev/null +++ b/Aaru.CommonTypes/Extents/ExtentsUShort.cs @@ -0,0 +1,250 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ExtentsUShort.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Implements extents for +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedType.Global")] +public sealed class ExtentsUShort +{ + List> _backend; + + /// Initialize an empty list of extents + public ExtentsUShort() => _backend = new List>(); + + /// Initializes extents with an specific list + /// List of extents as tuples "start, end" + public ExtentsUShort(IEnumerable> list) + { + _backend = new List>(); + + // This ensure no overlapping extents are added on creation + foreach(Tuple t in list) + Add(t.Item1, t.Item2); + } + + /// Gets a count of how many extents are stored + public int Count => _backend.Count; + + /// Adds the specified number to the corresponding extent, or creates a new one + /// + public void Add(ushort item) + { + Tuple removeOne = null; + Tuple removeTwo = null; + Tuple 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(_backend[i - 1].Item1, _backend[i].Item2); + } + else + itemToAdd = new Tuple(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(_backend[i].Item1, _backend[i + 1].Item2); + } + else + itemToAdd = new Tuple(_backend[i].Item1, item); + + break; + } + + if(itemToAdd != null) + { + _backend.Remove(removeOne); + _backend.Remove(removeTwo); + _backend.Add(itemToAdd); + } + else + _backend.Add(new Tuple(item, item)); + + // Sort + _backend = _backend.OrderBy(t => t.Item1).ToList(); + } + + /// Adds a new extent + /// First element of the extent + /// + /// Last element of the extent or if is true how many elements the extent runs + /// for + /// + /// If set to true, indicates how many elements the extent runs for + 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); + } + + /// Checks if the specified item is contained by an extent on this instance + /// Item to search for + /// true if any of the extents on this instance contains the item + public bool Contains(ushort item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2); + + /// Removes all extents from this instance + public void Clear() => _backend.Clear(); + + /// Removes an item from the extents in this instance + /// Item to remove + /// true if the item was contained in a known extent and removed, false otherwise + public bool Remove(ushort item) + { + Tuple toRemove = null; + Tuple toAddOne = null; + Tuple toAddTwo = null; + + foreach(Tuple extent in _backend) + { + // Extent is contained and not a border + if(item > extent.Item1 && item < extent.Item2) + { + toRemove = extent; + toAddOne = new Tuple(extent.Item1, (ushort)(item - 1)); + toAddTwo = new Tuple((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)(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(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; + } + + /// + /// Converts the list of extents to an array of where T1 is first element of the extent and + /// T2 is last element + /// + /// Array of + public Tuple[] ToArray() => _backend.ToArray(); + + /// Gets the first element of the extent that contains the specified item + /// Item + /// First element of extent + /// true if item was found in an extent, false otherwise + public bool GetStart(ushort item, out ushort start) + { + start = 0; + + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + { + start = extent.Item1; + + return true; + } + + return false; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Geometry.cs b/Aaru.CommonTypes/Geometry.cs new file mode 100644 index 000000000..fd3ece7af --- /dev/null +++ b/Aaru.CommonTypes/Geometry.cs @@ -0,0 +1,144 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Geometry.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Handles CHS geometries +public static class Geometry +{ + /// List of known disk geometries + 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) + }; + + /// Gets the media type for a given geometry + /// Geometry + /// Media type + 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(); + + /// Gets the geometry for a given media type + /// Media type + /// Geometry + 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(); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IArchive.cs b/Aaru.CommonTypes/Interfaces/IArchive.cs new file mode 100644 index 000000000..469be5dfc --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IArchive.cs @@ -0,0 +1,208 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IArchive.cs +// Author(s) : Michael Drüing +// +// 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 . +// +// ---------------------------------------------------------------------------- +// 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; + +/// Supported archive features +[Flags] +public enum ArchiveSupportedFeature : uint +{ + /// The archive supports filenames for its entries. If this flag is not set, files can only be accessed by number. + SupportsFilenames = 1 << 0, + /// + /// The archive supports compression. If this flag is not set, compressed and uncompressed lengths are always the + /// same. + /// + SupportsCompression = 1 << 1, + /// + /// The archive supports subdirectories. If this flag is not set, all filenames are guaranteed to not contain any + /// "/" character. + /// + SupportsSubdirectories = 1 << 2, + /// + /// 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. + /// + HasExplicitDirectories = 1 << 3, + /// The archive stores a timestamp with each entry if this flag is set. + HasEntryTimestamp = 1 << 4, + /// If this flag is set, individual files or the whole archive might be encrypted or password-protected. + SupportsProtection = 1 << 5, // TODO: not implemented yet + + /// If this flag is set, the archive supports returning extended attributes (Xattrs) for each entry. + SupportsXAttrs = 1 << 6 +} + +/// Defines the interface to handle an archive (e.g. ZIP, WAD, etc) +public interface IArchive +{ + /// Descriptive name of the plugin + string Name { get; } + + /// Unique UUID of the plugin + Guid Id { get; } + + /// Plugin author + string Author { get; } + + /// + /// Returns true if the archive has a file/stream/buffer currently opened and no + /// has been issued. + /// + /// true if the archive is opened, false otherwise. + bool Opened { get; } + + /// Return a bitfield indicating the features supported by this archive type. + /// The ArchiveSupportedFeature bitfield. + /// + /// 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. + /// + ArchiveSupportedFeature ArchiveFeatures { get; } + + /// Gets the number of entries (i.e. files) that are contained in this archive. + /// + /// 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! + /// + /// The number of files. + int NumberOfEntries { get; } + + /// Identifies if the specified filter contains data recognizable by this archive instance + /// Filter that contains the archive. This allows use to handle .tar.gz and similars. + bool Identify(IFilter filter); + + /// Opens the specified stream with this archive instance + /// Filter that contains the archive. This allows use to handle .tar.gz and similars. + /// The encoding codepage to use for this archive. + ErrorNumber Open(IFilter filter, Encoding encoding); + + /// Closes the archive. + void Close(); + + /// Gets the file name (and path) of the given entry in the archive. + /// + /// The path components are separated by a forward slash "/".
The path should not start with a leading + /// slash (i.e. it should be relative, not absolute). + ///
+ /// + /// The entry in the archive for which to return the file name. + /// The file name, with (relative) path + /// Error number. + ErrorNumber GetFilename(int entryNumber, out string fileName); + + /// + /// Gets the entry number for a particular file path in the archive. fileName is the relative path of the + /// file in the archive. If the file cannot be found, -1 is returned. + /// + /// + /// 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. + /// + /// The relative path for which to get the entry number. + /// If set, do a case insensitive matching and return the first file that matches. + /// The number of the entry corresponding to the given path, or -1 if the path does not exist. + /// Error number. + ErrorNumber GetEntryNumber(string fileName, bool caseInsensitiveMatch, out int entryNumber); + + /// Gets the (compressed) size of the given entry. + /// The entry for which to get the compressed size. + /// The compressed size of the entry, or 0 if the entry is not a regular file. + /// Error number. + /// The return value is equal to the return value of GetUncompressedSize() if the file is not compressed. + /// + ErrorNumber GetCompressedSize(int entryNumber, out long length); + + /// Gets the uncompressed size of the given entry. + /// The entry for which to get the uncompressed size. + /// The uncompressed size of the entry, or 0 if the entry is not a regular file. + /// Error number. + /// The return value is equal to the return value of GetCompressedSize() if the file is not compressed. + /// + ErrorNumber GetUncompressedSize(int entryNumber, out long length); + + /// Gets the attributes of a file or directory. + /// The entry in the archive for which to retrieve the attributes. + /// File attributes, or zero if the archive does not support attributes. + /// Error number. + /// + ErrorNumber GetAttributes(int entryNumber, out FileAttributes attributes); + + /// Lists all extended attributes, alternate data streams and forks of the given file. + /// The entry in the archive for which to retrieve the list of attributes. + /// List of extended attributes, alternate data streams and forks. + /// Error number. + ErrorNumber ListXAttr(int entryNumber, out List xattrs); + + /// Reads an extended attribute, alternate data stream or fork from the given file. + /// The entry in the archive for which to retrieve the XAttr. + /// Extended attribute, alternate data stream or fork name. + /// Buffer where the extended attribute data will be stored. + /// Error number. + ErrorNumber GetXattr(int entryNumber, string xattr, ref byte[] buffer); + + /// Gets information about an entry in the archive. + /// Note that some of the data might be incomplete or not available at all, depending on the type of archive. + /// The entry int he archive for which to get the information + /// The available information about the entry in the archive + /// Error number. + /// + /// + ErrorNumber Stat(int entryNumber, out FileEntryInfo stat); + + /// + /// Returns the Filter for the given entry. It will return null if the entry in question is not a regular + /// file (i.e. directory, volume label, etc.) + /// + /// The entry for which the Filter should be returned. + /// The Filter for the given entry. + /// Error number. + ErrorNumber GetEntry(int entryNumber, out IFilter filter); + + /// + /// Gets user readable information about the archive. The exact contents depend on the archive plugin implementation. + /// + /// Filter that handles the archive. + /// The encoding codepage to use with the archive. + /// Variable that holds the user readable information. + void GetInformation(IFilter filter, Encoding encoding, out string information); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IBaseImage.cs b/Aaru.CommonTypes/Interfaces/IBaseImage.cs new file mode 100644 index 000000000..046e91c8d --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IBaseImage.cs @@ -0,0 +1,81 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IBaseImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Base interface for all images +public interface IBaseImage +{ + /// Plugin author + string Author { get; } + + /// Gets the Aaru Metadata for the image + AaruMetadata.Metadata AaruMetadata { get; } + + /// List of dump hardware used to create the image from real media + List DumpHardware { get; } + + /// Gets the image format. + /// The image format. + string Format { get; } + + /// Plugin UUID. + Guid Id { get; } + + /// Image information + ImageInfo Info { get; } + + /// Plugin name. + string Name { get; } + + /// Identifies the image. + /// true, if image was identified, false otherwise. + /// Image filter. + bool Identify(IFilter imageFilter); + + /// Opens the image. + /// true, if image was opened, false otherwise. + /// Image filter. + ErrorNumber Open(IFilter imageFilter); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IBaseWritableImage.cs b/Aaru.CommonTypes/Interfaces/IBaseWritableImage.cs new file mode 100644 index 000000000..08c8ada13 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IBaseWritableImage.cs @@ -0,0 +1,98 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IBaseWritableImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Base interface for all writable images +public interface IBaseWritableImage : IBaseImage +{ + /// Contains a description of the last error + string ErrorMessage { get; } + + /// If set to true means the image is opened for writing + bool IsWriting { get; } + + /// Gets a list of known extensions for format auto-choosing + IEnumerable KnownExtensions { get; } + + /// Gets a list of that are supported by the media image format + IEnumerable SupportedMediaTags { get; } + + /// Gets a list of that are supported by the media image format + IEnumerable SupportedMediaTypes { get; } + + /// Retrieves a list of options supported by the filesystem, with name, type and description + IEnumerable<(string name, Type type, string description, object @default)> SupportedOptions { get; } + + /// Gets a list of that are supported by the media image format + IEnumerable SupportedSectorTags { get; } + + /// + /// Creates a new image in the specified path, for the specified , with the specified + /// options to hold a media with the specified number of sectors + /// + /// Path to the new image, with extension + /// that will be written in the image + /// Options to be used when creating new image + /// How many sectors the media has. + /// + /// true if operating completed successfully, false otherwise + bool Create(string path, MediaType mediaType, Dictionary options, ulong sectors, uint sectorSize); + + /// Closes the image and flushes all data to disk + /// Error number + bool Close(); + + /// Sets the Aaru Metadata for the image + bool SetMetadata(AaruMetadata.Metadata metadata); + + /// Sets the list of dump hardware used to create the image from real media + bool SetDumpHardware(List dumpHardware); + + /// Sets image metadata + /// containing image metadata + /// true if operating completed successfully, false otherwise + bool SetImageInfo(ImageInfo imageInfo); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IByteAddressableImage.cs b/Aaru.CommonTypes/Interfaces/IByteAddressableImage.cs new file mode 100644 index 000000000..69df14004 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IByteAddressableImage.cs @@ -0,0 +1,141 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IByteAddressableImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Interface defining linear media (chips, game carts, etc) images +[SuppressMessage("ReSharper", "UnusedParameter.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "OutParameterValueIsAlwaysDiscarded.Global")] +public interface IByteAddressableImage : IBaseWritableImage +{ + /// Gets or sets the current position + long Position { get; set; } + + /// Creates a linear media image + /// Path where to create the media image + /// Media type + /// Image options + /// Maximum size in bytes + /// Error number + ErrorNumber Create(string path, MediaType mediaType, Dictionary options, long maximumSize); + + /// Gets the linear memory mappings, e.g. interleaving, starting address, etc. + /// Format still not decided + /// Error number + ErrorNumber GetMappings(out LinearMemoryMap mappings); + + /// Reads a byte from the image + /// The byte read + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber ReadByte(out byte b, bool advance = true); + + /// Reads a byte from the image at the specified position + /// Position + /// The byte read + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber ReadByteAt(long position, out byte b, bool advance = true); + + /// Reads several bytes from the image + /// Buffer to store the data in + /// Offset in buffer where to place the byte in + /// How many bytes to read from image + /// How many bytes were read + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber ReadBytes(byte[] buffer, int offset, int bytesToRead, out int bytesRead, bool advance = true); + + /// Reads several bytes from the image at the specified position + /// Position + /// Buffer to store the data in + /// Offset in buffer where to place the byte in + /// How many bytes to read from image + /// How many bytes were read + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber ReadBytesAt(long position, byte[] buffer, int offset, int bytesToRead, out int bytesRead, + bool advance = true); + + /// Sets the linear memory mappings, e.g. interleaving, starting address, etc. + /// Format still not decided + /// Error number + ErrorNumber SetMappings(LinearMemoryMap mappings); + + /// Writes a byte to the image + /// The byte to be written + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber WriteByte(byte b, bool advance = true); + + /// Writes a byte to the image at the specified position + /// Position + /// The byte read + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber WriteByteAt(long position, byte b, bool advance = true); + + /// Writes several bytes to the image + /// Buffer to store the data in + /// Offset in buffer where the bytes start in + /// How many bytes to write to image + /// How many bytes were written + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber WriteBytes(byte[] buffer, int offset, int bytesToWrite, out int bytesWritten, bool advance = true); + + /// Writes several bytes to the image at the specified position + /// Position + /// Buffer to store the data in + /// Offset in buffer where the bytes start in + /// How many bytes to write to image + /// How many bytes were written + /// Set to true to advance position, false otherwise. + /// Error number + ErrorNumber WriteBytesAt(long position, byte[] buffer, int offset, int bytesToWrite, out int bytesWritten, + bool advance = true); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IChecksum.cs b/Aaru.CommonTypes/Interfaces/IChecksum.cs new file mode 100644 index 000000000..f0738b58a --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IChecksum.cs @@ -0,0 +1,69 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IChecksum.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Defines the interface to implement a checksum or hashing algorithm +public interface IChecksum +{ + /// Plugin author + string Author { get; } + + /// Plugin name. + string Name { get; } + + /// Plugin UUID. + Guid Id { get; } + + /// Updates the hash with data. + /// Data buffer. + /// Length of buffer to hash. + void Update(byte[] data, uint len); + + /// Updates the hash with data. + /// Data buffer. + void Update(byte[] data); + + /// Returns a byte array of the hash value. + byte[] Final(); + + /// Returns a hexadecimal representation of the hash value. + string End(); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IFilesystem.cs b/Aaru.CommonTypes/Interfaces/IFilesystem.cs new file mode 100644 index 000000000..66336d8a1 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IFilesystem.cs @@ -0,0 +1,71 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IFilesystem.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Interface to implement filesystem plugins. +public interface IFilesystem +{ + /// Plugin name (translatable). + string Name { get; } + + /// Plugin UUID. + Guid Id { get; } + + /// Plugin author + string Author { get; } + + /// Identifies the filesystem in the specified LBA + /// Disk image. + /// Partition. + /// true, if the filesystem is recognized, false otherwise. + bool Identify(IMediaImage imagePlugin, Partition partition); + + /// Gets information about the identified filesystem. + /// Disk image. + /// Partition. + /// Which encoding to use for this filesystem. + /// Filesystem information. + /// Information about the filesystem as expected by Aaru Metadata + void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information, + out FileSystem metadata); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IFilter.cs b/Aaru.CommonTypes/Interfaces/IFilter.cs new file mode 100644 index 000000000..eca29c83f --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IFilter.cs @@ -0,0 +1,154 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IFilter.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// 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) +/// +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +public interface IFilter +{ + /// Descriptive name of the plugin + string Name { get; } + + /// Unique UUID of the plugin + Guid Id { get; } + + /// Plugin author + string Author { get; } + + /// + /// Gets the path used to open this filter.
UNIX: /path/to/archive.zip/path/to/file.bin => + /// /path/to/archive.zip/path/to/file.bin
Windows: C:\path\to\archive.zip\path\to\file.bin => + /// C:\path\to\archive.zip\path\to\file.bin + ///
+ /// Path used to open this filter. + string BasePath { get; } + + /// Gets creation time of file referenced by this filter. + /// The creation time. + DateTime CreationTime { get; } + + /// Gets length of this filter's data fork. + /// The data fork length. + long DataForkLength { get; } + + /// + /// Gets the filename for the file referenced by this filter.
UNIX: /path/to/archive.zip/path/to/file.bin = + /// > file.bin
Windows: C:\path\to\archive.zip\path\to\file.bin => file.bin + ///
+ /// The filename. + string Filename { get; } + + /// Gets last write time of file referenced by this filter. + /// The last write time. + DateTime LastWriteTime { get; } + + /// Gets length of file referenced by ths filter. + /// The length. + long Length { get; } + + /// + /// Gets full path to file referenced by this filter. If it's an archive, it's the path inside the archive.
+ /// UNIX: /path/to/archive.zip/path/to/file.bin => /path/to/file.bin
Windows: + /// C:\path\to\archive.zip\path\to\file.bin => \path\to\file.bin + ///
+ /// The path. + string Path { get; } + + /// + /// 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.
UNIX: /path/to/archive.zip/path/to/file.bin => /path/to/archive.zip
Windows: + /// C:\path\to\archive.zip\path\to\file.bin = > C:\path\to\archive.zip + ///
+ /// The parent folder. + string ParentFolder { get; } + + /// Gets length of this filter's resource fork. + /// The resource fork length. + long ResourceForkLength { get; } + + /// Returns true if the file referenced by this filter has a resource fork + bool HasResourceFork { get; } + + /// Closes all opened streams. + void Close(); + + /// Gets a stream to access the data fork contents. + /// The data fork stream. + Stream GetDataForkStream(); + + /// Gets a stream to access the resource fork contents. + /// The resource fork stream. + Stream GetResourceForkStream(); + + /// Identifies if the specified path contains data recognizable by this filter instance + /// Path. + bool Identify(string path) => File.Exists(path) && Identify(new FileStream(path, FileMode.Open, FileAccess.Read)); + + /// Identifies if the specified stream contains data recognizable by this filter instance + /// Stream. + bool Identify(Stream stream); + + /// Identifies if the specified buffer contains data recognizable by this filter instance + /// Buffer. + bool Identify(byte[] buffer) => Identify(new MemoryStream(buffer)); + + /// Opens the specified path with this filter instance + /// Path. + ErrorNumber Open(string path) => !File.Exists(path) + ? ErrorNumber.NoSuchFile + : Open(new FileStream(path, FileMode.Open, FileAccess.Read)); + + /// Opens the specified stream with this filter instance + /// Stream. + ErrorNumber Open(Stream stream); + + /// Opens the specified buffer with this filter instance + /// Buffer. + ErrorNumber Open(byte[] buffer) => Open(new MemoryStream(buffer)); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IFloppyImage.cs b/Aaru.CommonTypes/Interfaces/IFloppyImage.cs new file mode 100644 index 000000000..38feff59f --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IFloppyImage.cs @@ -0,0 +1,128 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IFloppyImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// +/// 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 . All data returned by these +/// methods is already decoded from its corresponding bitstream. +/// +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public interface IFloppyImage : IMediaImage +{ + /// + /// Floppy info, contains information about physical characteristics of floppy, like size, bitrate, track density, + /// etc... + /// + FloppyInfo FloppyInfo { get; } + + /// Reads a sector's user data. + /// + /// If is one of the duplicates is returned + /// randomly. If is or + /// random data is returned. If is + /// null is returned. Otherwise, whatever is in the sector is + /// returned. + /// + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// Logical sector ID. + /// Status of request. + /// Buffer where the sector data will be stored. + ErrorNumber ReadSector(ushort track, byte head, ushort sector, out FloppySectorStatus status, out byte[] buffer); + + /// Reads a sector's tag. + /// + /// If is one of the duplicates is returned + /// randomly. If is or + /// random data is returned. If is + /// null is returned. Otherwise, whatever tag is in the sector is + /// returned. + /// + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// Logical sector ID. + /// Status of request. + /// Sector tag + /// Buffer where the sector tag data will be stored. + ErrorNumber ReadSectorTag(ushort track, byte head, ushort sector, out FloppySectorStatus status, SectorTagType tag, + out byte[] buffer); + + /// Reads a whole track. It includes all gaps, address marks, sectors data, etc. + /// The track data. + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// Buffer where the track data will be stored. + ErrorNumber ReadTrack(ushort track, byte head, out byte[] buffer); + + /// Reads a sector's data including all tags, address mark, and so, in a format dependent of represented media. + /// + /// If is one of the duplicates is returned + /// randomly. If is or + /// random data is returned. If is + /// null is returned. Otherwise, whatever is in the sector is + /// returned. + /// + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// Logical sector ID. + /// Status of request. + /// Buffer where the sector data will be stored. + ErrorNumber ReadSectorLong(ushort track, byte head, ushort sector, out FloppySectorStatus status, + out byte[] buffer); + + /// Verifies a track. + /// True if correct, false if incorrect, null if uncheckable. + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + bool? VerifyTrack(ushort track, byte head); + + /// Verifies a sector, relative to track. + /// True if correct, false if incorrect, null if uncheckable. + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// Logical sector ID. + bool? VerifySector(ushort track, byte head, ushort sector); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IFluxImage.cs b/Aaru.CommonTypes/Interfaces/IFluxImage.cs new file mode 100644 index 000000000..7a3956590 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IFluxImage.cs @@ -0,0 +1,130 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IFluxImage.cs +// Author(s) : Rebecca Wallander +// +// 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; + +/// +/// Abstract class to implement flux reading plugins. +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +public interface IFluxImage : IBaseImage +{ + /// + /// 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. + /// + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// The number of captures + ErrorNumber CapturesLength(uint head, ushort track, byte subTrack, out uint length); + + /// Reads the resolution (sample rate) of a index signal capture in picoseconds. + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// The resolution of the index capture in picoseconds + ErrorNumber ReadFluxIndexResolution(uint head, ushort track, byte subTrack, uint captureIndex, + out ulong resolution); + + /// Reads the resolution (sample rate) of a data signal capture in picoseconds. + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// The resolution of the data capture in picoseconds + ErrorNumber ReadFluxDataResolution(uint head, ushort track, byte subTrack, uint captureIndex, out ulong resolution); + + /// Reads the resolution (sample rate) of a flux capture in picoseconds. + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// The resolution of the index capture in picoseconds + /// The resolution of the data capture in picoseconds + ErrorNumber ReadFluxResolution(uint head, ushort track, byte subTrack, uint captureIndex, out ulong indexResolution, + out ulong dataResolution); + + /// Reads the entire flux capture with index and data streams, as well as its resolution. + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// The resolution (sample rate) of the index capture in picoseconds + /// The resolution (sample rate) of the data capture in picoseconds + /// Buffer to store the index stream in + /// Buffer to store the data stream in + ErrorNumber ReadFluxCapture(uint head, ushort track, byte subTrack, uint captureIndex, out ulong indexResolution, + out ulong dataResolution, out byte[] indexBuffer, out byte[] dataBuffer); + + /// Reads a capture's index stream. + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// Buffer to store the data in + ErrorNumber ReadFluxIndexCapture(uint head, ushort track, byte subTrack, uint captureIndex, out byte[] buffer); + + /// Reads a capture's data stream. + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + /// Buffer to store the data in + ErrorNumber ReadFluxDataCapture(uint head, ushort track, byte subTrack, uint captureIndex, out byte[] buffer); + + /// + /// An image may have tracks split into sub-steps. This returns the highest sub-step index for the track. + /// + /// Error number + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// The number of captures + ErrorNumber SubTrackLength(uint head, ushort track, out byte length); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IMediaGraph.cs b/Aaru.CommonTypes/Interfaces/IMediaGraph.cs new file mode 100644 index 000000000..bfd131da3 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IMediaGraph.cs @@ -0,0 +1,133 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IMediaGraph.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Defines the interface to draw the dump or verification status of a media in a picture. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +public interface IMediaGraph +{ + /// Paints the specified sector in green + /// Sector + public void PaintSectorGood(ulong sector); + + /// Paints the specified sector in red + /// Sector + public void PaintSectorBad(ulong sector); + + /// Paints the specified sector in yellow + /// Sector + public void PaintSectorUnknown(ulong sector); + + /// Paints the specified sector in gray + /// Sector + public void PaintSectorUndumped(ulong sector); + + /// Paints a sector with the specified color + /// Sector + /// Red from 0 to 255 + /// Green from 0 to 255 + /// Blue from 0 to 255 + /// Opacity from 0 to 255 + public void PaintSector(ulong sector, byte red, byte green, byte blue, byte opacity = 0xFF); + + /// Paints sectors, staring at in gray + /// First sector to paint + /// How many sectors to paint + public void PaintSectorsUndumped(ulong startingSector, uint length); + + /// Paints sectors, staring at in green + /// First sector to paint + /// How many sectors to paint + public void PaintSectorsGood(ulong startingSector, uint length); + + /// Paints sectors, staring at in red + /// First sector to paint + /// How many sectors to paint + public void PaintSectorsBad(ulong startingSector, uint length); + + /// Paints sectors, staring at in yellow + /// First sector to paint + /// How many sectors to paint + public void PaintSectorsUnknown(ulong startingSector, uint length); + + /// Paints sectors, staring at in the specified color + /// First sector to paint + /// How many sectors to paint + /// Red from 0 to 255 + /// Green from 0 to 255 + /// Blue from 0 to 255 + /// Opacity from 0 to 255 + public void PaintSectors(ulong startingSector, uint length, byte red, byte green, byte blue, byte opacity = 0xFF); + + /// Paints the specified sectors in gray + /// List of sectors to paint + public void PaintSectorsUndumped(IEnumerable sectors); + + /// Paints the specified sectors in green + /// List of sectors to paint + public void PaintSectorsGood(IEnumerable sectors); + + /// Paints the specified sectors in red + /// List of sectors to paint + public void PaintSectorsBad(IEnumerable sectors); + + /// Paints the specified sectors in yellow + /// List of sectors to paint + public void PaintSectorsUnknown(IEnumerable sectors); + + /// Paints the specified sectors in the specified color + /// List of sectors to paint + /// Red from 0 to 255 + /// Green from 0 to 255 + /// Blue from 0 to 255 + /// Opacity from 0 to 255 + public void PaintSectorsUnknown(IEnumerable sectors, byte red, byte green, byte blue, byte opacity = 0xFF); + + /// Paints the information specific to recordable discs in green + public void PaintRecordableInformationGood(); + + /// Writes the graph bitmap as a PNG into the specified stream + /// Stream that will receive the spiral bitmap + public void WriteTo(Stream stream); + + /// Writes the graph bitmap as a PNG into the specified stream + /// Path to the file to save the PNG to + public void WriteTo(string path); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IMediaImage.cs b/Aaru.CommonTypes/Interfaces/IMediaImage.cs new file mode 100644 index 000000000..759987f54 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IMediaImage.cs @@ -0,0 +1,94 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IMediaImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Abstract class to implement disk image reading plugins. +public interface IMediaImage : IBaseImage +{ + /// Reads a disk tag. + /// + /// Tag type to read. + /// Disk tag + ErrorNumber ReadMediaTag(MediaTagType tag, out byte[] buffer); + + /// Reads a sector's user data. + /// The sector's user data. + /// Sector address (LBA). + /// + ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer); + + /// Reads a complete sector (user data + all tags). + /// The complete sector. Format depends on disk type. + /// Sector address (LBA). + /// + ErrorNumber ReadSectorLong(ulong sectorAddress, out byte[] buffer); + + /// Reads user data from several sectors. + /// The sectors user data. + /// Starting sector address (LBA). + /// How many sectors to read. + /// + ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer); + + /// Reads several complete sector (user data + all tags). + /// The complete sectors. Format depends on disk type. + /// Starting sector address (LBA). + /// How many sectors to read. + /// + ErrorNumber ReadSectorsLong(ulong sectorAddress, uint length, out byte[] buffer); + + /// Reads tag from several sectors. + /// The sectors tag. + /// Starting sector address (LBA). + /// How many sectors to read. + /// Tag type. + /// + ErrorNumber ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag, out byte[] buffer); + + /// Reads a sector's tag. + /// The sector's tag. + /// Sector address (LBA). + /// Tag type. + /// + ErrorNumber ReadSectorTag(ulong sectorAddress, SectorTagType tag, out byte[] buffer); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IOpticalMediaImage.cs b/Aaru.CommonTypes/Interfaces/IOpticalMediaImage.cs new file mode 100644 index 000000000..f4db0feec --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IOpticalMediaImage.cs @@ -0,0 +1,127 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IOpticalMediaImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Abstract class to implement disk image reading plugins. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +public interface IOpticalMediaImage : IMediaImage, IPartitionableMediaImage, IVerifiableSectorsImage +{ + /// Gets the disc track extents (start, length). + /// The track extents. + List Tracks { get; } + + /// Gets the sessions (optical discs only). + /// The sessions. + List Sessions { get; } + + /// Reads a sector's user data, relative to track. + /// The sector's user data. + /// Sector address (relative LBA). + /// Track. + /// + ErrorNumber ReadSector(ulong sectorAddress, uint track, out byte[] buffer); + + /// Reads a sector's tag, relative to track. + /// The sector's tag. + /// Sector address (relative LBA). + /// Track. + /// Tag type. + /// + ErrorNumber ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag, out byte[] buffer); + + /// Reads user data from several sectors, relative to track. + /// The sectors user data. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + /// + ErrorNumber ReadSectors(ulong sectorAddress, uint length, uint track, out byte[] buffer); + + /// Reads tag from several sectors, relative to track. + /// The sectors tag. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + /// Tag type. + /// + ErrorNumber ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag, out byte[] buffer); + + /// Reads a complete sector (user data + all tags), relative to track. + /// The complete sector. Format depends on disk type. + /// Sector address (relative LBA). + /// Track. + /// + ErrorNumber ReadSectorLong(ulong sectorAddress, uint track, out byte[] buffer); + + /// Reads several complete sector (user data + all tags), relative to track. + /// The complete sectors. Format depends on disk type. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + /// + ErrorNumber ReadSectorsLong(ulong sectorAddress, uint length, uint track, out byte[] buffer); + + /// Gets the disc track extents for a specified session. + /// The track extents for that session. + /// Session. + List GetSessionTracks(Session session); + + /// Gets the disc track extents for a specified session. + /// The track extents for that session. + /// Session. + List GetSessionTracks(ushort session); + + /// Verifies several sectors, relative to track. + /// True if all are correct, false if any is incorrect, null if any is uncheckable. + /// Starting sector address (relative LBA). + /// How many sectors to read. + /// Track. + /// List of incorrect sectors + /// List of uncheckable sectors + bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List failingLbas, + out List unknownLbas); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IPartition.cs b/Aaru.CommonTypes/Interfaces/IPartition.cs new file mode 100644 index 000000000..f52a2ec01 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IPartition.cs @@ -0,0 +1,63 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IPartition.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Abstract class to implement partitioning schemes interpreting plugins. +public interface IPartition +{ + /// Plugin name. + string Name { get; } + + /// Plugin UUID. + Guid Id { get; } + + /// Plugin author + string Author { get; } + + /// Interprets a partitioning scheme. + /// true, if partitioning scheme is recognized, false otherwise. + /// Disk image. + /// Returns list of partitions. + /// At which sector to start searching for the partition scheme. + bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IPartitionableMediaImage.cs b/Aaru.CommonTypes/Interfaces/IPartitionableMediaImage.cs new file mode 100644 index 000000000..8df0db3ba --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IPartitionableMediaImage.cs @@ -0,0 +1,53 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IPartitionableMediaImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Defines an image that can contain partitions +public interface IPartitionableMediaImage +{ + /// + /// 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. + /// + /// The partitions. + List Partitions { get; } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IPluginRegister.cs b/Aaru.CommonTypes/Interfaces/IPluginRegister.cs new file mode 100644 index 000000000..f3ddf8fa4 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IPluginRegister.cs @@ -0,0 +1,113 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IPluginsRegister.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Defines a register of all known plugins +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public interface IPluginRegister +{ + /// + /// Registers all checksum plugins in the provided service collection + /// + /// Service collection + void RegisterChecksumPlugins(IServiceCollection services); + + /// + /// Registers all filesystem plugins in the provided service collection + /// + /// Service collection + void RegisterFilesystemPlugins(IServiceCollection services); + + /// + /// Registers all filter plugins in the provided service collection + /// + /// Service collection + void RegisterFilterPlugins(IServiceCollection services); + + /// + /// Registers all floppy image plugins in the provided service collection + /// + /// Service collection + void RegisterFloppyImagePlugins(IServiceCollection services); + + /// + /// Registers all media image plugins in the provided service collection + /// + /// Service collection + void RegisterMediaImagePlugins(IServiceCollection services); + + /// + /// Registers all partition plugins in the provided service collection + /// + /// Service collection + void RegisterPartitionPlugins(IServiceCollection services); + + /// + /// Registers all read-only filesystem plugins in the provided service collection + /// + /// Service collection + void RegisterReadOnlyFilesystemPlugins(IServiceCollection services); + + /// + /// Registers all writable floppy image plugins in the provided service collection + /// + /// Service collection + void RegisterWritableFloppyImagePlugins(IServiceCollection services); + + /// + /// Registers all writable media image plugins in the provided service collection + /// + /// Service collection + void RegisterWritableImagePlugins(IServiceCollection services); + + /// + /// Registers all archive plugins in the provided service collection + /// + /// Service collection + void RegisterArchivePlugins(IServiceCollection services); + + /// + /// Registers all byte addressable media image plugins in the provided service collection + /// + /// Service collection + void RegisterByteAddressablePlugins(IServiceCollection services); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IReadOnlyFilesystem.cs b/Aaru.CommonTypes/Interfaces/IReadOnlyFilesystem.cs new file mode 100644 index 000000000..8dea58691 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IReadOnlyFilesystem.cs @@ -0,0 +1,205 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IReadOnlyFilesystem.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Defines the interface to implement reading the contents of a filesystem +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +public interface IReadOnlyFilesystem : IFilesystem +{ + /// Information about the filesystem as expected by Aaru Metadata + FileSystem Metadata { get; } + + /// Retrieves a list of options supported by the filesystem, with name, type and description + IEnumerable<(string name, Type type, string description)> SupportedOptions { get; } + + /// Supported namespaces + Dictionary Namespaces { get; } + + /// + /// Initializes whatever internal structures the filesystem plugin needs to be able to read files and directories + /// from the filesystem. + /// + /// + /// + /// Which encoding to use for this filesystem. + /// Dictionary of key=value pairs containing options to pass to the filesystem + /// Filename namespace + ErrorNumber Mount(IMediaImage imagePlugin, Partition partition, Encoding encoding, + Dictionary options, string @namespace); + + /// Frees all internal structures created by + ErrorNumber Unmount(); + + /// Gets the attributes of a file or directory + /// Error number. + /// File path. + /// File attributes. + ErrorNumber GetAttributes(string path, out FileAttributes attributes); + + /// Lists all extended attributes, alternate data streams and forks of the given file. + /// Error number. + /// Path. + /// List of extended attributes, alternate data streams and forks. + ErrorNumber ListXAttr(string path, out List xattrs); + + /// Reads an extended attribute, alternate data stream or fork from the given file. + /// Error number. + /// File path. + /// Extended attribute, alternate data stream or fork name. + /// Buffer. + ErrorNumber GetXattr(string path, string xattr, ref byte[] buf); + + /// Gets information about the mounted volume. + /// Information about the mounted volume. + ErrorNumber StatFs(out FileSystemInfo stat); + + /// Gets information about a file or directory. + /// File path. + /// File information. + ErrorNumber Stat(string path, out FileEntryInfo stat); + + /// Solves a symbolic link. + /// Link path. + /// Link destination. + ErrorNumber ReadLink(string path, out string dest); + + /// Opens a file for reading. + /// Path to the file. + /// Represents the opened file and is needed for other file-related operations. + /// Error number + ErrorNumber OpenFile(string path, out IFileNode node); + + /// Closes a file, freeing any private data allocated on opening. + /// The file node. + /// Error number. + ErrorNumber CloseFile(IFileNode node); + + /// Move the file node position pointer to the specified position with the specified origin + /// The file node. + /// Desired position. + /// From where in the file to move the position pointer to. + /// Error number. + 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; + } + + /// Reads data from a file (main/only data stream or data fork). + /// File node. + /// Bytes to read. + /// Buffer. Must exist and be of size equal or bigger than + /// How many bytes were read into the buffer + ErrorNumber ReadFile(IFileNode node, long length, byte[] buffer, out long read); + + /// Opens a directory for listing. + /// Path to the directory. + /// Represents the opened directory and is needed for other directory-related operations. + /// Error number + ErrorNumber OpenDir(string path, out IDirNode node); + + /// Closes a directory, freeing any private data allocated on opening. + /// The directory node. + /// Error number. + ErrorNumber CloseDir(IDirNode node); + + /// Reads the next entry in the directory. + /// Represent an opened directory. + /// + /// The next entry name. + /// null + /// if there are no more entries. + /// + /// Error number. + ErrorNumber ReadDir(IDirNode node, out string filename); +} + +/// Represents an opened file from a filesystem +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +public interface IFileNode +{ + /// Path to the file + string Path { get; } + + /// File length + long Length { get; } + + /// Current position in file + long Offset { get; set; } +} + +/// Represents an opened directory from a filesystem +[SuppressMessage("ReSharper", "UnusedMemberInSuper.Global")] +public interface IDirNode +{ + /// Path to the directory + string Path { get; } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/ITapeImage.cs b/Aaru.CommonTypes/Interfaces/ITapeImage.cs new file mode 100644 index 000000000..8fe17b14c --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/ITapeImage.cs @@ -0,0 +1,57 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : ITapeImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Defines an image that can store the information from streaming, digital, tapes +public interface ITapeImage : IMediaImage +{ + /// Gets a list of all the files registered in the image + List Files { get; } + + /// Gets a list of all the partitions registered in the image + List TapePartitions { get; } + + /// If the media is a really a tape, as some formats can store non-tapes + bool IsTape { get; } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IVerifiableImage.cs b/Aaru.CommonTypes/Interfaces/IVerifiableImage.cs new file mode 100644 index 000000000..295476b9f --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IVerifiableImage.cs @@ -0,0 +1,48 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IVerifiableImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Defines an image that can verify the integrity of the image itself, but not its contents +public interface IVerifiableImage +{ + /// Verifies media image internal checksum. + /// True if correct, false if incorrect, null if there is no internal checksum available + bool? VerifyMediaImage(); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IVerifiableSectorsImage.cs b/Aaru.CommonTypes/Interfaces/IVerifiableSectorsImage.cs new file mode 100644 index 000000000..0805e3922 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IVerifiableSectorsImage.cs @@ -0,0 +1,62 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IVerifiableSectorsImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Defines an image that can verify the integrity of the sectors it contains +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +public interface IVerifiableSectorsImage +{ + /// Verifies a sector. + /// True if correct, false if incorrect, null if uncheckable. + /// Sector address (LBA). + bool? VerifySector(ulong sectorAddress); + + /// Verifies several sectors. + /// True if all are correct, false if any is incorrect, null if any is uncheckable. + /// Starting sector address (LBA). + /// How many sectors to read. + /// List of incorrect sectors + /// List of uncheckable sectors + bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, out List unknownLbas); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IWritableFloppyImage.cs b/Aaru.CommonTypes/Interfaces/IWritableFloppyImage.cs new file mode 100644 index 000000000..952eacaa5 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IWritableFloppyImage.cs @@ -0,0 +1,98 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IFloppyImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// +/// 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 . All data expected by these methods +/// is already decoded from its corresponding bitstream. +/// +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public interface IWritableFloppyImage : IFloppyImage, IWritableImage +{ + /// + /// 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. + /// + /// + /// Floppy info, contains information about physical characteristics of floppy, like size, bitrate, + /// track density, etc... + /// + /// true if operating completed successfully, false otherwise + bool SetFloppyCharacteristics(FloppyInfo info); + + /// Writes a sector's user data. + /// + /// If is one of the duplicates. If + /// is , , + /// it will be ignored. Otherwise, whatever data should be in the sector. + /// + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// Logical sector ID. + /// Status of sector. + /// true if operating completed successfully, false otherwise + bool WriteSector(byte[] data, ushort track, byte head, ushort sector, FloppySectorStatus status); + + /// Writes a whole track, including all gaps, address marks, sectors data, etc. + /// The track data. + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// true if operating completed successfully, false otherwise + bool WriteTrack(byte[] data, ushort track, byte head); + + /// Writes a sector's data including all tags, address mark, and so, in a format dependent of represented media. + /// + /// If is one of the duplicates. If + /// is , , + /// it will be ignored. Otherwise, whatever data should be in the sector. + /// + /// Physical track (position of the heads over the floppy media, 0-based). + /// Physical head (0-based). + /// Logical sector ID. + /// Status of request. + /// true if operating completed successfully, false otherwise + bool WriteSectorLong(byte[] data, ushort track, byte head, ushort sector, out FloppySectorStatus status); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IWritableFluxImage.cs b/Aaru.CommonTypes/Interfaces/IWritableFluxImage.cs new file mode 100644 index 000000000..61c506023 --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IWritableFluxImage.cs @@ -0,0 +1,85 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IWritableFluxImage.cs +// Author(s) : Rebecca Wallander +// +// 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; + +/// +/// Abstract class to implement flux writing plugins. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +[SuppressMessage("ReSharper", "UnusedParameter.Global")] +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +public interface IWritableFluxImage : IFluxImage, IWritableImage +{ + /// Writes a flux capture. + /// Error number + /// The index capture's resolution (sample rate) in picoseconds + /// The capture's resolution (sample rate) in picoseconds + /// Flux representation of the index signal + /// Flux representation of the data signal + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture slot to write to. See also + ErrorNumber WriteFluxCapture(ulong indexResolution, ulong dataResolution, byte[] indexBuffer, byte[] dataBuffer, + uint head, ushort track, byte subTrack, uint captureIndex); + + /// Writes a capture's index stream. + /// Error number + /// The capture's resolution (sample rate) in picoseconds + /// Flux representation of the index signal + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + ErrorNumber WriteFluxIndexCapture(ulong resolution, byte[] index, uint head, ushort track, byte subTrack, + uint captureIndex); + + /// Writes a capture's data stream. + /// Error number + /// The capture's resolution (sample rate) in picoseconds + /// Flux representation of the data signal + /// Physical head (0-based) + /// Physical track (position of the heads over the floppy media, 0-based) + /// Physical sub-step of track (e.g. half-track) + /// Which capture to read. See also + ErrorNumber WriteFluxDataCapture(ulong resolution, byte[] data, uint head, ushort track, byte subTrack, + uint captureIndex); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IWritableImage.cs b/Aaru.CommonTypes/Interfaces/IWritableImage.cs new file mode 100644 index 000000000..168e112ef --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IWritableImage.cs @@ -0,0 +1,105 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IWritableImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// +/// Abstract class to implement disk image writing plugins. TODO: This interface is subject to change until +/// notice. +/// +public interface IWritableImage : IMediaImage, IBaseWritableImage +{ + /// Sets media geometry + /// Cylinders + /// Heads + /// Sectors per track + /// true if operating completed successfully, false otherwise + bool SetGeometry(uint cylinders, uint heads, uint sectorsPerTrack); + + /// Writes a media tag to the image + /// Media tag + /// + /// + /// + /// true if operating completed successfully, false otherwise + bool WriteMediaTag(byte[] data, MediaTagType tag); + + /// Writes a sector to the image + /// Sector data + /// Sector address + /// true if operating completed successfully, false otherwise + bool WriteSector(byte[] data, ulong sectorAddress); + + /// Writes a sector to the image with main channel tags attached + /// Sector data with its main channel tags attached + /// Sector address + /// true if operating completed successfully, false otherwise + bool WriteSectorLong(byte[] data, ulong sectorAddress); + + /// Writes several sectors to the image + /// Sectors data + /// Sector starting address + /// How many sectors to write + /// true if operating completed successfully, false otherwise + bool WriteSectors(byte[] data, ulong sectorAddress, uint length); + + /// Writes several sectors to the image + /// Sector data with their main channel tags attached + /// Sector starting address + /// How many sectors to write + /// true if operating completed successfully, false otherwise + bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length); + + /// Writes parallel or subchannel sector tag for several sector + /// Tag data to write + /// Starting sector address + /// How many sectors to write + /// Tag type + /// true if operating completed successfully, false otherwise + bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag); + + /// Writes parallel or subchannel sector tag for one sector + /// Tag data to write + /// Sector address + /// Tag type + /// true if operating completed successfully, false otherwise + bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IWritableOpticalImage.cs b/Aaru.CommonTypes/Interfaces/IWritableOpticalImage.cs new file mode 100644 index 000000000..f4242e0ce --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IWritableOpticalImage.cs @@ -0,0 +1,56 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IWritableOpticalImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Defines an image that is writable and can store an optical disc (CD, DVD, etc) +public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage +{ + /// Image format capabilities + OpticalImageCapabilities OpticalCapabilities { get; } + + /// Sets tracks for optical media + /// List of tracks + /// true if operating completed successfully, false otherwise + bool SetTracks(List tracks); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interfaces/IWritableTapeImage.cs b/Aaru.CommonTypes/Interfaces/IWritableTapeImage.cs new file mode 100644 index 000000000..f8ae43aaf --- /dev/null +++ b/Aaru.CommonTypes/Interfaces/IWritableTapeImage.cs @@ -0,0 +1,66 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IWritableTapeImage.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Defines an image that is writable and can store information about a streaming, digital, tape +[SuppressMessage("ReSharper", "UnusedMethodReturnValue.Global")] +public interface IWritableTapeImage : ITapeImage, IWritableImage +{ + /// Registers a new file in the image + /// Tape file descriptor + /// true if successful, false otherwise + bool AddFile(TapeFile file); + + /// Registers a new partition + /// Tape partition descriptor + /// true if successful, false otherwise + bool AddPartition(TapePartition partition); + + /// + /// Tells the image plugin to set the internal structures to expect a tape (e.g. unknown block count and size). + /// Must be called before + /// + /// true if successful, false otherwise + bool SetTape(); +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interop/DetectOS.cs b/Aaru.CommonTypes/Interop/DetectOS.cs new file mode 100644 index 000000000..197a65650 --- /dev/null +++ b/Aaru.CommonTypes/Interop/DetectOS.cs @@ -0,0 +1,449 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : DetectOS.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Detects the underlying execution framework and operating system +public static class DetectOS +{ + /// Are we running under Mono? + public static readonly bool IsMono = + RuntimeInformation.FrameworkDescription.StartsWith("Mono", StringComparison.Ordinal); + /// Are we running under .NET Core? + public static readonly bool IsNetCore = + RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal); + + /// Checks if the underlying runtime runs in 64-bit mode + public static readonly bool Is64Bit = IntPtr.Size == 8; + + /// Are we running under Windows? + public static bool IsWindows => GetRealPlatformID() == PlatformID.Win32NT || + GetRealPlatformID() == PlatformID.Win32S || + GetRealPlatformID() == PlatformID.Win32Windows || + GetRealPlatformID() == PlatformID.WinCE || + GetRealPlatformID() == PlatformID.WindowsPhone || + GetRealPlatformID() == PlatformID.Xbox; + + /// Are we running with administrative (root) privileges? + 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); + + /// Gets the real platform ID, not the incomplete .NET framework one + /// Platform ID + /// Unhandled 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; + } + } + } + + /// Gets a string for the current operating system REAL version (handles Darwin 1.4 and Windows 10 falsifying) + /// Current operating system version + 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; + } + } + + /// From a platform ID and version returns a human-readable version + /// Platform ID + /// Version number + /// Operating system name + 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 + + /// POSIX uname structure, size from OSX, big enough to handle extra fields + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + struct UtsName + { + /// System name + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public readonly string sysname; + /// Node name + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public readonly string nodename; + /// Release level + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public readonly string release; + /// Version level + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public readonly string version; + /// Hardware level + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public readonly string machine; + } + +#endregion +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interop/PlatformID.cs b/Aaru.CommonTypes/Interop/PlatformID.cs new file mode 100644 index 000000000..493e3f075 --- /dev/null +++ b/Aaru.CommonTypes/Interop/PlatformID.cs @@ -0,0 +1,121 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : PlatformID.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Contains an arbitrary list of OSes, even if .NET does not run on them +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum PlatformID +{ + /// Win32s + Win32S = 0, + /// Win32 (Windows 9x) + Win32Windows = 1, + /// Windows NT + Win32NT = 2, + /// Windows Mobile + WinCE = 3, + /// UNIX (do not use, too generic) + Unix = 4, + /// Xbox 360 + Xbox = 5, + /// OS X + MacOSX = 6, + /// iOS is not OS X + iOS = 7, + /// Linux + Linux = 8, + /// Sun Solaris + Solaris = 9, + /// NetBSD + NetBSD = 10, + /// OpenBSD + OpenBSD = 11, + /// FreeBSD + FreeBSD = 12, + /// DragonFly BSD + DragonFly = 13, + /// Nintendo Wii + Wii = 14, + /// Nintendo Wii U + WiiU = 15, + /// Sony PlayStation 3 + PlayStation3 = 16, + /// Sony Playstation 4 + PlayStation4 = 17, + /// Google Android + Android = 18, + /// Samsung Tizen + Tizen = 19, + /// Windows Phone + WindowsPhone = 20, + /// GNU/Hurd + Hurd = 21, + /// Haiku + Haiku = 22, + /// HP-UX + HPUX = 23, + /// AIX + AIX = 24, + /// OS/400 + OS400 = 25, + /// IRIX + IRIX = 26, + /// Minix + Minix = 27, + /// NonStop + NonStop = 28, + /// QNX + QNX = 29, + /// SINIX + SINIX = 30, + /// Tru64 UNIX + Tru64 = 31, + /// Ultrix + Ultrix = 32, + /// SCO OpenServer / SCO UNIX + OpenServer = 33, + /// SCO UnixWare + UnixWare = 34, + /// IBM z/OS + zOS = 35, + /// Unknown + Unknown = -1 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Interop/Version.cs b/Aaru.CommonTypes/Interop/Version.cs new file mode 100644 index 000000000..1c6e9e4ba --- /dev/null +++ b/Aaru.CommonTypes/Interop/Version.cs @@ -0,0 +1,89 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Version.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Gets our own, or the runtime's version +public static class Version +{ + /// Gets version string + /// Version + public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString(); + + /// Gets .NET Core version + /// Version + 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; + } + + /// Gets Mono version + /// Version + 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; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Localization/Localization.Designer.cs b/Aaru.CommonTypes/Localization/Localization.Designer.cs new file mode 100644 index 000000000..f275e3257 --- /dev/null +++ b/Aaru.CommonTypes/Localization/Localization.Designer.cs @@ -0,0 +1,1886 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Aaru.CommonTypes { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Localization { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Localization() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Aaru.CommonTypes.Localization.Localization", typeof(Localization).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 1961069 blocks of 512 bytes, setting media type to SparQ.. + /// + internal static string Drive_manufacturer_is_SyQuest_media_has_1961069_blocks_of_512_bytes_setting_media_type_to_SparQ { + get { + return ResourceManager.GetString("Drive_manufacturer_is_SyQuest_media_has_1961069_blocks_of_512_bytes_setting_media" + + "_type_to_SparQ", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exception {0}. + /// + internal static string Exception_0 { + get { + return ResourceManager.GetString("Exception_0", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to IDENTIFY response is different than 512 bytes, not decoding.. + /// + internal static string IDENTIFY_response_is_different_than_512_bytes_not_decoding { + get { + return ResourceManager.GetString("IDENTIFY_response_is_different_than_512_bytes_not_decoding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to INQUIRY response is {0} bytes, less than minimum of 36 bytes, decoded data can be incorrect, not decoding.. + /// + internal static string INQUIRY_response_is_0_bytes_less_than_minimum_of_36_bytes { + get { + return ResourceManager.GetString("INQUIRY_response_is_0_bytes_less_than_minimum_of_36_bytes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, not decoding.. + /// + internal static string INQUIRY_response_length_0_bytes_is_different_than_specified_in_length_field { + get { + return ResourceManager.GetString("INQUIRY_response_length_0_bytes_is_different_than_specified_in_length_field", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 5¼" double density floppy.. + /// + internal static string SCSI_Media_Type_Description_Acorn_MD1DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Acorn_MD1DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Acorn_MD1DD_80 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Acorn_MD1DD_80", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 5¼" single density floppy.. + /// + internal static string SCSI_Media_Type_Description_Acorn_MD1SD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Acorn_MD1SD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 3½" double density floppy.. + /// + internal static string SCSI_Media_Type_Description_Acorn_MF2DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Acorn_MF2DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 3½" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_Acorn_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Acorn_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Amiga formatted 3½" double density floppy.. + /// + internal static string SCSI_Media_Type_Description_Amiga_MF2DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Amiga_MF2DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Amiga formatted 3½" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_Amiga_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Amiga_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Apple_DOS32 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Apple_DOS32", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Apple_DOS32_DS { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Apple_DOS32_DS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Apple_DOS33 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Apple_DOS33", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Apple_DOS33_DS { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Apple_DOS33_DS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Apple_MF1DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Apple_MF1DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apricot formatted 3½" floppy.. + /// + internal static string SCSI_Media_Type_Description_Apricot_MF2DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Apricot_MF2DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Atari formatted 5¼" double density floppy.. + /// + internal static string SCSI_Media_Type_Description_Atari_MD1DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Atari_MD1DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Atari formatted 5¼" single density floppy.. + /// + internal static string SCSI_Media_Type_Description_Atari_MD1SD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Atari_MD1SD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, media has {0} blocks of 256 bytes, setting media type to 10Mb Bernoulli Box.. + /// + internal static string SCSI_Media_Type_Description_Bernoulli10 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Bernoulli10", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, media has 294918 blocks of 512 bytes, setting media type to 150Mb Bernoulli Box II.. + /// + internal static string SCSI_Media_Type_Description_Bernoulli2_150 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Bernoulli2_150", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, media has 87040 blocks of 512 bytes, setting media type to 44Mb Bernoulli Box II.. + /// + internal static string SCSI_Media_Type_Description_Bernoulli2_44 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Bernoulli2_44", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, media has 175856 blocks of 512 bytes, setting media type to 90Mb Bernoulli Box II.. + /// + internal static string SCSI_Media_Type_Description_Bernoulli2_90 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Bernoulli2_90", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to CompactTape.. + /// + internal static string SCSI_Media_Type_Description_CompactTape { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_CompactTape", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to CompactTape II.. + /// + internal static string SCSI_Media_Type_Description_CompactTapeII { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_CompactTapeII", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DAT72.. + /// + internal static string SCSI_Media_Type_Description_DAT72_dat { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DAT72_dat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS.. + /// + internal static string SCSI_Media_Type_Description_DDS { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DDS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-2.. + /// + internal static string SCSI_Media_Type_Description_DDS2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DDS2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-2.. + /// + internal static string SCSI_Media_Type_Description_DDS2_dat { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DDS2_dat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-3.. + /// + internal static string SCSI_Media_Type_Description_DDS3 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DDS3", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-3.. + /// + internal static string SCSI_Media_Type_Description_DDS3_dat { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DDS3_dat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-4.. + /// + internal static string SCSI_Media_Type_Description_DDS4 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DDS4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-4.. + /// + internal static string SCSI_Media_Type_Description_DDS4_alt { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DDS4_alt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to DEC RX02 floppy.. + /// + internal static string SCSI_Media_Type_Description_DEC_RX02 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DEC_RX02", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape III.. + /// + internal static string SCSI_Media_Type_Description_DLTtapeIII { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DLTtapeIII", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape IIIxt.. + /// + internal static string SCSI_Media_Type_Description_DLTtapeIIIxt { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DLTtapeIIIxt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape IV.. + /// + internal static string SCSI_Media_Type_Description_DLTtapeIV { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DLTtapeIV", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_DMF_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_DMF_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA154 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA154", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA183 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA183", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA184 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA184", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA195 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA195", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA201 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA201", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA201_embossed { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA201_embossed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-223 conforming 3½" magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_ECMA223 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA223", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA238 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA238", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA239 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA239", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA260 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA260", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA280 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA280", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA317 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA317", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA322 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA322", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-54 formatted 8" floppy.. + /// + internal static string SCSI_Media_Type_Description_ECMA54 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA54", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_ECMA56 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA56", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-59 formatted 8" floppy.. + /// + internal static string SCSI_Media_Type_Description_ECMA59 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA59", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-66 formatted 5¼" floppy.. + /// + internal static string SCSI_Media_Type_Description_ECMA66 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA66", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-69 formatted 8" floppy.. + /// + internal static string SCSI_Media_Type_Description_ECMA69 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA69", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-70 formatted 5¼" floppy.. + /// + internal static string SCSI_Media_Type_Description_ECMA70 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA70", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-78 formatted 5¼" floppy.. + /// + internal static string SCSI_Media_Type_Description_ECMA78 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA78", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-99 formatted 5¼" floppy.. + /// + internal static string SCSI_Media_Type_Description_ECMA99 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ECMA99", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 106m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_106m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_106m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 112m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_112m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_112m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 125m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_125m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_125m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 150m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_150m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_150m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 15m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_15m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_15m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Exatape_160m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_160m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 170m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_170m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_170m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 225m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_225m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_225m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 22m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_22m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_22m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_Exatape_22m_AME { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_22m_AME", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 28m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_28m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_28m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 40m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_40m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_40m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 45m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_45m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_45m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 54m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_54m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_54m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 75m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_75m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_75m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 76m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_76m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_76m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 80m Exatape.. + /// + internal static string SCSI_Media_Type_Description_Exatape_80m { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Exatape_80m", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 262144 blocks of 512 bytes, setting media type to EZ135.. + /// + internal static string SCSI_Media_Type_Description_EZ135 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_EZ135", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 450560 blocks of 512 bytes, setting media type to EZ230.. + /// + internal static string SCSI_Media_Type_Description_EZ230 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_EZ230", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive model is LS (SuperDisk), media has 65536 blocks of 512 bytes, setting media type to FD32MB.. + /// + internal static string SCSI_Media_Type_Description_FD32MB { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_FD32MB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 5¼" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_FDFORMAT_MD2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_FDFORMAT_MD2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 3½" double density floppy.. + /// + internal static string SCSI_Media_Type_Description_FDFORMAT_MF2DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_FDFORMAT_MF2DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 3½" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_FDFORMAT_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_FDFORMAT_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Floptical.. + /// + internal static string SCSI_Media_Type_Description_Floptical { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Floptical", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to GigaMO 3½" magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_GigaMO { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_GigaMO", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to GigaMO 2 3½" magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_GigaMO2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_GigaMO2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media has 46956 blocks of 256 bytes, setting media type to 12Mb HyperFlex.. + /// + internal static string SCSI_Media_Type_Description_HF12 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_HF12", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Media has 78936 blocks of 256 bytes, setting media type to 24Mb HyperFlex.. + /// + internal static string SCSI_Media_Type_Description_HF24 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_HF24", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive model is HiFD, media has 393380 blocks of 512 bytes, setting media type to HiFD.. + /// + internal static string SCSI_Media_Type_Description_HiFD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_HiFD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Sony HiMD.. + /// + internal static string SCSI_Media_Type_Description_HiMD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_HiMD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (23FD) floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_23FD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_23FD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (33FD) floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_33FD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_33FD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (43FD) floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_43FD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_43FD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (53FD) floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_53FD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_53FD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_IBM_MD1DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MD1DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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).. + /// + internal static string SCSI_Media_Type_Description_IBM_MD1DD_8 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MD1DD_8", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" double density floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_MD2DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MD2DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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).. + /// + internal static string SCSI_Media_Type_Description_IBM_MD2DD_8 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MD2DD_8", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_MD2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MD2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_IBM_MF1DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MF1DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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).. + /// + internal static string SCSI_Media_Type_Description_IBM_MF1DD_8 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MF1DD_8", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" double density floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_MF2DD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MF2DD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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).. + /// + internal static string SCSI_Media_Type_Description_IBM_MF2DD_8 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MF2DD_8", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" extra density floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_MF2ED { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MF2ED", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_IBM_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to IBM 3490.. + /// + internal static string SCSI_Media_Type_Description_IBM3490 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM3490", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to IBM 3490E.. + /// + internal static string SCSI_Media_Type_Description_IBM3490E { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM3490E", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is IBM, setting media type to IBM 3592.. + /// + internal static string SCSI_Media_Type_Description_IBM3592 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_IBM3592", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 10089 conforming 5¼" magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_ISO10089 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ISO10089", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 14517 conforming 5¼" magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_ISO14517 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ISO14517", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 15041 conforming 3½" magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_ISO15041 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ISO15041", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 15286 conforming 5¼" magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_ISO15286 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ISO15286", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, drive model is JAZ, media has 2091050 blocks of 512 bytes, setting media type to 1Gb JAZ.. + /// + internal static string SCSI_Media_Type_Description_JAZ { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_JAZ", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, drive model is JAZ, media has 3915600 blocks of 512 bytes, setting media type to 2Gb JAZ.. + /// + internal static string SCSI_Media_Type_Description_JAZ2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_JAZ2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive model is LS (SuperDisk), media has 2880 blocks of 512 bytes, setting media type to PC-98 formatted 3½" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_LS_PC98_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LS_PC98_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive model is LS (SuperDisk), media has 246528 blocks of 512 bytes, setting media type to LS-120.. + /// + internal static string SCSI_Media_Type_Description_LS120 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LS120", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive model is LS (SuperDisk), media has 469504 blocks of 512 bytes, setting media type to LS-240.. + /// + internal static string SCSI_Media_Type_Description_LS240 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LS240", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to LTO.. + /// + internal static string SCSI_Media_Type_Description_LTO { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO.. + /// + internal static string SCSI_Media_Type_Description_LTO_ult { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO_ult", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to LTO-2.. + /// + internal static string SCSI_Media_Type_Description_LTO2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-2.. + /// + internal static string SCSI_Media_Type_Description_LTO2_ult { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO2_ult", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-3.. + /// + internal static string SCSI_Media_Type_Description_LTO3 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO3", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-4.. + /// + internal static string SCSI_Media_Type_Description_LTO4 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-5.. + /// + internal static string SCSI_Media_Type_Description_LTO5 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO5", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-6.. + /// + internal static string SCSI_Media_Type_Description_LTO6_ult { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO6_ult", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-7.. + /// + internal static string SCSI_Media_Type_Description_LTO7_ult { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_LTO7_ult", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 60 minute MiniDisc.. + /// + internal static string SCSI_Media_Type_Description_MD60 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MD60", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 60 minute MiniDisc.. + /// + internal static string SCSI_Media_Type_Description_MD60_MDDATA { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MD60_MDDATA", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 74 minute MiniDisc.. + /// + internal static string SCSI_Media_Type_Description_MD74 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MD74", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 74 minute MiniDisc.. + /// + internal static string SCSI_Media_Type_Description_MD74_MDDATA { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MD74_MDDATA", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 80 minute MiniDisc.. + /// + internal static string SCSI_Media_Type_Description_MD80 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MD80", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 80 minute MiniDisc.. + /// + internal static string SCSI_Media_Type_Description_MD80_MDDATA { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MD80_MDDATA", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to MiniDisc for Data.. + /// + internal static string SCSI_Media_Type_Description_MDDATA { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MDDATA", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_MetaFloppy { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_MetaFloppy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive model is Castlewood Orb, media has 4307184 blocks of 512 bytes, setting media type to Orb.. + /// + internal static string SCSI_Media_Type_Description_Orb { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Orb", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_PC98_MD2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_PC98_MD2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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).. + /// + internal static string SCSI_Media_Type_Description_PC98_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_PC98_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, media has 78882 blocks of 512 bytes, setting media type to PocketZIP.. + /// + internal static string SCSI_Media_Type_Description_PocketZIP { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_PocketZIP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-11.. + /// + internal static string SCSI_Media_Type_Description_QIC11 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_QIC11", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-120.. + /// + internal static string SCSI_Media_Type_Description_QIC120 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_QIC120", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-150.. + /// + internal static string SCSI_Media_Type_Description_QIC150 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_QIC150", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-24.. + /// + internal static string SCSI_Media_Type_Description_QIC24 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_QIC24", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive model is RDX, media has {0} blocks of {1} bytes, setting media type to RDX320.. + /// + internal static string SCSI_Media_Type_Description_RDX320 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_RDX320", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 120Gb REV.. + /// + internal static string SCSI_Media_Type_Description_REV120 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_REV120", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 35Gb REV.. + /// + internal static string SCSI_Media_Type_Description_REV35 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_REV35", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 70Gb REV.. + /// + internal static string SCSI_Media_Type_Description_REV70 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_REV70", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "sdz" setting media type to Super AIT.. + /// + internal static string SCSI_Media_Type_Description_SAIT { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SAIT", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to SuperDLT.. + /// + internal static string SCSI_Media_Type_Description_SDLT { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SDLT", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to SuperDLT 2.. + /// + internal static string SCSI_Media_Type_Description_SDLT2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SDLT2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Sharp formatted 3½" high density floppy.. + /// + internal static string SCSI_Media_Type_Description_Sharp_MF2HD { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Sharp_MF2HD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 390696 blocks of 512 bytes, setting media type to SQ2000.. + /// + internal static string SCSI_Media_Type_Description_SQ2000 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SQ2000", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 215440 blocks of 512 bytes, setting media type to SQ310.. + /// + internal static string SCSI_Media_Type_Description_SQ310 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SQ310", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 524288 blocks of 512 bytes, setting media type to SQ327.. + /// + internal static string SCSI_Media_Type_Description_SQ327 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SQ327", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 86700 blocks of 512 bytes, setting media type to SQ400.. + /// + internal static string SCSI_Media_Type_Description_SQ400 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SQ400", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 173456 blocks of 512 bytes, setting media type to SQ800.. + /// + internal static string SCSI_Media_Type_Description_SQ800 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SQ800", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is SyQuest, media has 2929800 blocks of 512 bytes, setting media type to SyJet.. + /// + internal static string SCSI_Media_Type_Description_SyJet { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_SyJet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000A.. + /// + internal static string SCSI_Media_Type_Description_T10000A { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T10000A", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000B.. + /// + internal static string SCSI_Media_Type_Description_T10000B { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T10000B", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000C.. + /// + internal static string SCSI_Media_Type_Description_T10000C { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T10000C", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000D.. + /// + internal static string SCSI_Media_Type_Description_T10000D { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T10000D", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840A.. + /// + internal static string SCSI_Media_Type_Description_T9840A { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T9840A", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840D.. + /// + internal static string SCSI_Media_Type_Description_T9840D { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T9840D", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9940A.. + /// + internal static string SCSI_Media_Type_Description_T9940A { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T9940A", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9940B.. + /// + internal static string SCSI_Media_Type_Description_T9940B { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T9940B", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840C.. + /// + internal static string SCSI_Media_Type_Description_T9940C { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_T9940C", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to Travan 4.. + /// + internal static string SCSI_Media_Type_Description_Travan4 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Travan4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to Travan 5.. + /// + internal static string SCSI_Media_Type_Description_Travan5 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Travan5", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "stt" setting media type to Travan 5.. + /// + internal static string SCSI_Media_Type_Description_Travan5_stt { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Travan5_stt", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "stt" setting media type to Travan 7.. + /// + internal static string SCSI_Media_Type_Description_Travan7 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Travan7", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to UDO.. + /// + internal static string SCSI_Media_Type_Description_UDO { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_UDO", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to UDO2.. + /// + internal static string SCSI_Media_Type_Description_UDO2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_UDO2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to unknown.. + /// + internal static string SCSI_Media_Type_Description_Unknown { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Unknown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to unknown magneto-optical.. + /// + internal static string SCSI_Media_Type_Description_Unknown_MO { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_Unknown_MO", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to VStape I.. + /// + internal static string SCSI_Media_Type_Description_VStape { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_VStape", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA.. + /// + internal static string SCSI_Media_Type_Description_VXA { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_VXA", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA 2.. + /// + internal static string SCSI_Media_Type_Description_VXA2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_VXA2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA 3.. + /// + internal static string SCSI_Media_Type_Description_VXA3 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_VXA3", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_WORM_LTO3 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_WORM_LTO3", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_WORM_LTO4 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_WORM_LTO4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_WORM_LTO5 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_WORM_LTO5", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_WORM_LTO6_ult { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_WORM_LTO6_ult", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 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.. + /// + internal static string SCSI_Media_Type_Description_WORM_LTO7_ult { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_WORM_LTO7_ult", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to WORM UDO2.. + /// + internal static string SCSI_Media_Type_Description_WORM_UDO2 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_WORM_UDO2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI peripheral type is {0:X2}h, setting media type to host managed zoned block device.. + /// + internal static string SCSI_Media_Type_Description_ZBC_Host_Managed { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ZBC_Host_Managed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, drive model is ZIP, media has 196608 blocks of 512 bytes, setting media type to 100Mb ZIP.. + /// + internal static string SCSI_Media_Type_Description_ZIP100 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ZIP100", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Drive manufacturer is IOMEGA, drive model is ZIP, media has 489532 blocks of 512 bytes, setting media type to 250Mb ZIP.. + /// + internal static string SCSI_Media_Type_Description_ZIP250 { + get { + return ResourceManager.GetString("SCSI_Media_Type_Description_ZIP250", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h and device is USB, setting media type to Flash Drive.. + /// + internal static string SCSI_medium_type_is_0_and_device_is_USB_setting_media_type_to_Flash_Drive { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_and_device_is_USB_setting_media_type_to_Flash_Drive", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-2.. + /// + internal static string SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO2 { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_" + + "to_LTO2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-3.. + /// + internal static string SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO3 { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_" + + "to_LTO3", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-4.. + /// + internal static string SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO4 { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_" + + "to_LTO4", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-5.. + /// + internal static string SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_to_LTO5 { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_density_code_is_1_drive_starts_with_ult_setting_media_type_" + + "to_LTO5", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to PD-650.. + /// + internal static string SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_PD_650 { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_PD_650", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to WORM PD-650.. + /// + internal static string SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_WORM_PD_650 { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_media_has_1_blocks_of_2_bytes_setting_media_type_to_WORM_PD" + + "_650", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to CD+.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_CD_Plus { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_CD_Plus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to CD-ROM.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_CD_ROM { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_CD_ROM", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to CD-R.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_CDR { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_CDR", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to CD-RW.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_CDRW { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_CDRW", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to Compact Disc.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to Compact Disc Digital Audio.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc_Digital_Audio { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_Compact_Disc_Digital_Audio", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to Photo CD.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_Photo_CD { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_Photo_CD", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SCSI medium type is {0:X2}h, setting media type to unknown magneto-optical.. + /// + internal static string SCSI_medium_type_is_0_setting_media_type_to_unknown_magneto_optical { + get { + return ResourceManager.GetString("SCSI_medium_type_is_0_setting_media_type_to_unknown_magneto_optical", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unhandled exception calling uname: {0}. + /// + internal static string Unhandled_exception_calling_uname_0 { + get { + return ResourceManager.GetString("Unhandled_exception_calling_uname_0", resourceCulture); + } + } + } +} diff --git a/Aaru.CommonTypes/Localization/Localization.es.resx b/Aaru.CommonTypes/Localization/Localization.es.resx new file mode 100644 index 000000000..1208ed515 --- /dev/null +++ b/Aaru.CommonTypes/Localization/Localization.es.resx @@ -0,0 +1,631 @@ + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + El fabricante es SyQuest, el medio tiene 1961069 bloques de 512 bytes, estableciendo tipo como SparQ. + + + Excepción {0} + + + La respuesta a IDENTIFY es diferente de 512, no se decodificará. + + + 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á. + + + 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á. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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 + + + 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 + + + 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 + + + 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. + + + 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. + + + 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. + + + 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. + + + El fabricante es IOMEGA, el medio tiene {0} bloques de 256 bytes, estableciendo tipo como Bernoulli Box de 10Mb. + + + El fabricante es IOMEGA, el medio tiene 294918 bloques de 512 bytes, estableciendo tipo como Bernoulli Box II de 150Mb. + + + El fabricante es IOMEGA, el medio tiene 87040 bloques de 512 bytes, estableciendo tipo como Bernoulli Box II de 44Mb. + + + El fabricante es IOMEGA, el medio tiene 175856 bloques de 512 bytes, estableciendo tipo como Bernoulli Box II de 90Mb. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS-2. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS-3. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como DDS-4. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como disquete DEC RX02. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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). + + + 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. + + + 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). + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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). + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + El modelo de la unidad es LS (SuperDisk), el medio tiene 246528 bloques de 512 bytes, estableciendo tipo como LS-120. + + + El modelo de la unidad es LS (SuperDisk), el medio tiene 469504 bloques de 512 bytes, estableciendo tipo como LS-120. + + + 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. + + + 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. + + + 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. + + + 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. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como LTO. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como LTO-2. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-11. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-120. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-150. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como QIC-24. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como Travan 5. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como Travan 4. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como Floptical. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como Sony HiMD. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 60 minutos. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 74 minutos. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc de 80 minutos. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como REV de 120Gb. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como REV de 35Gb. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como REV de 70Gb. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como UDO. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como UDO2. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como desconocido. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como magneto-óptico desconocido. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como WORM UDO 2. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como PD-650. + + + El tipo de medio SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como WORM PD-650. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + 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. + + + El medio tiene 46956 bloques de 256 bytes, estableciendo tipo como HyperFlex de 12Mb. + + + El medio tiene 46956 bloques de 256 bytes, estableciendo tipo como HyperFlex de 24Mb. + + + El modelo de la unidad es Castlewood Orb, el medio tiene 4307184 bloques de 512 bytes, estableciendo tipo como Orb. + + + El modelo de la unidad es RDX, el medio tiene {0} bloques de {1} bytes, estableciendo tipo como RDX320. + + + El fabricante de la unidad es SyQuest, el medio tiene 390696 bloques de 512 bytes, estableciendo tipo como SQ2000. + + + El fabricante de la unidad es SyQuest, el medio tiene 215440 bloques de 512 bytes, estableciendo tipo como SQ310. + + + El fabricante de la unidad es SyQuest, el medio tiene 524288 bloques de 512 bytes, estableciendo tipo como SQ327. + + + El fabricante de la unidad es SyQuest, el medio tiene 87600 bloques de 512 bytes, estableciendo tipo como SQ400. + + + El fabricante de la unidad es SyQuest, el medio tiene 173456 bloques de 512 bytes, estableciendo tipo como SQ800. + + + El fabricante de la unidad es SyQuest, el medio tiene 2929800 bloques de 512 bytes, estableciendo tipo como SyJet. + + + El fabricante de la unidad es IOMEGA, el medio tiene 78882 bloques de 512 bytes, estableciendo tipo como PocketZIP. + + + El modelo de la unidad es HiFD, el medio tiene 393380 bloques de 512 bytes, estableciendo tipo como HiFD. + + + El modelo de la unidad es LS (SuperDisk), el medio tiene 65536 bloques de 512 bytes, estableciendo tipo como FD32MB. + + + El fabricante es SyQuest, el medio tiene 262144 bloques de 512 bytes, estableciendo tipo como EZ135. + + + El fabricante es SyQuest, el medio tiene 450560 bloques de 512 bytes, estableciendo tipo como EZ230. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como IBM 3490. + + + El tipo de medio SCSI es {0:X2}h, el código de densidad es {1:X2}h, estableciendo tipo como IBM 3490E. + + + 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. + + + 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. + + + 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. + + + 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. + + + El tipo de periférico SCSI es {0:X2}h, el medio tiene {1} bloques de {2} bytes, estableciendo tipo como MiniDisc for Data. + + + 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. + + + El tipo de periférico SCSI es {0:X2}h, estableciendo tipo como dispositivo de zonas de bloques gestionado. + + + El tipo de medio SCSI es {0:X2}h y el dispositivo es USB, estableciendo tipo como unidad Flash. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD-R. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD-RW. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD+. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como CD-ROM. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como Compact Disc. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como Compact Disc Digital Audio. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como Photo CD. + + + El tipo de medio SCSI es {0:X2}h, estableciendo tipo como magneto-óptico desconocido. + + + Excepción no manejada llamando a uname: {0} + + \ No newline at end of file diff --git a/Aaru.CommonTypes/Localization/Localization.resx b/Aaru.CommonTypes/Localization/Localization.resx new file mode 100644 index 000000000..5bbf14e20 --- /dev/null +++ b/Aaru.CommonTypes/Localization/Localization.resx @@ -0,0 +1,638 @@ + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + + + + Unhandled exception calling uname: {0} + + + Drive manufacturer is SyQuest, media has 1961069 blocks of 512 bytes, setting media type to SparQ. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to WORM PD-650. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to PD-650. + + + SCSI medium type is {0:X2}h, setting media type to Compact Disc. + + + SCSI medium type is {0:X2}h, setting media type to CD-ROM. + + + SCSI medium type is {0:X2}h, setting media type to Compact Disc Digital Audio. + + + SCSI medium type is {0:X2}h, setting media type to CD+. + + + SCSI medium type is {0:X2}h, setting media type to Photo CD. + + + SCSI medium type is {0:X2}h, setting media type to CD-R. + + + SCSI medium type is {0:X2}h, setting media type to CD-RW. + + + SCSI medium type is {0:X2}h and device is USB, setting media type to Flash Drive. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-2. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-3. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-4. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive starts with "ult", setting media type to LTO-5. + + + SCSI medium type is {0:X2}h, setting media type to unknown magneto-optical. + + + 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. + + + 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. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-223 conforming 3½" magneto-optical. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 15041 conforming 3½" magneto-optical. + + + 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. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 14517 conforming 5¼" magneto-optical. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to unknown magneto-optical. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 10089 conforming 5¼" magneto-optical. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ISO 15286 conforming 5¼" magneto-optical. + + + 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. + + + 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. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to GigaMO 3½" magneto-optical. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to GigaMO 2 3½" magneto-optical. + + + 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. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to UDO. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to WORM UDO2. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to UDO2. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-54 formatted 8" floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-59 formatted 8" floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-69 formatted 8" floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to unknown. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-66 formatted 5¼" floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-70 formatted 5¼" floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-78 formatted 5¼" floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to ECMA-99 formatted 5¼" floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" double density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 120Gb REV. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 70Gb REV. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 35Gb REV. + + + 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). + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" high density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Atari formatted 5¼" single density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Atari formatted 5¼" double density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (33FD) floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (43FD) floppy. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 5¼" single density floppy. + + + 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. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 5¼" double density floppy. + + + 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. + + + 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. + + + 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. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to DEC RX02 floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (53FD) floppy. + + + Drive manufacturer is IOMEGA, media has {0} blocks of 256 bytes, setting media type to 10Mb Bernoulli Box. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 8" (23FD) floppy. + + + 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). + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Apricot formatted 3½" floppy. + + + 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). + + + 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). + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" double density floppy. + + + 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. + + + 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). + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 3½" double density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Amiga formatted 3½" double density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 5¼" high density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 5¼" high density floppy. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to FDFORMAT formatted 3½" high density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Amiga formatted 3½" high density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to IBM formatted 3½" extra density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Floptical. + + + Drive model is LS (SuperDisk), media has 65536 blocks of 512 bytes, setting media type to FD32MB. + + + Drive manufacturer is IOMEGA, media has 78882 blocks of 512 bytes, setting media type to PocketZIP. + + + Drive manufacturer is SyQuest, media has 86700 blocks of 512 bytes, setting media type to SQ400. + + + Drive manufacturer is IOMEGA, media has 87040 blocks of 512 bytes, setting media type to 44Mb Bernoulli Box II. + + + Drive manufacturer is SyQuest, media has 173456 blocks of 512 bytes, setting media type to SQ800. + + + Drive manufacturer is IOMEGA, media has 175856 blocks of 512 bytes, setting media type to 90Mb Bernoulli Box II. + + + Drive manufacturer is IOMEGA, drive model is ZIP, media has 196608 blocks of 512 bytes, setting media type to 100Mb ZIP. + + + Drive manufacturer is SyQuest, media has 215440 blocks of 512 bytes, setting media type to SQ310. + + + Drive model is LS (SuperDisk), media has 246528 blocks of 512 bytes, setting media type to LS-120. + + + Drive manufacturer is SyQuest, media has 262144 blocks of 512 bytes, setting media type to EZ135. + + + Drive manufacturer is IOMEGA, media has 294918 blocks of 512 bytes, setting media type to 150Mb Bernoulli Box II. + + + Drive manufacturer is SyQuest, media has 390696 blocks of 512 bytes, setting media type to SQ2000. + + + Drive model is HiFD, media has 393380 blocks of 512 bytes, setting media type to HiFD. + + + Drive manufacturer is SyQuest, media has 450560 blocks of 512 bytes, setting media type to EZ230. + + + Drive model is LS (SuperDisk), media has 469504 blocks of 512 bytes, setting media type to LS-240. + + + Drive manufacturer is IOMEGA, drive model is ZIP, media has 489532 blocks of 512 bytes, setting media type to 250Mb ZIP. + + + Drive manufacturer is SyQuest, media has 524288 blocks of 512 bytes, setting media type to SQ327. + + + Drive manufacturer is IOMEGA, drive model is JAZ, media has 2091050 blocks of 512 bytes, setting media type to 1Gb JAZ. + + + Drive manufacturer is SyQuest, media has 2929800 blocks of 512 bytes, setting media type to SyJet. + + + Drive manufacturer is IOMEGA, drive model is JAZ, media has 3915600 blocks of 512 bytes, setting media type to 2Gb JAZ. + + + Drive model is Castlewood Orb, media has 4307184 blocks of 512 bytes, setting media type to Orb. + + + Drive model is RDX, media has {0} blocks of {1} bytes, setting media type to RDX320. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 3½" double density floppy. + + + Drive model is LS (SuperDisk), media has 2880 blocks of 512 bytes, setting media type to PC-98 formatted 3½" high density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Sharp formatted 3½" high density floppy. + + + 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. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Acorn formatted 3½" high density floppy. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 60 minute MiniDisc. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 74 minute MiniDisc. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 80 minute MiniDisc. + + + SCSI medium type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to Sony HiMD. + + + SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to MiniDisc for Data. + + + SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 60 minute MiniDisc. + + + SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 74 minute MiniDisc. + + + SCSI peripheral type is {0:X2}h, media has {1} blocks of {2} bytes, setting media type to 80 minute MiniDisc. + + + SCSI peripheral type is {0:X2}h, setting media type to host managed zoned block device. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-11. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-24. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to IBM 3490. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-120. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to QIC-150. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-2. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-3. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to DDS-4. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to IBM 3490E. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "sdz" setting media type to Super AIT. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-2. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840A. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9940A. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-3. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9940B. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840C. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-4. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T9840D. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000A. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000B. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000C. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is StorageTek, setting media type to T10000D. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-5. + + + 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. + + + 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. + + + 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. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to LTO. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to LTO-2. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-3. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-4. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DAT72. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dat" setting media type to DDS-2. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-6. + + + 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. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "ult" setting media type to LTO-7. + + + 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. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 15m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive manufacturer is IBM, setting media type to IBM 3592. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 28m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to CompactTape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to CompactTape II. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA 2. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "vxa" setting media type to VXA 3. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 54m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape III. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape IIIxt. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 106m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to DLTtape IV. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "stt" setting media type to Travan 5. + + + 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. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to SuperDLT. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to SuperDLT 2. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "dlt" setting media type to VStape I. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "stt" setting media type to Travan 7. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to Travan 4. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, setting media type to Travan 5. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 22m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 40m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 76m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 112m Exatape. + + + 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. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 170m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 125m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 45m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 225m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 150m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 75m Exatape. + + + SCSI medium type is {0:X2}h, density code is {1:X2}h, drive model starts with "exb" setting media type to 80m Exatape. + + + IDENTIFY response is different than 512 bytes, not decoding. + + + INQUIRY response is {0} bytes, less than minimum of 36 bytes, decoded data can be incorrect, not decoding. + + + INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, not decoding. + + + Exception {0} + + + Media has 46956 blocks of 256 bytes, setting media type to 12Mb HyperFlex. + + + Media has 78936 blocks of 256 bytes, setting media type to 24Mb HyperFlex. + + \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaType.cs b/Aaru.CommonTypes/MediaType.cs new file mode 100644 index 000000000..3f5bf6ba7 --- /dev/null +++ b/Aaru.CommonTypes/MediaType.cs @@ -0,0 +1,1323 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : MediaType.cs +// Author(s) : Natalia Portillo +// +// Component : Aaru common types. +// +// --[ Description ] ---------------------------------------------------------- +// +// Contains common media 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 +// ****************************************************************************/ + +// ReSharper disable InconsistentNaming +// TODO: Rename contents + +using System; + +#pragma warning disable 1591 + +// ReSharper disable UnusedMember.Global +// ReSharper disable IdentifierTypo + +namespace Aaru.CommonTypes; + +public enum MediaEncoding +{ + Unknown, + FM, + MFM, + M2FM, + AppleGCR, + CommodoreGCR +} + +/// Contains an enumeration of all known types of media. +public enum MediaType : uint +{ +#region Generics, types 0 to 9 + + /// Unknown disk type + Unknown = 0, + /// Unknown magneto-optical + UnknownMO = 1, + /// Generic hard disk + GENERIC_HDD = 2, + /// Microdrive type hard disk + Microdrive = 3, + /// Zoned hard disk + Zone_HDD = 4, + /// USB flash drives + FlashDrive = 5, + /// Unknown data tape + UnknownTape = 6, + +#endregion Generics, types 0 to 9 + +#region Somewhat standard Compact Disc formats, types 10 to 39 + + /// Any unknown or standard violating CD + CD = 10, + /// CD Digital Audio (Red Book) + CDDA = 11, + /// CD+G (Red Book) + CDG = 12, + /// CD+EG (Red Book) + CDEG = 13, + /// CD-i (Green Book) + CDI = 14, + /// CD-ROM (Yellow Book) + CDROM = 15, + /// CD-ROM XA (Yellow Book) + CDROMXA = 16, + /// CD+ (Blue Book) + CDPLUS = 17, + /// CD-MO (Orange Book) + CDMO = 18, + /// CD-Recordable (Orange Book) + CDR = 19, + /// CD-ReWritable (Orange Book) + CDRW = 20, + /// Mount-Rainier CD-RW + CDMRW = 21, + /// Video CD (White Book) + VCD = 22, + /// Super Video CD (White Book) + SVCD = 23, + /// Photo CD (Beige Book) + PCD = 24, + /// Super Audio CD (Scarlet Book) + SACD = 25, + /// Double-Density CD-ROM (Purple Book) + DDCD = 26, + /// DD CD-R (Purple Book) + DDCDR = 27, + /// DD CD-RW (Purple Book) + DDCDRW = 28, + /// DTS audio CD (non-standard) + DTSCD = 29, + /// CD-MIDI (Red Book) + CDMIDI = 30, + /// CD-Video (ISO/IEC 61104) + CDV = 31, + /// 120mm, Phase-Change, 1298496 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485 + PD650 = 32, + /// 120mm, Write-Once, 1281856 sectors, 512 bytes/sector, PD650, ECMA-240, ISO 15485 + PD650_WORM = 33, + /// + /// 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. + /// + CDIREADY = 34, + FMTOWNS = 35, + +#endregion Somewhat standard Compact Disc formats, types 10 to 39 + +#region Standard DVD formats, types 40 to 50 + + /// DVD-ROM (applies to DVD Video and DVD Audio) + DVDROM = 40, + /// DVD-R + DVDR = 41, + /// DVD-RW + DVDRW = 42, + /// DVD+R + DVDPR = 43, + /// DVD+RW + DVDPRW = 44, + /// DVD+RW DL + DVDPRWDL = 45, + /// DVD-R DL + DVDRDL = 46, + /// DVD+R DL + DVDPRDL = 47, + /// DVD-RAM + DVDRAM = 48, + /// DVD-RW DL + DVDRWDL = 49, + /// DVD-Download + DVDDownload = 50, + +#endregion Standard DVD formats, types 40 to 50 + +#region Standard HD-DVD formats, types 51 to 59 + + /// HD DVD-ROM (applies to HD DVD Video) + HDDVDROM = 51, + /// HD DVD-RAM + HDDVDRAM = 52, + /// HD DVD-R + HDDVDR = 53, + /// HD DVD-RW + HDDVDRW = 54, + /// HD DVD-R DL + HDDVDRDL = 55, + /// HD DVD-RW DL + HDDVDRWDL = 56, + +#endregion Standard HD-DVD formats, types 51 to 59 + +#region Standard Blu-ray formats, types 60 to 69 + + /// BD-ROM (and BD Video) + BDROM = 60, + /// BD-R + BDR = 61, + /// BD-RE + BDRE = 62, + /// BD-R XL + BDRXL = 63, + /// BD-RE XL + BDREXL = 64, + /// Ultra HD Blu-ray + UHDBD = 65, + +#endregion Standard Blu-ray formats, types 60 to 69 + +#region Rare or uncommon optical standards, types 70 to 79 + + /// Enhanced Versatile Disc + EVD = 70, + /// Forward Versatile Disc + FVD = 71, + /// Holographic Versatile Disc + HVD = 72, + /// China Blue High Definition + CBHD = 73, + /// High Definition Versatile Multilayer Disc + HDVMD = 74, + /// Versatile Compact Disc High Density + VCDHD = 75, + /// Stacked Volumetric Optical Disc + SVOD = 76, + /// Five Dimensional disc + FDDVD = 77, + /// China Video Disc + CVD = 78, + +#endregion Rare or uncommon optical standards, types 70 to 79 + +#region LaserDisc based, types 80 to 89 + + /// Pioneer LaserDisc + LD = 80, + /// Pioneer LaserDisc data + LDROM = 81, + LDROM2 = 82, + LVROM = 83, + MegaLD = 84, + /// Writable LaserDisc with support for component video + CRVdisc = 85, + +#endregion LaserDisc based, types 80 to 89 + +#region MiniDisc based, types 90 to 99 + + /// Sony Hi-MD + HiMD = 90, + /// Sony MiniDisc + MD = 91, + /// Sony MD-Data + MDData = 92, + /// Sony MD-Data2 + MDData2 = 93, + /// Sony MiniDisc, 60 minutes, formatted with Hi-MD format + MD60 = 94, + /// Sony MiniDisc, 74 minutes, formatted with Hi-MD format + MD74 = 95, + /// Sony MiniDisc, 80 minutes, formatted with Hi-MD format + MD80 = 96, + +#endregion MiniDisc based, types 90 to 99 + +#region Plasmon UDO, types 100 to 109 + + /// 5.25", Phase-Change, 1834348 sectors, 8192 bytes/sector, Ultra Density Optical, ECMA-350, ISO 17345 + UDO = 100, + /// 5.25", Phase-Change, 3669724 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976 + UDO2 = 101, + /// 5.25", Write-Once, 3668759 sectors, 8192 bytes/sector, Ultra Density Optical 2, ECMA-380, ISO 11976 + UDO2_WORM = 102, + +#endregion Plasmon UDO, types 100 to 109 + +#region Sony game media, types 110 to 129 + + PlayStationMemoryCard = 110, + PlayStationMemoryCard2 = 111, + /// Sony PlayStation game CD + PS1CD = 112, + /// Sony PlayStation 2 game CD + PS2CD = 113, + /// Sony PlayStation 2 game DVD + PS2DVD = 114, + /// Sony PlayStation 3 game DVD + PS3DVD = 115, + /// Sony PlayStation 3 game Blu-ray + PS3BD = 116, + /// Sony PlayStation 4 game Blu-ray + PS4BD = 117, + /// Sony PlayStation Portable Universal Media Disc (ECMA-365) + UMD = 118, + PlayStationVitaGameCard = 119, + /// Sony PlayStation 5 game Ultra HD Blu-ray + PS5BD = 120, + +#endregion Sony game media, types 110 to 129 + +#region Microsoft game media, types 130 to 149 + + /// Microsoft X-box Game Disc + XGD = 130, + /// Microsoft X-box 360 Game Disc + XGD2 = 131, + /// Microsoft X-box 360 Game Disc + XGD3 = 132, + /// Microsoft X-box One Game Disc + XGD4 = 133, + +#endregion Microsoft game media, types 130 to 149 + +#region Sega game media, types 150 to 169 + + /// Sega MegaCD + MEGACD = 150, + /// Sega Saturn disc + SATURNCD = 151, + /// Sega/Yamaha Gigabyte Disc + GDROM = 152, + /// Sega/Yamaha recordable Gigabyte Disc + GDR = 153, + SegaCard = 154, + MilCD = 155, + MegaDriveCartridge = 156, + _32XCartridge = 157, + SegaPicoCartridge = 158, + MasterSystemCartridge = 159, + GameGearCartridge = 160, + SegaSaturnCartridge = 161, + +#endregion Sega game media, types 150 to 169 + +#region Other game media, types 170 to 179 + + /// PC-Engine / TurboGrafx cartridge + HuCard = 170, + /// PC-Engine / TurboGrafx CD + SuperCDROM2 = 171, + /// Atari Jaguar CD + JaguarCD = 172, + /// 3DO CD + ThreeDO = 173, + /// NEC PC-FX + PCFX = 174, + /// NEO-GEO CD + NeoGeoCD = 175, + /// Commodore CDTV + CDTV = 176, + /// Amiga CD32 + CD32 = 177, + /// Nuon (DVD based videogame console) + Nuon = 178, + /// Bandai Playdia + Playdia = 179, + +#endregion Other game media, types 170 to 179 + +#region Apple standard floppy format, types 180 to 189 + + /// 5.25", SS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR + Apple32SS = 180, + /// 5.25", DS, DD, 35 tracks, 13 spt, 256 bytes/sector, GCR + Apple32DS = 181, + /// 5.25", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR + Apple33SS = 182, + /// 5.25", DS, DD, 35 tracks, 16 spt, 256 bytes/sector, GCR + Apple33DS = 183, + /// 3.5", SS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR + AppleSonySS = 184, + /// 3.5", DS, DD, 80 tracks, 8 to 12 spt, 512 bytes/sector, GCR + AppleSonyDS = 185, + /// 5.25", DS, ?D, ?? tracks, ?? spt, 512 bytes/sector, GCR, opposite side heads, aka Twiggy + AppleFileWare = 186, + +#endregion Apple standard floppy format + +#region IBM/Microsoft PC floppy formats, types 190 to 209 + + /// 5.25", SS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM + DOS_525_SS_DD_8 = 190, + /// 5.25", SS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM + DOS_525_SS_DD_9 = 191, + /// 5.25", DS, DD, 40 tracks, 8 spt, 512 bytes/sector, MFM + DOS_525_DS_DD_8 = 192, + /// 5.25", DS, DD, 40 tracks, 9 spt, 512 bytes/sector, MFM + DOS_525_DS_DD_9 = 193, + /// 5.25", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM + DOS_525_HD = 194, + /// 3.5", SS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM + DOS_35_SS_DD_8 = 195, + /// 3.5", SS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM + DOS_35_SS_DD_9 = 196, + /// 3.5", DS, DD, 80 tracks, 8 spt, 512 bytes/sector, MFM + DOS_35_DS_DD_8 = 197, + /// 3.5", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM + DOS_35_DS_DD_9 = 198, + /// 3.5", DS, HD, 80 tracks, 18 spt, 512 bytes/sector, MFM + DOS_35_HD = 199, + /// 3.5", DS, ED, 80 tracks, 36 spt, 512 bytes/sector, MFM + DOS_35_ED = 200, + /// 3.5", DS, HD, 80 tracks, 21 spt, 512 bytes/sector, MFM + DMF = 201, + /// 3.5", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM + DMF_82 = 202, + /// + /// 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_525 = 203, + /// + /// 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 + /// + XDF_35 = 204, + +#endregion IBM/Microsoft PC standard floppy formats, types 190 to 209 + +#region IBM standard floppy formats, types 210 to 219 + + /// 8", SS, SD, 32 tracks, 8 spt, 319 bytes/sector, FM + IBM23FD = 210, + /// 8", SS, SD, 73 tracks, 26 spt, 128 bytes/sector, FM + IBM33FD_128 = 211, + /// 8", SS, SD, 74 tracks, 15 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + IBM33FD_256 = 212, + /// 8", SS, SD, 74 tracks, 8 spt, 512 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + IBM33FD_512 = 213, + /// 8", DS, SD, 74 tracks, 26 spt, 128 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + IBM43FD_128 = 214, + /// 8", DS, SD, 74 tracks, 26 spt, 256 bytes/sector, FM, track 0 = 26 sectors, 128 bytes/sector + IBM43FD_256 = 215, + /// + /// 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_256 = 216, + /// + /// 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_512 = 217, + /// + /// 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 + /// + IBM53FD_1024 = 218, + +#endregion IBM standard floppy formats, types 210 to 219 + +#region DEC standard floppy formats, types 220 to 229 + + /// 8", SS, DD, 77 tracks, 26 spt, 128 bytes/sector, FM + RX01 = 220, + /// 8", SS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM + RX02 = 221, + /// 8", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, FM/MFM + RX03 = 222, + /// 5.25", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM + RX50 = 223, + +#endregion DEC standard floppy formats, types 220 to 229 + +#region Acorn standard floppy formats, types 230 to 239 + + /// 5,25", SS, SD, 40 tracks, 10 spt, 256 bytes/sector, FM + ACORN_525_SS_SD_40 = 230, + /// 5,25", SS, SD, 80 tracks, 10 spt, 256 bytes/sector, FM + ACORN_525_SS_SD_80 = 231, + /// 5,25", SS, DD, 40 tracks, 16 spt, 256 bytes/sector, MFM + ACORN_525_SS_DD_40 = 232, + /// 5,25", SS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM + ACORN_525_SS_DD_80 = 233, + /// 5,25", DS, DD, 80 tracks, 16 spt, 256 bytes/sector, MFM + ACORN_525_DS_DD = 234, + /// 3,5", DS, DD, 80 tracks, 5 spt, 1024 bytes/sector, MFM + ACORN_35_DS_DD = 235, + /// 3,5", DS, HD, 80 tracks, 10 spt, 1024 bytes/sector, MFM + ACORN_35_DS_HD = 236, + +#endregion Acorn standard floppy formats, types 230 to 239 + +#region Atari standard floppy formats, types 240 to 249 + + /// 5,25", SS, SD, 40 tracks, 18 spt, 128 bytes/sector, FM + ATARI_525_SD = 240, + /// 5,25", SS, ED, 40 tracks, 26 spt, 128 bytes/sector, MFM + ATARI_525_ED = 241, + /// 5,25", SS, DD, 40 tracks, 18 spt, 256 bytes/sector, MFM + ATARI_525_DD = 242, + /// 3,5", SS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM + ATARI_35_SS_DD = 243, + /// 3,5", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM + ATARI_35_DS_DD = 244, + /// 3,5", SS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM + ATARI_35_SS_DD_11 = 245, + /// 3,5", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM + ATARI_35_DS_DD_11 = 246, + +#endregion Atari standard floppy formats, types 240 to 249 + +#region Commodore standard floppy formats, types 250 to 259 + + /// 3,5", DS, DD, 80 tracks, 10 spt, 512 bytes/sector, MFM (1581) + CBM_35_DD = 250, + /// 3,5", DS, DD, 80 tracks, 11 spt, 512 bytes/sector, MFM (Amiga) + CBM_AMIGA_35_DD = 251, + /// 3,5", DS, HD, 80 tracks, 22 spt, 512 bytes/sector, MFM (Amiga) + CBM_AMIGA_35_HD = 252, + /// 5,25", SS, DD, 35 tracks, GCR + CBM_1540 = 253, + /// 5,25", SS, DD, 40 tracks, GCR + CBM_1540_Ext = 254, + /// 5,25", DS, DD, 35 tracks, GCR + CBM_1571 = 255, + +#endregion Commodore standard floppy formats, types 250 to 259 + +#region NEC/SHARP standard floppy formats, types 260 to 269 + + /// 8", DS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM + NEC_8_SD = 260, + /// 8", DS, DD, 77 tracks, 26 spt, 256 bytes/sector, MFM + NEC_8_DD = 261, + /// 5.25", SS, SD, 80 tracks, 16 spt, 256 bytes/sector, FM + NEC_525_SS = 262, + /// 5.25", DS, SD, 80 tracks, 16 spt, 256 bytes/sector, MFM + NEC_525_DS = 263, + /// 5,25", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM + NEC_525_HD = 264, + /// 3,5", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM, aka mode 3 + NEC_35_HD_8 = 265, + /// 3,5", DS, HD, 80 tracks, 15 spt, 512 bytes/sector, MFM + NEC_35_HD_15 = 266, + /// 3,5", DS, TD, 240 tracks, 38 spt, 512 bytes/sector, MFM + NEC_35_TD = 267, + /// 5,25", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM + SHARP_525 = NEC_525_HD, + /// 3,5", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM + SHARP_525_9 = 268, + /// 3,5", DS, HD, 77 tracks, 8 spt, 1024 bytes/sector, MFM + SHARP_35 = NEC_35_HD_8, + /// 3,5", DS, HD, 80 tracks, 9 spt, 1024 bytes/sector, MFM + SHARP_35_9 = 269, + +#endregion NEC/SHARP standard floppy formats, types 260 to 269 + +#region ECMA floppy standards, types 270 to 289 + + /// + /// 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_8 = 270, + /// + /// 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_15 = 271, + /// + /// 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_99_26 = 272, + /// 3,5", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, MFM + ECMA_100 = DOS_35_DS_DD_9, + /// 3,5", DS, HD, 80 tracks, 18 spt, 512 bytes/sector, MFM + ECMA_125 = DOS_35_HD, + /// 3,5", DS, ED, 80 tracks, 36 spt, 512 bytes/sector, MFM + ECMA_147 = DOS_35_ED, + /// 8", SS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM + ECMA_54 = 273, + /// 8", DS, SD, 77 tracks, 26 spt, 128 bytes/sector, FM + ECMA_59 = 274, + /// 5,25", SS, DD, 35 tracks, 9 spt, 256 bytes/sector, FM, track 0 side 0 = 16 sectors, 128 bytes/sector + ECMA_66 = 275, + /// + /// 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_8 = 276, + /// + /// 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_15 = 277, + /// + /// 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_69_26 = 278, + /// + /// 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_70 = 279, + /// + /// 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 = 280, + /// 5,25", DS, DD, 80 tracks, 9 spt, 512 bytes/sector, FM + ECMA_78_2 = 281, + +#endregion ECMA floppy standards, types 270 to 289 + +#region Non-standard PC formats (FDFORMAT, 2M, etc), types 290 to 308 + + /// 5,25", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM + FDFORMAT_525_DD = 290, + /// 5,25", DS, HD, 82 tracks, 17 spt, 512 bytes/sector, MFM + FDFORMAT_525_HD = 291, + /// 3,5", DS, DD, 82 tracks, 10 spt, 512 bytes/sector, MFM + FDFORMAT_35_DD = 292, + /// 3,5", DS, HD, 82 tracks, 21 spt, 512 bytes/sector, MFM + FDFORMAT_35_HD = 293, + +#endregion Non-standard PC formats (FDFORMAT, 2M, etc), types 290 to 308 + +#region Apricot ACT standard floppy formats, type 309 + + /// 3.5", DS, DD, 70 tracks, 9 spt, 512 bytes/sector, MFM + Apricot_35 = 309, + +#endregion Apricot ACT standard floppy formats, type 309 + +#region OnStream ADR, types 310 to 319 + + ADR2120 = 310, + ADR260 = 311, + ADR30 = 312, + ADR50 = 313, + +#endregion OnStream ADR, types 310 to 319 + +#region Advanced Intelligent Tape, types 320 to 339 + + AIT1 = 320, + AIT1Turbo = 321, + AIT2 = 322, + AIT2Turbo = 323, + AIT3 = 324, + AIT3Ex = 325, + AIT3Turbo = 326, + AIT4 = 327, + AIT5 = 328, + AITETurbo = 329, + SAIT1 = 330, + SAIT2 = 331, + +#endregion Advanced Intelligent Tape, types 320 to 339 + +#region Iomega, types 340 to 359 + + /// Obsolete type for 8"x11" Bernoulli Box disk + [Obsolete] + Bernoulli = 340, + /// Obsolete type for 5⅓" Bernoulli Box II disks + [Obsolete] + Bernoulli2 = 341, + Ditto = 342, + DittoMax = 343, + Jaz = 344, + Jaz2 = 345, + PocketZip = 346, + REV120 = 347, + REV35 = 348, + REV70 = 349, + ZIP100 = 350, + ZIP250 = 351, + ZIP750 = 352, + /// 5⅓" Bernoulli Box II disk with 35Mb capacity + Bernoulli35 = 353, + /// 5⅓" Bernoulli Box II disk with 44Mb capacity + Bernoulli44 = 354, + /// 5⅓" Bernoulli Box II disk with 65Mb capacity + Bernoulli65 = 355, + /// 5⅓" Bernoulli Box II disk with 90Mb capacity + Bernoulli90 = 356, + /// 5⅓" Bernoulli Box II disk with 105Mb capacity + Bernoulli105 = 357, + /// 5⅓" Bernoulli Box II disk with 150Mb capacity + Bernoulli150 = 358, + /// 5⅓" Bernoulli Box II disk with 230Mb capacity + Bernoulli230 = 359, + +#endregion Iomega, types 340 to 359 + +#region Audio or video media, types 360 to 369 + + CompactCassette = 360, + Data8 = 361, + MiniDV = 362, + /// D/CAS-25: Digital data on Compact Cassette form factor, special magnetic media, 9-track + Dcas25 = 363, + /// D/CAS-85: Digital data on Compact Cassette form factor, special magnetic media, 17-track + Dcas85 = 364, + /// D/CAS-103: Digital data on Compact Cassette form factor, special magnetic media, 21-track + Dcas103 = 365, + +#endregion Audio media, types 360 to 369 + +#region CompactFlash Association, types 370 to 379 + + CFast = 370, + CompactFlash = 371, + CompactFlashType2 = 372, + +#endregion CompactFlash Association, types 370 to 379 + +#region Digital Audio Tape / Digital Data Storage, types 380 to 389 + + DigitalAudioTape = 380, + DAT160 = 381, + DAT320 = 382, + DAT72 = 383, + DDS1 = 384, + DDS2 = 385, + DDS3 = 386, + DDS4 = 387, + +#endregion Digital Audio Tape / Digital Data Storage, types 380 to 389 + +#region DEC, types 390 to 399 + + CompactTapeI = 390, + CompactTapeII = 391, + DECtapeII = 392, + DLTtapeIII = 393, + DLTtapeIIIxt = 394, + DLTtapeIV = 395, + DLTtapeS4 = 396, + SDLT1 = 397, + SDLT2 = 398, + VStapeI = 399, + +#endregion DEC, types 390 to 399 + +#region Exatape, types 400 to 419 + + 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, + +#endregion Exatape, types 400 to 419 + +#region PCMCIA / ExpressCard, types 420 to 429 + + ExpressCard34 = 420, + ExpressCard54 = 421, + PCCardTypeI = 422, + PCCardTypeII = 423, + PCCardTypeIII = 424, + PCCardTypeIV = 425, + +#endregion PCMCIA / ExpressCard, types 420 to 429 + +#region SyQuest, types 430 to 449 + + /// SyQuest 135Mb cartridge for use in EZ135 and EZFlyer drives + EZ135 = 430, + /// SyQuest EZFlyer 230Mb cartridge for use in EZFlyer drive + EZ230 = 431, + /// SyQuest 4.7Gb for use in Quest drive + Quest = 432, + /// SyQuest SparQ 1Gb cartridge + SparQ = 433, + /// SyQuest 5Mb cartridge for SQ306RD drive + SQ100 = 434, + /// SyQuest 10Mb cartridge for SQ312RD drive + SQ200 = 435, + /// SyQuest 15Mb cartridge for SQ319RD drive + SQ300 = 436, + /// SyQuest 105Mb cartridge for SQ3105 and SQ3270 drives + SQ310 = 437, + /// SyQuest 270Mb cartridge for SQ3270 drive + SQ327 = 438, + /// SyQuest 44Mb cartridge for SQ555, SQ5110 and SQ5200C/SQ200 drives + SQ400 = 439, + /// SyQuest 88Mb cartridge for SQ5110 and SQ5200C/SQ200 drives + SQ800 = 440, + /// SyQuest 1.5Gb cartridge for SyJet drive + [Obsolete] + SQ1500 = 441, + /// SyQuest 200Mb cartridge for use in SQ5200C drive + SQ2000 = 442, + /// SyQuest 1.5Gb cartridge for SyJet drive + SyJet = 443, + +#endregion SyQuest, types 430 to 449 + +#region Nintendo, types 450 to 469 + + FamicomGamePak = 450, + GameBoyAdvanceGamePak = 451, + GameBoyGamePak = 452, + /// Nintendo GameCube Optical Disc + GOD = 453, + N64DD = 454, + N64GamePak = 455, + NESGamePak = 456, + Nintendo3DSGameCard = 457, + NintendoDiskCard = 458, + NintendoDSGameCard = 459, + NintendoDSiGameCard = 460, + SNESGamePak = 461, + SNESGamePakUS = 462, + /// Nintendo Wii Optical Disc + WOD = 463, + /// Nintendo Wii U Optical Disc + WUOD = 464, + SwitchGameCard = 465, + +#endregion Nintendo, types 450 to 469 + +#region IBM Tapes, types 470 to 479 + + IBM3470 = 470, + IBM3480 = 471, + IBM3490 = 472, + IBM3490E = 473, + IBM3592 = 474, + +#endregion IBM Tapes, types 470 to 479 + +#region LTO Ultrium, types 480 to 509 + + LTO = 480, + LTO2 = 481, + LTO3 = 482, + LTO3WORM = 483, + LTO4 = 484, + LTO4WORM = 485, + LTO5 = 486, + LTO5WORM = 487, + LTO6 = 488, + LTO6WORM = 489, + LTO7 = 490, + LTO7WORM = 491, + +#endregion LTO Ultrium, types 480 to 509 + +#region MemoryStick, types 510 to 519 + + MemoryStick = 510, + MemoryStickDuo = 511, + MemoryStickMicro = 512, + MemoryStickPro = 513, + MemoryStickProDuo = 514, + +#endregion MemoryStick, types 510 to 519 + +#region SecureDigital, types 520 to 529 + + microSD = 520, + miniSD = 521, + SecureDigital = 522, + +#endregion SecureDigital, types 520 to 529 + +#region MultiMediaCard, types 530 to 539 + + MMC = 530, + MMCmicro = 531, + RSMMC = 532, + MMCplus = 533, + MMCmobile = 534, + +#endregion MultiMediaCard, types 530 to 539 + +#region SLR, types 540 to 569 + + 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, + +#endregion SLR, types 540 to 569 + +#region QIC, types 570 to 589 + + 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, + +#endregion QIC, types 570 to 589 + +#region StorageTek tapes, types 590 to 609 + + 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, + +#endregion StorageTek tapes, types 590 to 609 + +#region Travan, types 610 to 619 + + Travan = 610, + Travan1Ex = 611, + Travan3 = 612, + Travan3Ex = 613, + Travan4 = 614, + Travan5 = 615, + Travan7 = 616, + +#endregion Travan, types 610 to 619 + +#region VXA, types 620 to 629 + + VXA1 = 620, + VXA2 = 621, + VXA3 = 622, + +#endregion VXA, types 620 to 629 + +#region Magneto-optical, types 630 to 659 + + /// 5,25", M.O., WORM, 650Mb, 318750 sectors, 1024 bytes/sector, ECMA-153, ISO 11560 + ECMA_153 = 630, + /// 5,25", M.O., WORM, 600Mb, 581250 sectors, 512 bytes/sector, ECMA-153, ISO 11560 + ECMA_153_512 = 631, + /// 3,5", M.O., RW, 128Mb, 248826 sectors, 512 bytes/sector, ECMA-154, ISO 10090 + ECMA_154 = 632, + /// 5,25", M.O., RW/WORM, 1Gb, 904995 sectors, 512 bytes/sector, ECMA-183, ISO 13481 + ECMA_183_512 = 633, + /// 5,25", M.O., RW/WORM, 1Gb, 498526 sectors, 1024 bytes/sector, ECMA-183, ISO 13481 + ECMA_183 = 634, + /// 5,25", M.O., RW/WORM, 1.2Gb, 1165600 sectors, 512 bytes/sector, ECMA-184, ISO 13549 + ECMA_184_512 = 635, + /// 5,25", M.O., RW/WORM, 1.3Gb, 639200 sectors, 1024 bytes/sector, ECMA-184, ISO 13549 + ECMA_184 = 636, + /// 300mm, M.O., WORM, ??? sectors, 1024 bytes/sector, ECMA-189, ISO 13614 + ECMA_189 = 637, + /// 300mm, M.O., WORM, ??? sectors, 1024 bytes/sector, ECMA-190, ISO 13403 + ECMA_190 = 638, + /// 5,25", M.O., RW/WORM, 936921 or 948770 sectors, 1024 bytes/sector, ECMA-195, ISO 13842 + ECMA_195 = 639, + /// 5,25", M.O., RW/WORM, 1644581 or 1647371 sectors, 512 bytes/sector, ECMA-195, ISO 13842 + ECMA_195_512 = 640, + /// 3,5", M.O., 446325 sectors, 512 bytes/sector, ECMA-201, ISO 13963 + ECMA_201 = 641, + /// 3,5", M.O., 429975 sectors, 512 bytes/sector, embossed, ISO 13963 + ECMA_201_ROM = 642, + /// 3,5", M.O., 371371 sectors, 1024 bytes/sector, ECMA-223 + ECMA_223 = 643, + /// 3,5", M.O., 694929 sectors, 512 bytes/sector, ECMA-223 + ECMA_223_512 = 644, + /// 5,25", M.O., 1244621 sectors, 1024 bytes/sector, ECMA-238, ISO 15486 + ECMA_238 = 645, + /// 3,5", M.O., 310352, 320332 or 321100 sectors, 2048 bytes/sector, ECMA-239, ISO 15498 + ECMA_239 = 646, + /// 356mm, M.O., 14476734 sectors, 1024 bytes/sector, ECMA-260, ISO 15898 + ECMA_260 = 647, + /// 356mm, M.O., 24445990 sectors, 1024 bytes/sector, ECMA-260, ISO 15898 + ECMA_260_Double = 648, + /// 5,25", M.O., 1128134 sectors, 2048 bytes/sector, ECMA-280, ISO 18093 + ECMA_280 = 649, + /// 300mm, M.O., 7355716 sectors, 2048 bytes/sector, ECMA-317, ISO 20162 + ECMA_317 = 650, + /// 5,25", M.O., 1095840 sectors, 4096 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart + ECMA_322 = 651, + /// 5,25", M.O., 2043664 sectors, 2048 bytes/sector, ECMA-322, ISO 22092, 8.6Gb/cart + ECMA_322_2k = 652, + /// 3,5", M.O., 605846 sectors, 2048 bytes/sector, Cherry Book, GigaMo, ECMA-351, ISO 17346 + GigaMo = 653, + /// 3,5", M.O., 1063146 sectors, 2048 bytes/sector, Cherry Book 2, GigaMo 2, ECMA-353, ISO 22533 + GigaMo2 = 654, + /// 5,25", M.O., 1263472 sectors, 2048 bytes/sector, ISO 15286, 5.2Gb/cart + ISO_15286 = 655, + /// 5,25", M.O., 2319786 sectors, 1024 bytes/sector, ISO 15286, 4.8Gb/cart + ISO_15286_1024 = 656, + /// 5,25", M.O., ??????? sectors, 512 bytes/sector, ISO 15286, 4.1Gb/cart + ISO_15286_512 = 657, + /// 5,25", M.O., 314569 sectors, 1024 bytes/sector, ISO 10089, 650Mb/cart + ISO_10089 = 658, + /// 5,25", M.O., ?????? sectors, 512 bytes/sector, ISO 10089, 594Mb/cart + ISO_10089_512 = 659, + +#endregion Magneto-optical, types 630 to 659 + +#region Other floppy standards, types 660 to 689 + + CompactFloppy = 660, + DemiDiskette = 661, + /// 3.5", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169 + Floptical = 662, + HiFD = 663, + QuickDisk = 664, + UHD144 = 665, + VideoFloppy = 666, + Wafer = 667, + ZXMicrodrive = 668, + /// 5.25", SS, DD, 77 tracks, 16 spt, 256 bytes/sector, MFM, 100 tpi, 300rpm + MetaFloppy_Mod_II = 669, + +#endregion Other floppy standards, types 660 to 669 + +#region Miscellaneous, types 670 to 689 + + 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, + +#endregion Miscellaneous, types 670 to 689 + +#region Apple specific media, types 690 to 699 + + AppleProfile = 690, + AppleWidget = 691, + AppleHD20 = 692, + PriamDataTower = 693, + Pippin = 694, + +#endregion Apple specific media, types 690 to 699 + +#region DEC hard disks, types 700 to 729 + + /// + /// 2382 cylinders, 4 tracks/cylinder, 42 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 204890112 bytes + /// + RA60 = 700, + /// + /// 546 cylinders, 14 tracks/cylinder, 31 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 121325568 bytes + /// + RA80 = 701, + /// + /// 1248 cylinders, 14 tracks/cylinder, 51 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 456228864 bytes + /// + RA81 = 702, + /// + /// 302 cylinders, 4 tracks/cylinder, 42 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 25976832 + /// bytes + /// + RC25 = 703, + /// + /// 615 cylinders, 4 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 21411840 + /// bytes + /// + RD31 = 704, + /// + /// 820 cylinders, 6 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 42823680 + /// bytes + /// + RD32 = 705, + /// + /// 306 cylinders, 4 tracks/cylinder, 17 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 10653696 + /// bytes + /// + RD51 = 706, + /// + /// 480 cylinders, 7 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 30965760 + /// bytes + /// + RD52 = 707, + /// + /// 1024 cylinders, 7 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 75497472 bytes + /// + RD53 = 708, + /// + /// 1225 cylinders, 8 tracks/cylinder, 18 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 159936000 bytes + /// + RD54 = 709, + /// + /// 411 cylinders, 3 tracks/cylinder, 22 sectors/track, 256 words/sector, 16 bits/word, 512 bytes/sector, 13888512 + /// bytes + /// + RK06 = 710, + /// + /// 411 cylinders, 3 tracks/cylinder, 20 sectors/track, 256 words/sector, 18 bits/word, 576 bytes/sector, 14204160 + /// bytes + /// + RK06_18 = 711, + /// + /// 815 cylinders, 3 tracks/cylinder, 22 sectors/track, 256 words/sector, 16 bits/word, 512 bytes/sector, 27540480 + /// bytes + /// + RK07 = 712, + /// + /// 815 cylinders, 3 tracks/cylinder, 20 sectors/track, 256 words/sector, 18 bits/word, 576 bytes/sector, 28166400 + /// bytes + /// + RK07_18 = 713, + /// + /// 823 cylinders, 5 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, 67420160 + /// 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, 19 tracks/cylinder, 32 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 256196608 bytes + /// + RM05 = 716, + /// + /// 203 cylinders, 10 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 22865920 bytes + /// + RP02 = 717, + /// + /// 203 cylinders, 10 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, + /// 23385600 bytes + /// + RP02_18 = 718, + /// + /// 400 cylinders, 10 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 45056000 bytes + /// + RP03 = 719, + /// + /// 400 cylinders, 10 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, + /// 46080000 bytes + /// + RP03_18 = 720, + /// + /// 411 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 87960576 bytes + /// + RP04 = 721, + /// + /// 411 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, + /// 89959680 bytes + /// + RP04_18 = 722, + /// + /// 411 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 87960576 bytes + /// + RP05 = 723, + /// + /// 411 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, + /// 89959680 bytes + /// + RP05_18 = 724, + /// + /// 815 cylinders, 19 tracks/cylinder, 22 sectors/track, 128 words/sector, 32 bits/word, 512 bytes/sector, + /// 174423040 bytes + /// + RP06 = 725, + /// + /// 815 cylinders, 19 tracks/cylinder, 20 sectors/track, 128 words/sector, 36 bits/word, 576 bytes/sector, + /// 178387200 bytes + /// + RP06_18 = 726, + +#endregion DEC hard disks, types 700 to 729 + +#region Imation, types 730 to 739 + + LS120 = 730, + LS240 = 731, + FD32MB = 732, + RDX = 733, + /// Imation 320Gb RDX + RDX320 = 734, + +#endregion Imation, types 730 to 739 + +#region VideoNow, types 740 to 749 + + VideoNow = 740, + VideoNowColor = 741, + VideoNowXp = 742, + +#endregion + +#region Iomega, types 750 to 759 + + /// 8"x11" Bernoulli Box disk with 10Mb capacity + Bernoulli10 = 750, + /// 8"x11" Bernoulli Box disk with 20Mb capacity + Bernoulli20 = 751, + /// 5⅓" Bernoulli Box II disk with 20Mb capacity + BernoulliBox2_20 = 752, + +#endregion Iomega, types 750 to 759 + +#region Kodak, types 760 to 769 + + KodakVerbatim3 = 760, + KodakVerbatim6 = 761, + KodakVerbatim12 = 762, + +#endregion Kodak, types 760 to 769 + +#region Sony and Panasonic Blu-ray derived, types 770 to 799 + + /// Professional Disc for video, single layer, rewritable, 23Gb + ProfessionalDisc = 770, + /// Professional Disc for video, dual layer, rewritable, 50Gb + ProfessionalDiscDual = 771, + /// Professional Disc for video, triple layer, rewritable, 100Gb + ProfessionalDiscTriple = 772, + /// Professional Disc for video, quad layer, write once, 128Gb + ProfessionalDiscQuad = 773, + /// Professional Disc for DATA, single layer, rewritable, 23Gb + PDD = 774, + /// Professional Disc for DATA, single layer, write once, 23Gb + PDD_WORM = 775, + /// Archival Disc, 1st gen., 300Gb + ArchivalDisc = 776, + /// Archival Disc, 2nd gen., 500Gb + ArchivalDisc2 = 777, + /// Archival Disc, 3rd gen., 1Tb + ArchivalDisc3 = 778, + /// Optical Disc archive, 1st gen., write once, 300Gb + ODC300R = 779, + /// Optical Disc archive, 1st gen., rewritable, 300Gb + ODC300RE = 780, + /// Optical Disc archive, 2nd gen., write once, 600Gb + ODC600R = 781, + /// Optical Disc archive, 2nd gen., rewritable, 600Gb + ODC600RE = 782, + /// Optical Disc archive, 3rd gen., rewritable, 1200Gb + ODC1200RE = 783, + /// Optical Disc archive, 3rd gen., write once, 1500Gb + ODC1500R = 784, + /// Optical Disc archive, 4th gen., write once, 3300Gb + ODC3300R = 785, + /// Optical Disc archive, 5th gen., write once, 5500Gb + ODC5500R = 786, + +#endregion Sony and Panasonic Blu-ray derived, types 770 to 799 + +#region Magneto-optical, types 800 to 819 + + /// 5,25", M.O., 4383356 sectors, 1024 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart + ECMA_322_1k = 800, + /// 5,25", M.O., ??????? sectors, 512 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart + ECMA_322_512 = 801, + /// 5,25", M.O., 1273011 sectors, 1024 bytes/sector, ISO 14517, 2.6Gb/cart + ISO_14517 = 802, + /// 5,25", M.O., 2244958 sectors, 512 bytes/sector, ISO 14517, 2.3Gb/cart + ISO_14517_512 = 803, + /// 3,5", M.O., 1041500 sectors, 512 bytes/sector, ISO 15041, 540Mb/cart + ISO_15041_512 = 804, + +#endregion Magneto-optical, types 800 to 819 + +#region More floppy formats, types 820 to deprecated + + /// 5.25", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, MFM, 48 tpi, ???rpm + MetaFloppy_Mod_I = 820, + /// HyperFlex (12Mb), 5.25", DS, 301 tracks, 78 spt, 256 bytes/sector, MFM, 333 tpi, 600rpm + HF12 = 823, + /// HyperFlex (24Mb), 5.25", DS, 506 tracks, 78 spt, 256 bytes/sector, MFM, 666 tpi, 720rpm + HF24 = 824, + +#endregion + + AtariLynxCard = 821, + AtariJaguarCartridge = 822 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaType.csv b/Aaru.CommonTypes/MediaType.csv new file mode 100644 index 000000000..154aa40ee --- /dev/null +++ b/Aaru.CommonTypes/MediaType.csv @@ -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", \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaTypeFromDevice/FromAta.cs b/Aaru.CommonTypes/MediaTypeFromDevice/FromAta.cs new file mode 100644 index 000000000..e794b34f2 --- /dev/null +++ b/Aaru.CommonTypes/MediaTypeFromDevice/FromAta.cs @@ -0,0 +1,72 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : FromAta.cs +// Author(s) : Natalia Portillo +// +// 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 +{ + /// Gets the media type from an ATA (not ATAPI) device + /// Manufacturer string + /// Model string + /// Is the device removable? + /// Does the device self-identify as CompactFlash? + /// Is the device attached thru PCMCIA or CardBus? + /// Number of blocks in device + /// The media type + 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; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaTypeFromDevice/FromMmc.cs b/Aaru.CommonTypes/MediaTypeFromDevice/FromMmc.cs new file mode 100644 index 000000000..2062a4f1c --- /dev/null +++ b/Aaru.CommonTypes/MediaTypeFromDevice/FromMmc.cs @@ -0,0 +1,186 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : FromMmc.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Gets the media type from a real device +public static partial class MediaTypeFromDevice +{ + /// Gets the media type from an SCSI MultiMedia Commands compliant device + /// Model string + /// Medium type from MODE SENSE + /// Density code from MODE SENSE + /// Number of blocks in media + /// Size of a block in bytes + /// Is the device USB attached + /// Is the media an optical disc + /// Media type + 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; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaTypeFromDevice/FromOdc.cs b/Aaru.CommonTypes/MediaTypeFromDevice/FromOdc.cs new file mode 100644 index 000000000..834edb69f --- /dev/null +++ b/Aaru.CommonTypes/MediaTypeFromDevice/FromOdc.cs @@ -0,0 +1,303 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : FromOdc.cs +// Author(s) : Natalia Portillo +// +// 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 +{ + /// Gets the device type from a SCSI Optical Device + /// Medium type from MODE SENSE + /// Number of blocks in device + /// Size in bytes of a block + /// Media type + 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; + } + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaTypeFromDevice/FromSbc.cs b/Aaru.CommonTypes/MediaTypeFromDevice/FromSbc.cs new file mode 100644 index 000000000..a474ff35a --- /dev/null +++ b/Aaru.CommonTypes/MediaTypeFromDevice/FromSbc.cs @@ -0,0 +1,827 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : FromSbc.cs +// Author(s) : Natalia Portillo +// +// 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 +{ + /// Gets the media type from a SCSI Block Commands compliant device + /// Vendor string + /// Model string + /// Medium type from MODE SENSE + /// Number of blocks in device + /// Size of a block in bytes + /// Media type + 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; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaTypeFromDevice/FromScsi.cs b/Aaru.CommonTypes/MediaTypeFromDevice/FromScsi.cs new file mode 100644 index 000000000..d34870594 --- /dev/null +++ b/Aaru.CommonTypes/MediaTypeFromDevice/FromScsi.cs @@ -0,0 +1,128 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : FromScsi.cs +// Author(s) : Natalia Portillo +// +// 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"; + + /// Tries to guess, from SCSI information, the media type of a device and/or its inserted media + /// The SCSI Peripheral Type as indicated in the INQUIRY response + /// The vendor string of the device + /// The model string of the device + /// The medium type byte from MODE SENSE + /// The density type byte from MODE SENSE + /// How many blocks are on the media + /// Size in bytes of each block + /// Device is USB + /// Is media an optical disc? + /// The media type + 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; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/MediaTypeFromDevice/FromSsc.cs b/Aaru.CommonTypes/MediaTypeFromDevice/FromSsc.cs new file mode 100644 index 000000000..ad361a1c3 --- /dev/null +++ b/Aaru.CommonTypes/MediaTypeFromDevice/FromSsc.cs @@ -0,0 +1,1541 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : FromSsc.cs +// Author(s) : Natalia Portillo +// +// 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 +{ + /// Gets the media type from an SCSI Streaming Commands compliant device + /// Vendor string + /// Model string + /// Medium type from MODE SENSE + /// Density code from MODE SENSE + /// Media type + public static MediaType GetFromSsc(string vendor, string model, byte mediumType, byte densityCode) + { + switch(mediumType) + { + case 0x00: + switch(densityCode) + { + case 0x04: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_QIC11, + mediumType, densityCode); + + return MediaType.QIC11; + case 0x05: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_QIC24, + mediumType, densityCode); + + return MediaType.QIC24; + case 0x09: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM3490, + mediumType, densityCode); + + return MediaType.IBM3490; + case 0x0F: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_QIC120, + mediumType, densityCode); + + return MediaType.QIC120; + case 0x10: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_QIC150, + mediumType, densityCode); + + return MediaType.QIC150; + case 0x13: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS, + mediumType, densityCode); + + return MediaType.DDS1; + case 0x24: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS2, + mediumType, densityCode); + + return MediaType.DDS2; + case 0x25: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS3, + mediumType, densityCode); + + return MediaType.DDS3; + case 0x26: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS4, + mediumType, densityCode); + + return MediaType.DDS4; + case 0x28: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM3490E, + mediumType, densityCode); + + return MediaType.IBM3490E; + case 0x40: + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO_ult, + mediumType, densityCode); + + return MediaType.LTO; + } + + if(model.StartsWith("sdz", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SAIT, + mediumType, densityCode); + + return MediaType.SAIT1; + } + + break; + + case 0x41: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO2_ult, + mediumType, densityCode); + + return MediaType.LTO2; + } + + break; + } + + case 0x42: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO2_ult, + mediumType, densityCode); + + return MediaType.LTO2; + } + + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T9840A, + mediumType, densityCode); + + return MediaType.T9840A; + } + + break; + } + + case 0x43: + { + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T9940A, + mediumType, densityCode); + + return MediaType.T9940A; + } + + break; + } + + case 0x44: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO3, + mediumType, densityCode); + + return MediaType.LTO3; + } + + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T9940B, + mediumType, densityCode); + + return MediaType.T9940B; + } + + break; + } + + case 0x45: + { + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T9940C, + mediumType, densityCode); + + return MediaType.T9840C; + } + + break; + } + + case 0x46: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO4, + mediumType, densityCode); + + return MediaType.LTO4; + } + + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T9840D, + mediumType, densityCode); + + return MediaType.T9840D; + } + + break; + } + + case 0x4A: + { + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T10000A, + mediumType, densityCode); + + return MediaType.T10000A; + } + + break; + } + + case 0x4B: + { + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T10000B, + mediumType, densityCode); + + return MediaType.T10000B; + } + + break; + } + + case 0x4C: + { + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T10000C, + mediumType, densityCode); + + return MediaType.T10000C; + } + + break; + } + + case 0x4D: + { + if(vendor.Equals("stk", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_T10000D, + mediumType, densityCode); + + return MediaType.T10000D; + } + + break; + } + + case 0x58: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO5, + mediumType, densityCode); + + return MediaType.LTO5; + } + + break; + } + + // Used by some HP drives for all generations + case 0x8C: + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS, + mediumType, densityCode); + + return MediaType.DDS1; + } + } + + break; + case 0x01: + { + switch(densityCode) + { + case 0x44: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_LTO3, + mediumType, densityCode); + + return MediaType.LTO3WORM; + } + + break; + } + + case 0x46: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_LTO4, + mediumType, densityCode); + + return MediaType.LTO4WORM; + } + + break; + } + + case 0x58: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_LTO5, + mediumType, densityCode); + + return MediaType.LTO5WORM; + } + + break; + } + } + } + + break; + case 0x18: + { + switch(densityCode) + { + case 0x00: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO_ult, + mediumType, densityCode); + + return MediaType.LTO; + } + + break; + } + + case 0x40: + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO, + mediumType, densityCode); + + return MediaType.LTO; + } + } + } + + break; + case 0x28: + { + switch(densityCode) + { + case 0x00: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO2_ult, + mediumType, densityCode); + + return MediaType.LTO2; + } + + break; + } + + case 0x42: + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO2, + mediumType, densityCode); + + return MediaType.LTO2; + } + } + } + + break; + case 0x33: + { + switch(densityCode) + { + case 0x00: + case 0x25: + { + if(model.StartsWith("dat", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS3_dat, + mediumType, densityCode); + + return MediaType.DDS3; + } + + break; + } + } + } + + break; + case 0x34: + { + switch(densityCode) + { + case 0x00: + case 0x26: + { + if(model.StartsWith("dat", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS4_alt, + mediumType, densityCode); + + return MediaType.DDS4; + } + + break; + } + } + } + + break; + case 0x35: + { + switch(densityCode) + { + case 0x00: + case 0x47: + { + if(model.StartsWith("dat", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DAT72_dat, + mediumType, densityCode); + + return MediaType.DAT72; + } + + break; + } + } + } + + break; + case 0x38: + { + switch(densityCode) + { + case 0x00: + case 0x44: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO3, + mediumType, densityCode); + + return MediaType.LTO3; + } + + break; + } + } + } + + break; + case 0x3C: + { + switch(densityCode) + { + case 0x00: + case 0x44: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_LTO3, + mediumType, densityCode); + + return MediaType.LTO3WORM; + } + + break; + } + } + } + + break; + case 0x48: + { + switch(densityCode) + { + case 0x00: + case 0x46: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO4, + mediumType, densityCode); + + return MediaType.LTO4; + } + + break; + } + } + } + + break; + case 0x4C: + { + switch(densityCode) + { + case 0x00: + case 0x46: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_LTO4, + mediumType, densityCode); + + return MediaType.LTO4WORM; + } + + break; + } + } + } + + break; + case 0x50: + { + switch(densityCode) + { + case 0x00: + case 0x24: + { + if(model.StartsWith("dat", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DDS2_dat, + mediumType, densityCode); + + return MediaType.DDS2; + } + + break; + } + } + } + + break; + case 0x58: + { + switch(densityCode) + { + case 0x00: + case 0x58: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO5, + mediumType, densityCode); + + return MediaType.LTO5; + } + + break; + } + } + } + + break; + case 0x5C: + { + switch(densityCode) + { + case 0x00: + case 0x58: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_WORM_LTO5, + mediumType, densityCode); + + return MediaType.LTO5WORM; + } + + break; + } + } + } + + break; + case 0x68: + { + switch(densityCode) + { + case 0x00: + case 0x5A: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO6_ult, + mediumType, densityCode); + + return MediaType.LTO6; + } + + break; + } + } + } + + break; + case 0x6C: + { + switch(densityCode) + { + case 0x00: + case 0x5A: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_WORM_LTO6_ult, + mediumType, densityCode); + + return MediaType.LTO6WORM; + } + + break; + } + } + } + + break; + case 0x78: + { + switch(densityCode) + { + case 0x00: + case 0x5C: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_LTO7_ult, + mediumType, densityCode); + + return MediaType.LTO7; + } + + break; + } + } + } + + break; + case 0x7C: + { + switch(densityCode) + { + case 0x00: + case 0x5C: + { + if(model.StartsWith("ult", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_WORM_LTO7_ult, + mediumType, densityCode); + + return MediaType.LTO7WORM; + } + + break; + } + } + } + + break; + case 0x81: + { + switch(densityCode) + { + case 0x00: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_15m, mediumType, + densityCode); + + return MediaType.Exatape15m; + } + + if(vendor.Equals("ibm", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM3592, + mediumType, densityCode); + + return MediaType.IBM3592; + } + + if(model.StartsWith("vxa", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_VXA, + mediumType, densityCode); + + return MediaType.VXA1; + } + + break; + } + + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_15m, mediumType, + densityCode); + + return MediaType.Exatape15m; + } + + break; + } + + case 0x29: + case 0x2A: + { + if(vendor.Equals("ibm", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM3592, + mediumType, densityCode); + + return MediaType.IBM3592; + } + + break; + } + + case 0x80: + { + if(model.StartsWith("vxa", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_VXA, + mediumType, densityCode); + + return MediaType.VXA1; + } + + break; + } + } + } + + break; + case 0x82: + { + switch(densityCode) + { + case 0x00: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_28m, mediumType, + densityCode); + + return MediaType.Exatape28m; + } + + if(vendor.Equals("ibm", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM3592, + mediumType, densityCode); + + return MediaType.IBM3592; + } + + break; + } + + case 0x0A: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_CompactTape, mediumType, + densityCode); + + return MediaType.CompactTapeI; + } + + break; + } + + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_28m, mediumType, + densityCode); + + return MediaType.Exatape28m; + } + + break; + } + + case 0x16: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_CompactTapeII, + mediumType, densityCode); + + return MediaType.CompactTapeII; + } + + break; + } + + case 0x29: + case 0x2A: + { + if(vendor.Equals("ibm", StringComparison.InvariantCultureIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_IBM3592, + mediumType, densityCode); + + return MediaType.IBM3592; + } + + break; + } + + case 0x81: + { + if(model.StartsWith("vxa", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_VXA2, + mediumType, densityCode); + + return MediaType.VXA2; + } + + break; + } + + case 0x82: + { + if(model.StartsWith("vxa", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_VXA3, + mediumType, densityCode); + + return MediaType.VXA3; + } + + break; + } + } + } + + break; + case 0x83: + { + switch(densityCode) + { + case 0x00: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_54m, mediumType, + densityCode); + + return MediaType.Exatape54m; + } + + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DLTtapeIII, + mediumType, densityCode); + + return MediaType.DLTtapeIII; + } + + break; + } + + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_54m, mediumType, + densityCode); + + return MediaType.Exatape54m; + } + + break; + } + + case 0x17: + case 0x18: + case 0x19: + case 0x80: + case 0x81: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DLTtapeIII, + mediumType, densityCode); + + return MediaType.DLTtapeIII; + } + + break; + } + } + } + + break; + case 0x84: + { + switch(densityCode) + { + case 0x00: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_80m, mediumType, + densityCode); + + return MediaType.Exatape80m; + } + + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_DLTtapeIIIxt, + mediumType, densityCode); + + return MediaType.DLTtapeIIIxt; + } + + break; + } + + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_80m, mediumType, + densityCode); + + return MediaType.Exatape80m; + } + + break; + } + + case 0x19: + case 0x80: + case 0x81: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_DLTtapeIIIxt, + mediumType, densityCode); + + return MediaType.DLTtapeIIIxt; + } + + break; + } + } + } + + break; + case 0x85: + { + switch(densityCode) + { + case 0x00: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_106m, + mediumType, densityCode); + + return MediaType.Exatape106m; + } + + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("sdlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("superdlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DLTtapeIV, + mediumType, densityCode); + + return MediaType.DLTtapeIV; + } + + if(model.StartsWith("stt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Travan5_stt, mediumType, + densityCode); + + return MediaType.Travan5; + } + + break; + } + + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_106m, + mediumType, densityCode); + + return MediaType.Exatape106m; + } + + break; + } + + case 0x1A: + case 0x1B: + case 0x40: + case 0x41: + case 0x82: + case 0x83: + case 0x84: + case 0x85: + case 0x86: + case 0x87: + case 0x88: + case 0x89: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("sdlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("superdlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_DLTtapeIV, + mediumType, densityCode); + + return MediaType.DLTtapeIV; + } + + break; + } + + case 0x46: + { + if(model.StartsWith("stt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Travan5_stt, mediumType, + densityCode); + + return MediaType.Travan5; + } + + break; + } + } + } + + break; + case 0x86: + { + switch(densityCode) + { + case 0x00: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_160m, + mediumType, densityCode); + + return MediaType.Exatape160mXL; + } + + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("sdlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("superdlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SDLT, + mediumType, densityCode); + + return MediaType.SDLT1; + } + + break; + } + + case 0x8C: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_160m, + mediumType, densityCode); + + return MediaType.Exatape160mXL; + } + + break; + } + + case 0x91: + case 0x92: + case 0x93: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("sdlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("superdlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SDLT, + mediumType, densityCode); + + return MediaType.SDLT1; + } + + break; + } + } + } + + break; + case 0x87: + { + switch(densityCode) + { + case 0x00: + case 0x4A: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("sdlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("superdlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_SDLT2, + mediumType, densityCode); + + return MediaType.SDLT2; + } + + break; + } + } + } + + break; + case 0x90: + { + switch(densityCode) + { + case 0x00: + case 0x50: + case 0x98: + case 0x99: + { + if(model.StartsWith("dlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("sdlt", StringComparison.OrdinalIgnoreCase) || + model.StartsWith("superdlt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_VStape, + mediumType, densityCode); + + return MediaType.VStapeI; + } + + break; + } + } + } + + break; + case 0x95: + { + if(model.StartsWith("stt", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Travan7, + mediumType, densityCode); + + return MediaType.Travan7; + } + } + + break; + case 0xB6: + { + switch(densityCode) + { + case 0x45: + // HP Colorado tapes have a different capacity but return same density code at least in Seagate drives + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Travan4, + mediumType, densityCode); + + return MediaType.Travan4; + } + } + + break; + case 0xB7: + { + switch(densityCode) + { + case 0x47: + AaruConsole.DebugWriteLine(MODULE_NAME, Localization.SCSI_Media_Type_Description_Travan5, + mediumType, densityCode); + + return MediaType.Travan5; + } + } + + break; + case 0xC1: + { + switch(densityCode) + { + case 0x00: + case 0x14: + case 0x15: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_22m, mediumType, + densityCode); + + return MediaType.Exatape22m; + } + + break; + } + } + } + + break; + case 0xC2: + { + switch(densityCode) + { + case 0x00: + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_40m, mediumType, + densityCode); + + return MediaType.Exatape40m; + } + + break; + } + } + } + + break; + case 0xC3: + { + switch(densityCode) + { + case 0x00: + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_76m, mediumType, + densityCode); + + return MediaType.Exatape76m; + } + + break; + } + } + } + + break; + case 0xC4: + { + switch(densityCode) + { + case 0x00: + case 0x14: + case 0x15: + case 0x27: + case 0x8C: + case 0x90: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_112m, + mediumType, densityCode); + + return MediaType.Exatape112m; + } + + break; + } + } + } + + break; + case 0xD1: + { + switch(densityCode) + { + case 0x00: + case 0x27: + case 0x28: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_22m_AME, + mediumType, densityCode); + + return MediaType.Exatape22mAME; + } + + break; + } + } + } + + break; + case 0xD2: + { + switch(densityCode) + { + case 0x00: + case 0x27: + case 0x28: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_170m, + mediumType, densityCode); + + return MediaType.Exatape170m; + } + + break; + } + } + } + + break; + case 0xD3: + { + switch(densityCode) + { + case 0x00: + case 0x27: + case 0x28: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_125m, + mediumType, densityCode); + + return MediaType.Exatape125m; + } + + break; + } + } + } + + break; + case 0xD4: + { + switch(densityCode) + { + case 0x00: + case 0x27: + case 0x28: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_45m, mediumType, + densityCode); + + return MediaType.Exatape45m; + } + + break; + } + } + } + + break; + case 0xD5: + { + switch(densityCode) + { + case 0x00: + case 0x27: + case 0x28: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_225m, + mediumType, densityCode); + + return MediaType.Exatape225m; + } + + break; + } + } + } + + break; + case 0xD6: + { + switch(densityCode) + { + case 0x00: + case 0x27: + case 0x28: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_150m, + mediumType, densityCode); + + return MediaType.Exatape150m; + } + + break; + } + } + } + + break; + case 0xD7: + { + switch(densityCode) + { + case 0x00: + case 0x27: + case 0x28: + { + if(model.StartsWith("exb", StringComparison.OrdinalIgnoreCase)) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.SCSI_Media_Type_Description_Exatape_75m, mediumType, + densityCode); + + return MediaType.Exatape75m; + } + + break; + } + } + } + + break; + } + + return MediaType.Unknown; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Metadata/CdOffset.cs b/Aaru.CommonTypes/Metadata/CdOffset.cs new file mode 100644 index 000000000..2f3ab2517 --- /dev/null +++ b/Aaru.CommonTypes/Metadata/CdOffset.cs @@ -0,0 +1,61 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : CdOffset.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Describes CD reading offset +public class CdOffset +{ + /// Drive manufacturer + public string Manufacturer { get; set; } + + /// Drive model + public string Model { get; set; } + + /// Reading offset + public short Offset { get; set; } + + /// Number of times this offset has been submitted + public int Submissions { get; set; } + + /// Percentage of submissions in agreement with this offset + [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:P0}")] + public float Agreement { get; set; } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Metadata/DeviceReport.cs b/Aaru.CommonTypes/Metadata/DeviceReport.cs new file mode 100644 index 000000000..cfc0b3136 --- /dev/null +++ b/Aaru.CommonTypes/Metadata/DeviceReport.cs @@ -0,0 +1,1533 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : DeviceReport.cs +// Author(s) : Natalia Portillo +// +// Component : JSON metadata. +// +// --[ Description ] ---------------------------------------------------------- +// +// Contains classes for a JSON device report. +// +// --[ 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 +// ****************************************************************************/ + +// TODO: Re-enable CS1591 in this file + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; +using Aaru.CommonTypes.Enums; +using Aaru.CommonTypes.Structs.Devices.ATA; +using Aaru.CommonTypes.Structs.Devices.SCSI; +using Aaru.CommonTypes.Structs.Devices.SCSI.Modes; + +#pragma warning disable 1591 + +// ReSharper disable VirtualMemberNeverOverridden.Global +// ReSharper disable VirtualMemberCallInConstructor +// ReSharper disable UnusedMember.Global +// ReSharper disable InconsistentNaming +// ReSharper disable UnusedAutoPropertyAccessor.Global + +namespace Aaru.CommonTypes.Metadata; + +// ReSharper disable once PartialTypeWithSinglePart +[JsonSourceGenerationOptions(WriteIndented = true, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, + IncludeFields = true)] +[JsonSerializable(typeof(DeviceReport))] +public partial class DeviceReportContext : JsonSerializerContext; + +public class DeviceReport +{ + [JsonIgnore] + public int Id { get; set; } + + public virtual Usb USB { get; set; } + public virtual FireWire FireWire { get; set; } + public virtual Pcmcia PCMCIA { get; set; } + public bool CompactFlash { get; set; } + public virtual Ata ATA { get; set; } + public virtual Ata ATAPI { get; set; } + public virtual Scsi SCSI { get; set; } + public virtual MmcSd MultiMediaCard { get; set; } + public virtual MmcSd SecureDigital { get; set; } + public virtual GdRomSwapDiscCapabilities GdRomSwapDiscCapabilities { get; set; } + + public string Manufacturer { get; set; } + public string Model { get; set; } + public string Revision { get; set; } + public DeviceType Type { get; set; } +} + +public class Usb +{ + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("Vendor ID")] + [DisplayFormat(DataFormatString = "0x{0:X4}")] + public ushort VendorID { get; set; } + + [DisplayName("Product ID")] + [DisplayFormat(DataFormatString = "0x{0:X4}")] + public ushort ProductID { get; set; } + + public string Manufacturer { get; set; } + public string Product { get; set; } + + [DisplayName("Removable media")] + public bool RemovableMedia { get; set; } + + public byte[] Descriptors { get; set; } +} + +public class FireWire +{ + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("Vendor ID")] + [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0x{0:X8}")] + public uint VendorID { get; set; } + + [DisplayName("Product ID")] + [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "0x{0:X8}")] + public uint ProductID { get; set; } + + [DisplayFormat(NullDisplayText = "Unknown")] + public string Manufacturer { get; set; } + + [DisplayFormat(NullDisplayText = "Unknown")] + public string Product { get; set; } + + [DisplayName("Is media removable?")] + public bool RemovableMedia { get; set; } +} + +public class Ata +{ + public Identify.IdentifyDevice? IdentifyDevice => Structs.Devices.ATA.Identify.Decode(Identify); + + [JsonIgnore] + public int Id { get; set; } + + public byte[] Identify { get; set; } + public virtual TestedMedia ReadCapabilities { get; set; } + public virtual List RemovableMedias { get; set; } +} + +public class Chs +{ + [JsonIgnore] + public int Id { get; set; } + + public ushort Cylinders { get; set; } + public ushort Heads { get; set; } + public ushort Sectors { get; set; } +} + +public class Scsi +{ + public Inquiry? Inquiry => Structs.Devices.SCSI.Inquiry.Decode(InquiryData); + + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("Data from INQUIRY command")] + public byte[] InquiryData { get; set; } + + public virtual List EVPDPages { get; set; } + + [DisplayName("Supports MODE SENSE(6)")] + public bool SupportsModeSense6 { get; set; } + + [DisplayName("Supports MODE SENSE(10)")] + public bool SupportsModeSense10 { get; set; } + + [DisplayName("Supports MODE SENSE with subpages")] + public bool SupportsModeSubpages { get; set; } + + public virtual ScsiMode ModeSense { get; set; } + public virtual Mmc MultiMediaDevice { get; set; } + public virtual TestedMedia ReadCapabilities { get; set; } + public virtual List RemovableMedias { get; set; } + public virtual Ssc SequentialDevice { get; set; } + + [DisplayName("Data from MODE SENSE(6) command")] + public byte[] ModeSense6Data { get; set; } + + [DisplayName("Data from MODE SENSE(10) command")] + public byte[] ModeSense10Data { get; set; } + + [DisplayName("Data from MODE SENSE(6) command (current)")] + public byte[] ModeSense6CurrentData { get; set; } + + [DisplayName("Data from MODE SENSE(10) command (current)")] + public byte[] ModeSense10CurrentData { get; set; } + + [DisplayName("Data from MODE SENSE(6) command (changeable)")] + public byte[] ModeSense6ChangeableData { get; set; } + + [DisplayName("Data from MODE SENSE(10) command (changeable)")] + public byte[] ModeSense10ChangeableData { get; set; } + + [JsonIgnore] + public int? SequentialDeviceId { get; set; } +} + +public class ScsiMode +{ + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("Medium type code")] + public byte? MediumType { get; set; } + + [DisplayName("Write protected")] + public bool WriteProtected { get; set; } + + public virtual List BlockDescriptors { get; set; } + public byte? Speed { get; set; } + + [DisplayName("Buffered mode")] + public byte? BufferedMode { get; set; } + + [DisplayName("Blank check enabled")] + public bool BlankCheckEnabled { get; set; } + + [DisplayName("DPO and FUA")] + public bool DPOandFUA { get; set; } + + public virtual List ModePages { get; set; } +} + +public class BlockDescriptor +{ + [JsonIgnore] + public int Id { get; set; } + + public byte Density { get; set; } + public ulong? Blocks { get; set; } + + [DisplayName("Block length (bytes)")] + public uint? BlockLength { get; set; } +} + +public class ScsiPage +{ + [JsonIgnore] + public int Id { get; set; } + + public byte page { get; set; } + public byte? subpage { get; set; } + public byte[] value { get; set; } +} + +public class Mmc +{ + [JsonIgnore] + public int Id { get; set; } + + public virtual ModePage_2A ModeSense2A => ModePage_2A.Decode(ModeSense2AData); + public virtual MmcFeatures Features { get; set; } + public virtual List TestedMedia { get; set; } + public byte[] ModeSense2AData { get; set; } + + [JsonIgnore] + public int? FeaturesId { get; set; } +} + +public class MmcFeatures +{ + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("AACS version")] + public byte? AACSVersion { get; set; } + + [DisplayName("AGIDs")] + public byte? AGIDs { get; set; } + + [DisplayName("Binding nonce blocks")] + public byte? BindingNonceBlocks { get; set; } + + [DisplayName("Blocks per readable unit")] + public ushort? BlocksPerReadableUnit { get; set; } + + [DisplayName("Buffer under-run free in DVD writing")] + public bool BufferUnderrunFreeInDVD { get; set; } + + [DisplayName("Buffer under-run free in SAO writing")] + public bool BufferUnderrunFreeInSAO { get; set; } + + [DisplayName("Buffer under-run free in TAO writing")] + public bool BufferUnderrunFreeInTAO { get; set; } + + [DisplayName("Can audio scan")] + public bool CanAudioScan { get; set; } + + [DisplayName("Can eject")] + public bool CanEject { get; set; } + + [DisplayName("Can erase sectors")] + public bool CanEraseSector { get; set; } + + [DisplayName("Can expand BD-RE spare area")] + public bool CanExpandBDRESpareArea { get; set; } + + [DisplayName("Can format media")] + public bool CanFormat { get; set; } + + [DisplayName("Can format BD-RE without spare area")] + public bool CanFormatBDREWithoutSpare { get; set; } + + [DisplayName("Can do a fully certified format")] + public bool CanFormatCert { get; set; } + + [DisplayName("Can do a FRF format")] + public bool CanFormatFRF { get; set; } + + [DisplayName("Can do a quick certified format")] + public bool CanFormatQCert { get; set; } + + [DisplayName("Can do a RRM format")] + public bool CanFormatRRM { get; set; } + + [DisplayName("Can generate binding nonce")] + public bool CanGenerateBindingNonce { get; set; } + + [DisplayName("Can load")] + public bool CanLoad { get; set; } + + [DisplayName("Can mute separate channels")] + public bool CanMuteSeparateChannels { get; set; } + + [DisplayName("Can overwrite track in SAO")] + public bool CanOverwriteSAOTrack { get; set; } + + [DisplayName("Can overwrite track in TAO")] + public bool CanOverwriteTAOTrack { get; set; } + + [DisplayName("Can play CD-DA")] + public bool CanPlayCDAudio { get; set; } + + [DisplayName("Can pseudo-overwrite BD-R")] + public bool CanPseudoOverwriteBDR { get; set; } + + [DisplayName("Can read all dual-layer recordables")] + public bool CanReadAllDualR { get; set; } + + [DisplayName("Can read all dual-layer rewritables")] + public bool CanReadAllDualRW { get; set; } + + [DisplayName("Can read Blu-ray")] + public bool CanReadBD { get; set; } + + [DisplayName("Can read BD-R")] + public bool CanReadBDR { get; set; } + + [DisplayName("Can read BD-RE v1")] + public bool CanReadBDRE1 { get; set; } + + [DisplayName("Can read BD-RE v2")] + public bool CanReadBDRE2 { get; set; } + + [DisplayName("Can read BD-ROM")] + public bool CanReadBDROM { get; set; } + + [DisplayName("Can read BCA from Blu-ray")] + public bool CanReadBluBCA { get; set; } + + [DisplayName("Can read CD")] + public bool CanReadCD { get; set; } + + [DisplayName("Can read CD-MRW")] + public bool CanReadCDMRW { get; set; } + + [DisplayName("Can read CPRM's MKB")] + public bool CanReadCPRM_MKB { get; set; } + + [DisplayName("Can read DDCD")] + public bool CanReadDDCD { get; set; } + + [DisplayName("Can read DVD")] + public bool CanReadDVD { get; set; } + + [DisplayName("Can read DVD+MRW")] + public bool CanReadDVDPlusMRW { get; set; } + + [DisplayName("Can read DVD+R")] + public bool CanReadDVDPlusR { get; set; } + + [DisplayName("Can read DVD+R DL")] + public bool CanReadDVDPlusRDL { get; set; } + + [DisplayName("Can read DVD+RW")] + public bool CanReadDVDPlusRW { get; set; } + + [DisplayName("Can read DVD+RW DL")] + public bool CanReadDVDPlusRWDL { get; set; } + + [DisplayName("Can read drive's AACS certificate")] + public bool CanReadDriveAACSCertificate { get; set; } + + [DisplayName("Can read HD DVD")] + public bool CanReadHDDVD { get; set; } + + [DisplayName("Can read HD DVD-R")] + public bool CanReadHDDVDR { get; set; } + + [DisplayName("Can read HD DVD-RAM")] + public bool CanReadHDDVDRAM { get; set; } + + [DisplayName("Can read Lead-In's CD-TEXT")] + public bool CanReadLeadInCDText { get; set; } + + [DisplayName("Can read old generation BD-R")] + public bool CanReadOldBDR { get; set; } + + [DisplayName("Can read old generation BD-RE")] + public bool CanReadOldBDRE { get; set; } + + [DisplayName("Can read old generation BD-ROM")] + public bool CanReadOldBDROM { get; set; } + + [DisplayName("Can read spare area information")] + public bool CanReadSpareAreaInformation { get; set; } + + [DisplayName("Can report drive serial number")] + public bool CanReportDriveSerial { get; set; } + + [DisplayName("Can report media serial number")] + public bool CanReportMediaSerial { get; set; } + + [DisplayName("Can test write DDCD-R")] + public bool CanTestWriteDDCDR { get; set; } + + [DisplayName("Can test write DVD")] + public bool CanTestWriteDVD { get; set; } + + [DisplayName("Can test write in SAO mode")] + public bool CanTestWriteInSAO { get; set; } + + [DisplayName("Can test write in TAO mode")] + public bool CanTestWriteInTAO { get; set; } + + [DisplayName("Can upgrade firmware")] + public bool CanUpgradeFirmware { get; set; } + + [DisplayName("Can write Blu-ray")] + public bool CanWriteBD { get; set; } + + [DisplayName("Can write BD-R")] + public bool CanWriteBDR { get; set; } + + [DisplayName("Can write BD-RE v1")] + public bool CanWriteBDRE1 { get; set; } + + [DisplayName("Can write BD-RE v2")] + public bool CanWriteBDRE2 { get; set; } + + [DisplayName("Can write bus encrypted blocks")] + public bool CanWriteBusEncryptedBlocks { get; set; } + + [DisplayName("Can write CD-MRW")] + public bool CanWriteCDMRW { get; set; } + + [DisplayName("Can write CD-RW")] + public bool CanWriteCDRW { get; set; } + + [DisplayName("Can write CD-RW CAV")] + public bool CanWriteCDRWCAV { get; set; } + + [DisplayName("Can write CD in SAO mode")] + public bool CanWriteCDSAO { get; set; } + + [DisplayName("Can write CD in TAO mode")] + public bool CanWriteCDTAO { get; set; } + + [DisplayName("Can write CSS managed DVD")] + public bool CanWriteCSSManagedDVD { get; set; } + + [DisplayName("Can write DDCD-R")] + public bool CanWriteDDCDR { get; set; } + + [DisplayName("Can write DDCD-RW")] + public bool CanWriteDDCDRW { get; set; } + + [DisplayName("Can write DVD+MRW")] + public bool CanWriteDVDPlusMRW { get; set; } + + [DisplayName("Can write DVD+R")] + public bool CanWriteDVDPlusR { get; set; } + + [DisplayName("Can write DVD+R DL")] + public bool CanWriteDVDPlusRDL { get; set; } + + [DisplayName("Can write DVD+RW")] + public bool CanWriteDVDPlusRW { get; set; } + + [DisplayName("Can write DVD+RW DL")] + public bool CanWriteDVDPlusRWDL { get; set; } + + [DisplayName("Can write DVD-R")] + public bool CanWriteDVDR { get; set; } + + [DisplayName("Can write DVD-R DL")] + public bool CanWriteDVDRDL { get; set; } + + [DisplayName("Can write DVD-RW")] + public bool CanWriteDVDRW { get; set; } + + [DisplayName("Can write HD DVD-R")] + public bool CanWriteHDDVDR { get; set; } + + [DisplayName("Can write HD DVD-RAM")] + public bool CanWriteHDDVDRAM { get; set; } + + [DisplayName("Can write old generation BD-R")] + public bool CanWriteOldBDR { get; set; } + + [DisplayName("Can write old generation BD-RE")] + public bool CanWriteOldBDRE { get; set; } + + [DisplayName("Can write packet subchannel in TAO")] + public bool CanWritePackedSubchannelInTAO { get; set; } + + [DisplayName("Can write RW subchannel in SAO")] + public bool CanWriteRWSubchannelInSAO { get; set; } + + [DisplayName("Can write RW subchannel in TAO")] + public bool CanWriteRWSubchannelInTAO { get; set; } + + [DisplayName("Can write RAW-96 sectors")] + public bool CanWriteRaw { get; set; } + + [DisplayName("Can write RAW-96 sectors in multisession")] + public bool CanWriteRawMultiSession { get; set; } + + [DisplayName("Can write RAW-96 sectors in TAO")] + public bool CanWriteRawSubchannelInTAO { get; set; } + + [DisplayName("Changer is side change capable")] + public bool ChangerIsSideChangeCapable { get; set; } + + [DisplayName("Changer slots")] + public byte ChangerSlots { get; set; } + + [DisplayName("Changer supports disc present")] + public bool ChangerSupportsDiscPresent { get; set; } + + [DisplayName("CPRM version")] + public byte? CPRMVersion { get; set; } + + [DisplayName("CSS version")] + public byte? CSSVersion { get; set; } + + [DisplayName("DBML")] + public bool DBML { get; set; } + + [DisplayName("DVD Multi-Read Specification")] + public bool DVDMultiRead { get; set; } + + [DisplayName("Has an embedded changer")] + public bool EmbeddedChanger { get; set; } + + [DisplayName("Has error recovery page")] + public bool ErrorRecoveryPage { get; set; } + + [DisplayName("Firmware date")] + public DateTime? FirmwareDate { get; set; } + + [DisplayName("Loading mechanism type")] + public byte? LoadingMechanismType { get; set; } + + [DisplayName("Locked")] + public bool Locked { get; set; } + + [DisplayName("Logical block size")] + public uint? LogicalBlockSize { get; set; } + + [DisplayName("Multi-Read Specification")] + public bool MultiRead { get; set; } + + [DisplayName("Physical interface standard")] + public PhysicalInterfaces? PhysicalInterfaceStandard => (PhysicalInterfaces?)PhysicalInterfaceStandardNumber; + + [DisplayName("Physical interface standard number")] + public uint? PhysicalInterfaceStandardNumber { get; set; } + + [DisplayName("Prevent eject jumper")] + public bool PreventJumper { get; set; } + + [DisplayName("Supports AACS")] + public bool SupportsAACS { get; set; } + + [DisplayName("Supports bus encryption")] + public bool SupportsBusEncryption { get; set; } + + [DisplayName("Supports C2 pointers")] + public bool SupportsC2 { get; set; } + + [DisplayName("Supports CPRM")] + public bool SupportsCPRM { get; set; } + + [DisplayName("Supports CSS")] + public bool SupportsCSS { get; set; } + + [DisplayName("Supports DAP")] + public bool SupportsDAP { get; set; } + + [DisplayName("Supports device busy event")] + public bool SupportsDeviceBusyEvent { get; set; } + + [DisplayName("Supports hybrid discs")] + public bool SupportsHybridDiscs { get; set; } + + [DisplayName("Supports MODE PAGE 1Ch")] + public bool SupportsModePage1Ch { get; set; } + + [DisplayName("Supports OSSC")] + public bool SupportsOSSC { get; set; } + + [DisplayName("Supports PWP")] + public bool SupportsPWP { get; set; } + + [DisplayName("Supports SWPP")] + public bool SupportsSWPP { get; set; } + + [DisplayName("Supports SecurDisc")] + public bool SupportsSecurDisc { get; set; } + + [DisplayName("Support separate volume levels")] + public bool SupportsSeparateVolume { get; set; } + + [DisplayName("Supports VCPS")] + public bool SupportsVCPS { get; set; } + + [DisplayName("Supports write inhibit DCB")] + public bool SupportsWriteInhibitDCB { get; set; } + + [DisplayName("Supports write protect PAC")] + public bool SupportsWriteProtectPAC { get; set; } + + [DisplayName("Volume levels")] + public ushort? VolumeLevels { get; set; } + + [DisplayName("MMC FEATURES binary data")] + public byte[] BinaryData { get; set; } +} + +public class TestedMedia +{ + public Identify.IdentifyDevice? IdentifyDevice; + + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("IDENTIFY DEVICE data")] + public byte[] IdentifyData { get; set; } + + [DisplayName("Blocks")] + public ulong? Blocks { get; set; } + + [DisplayName("Bytes per block")] + public uint? BlockSize { get; set; } + + [DisplayName("Can read AACS")] + public bool? CanReadAACS { get; set; } + + [DisplayName("Can read ADIP")] + public bool? CanReadADIP { get; set; } + + [DisplayName("Can read ATIP")] + public bool? CanReadATIP { get; set; } + + [DisplayName("Can read BCA")] + public bool? CanReadBCA { get; set; } + + [DisplayName("Can read C2 pointers")] + public bool? CanReadC2Pointers { get; set; } + + [DisplayName("Can read Copyright Management Information")] + public bool? CanReadCMI { get; set; } + + [DisplayName("Can read corrected subchannel")] + public bool? CanReadCorrectedSubchannel { get; set; } + + [DisplayName("Can read corrected subchannel with C2 pointers")] + public bool? CanReadCorrectedSubchannelWithC2 { get; set; } + + [DisplayName("Can read DCBs")] + public bool? CanReadDCB { get; set; } + + [DisplayName("Can read DDS")] + public bool? CanReadDDS { get; set; } + + [DisplayName("Can read DMI")] + public bool? CanReadDMI { get; set; } + + [DisplayName("Can read disc information")] + public bool? CanReadDiscInformation { get; set; } + + [DisplayName("Can read full TOC")] + public bool? CanReadFullTOC { get; set; } + + [DisplayName("Can read HD-DVD Copyright Management Information")] + public bool? CanReadHDCMI { get; set; } + + [DisplayName("Can read layer capacity")] + public bool? CanReadLayerCapacity { get; set; } + + [DisplayName("Can read into first track pregap")] + public bool? CanReadFirstTrackPreGap { get; set; } + + [DisplayName("Can read into Lead-In")] + public bool? CanReadLeadIn { get; set; } + + [DisplayName("Can read into Lead-Out")] + public bool? CanReadLeadOut { get; set; } + + [DisplayName("Can read media ID")] + public bool? CanReadMediaID { get; set; } + + [DisplayName("Can read media serial number")] + public bool? CanReadMediaSerial { get; set; } + + [DisplayName("Can read PAC")] + public bool? CanReadPAC { get; set; } + + [DisplayName("Can read PFI")] + public bool? CanReadPFI { get; set; } + + [DisplayName("Can read PMA")] + public bool? CanReadPMA { get; set; } + + [DisplayName("Can read PQ subchannel")] + public bool? CanReadPQSubchannel { get; set; } + + [DisplayName("Can read PQ subchannel with C2 pointers")] + public bool? CanReadPQSubchannelWithC2 { get; set; } + + [DisplayName("Can read pre-recorded information")] + public bool? CanReadPRI { get; set; } + + [DisplayName("Can read RW subchannel")] + public bool? CanReadRWSubchannel { get; set; } + + [DisplayName("Can read RW subchannel with C2 pointers")] + public bool? CanReadRWSubchannelWithC2 { get; set; } + + [DisplayName("Can read recordable PFI")] + public bool? CanReadRecordablePFI { get; set; } + + [DisplayName("Can read spare area information")] + public bool? CanReadSpareAreaInformation { get; set; } + + [DisplayName("Can read TOC")] + public bool? CanReadTOC { get; set; } + + [DisplayName("Density code")] + public byte? Density { get; set; } + + [DisplayName("Bytes per block in READ LONG commands")] + public uint? LongBlockSize { get; set; } + + [DisplayName("Media manufacturer")] + public string Manufacturer { get; set; } + + [DisplayName("Media recognized by drive?")] + public bool MediaIsRecognized { get; set; } + + [DisplayName("Medium type code")] + public byte? MediumType { get; set; } + + [DisplayName("Media type")] + public string MediumTypeName { get; set; } + + [DisplayName("Media model")] + public string Model { get; set; } + + [DisplayName("Can read scrambled DVD sectors using HL-DT-ST cache trick")] + public bool? SupportsHLDTSTReadRawDVD { get; set; } + + [DisplayName("Supports NEC READ CD-DA command")] + public bool? SupportsNECReadCDDA { get; set; } + + [DisplayName("Supports Pioneer READ CD-DA command")] + public bool? SupportsPioneerReadCDDA { get; set; } + + [DisplayName("Supports Pioneer READ CD-DA MSF command")] + public bool? SupportsPioneerReadCDDAMSF { get; set; } + + [DisplayName("Supports Plextor READ CD-DA command")] + public bool? SupportsPlextorReadCDDA { get; set; } + + [DisplayName("Can read scrambled DVD sectors using Plextor vendor command")] + public bool? SupportsPlextorReadRawDVD { get; set; } + + [DisplayName("Supports READ(10) command")] + public bool? SupportsRead10 { get; set; } + + [DisplayName("Supports READ(12) command")] + public bool? SupportsRead12 { get; set; } + + [DisplayName("Supports READ(16) command")] + public bool? SupportsRead16 { get; set; } + + [DisplayName("Supports READ(6) command")] + public bool? SupportsRead6 { get; set; } + + [DisplayName("Supports READ CAPACITY(16) command")] + public bool? SupportsReadCapacity16 { get; set; } + + [DisplayName("Supports READ CAPACITY command")] + public bool? SupportsReadCapacity { get; set; } + + [DisplayName("Supports READ CD command")] + public bool? SupportsReadCd { get; set; } + + [DisplayName("Supports READ CD MSF command")] + public bool? SupportsReadCdMsf { get; set; } + + [DisplayName("Supports full sector in READ CD command")] + public bool? SupportsReadCdRaw { get; set; } + + [DisplayName("Supports full sector in READ CD MSF command")] + public bool? SupportsReadCdMsfRaw { get; set; } + + [DisplayName("Supports READ LONG(16) command")] + public bool? SupportsReadLong16 { get; set; } + + [DisplayName("Supports READ LONG command")] + public bool? SupportsReadLong { get; set; } + + [DisplayName("Data from MODE SENSE(6) command")] + public byte[] ModeSense6Data { get; set; } + + [DisplayName("Data from MODE SENSE(10) command")] + public byte[] ModeSense10Data { get; set; } + + public virtual Chs CHS { get; set; } + public virtual Chs CurrentCHS { get; set; } + + [DisplayName("Sectors in 28-bit LBA mode")] + public uint? LBASectors { get; set; } + + [DisplayName("Sectors in 48-bit LBA mode")] + public ulong? LBA48Sectors { get; set; } + + [DisplayName("Logical alignment")] + public ushort? LogicalAlignment { get; set; } + + [DisplayName("Nominal rotation rate")] + public ushort? NominalRotationRate { get; set; } + + [DisplayName("Bytes per block, physical")] + public uint? PhysicalBlockSize { get; set; } + + [DisplayName("Is it a SSD?")] + public bool? SolidStateDevice { get; set; } + + [DisplayName("Bytes per unformatted track")] + public ushort? UnformattedBPT { get; set; } + + [DisplayName("Bytes per unformatted sector")] + public ushort? UnformattedBPS { get; set; } + + [DisplayName("Supports READ DMA (LBA) command")] + public bool? SupportsReadDmaLba { get; set; } + + [DisplayName("Supports READ DMA RETRY (LBA) command")] + public bool? SupportsReadDmaRetryLba { get; set; } + + [DisplayName("Supports READ SECTORS (LBA) command")] + public bool? SupportsReadLba { get; set; } + + [DisplayName("Supports READ SECTORS RETRY (LBA) command")] + public bool? SupportsReadRetryLba { get; set; } + + [DisplayName("Supports READ SECTORS LONG (LBA) command")] + public bool? SupportsReadLongLba { get; set; } + + [DisplayName("Supports READ SECTORS LONG RETRY (LBA) command")] + public bool? SupportsReadLongRetryLba { get; set; } + + [DisplayName("Supports SEEK (LBA) command")] + public bool? SupportsSeekLba { get; set; } + + [DisplayName("Supports READ DMA EXT command")] + public bool? SupportsReadDmaLba48 { get; set; } + + [DisplayName("Supports READ SECTORS EXT command")] + public bool? SupportsReadLba48 { get; set; } + + [DisplayName("Supports READ DMA command")] + public bool? SupportsReadDma { get; set; } + + [DisplayName("Supports READ DMA RETRY command")] + public bool? SupportsReadDmaRetry { get; set; } + + [DisplayName("Supports READ SECTORS RETRY command")] + public bool? SupportsReadRetry { get; set; } + + [DisplayName("Supports READ SECTORS command")] + public bool? SupportsReadSectors { get; set; } + + [DisplayName("Supports READ SECTORS LONG RETRY command")] + public bool? SupportsReadLongRetry { get; set; } + + [DisplayName("Supports SEEK command")] + public bool? SupportsSeek { get; set; } + + [DisplayName("Can read into inter-session Lead-In")] + public bool? CanReadingIntersessionLeadIn { get; set; } + + [DisplayName("Can read into inter-session Lead-Out")] + public bool? CanReadingIntersessionLeadOut { get; set; } + + [DisplayName("Data from inter-session Lead-In")] + public byte[] IntersessionLeadInData { get; set; } + + [DisplayName("Data from inter-session Lead-Out")] + public byte[] IntersessionLeadOutData { get; set; } + + [DisplayName("Can read scrambled data using READ CD command")] + public bool? CanReadCdScrambled { get; set; } + + [DisplayName("Data from scrambled READ CD command")] + public byte[] ReadCdScrambledData { get; set; } + + [DisplayName("Can read from cache using F1h command subcommand 06h")] + public bool? CanReadF1_06 { get; set; } + + [DisplayName("Can read from cache using F1h command subcommand 06h")] + public byte[] ReadF1_06Data { get; set; } + + [DisplayName("Can read from cache using F1h command subcommand 06h targeting Lead-Out")] + public bool? CanReadF1_06LeadOut { get; set; } + + [DisplayName("Can read from cache using F1h command subcommand 06h targeting Lead-Out")] + public byte[] ReadF1_06LeadOutData { get; set; } + + [JsonIgnore] + public int? AtaId { get; set; } + + [JsonIgnore] + public int? ScsiId { get; set; } + + [JsonIgnore] + public int? MmcId { get; set; } + +#region SCSI data + + [DisplayName("Data from READ(6) command")] + public byte[] Read6Data { get; set; } + + [DisplayName("Data from READ(10) command")] + public byte[] Read10Data { get; set; } + + [DisplayName("Data from READ(12) command")] + public byte[] Read12Data { get; set; } + + [DisplayName("Data from READ(16) command")] + public byte[] Read16Data { get; set; } + + [DisplayName("Data from READ LONG(10) command")] + public byte[] ReadLong10Data { get; set; } + + [DisplayName("Data from READ LONG(16) command")] + public byte[] ReadLong16Data { get; set; } + +#endregion + +#region ATA data + + [DisplayName("Data from READ SECTORS command")] + public byte[] ReadSectorsData { get; set; } + + [DisplayName("Data from READ SECTORS RETRY command")] + public byte[] ReadSectorsRetryData { get; set; } + + [DisplayName("Data from READ DMA command")] + public byte[] ReadDmaData { get; set; } + + [DisplayName("Data from READ DMA RETRY command")] + public byte[] ReadDmaRetryData { get; set; } + + [DisplayName("Data from READ SECTORS (LBA) command")] + public byte[] ReadLbaData { get; set; } + + [DisplayName("Data from READ SECTORS RETRY (LBA) command")] + public byte[] ReadRetryLbaData { get; set; } + + [DisplayName("Data from READ DMA (LBA) command")] + public byte[] ReadDmaLbaData { get; set; } + + [DisplayName("Data from READ DMA RETRY (LBA) command")] + public byte[] ReadDmaRetryLbaData { get; set; } + + [DisplayName("Data from READ SECTORS EXT command")] + public byte[] ReadLba48Data { get; set; } + + [DisplayName("Data from READ DMA EXT command")] + public byte[] ReadDmaLba48Data { get; set; } + + [DisplayName("Data from READ SECTORS LONG command")] + public byte[] ReadLongData { get; set; } + + [DisplayName("Data from READ SECTORS LONG RETRY command")] + public byte[] ReadLongRetryData { get; set; } + + [DisplayName("Data from READ SECTORS LONG (LBA) command")] + public byte[] ReadLongLbaData { get; set; } + + [DisplayName("Data from READ SECTORS LONG RETRY (LBA) command")] + public byte[] ReadLongRetryLbaData { get; set; } + +#endregion + +#region CompactDisc data + + [DisplayName("Data from READ TOC command")] + public byte[] TocData { get; set; } + + [DisplayName("Data from READ FULL TOC command")] + public byte[] FullTocData { get; set; } + + [DisplayName("Data from READ ATIP command")] + public byte[] AtipData { get; set; } + + [DisplayName("Data from READ PMA command")] + public byte[] PmaData { get; set; } + + [DisplayName("Data from READ CD command")] + public byte[] ReadCdData { get; set; } + + [DisplayName("Data from READ CD MSF command")] + public byte[] ReadCdMsfData { get; set; } + + [DisplayName("Data from READ CD (full sector) command")] + public byte[] ReadCdFullData { get; set; } + + [DisplayName("Data from READ CD MSF (full sector) command")] + public byte[] ReadCdMsfFullData { get; set; } + + [DisplayName("Data from track 1 pregap")] + public byte[] Track1PregapData { get; set; } + + [DisplayName("Data from Lead-In")] + public byte[] LeadInData { get; set; } + + [DisplayName("Data from Lead-Out")] + public byte[] LeadOutData { get; set; } + + [DisplayName("Data from reading C2 pointers")] + public byte[] C2PointersData { get; set; } + + [DisplayName("Data from reading with PQ subchannels")] + public byte[] PQSubchannelData { get; set; } + + [DisplayName("Data from reading with RW subchannels")] + public byte[] RWSubchannelData { get; set; } + + [DisplayName("Data from reading with corrected subchannels")] + public byte[] CorrectedSubchannelData { get; set; } + + [DisplayName("Data from reading with PQ subchannels and C2 pointers")] + public byte[] PQSubchannelWithC2Data { get; set; } + + [DisplayName("Data from reading with RW subchannels and C2 pointers")] + public byte[] RWSubchannelWithC2Data { get; set; } + + [DisplayName("Data from reading with corrected subchannels and C2 pointers")] + public byte[] CorrectedSubchannelWithC2Data { get; set; } + +#endregion + +#region DVD data + + [DisplayName("Data from PFI")] + public byte[] PfiData { get; set; } + + [DisplayName("Data from DMI")] + public byte[] DmiData { get; set; } + + [DisplayName("Data from DVD's Copyright Management Information")] + public byte[] CmiData { get; set; } + + [DisplayName("Data from DVD's BCA")] + public byte[] DvdBcaData { get; set; } + + [DisplayName("Data from DVD's AACS")] + public byte[] DvdAacsData { get; set; } + + [DisplayName("Data from DVD's DDS")] + public byte[] DvdDdsData { get; set; } + + [DisplayName("Data from DVD's Spare Area Information")] + public byte[] DvdSaiData { get; set; } + + [DisplayName("Data from DVD's pre-recorded information")] + public byte[] PriData { get; set; } + + [DisplayName("Data from embossed PFI")] + public byte[] EmbossedPfiData { get; set; } + + [DisplayName("Data from ADIP")] + public byte[] AdipData { get; set; } + + [DisplayName("Data from DCBs")] + public byte[] DcbData { get; set; } + + [DisplayName("Data from HD-DVD's Copyright Management Information")] + public byte[] HdCmiData { get; set; } + + [DisplayName("Data from DVD's layer information")] + public byte[] DvdLayerData { get; set; } + +#endregion + +#region Blu-ray data + + [DisplayName("Data from Blu-ray's BCA")] + public byte[] BluBcaData { get; set; } + + [DisplayName("Data from Blu-ray's DDS")] + public byte[] BluDdsData { get; set; } + + [DisplayName("Data from Blu-ray's Spare Area Information")] + public byte[] BluSaiData { get; set; } + + [DisplayName("Data from Blu-ray's Disc Information")] + public byte[] BluDiData { get; set; } + + [DisplayName("Data from Blu-ray's PAC")] + public byte[] BluPacData { get; set; } + +#endregion + +#region Vendor data + + [DisplayName("Data from Plextor's READ CD-DA command")] + public byte[] PlextorReadCddaData { get; set; } + + [DisplayName("Data from Pioneer's READ CD-DA command")] + public byte[] PioneerReadCddaData { get; set; } + + [DisplayName("Data from Pioneer's READ CD-DA MSF command")] + public byte[] PioneerReadCddaMsfData { get; set; } + + [DisplayName("Data from NEC's READ CD-DA command")] + public byte[] NecReadCddaData { get; set; } + + [DisplayName("Data from Plextor's scrambled DVD reading command")] + public byte[] PlextorReadRawDVDData { get; set; } + + [DisplayName("Data from HL-DT-ST's scrambled DVD reading trick")] + public byte[] HLDTSTReadRawDVDData { get; set; } + +#endregion +} + +public class Ssc +{ + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("Block size granularity")] + public byte? BlockSizeGranularity { get; set; } + + [DisplayName("Maximum block length")] + public uint? MaxBlockLength { get; set; } + + [DisplayName("Minimum block length")] + public uint? MinBlockLength { get; set; } + + public virtual List SupportedDensities { get; set; } + public virtual List SupportedMediaTypes { get; set; } + public virtual List TestedMedia { get; set; } +} + +public class TestedSequentialMedia +{ + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("Can read media serial?")] + public bool? CanReadMediaSerial { get; set; } + + [DisplayName("Density code")] + public byte? Density { get; set; } + + public string Manufacturer { get; set; } + + [DisplayName("Media recognized by drive?")] + public bool MediaIsRecognized { get; set; } + + [DisplayName("Medium type code")] + public byte? MediumType { get; set; } + + [DisplayName("Medium type")] + public string MediumTypeName { get; set; } + + public string Model { get; set; } + public virtual List SupportedDensities { get; set; } + public virtual List SupportedMediaTypes { get; set; } + + public byte[] ModeSense6Data { get; set; } + public byte[] ModeSense10Data { get; set; } + + [JsonIgnore] + public int? SscId { get; set; } +} + +public class Pcmcia +{ + public string[] AdditionalInformation; + + [JsonIgnore] + public int Id { get; set; } + + public byte[] CIS { get; set; } + public string Compliance { get; set; } + + [DisplayName("Manufacturer code")] + public ushort? ManufacturerCode { get; set; } + + [DisplayName("Card code")] + public ushort? CardCode { get; set; } + + public string Manufacturer { get; set; } + + [DisplayName("Product name")] + public string ProductName { get; set; } +} + +public class MmcSd +{ + [JsonIgnore] + public int Id { get; set; } + + public byte[] CID { get; set; } + public byte[] CSD { get; set; } + public byte[] OCR { get; set; } + public byte[] SCR { get; set; } + public byte[] ExtendedCSD { get; set; } +} + +public class SscSupportedMedia +{ + [JsonIgnore] + public int Id { get; set; } + + public byte MediumType { get; set; } + public virtual List DensityCodes { get; set; } + public ushort Width { get; set; } + public ushort Length { get; set; } + public string Organization { get; set; } + public string Name { get; set; } + public string Description { get; set; } +} + +public class DensityCode : IEquatable +{ + [JsonIgnore] + [Key] + public int Id { get; set; } + + public int Code { get; set; } + +#region IEquatable Members + + public bool Equals(DensityCode other) + { + if(ReferenceEquals(null, other)) + return false; + + if(ReferenceEquals(this, other)) + return true; + + return Code == other.Code; + } + +#endregion + + public override bool Equals(object obj) + { + if(ReferenceEquals(null, obj)) + return false; + + if(ReferenceEquals(this, obj)) + return true; + + return obj.GetType() == GetType() && Equals((DensityCode)obj); + } + + // ReSharper disable once NonReadonlyMemberInGetHashCode + public override int GetHashCode() => Code; +} + +public class GdRomSwapDiscCapabilities +{ + [JsonIgnore] + [Key] + public int Id { get; set; } + + public bool RecognizedSwapDisc { get; set; } + public bool TestCrashed { get; set; } + public byte SwapDiscLeadOutPMIN { get; set; } + public byte SwapDiscLeadOutPSEC { get; set; } + public byte SwapDiscLeadOutPFRAM { get; set; } + public int SwapDiscLeadOutStart { get; set; } + public bool Lba0Readable { get; set; } + public byte[] Lba0Data { get; set; } + public byte[] Lba0Sense { get; set; } + public string Lba0DecodedSense { get; set; } + public bool Lba0ScrambledReadable { get; set; } + public byte[] Lba0ScrambledData { get; set; } + public byte[] Lba0ScrambledSense { get; set; } + public string Lba0ScrambledDecodedSense { get; set; } + public bool Lba44990Readable { get; set; } + public byte[] Lba44990Data { get; set; } + public byte[] Lba44990Sense { get; set; } + public string Lba44990DecodedSense { get; set; } + public int Lba44990ReadableCluster { get; set; } + public bool Lba45000Readable { get; set; } + public byte[] Lba45000Data { get; set; } + public byte[] Lba45000Sense { get; set; } + public string Lba45000DecodedSense { get; set; } + public int Lba45000ReadableCluster { get; set; } + public bool Lba50000Readable { get; set; } + public byte[] Lba50000Data { get; set; } + public byte[] Lba50000Sense { get; set; } + public string Lba50000DecodedSense { get; set; } + public int Lba50000ReadableCluster { get; set; } + public bool Lba100000Readable { get; set; } + public byte[] Lba100000Data { get; set; } + public byte[] Lba100000Sense { get; set; } + public string Lba100000DecodedSense { get; set; } + public int Lba100000ReadableCluster { get; set; } + public bool Lba400000Readable { get; set; } + public byte[] Lba400000Data { get; set; } + public byte[] Lba400000Sense { get; set; } + public string Lba400000DecodedSense { get; set; } + public int Lba400000ReadableCluster { get; set; } + public bool Lba450000Readable { get; set; } + public byte[] Lba450000Data { get; set; } + public byte[] Lba450000Sense { get; set; } + public string Lba450000DecodedSense { get; set; } + public int Lba450000ReadableCluster { get; set; } + public bool Lba44990PqReadable { get; set; } + public byte[] Lba44990PqData { get; set; } + public byte[] Lba44990PqSense { get; set; } + public string Lba44990PqDecodedSense { get; set; } + public int Lba44990PqReadableCluster { get; set; } + public bool Lba45000PqReadable { get; set; } + public byte[] Lba45000PqData { get; set; } + public byte[] Lba45000PqSense { get; set; } + public string Lba45000PqDecodedSense { get; set; } + public int Lba45000PqReadableCluster { get; set; } + public bool Lba50000PqReadable { get; set; } + public byte[] Lba50000PqData { get; set; } + public byte[] Lba50000PqSense { get; set; } + public string Lba50000PqDecodedSense { get; set; } + public int Lba50000PqReadableCluster { get; set; } + public bool Lba100000PqReadable { get; set; } + public byte[] Lba100000PqData { get; set; } + public byte[] Lba100000PqSense { get; set; } + public string Lba100000PqDecodedSense { get; set; } + public int Lba100000PqReadableCluster { get; set; } + public bool Lba400000PqReadable { get; set; } + public byte[] Lba400000PqData { get; set; } + public byte[] Lba400000PqSense { get; set; } + public string Lba400000PqDecodedSense { get; set; } + public int Lba400000PqReadableCluster { get; set; } + public bool Lba450000PqReadable { get; set; } + public byte[] Lba450000PqData { get; set; } + public byte[] Lba450000PqSense { get; set; } + public string Lba450000PqDecodedSense { get; set; } + public int Lba450000PqReadableCluster { get; set; } + public bool Lba44990RwReadable { get; set; } + public byte[] Lba44990RwData { get; set; } + public byte[] Lba44990RwSense { get; set; } + public string Lba44990RwDecodedSense { get; set; } + public int Lba44990RwReadableCluster { get; set; } + public bool Lba45000RwReadable { get; set; } + public byte[] Lba45000RwData { get; set; } + public byte[] Lba45000RwSense { get; set; } + public string Lba45000RwDecodedSense { get; set; } + public int Lba45000RwReadableCluster { get; set; } + public bool Lba50000RwReadable { get; set; } + public byte[] Lba50000RwData { get; set; } + public byte[] Lba50000RwSense { get; set; } + public string Lba50000RwDecodedSense { get; set; } + public int Lba50000RwReadableCluster { get; set; } + public bool Lba100000RwReadable { get; set; } + public byte[] Lba100000RwData { get; set; } + public byte[] Lba100000RwSense { get; set; } + public string Lba100000RwDecodedSense { get; set; } + public int Lba100000RwReadableCluster { get; set; } + public bool Lba400000RwReadable { get; set; } + public byte[] Lba400000RwData { get; set; } + public byte[] Lba400000RwSense { get; set; } + public string Lba400000RwDecodedSense { get; set; } + public int Lba400000RwReadableCluster { get; set; } + public bool Lba450000RwReadable { get; set; } + public byte[] Lba450000RwData { get; set; } + public byte[] Lba450000RwSense { get; set; } + public string Lba450000RwDecodedSense { get; set; } + public int Lba450000RwReadableCluster { get; set; } + public bool Lba44990AudioReadable { get; set; } + public byte[] Lba44990AudioData { get; set; } + public byte[] Lba44990AudioSense { get; set; } + public string Lba44990AudioDecodedSense { get; set; } + public int Lba44990AudioReadableCluster { get; set; } + public bool Lba45000AudioReadable { get; set; } + public byte[] Lba45000AudioData { get; set; } + public byte[] Lba45000AudioSense { get; set; } + public string Lba45000AudioDecodedSense { get; set; } + public int Lba45000AudioReadableCluster { get; set; } + public bool Lba50000AudioReadable { get; set; } + public byte[] Lba50000AudioData { get; set; } + public byte[] Lba50000AudioSense { get; set; } + public string Lba50000AudioDecodedSense { get; set; } + public int Lba50000AudioReadableCluster { get; set; } + public bool Lba100000AudioReadable { get; set; } + public byte[] Lba100000AudioData { get; set; } + public byte[] Lba100000AudioSense { get; set; } + public string Lba100000AudioDecodedSense { get; set; } + public int Lba100000AudioReadableCluster { get; set; } + public bool Lba400000AudioReadable { get; set; } + public byte[] Lba400000AudioData { get; set; } + public byte[] Lba400000AudioSense { get; set; } + public string Lba400000AudioDecodedSense { get; set; } + public int Lba400000AudioReadableCluster { get; set; } + public bool Lba450000AudioReadable { get; set; } + public byte[] Lba450000AudioData { get; set; } + public byte[] Lba450000AudioSense { get; set; } + public string Lba450000AudioDecodedSense { get; set; } + public int Lba450000AudioReadableCluster { get; set; } + public bool Lba44990AudioPqReadable { get; set; } + public byte[] Lba44990AudioPqData { get; set; } + public byte[] Lba44990AudioPqSense { get; set; } + public string Lba44990AudioPqDecodedSense { get; set; } + public int Lba44990AudioPqReadableCluster { get; set; } + public bool Lba45000AudioPqReadable { get; set; } + public byte[] Lba45000AudioPqData { get; set; } + public byte[] Lba45000AudioPqSense { get; set; } + public string Lba45000AudioPqDecodedSense { get; set; } + public int Lba45000AudioPqReadableCluster { get; set; } + public bool Lba50000AudioPqReadable { get; set; } + public byte[] Lba50000AudioPqData { get; set; } + public byte[] Lba50000AudioPqSense { get; set; } + public string Lba50000AudioPqDecodedSense { get; set; } + public int Lba50000AudioPqReadableCluster { get; set; } + public bool Lba100000AudioPqReadable { get; set; } + public byte[] Lba100000AudioPqData { get; set; } + public byte[] Lba100000AudioPqSense { get; set; } + public string Lba100000AudioPqDecodedSense { get; set; } + public int Lba100000AudioPqReadableCluster { get; set; } + public bool Lba400000AudioPqReadable { get; set; } + public byte[] Lba400000AudioPqData { get; set; } + public byte[] Lba400000AudioPqSense { get; set; } + public string Lba400000AudioPqDecodedSense { get; set; } + public int Lba400000AudioPqReadableCluster { get; set; } + public bool Lba450000AudioPqReadable { get; set; } + public byte[] Lba450000AudioPqData { get; set; } + public byte[] Lba450000AudioPqSense { get; set; } + public string Lba450000AudioPqDecodedSense { get; set; } + public int Lba450000AudioPqReadableCluster { get; set; } + public bool Lba44990AudioRwReadable { get; set; } + public byte[] Lba44990AudioRwData { get; set; } + public byte[] Lba44990AudioRwSense { get; set; } + public string Lba44990AudioRwDecodedSense { get; set; } + public int Lba44990AudioRwReadableCluster { get; set; } + public bool Lba45000AudioRwReadable { get; set; } + public byte[] Lba45000AudioRwData { get; set; } + public byte[] Lba45000AudioRwSense { get; set; } + public string Lba45000AudioRwDecodedSense { get; set; } + public int Lba45000AudioRwReadableCluster { get; set; } + public bool Lba50000AudioRwReadable { get; set; } + public byte[] Lba50000AudioRwData { get; set; } + public byte[] Lba50000AudioRwSense { get; set; } + public string Lba50000AudioRwDecodedSense { get; set; } + public int Lba50000AudioRwReadableCluster { get; set; } + public bool Lba100000AudioRwReadable { get; set; } + public byte[] Lba100000AudioRwData { get; set; } + public byte[] Lba100000AudioRwSense { get; set; } + public string Lba100000AudioRwDecodedSense { get; set; } + public int Lba100000AudioRwReadableCluster { get; set; } + public bool Lba400000AudioRwReadable { get; set; } + public byte[] Lba400000AudioRwData { get; set; } + public byte[] Lba400000AudioRwSense { get; set; } + public string Lba400000AudioRwDecodedSense { get; set; } + public int Lba400000AudioRwReadableCluster { get; set; } + public bool Lba450000AudioRwReadable { get; set; } + public byte[] Lba450000AudioRwData { get; set; } + public byte[] Lba450000AudioRwSense { get; set; } + public string Lba450000AudioRwDecodedSense { get; set; } + public int Lba450000AudioRwReadableCluster { get; set; } + public uint MinimumReadableSectorInHdArea { get; set; } + public uint MaximumReadableSectorInHdArea { get; set; } + public byte[] MaximumReadablePqInHdArea { get; set; } + public byte[] MaximumReadableRwInHdArea { get; set; } +} + +public class SupportedDensity +{ + [JsonIgnore] + public int Id { get; set; } + + [DisplayName("Primary density code")] + public byte PrimaryCode { get; set; } + + [DisplayName("Secondary density code")] + public byte SecondaryCode { get; set; } + + public bool Writable { get; set; } + public bool Duplicate { get; set; } + + [DisplayName("Default density code")] + public bool DefaultDensity { get; set; } + + [DisplayName("Bits per mm")] + public uint BitsPerMm { get; set; } + + public ushort Width { get; set; } + public ushort Tracks { get; set; } + + [DisplayName("Nominal capacity (MiB)")] + public uint Capacity { get; set; } + + public string Organization { get; set; } + public string Name { get; set; } + public string Description { get; set; } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Metadata/MediaType.cs b/Aaru.CommonTypes/Metadata/MediaType.cs new file mode 100644 index 000000000..75211d721 --- /dev/null +++ b/Aaru.CommonTypes/Metadata/MediaType.cs @@ -0,0 +1,2568 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : MediaType.cs +// Author(s) : Natalia Portillo +// +// Component : XML metadata. +// +// --[ Description ] ---------------------------------------------------------- +// +// Converts a common media type to the XML equivalent. +// +// --[ 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 +// ****************************************************************************/ + +#pragma warning disable 612 +namespace Aaru.CommonTypes.Metadata; + +/// Handles media type for metadata +public static class MediaType +{ + /// Converts a media type of a pair of type and subtype strings to use in metadata + /// Media type + /// Media type and subtype for metadata + public static (string type, string subType) MediaTypeToString(CommonTypes.MediaType dskType) + { + string discType; + string discSubType; + + switch(dskType) + { + case CommonTypes.MediaType.BDR: + discType = "Blu-ray"; + discSubType = "BD-R"; + + break; + case CommonTypes.MediaType.BDRE: + discType = "Blu-ray"; + discSubType = "BD-RE"; + + break; + case CommonTypes.MediaType.BDREXL: + discType = "Blu-ray"; + discSubType = "BD-RE XL"; + + break; + case CommonTypes.MediaType.BDROM: + discType = "Blu-ray"; + discSubType = "BD-ROM"; + + break; + case CommonTypes.MediaType.BDRXL: + discType = "Blu-ray"; + discSubType = "BD-R XL"; + + break; + case CommonTypes.MediaType.UHDBD: + discType = "Blu-ray"; + discSubType = "Ultra HD Blu-ray"; + + break; + case CommonTypes.MediaType.CBHD: + discType = "Blu-ray"; + discSubType = "CBHD"; + + break; + case CommonTypes.MediaType.CD: + discType = "Compact Disc"; + discSubType = "CD"; + + break; + case CommonTypes.MediaType.CDDA: + discType = "Compact Disc"; + discSubType = "CD Digital Audio"; + + break; + case CommonTypes.MediaType.CDEG: + discType = "Compact Disc"; + discSubType = "CD+EG"; + + break; + case CommonTypes.MediaType.CDG: + discType = "Compact Disc"; + discSubType = "CD+G"; + + break; + case CommonTypes.MediaType.CDI: + discType = "Compact Disc"; + discSubType = "CD-i"; + + break; + case CommonTypes.MediaType.CDIREADY: + discType = "Compact Disc"; + discSubType = "CD-i Ready"; + + break; + case CommonTypes.MediaType.CDMIDI: + discType = "Compact Disc"; + discSubType = "CD+MIDI"; + + break; + case CommonTypes.MediaType.CDMO: + discType = "Compact Disc"; + discSubType = "CD-MO"; + + break; + case CommonTypes.MediaType.CDMRW: + discType = "Compact Disc"; + discSubType = "CD-MRW"; + + break; + case CommonTypes.MediaType.CDPLUS: + discType = "Compact Disc"; + discSubType = "CD+"; + + break; + case CommonTypes.MediaType.CDR: + discType = "Compact Disc"; + discSubType = "CD-R"; + + break; + case CommonTypes.MediaType.CDROM: + discType = "Compact Disc"; + discSubType = "CD-ROM"; + + break; + case CommonTypes.MediaType.CDROMXA: + discType = "Compact Disc"; + discSubType = "CD-ROM XA"; + + break; + case CommonTypes.MediaType.CDRW: + discType = "Compact Disc"; + discSubType = "CD-RW"; + + break; + case CommonTypes.MediaType.CDV: + discType = "Compact Disc"; + discSubType = "CD-Video"; + + break; + case CommonTypes.MediaType.DDCD: + discType = "DDCD"; + discSubType = "DDCD"; + + break; + case CommonTypes.MediaType.DDCDR: + discType = "DDCD"; + discSubType = "DDCD-R"; + + break; + case CommonTypes.MediaType.DDCDRW: + discType = "DDCD"; + discSubType = "DDCD-RW"; + + break; + case CommonTypes.MediaType.DTSCD: + discType = "Compact Disc"; + discSubType = "DTS CD"; + + break; + case CommonTypes.MediaType.DVDDownload: + discType = "DVD"; + discSubType = "DVD-Download"; + + break; + case CommonTypes.MediaType.DVDPR: + discType = "DVD"; + discSubType = "DVD+R"; + + break; + case CommonTypes.MediaType.DVDPRDL: + discType = "DVD"; + discSubType = "DVD+R DL"; + + break; + case CommonTypes.MediaType.DVDPRW: + discType = "DVD"; + discSubType = "DVD+RW"; + + break; + case CommonTypes.MediaType.DVDPRWDL: + discType = "DVD"; + discSubType = "DVD+RW DL"; + + break; + case CommonTypes.MediaType.DVDR: + discType = "DVD"; + discSubType = "DVD-R"; + + break; + case CommonTypes.MediaType.DVDRAM: + discType = "DVD"; + discSubType = "DVD-RAM"; + + break; + case CommonTypes.MediaType.DVDRDL: + discType = "DVD"; + discSubType = "DVD-R DL"; + + break; + case CommonTypes.MediaType.DVDROM: + discType = "DVD"; + discSubType = "DVD-ROM"; + + break; + case CommonTypes.MediaType.DVDRW: + discType = "DVD"; + discSubType = "DVD-RW"; + + break; + case CommonTypes.MediaType.DVDRWDL: + discType = "DVD"; + discSubType = "DVD-RW DL"; + + break; + case CommonTypes.MediaType.EVD: + discType = "EVD"; + discSubType = "EVD"; + + break; + case CommonTypes.MediaType.FDDVD: + discType = "FDDVD"; + discSubType = "FDDVD"; + + break; + case CommonTypes.MediaType.FVD: + discType = "FVD"; + discSubType = "FVD"; + + break; + case CommonTypes.MediaType.GDR: + discType = "GD"; + discSubType = "GD-R"; + + break; + case CommonTypes.MediaType.GDROM: + discType = "GD"; + discSubType = "GD-ROM"; + + break; + case CommonTypes.MediaType.GOD: + discType = "DVD"; + discSubType = "GameCube Game Disc"; + + break; + case CommonTypes.MediaType.WOD: + discType = "DVD"; + discSubType = "Wii Optical Disc"; + + break; + case CommonTypes.MediaType.WUOD: + discType = "Blu-ray"; + discSubType = "Wii U Optical Disc"; + + break; + case CommonTypes.MediaType.HDDVDR: + discType = "HD DVD"; + discSubType = "HD DVD-R"; + + break; + case CommonTypes.MediaType.HDDVDRAM: + discType = "HD DVD"; + discSubType = "HD DVD-RAM"; + + break; + case CommonTypes.MediaType.HDDVDRDL: + discType = "HD DVD"; + discSubType = "HD DVD-R DL"; + + break; + case CommonTypes.MediaType.HDDVDROM: + discType = "HD DVD"; + discSubType = "HD DVD-ROM"; + + break; + case CommonTypes.MediaType.HDDVDRW: + discType = "HD DVD"; + discSubType = "HD DVD-RW"; + + break; + case CommonTypes.MediaType.HDDVDRWDL: + discType = "HD DVD"; + discSubType = "HD DVD-RW DL"; + + break; + case CommonTypes.MediaType.HDVMD: + discType = "HD VMD"; + discSubType = "HD VMD"; + + break; + case CommonTypes.MediaType.HiMD: + discType = "MiniDisc"; + discSubType = "Hi-MD"; + + break; + case CommonTypes.MediaType.HVD: + discType = "HVD"; + discSubType = "HVD"; + + break; + case CommonTypes.MediaType.LD: + discType = "LaserDisc"; + discSubType = "LaserDisc"; + + break; + case CommonTypes.MediaType.CRVdisc: + discType = "CRVdisc"; + discSubType = "CRVdisc"; + + break; + case CommonTypes.MediaType.LDROM: + discType = "LaserDisc"; + discSubType = "LD-ROM"; + + break; + case CommonTypes.MediaType.LVROM: + discType = "LaserDisc"; + discSubType = "LV-ROM"; + + break; + case CommonTypes.MediaType.MegaLD: + discType = "LaserDisc"; + discSubType = "MegaLD"; + + break; + case CommonTypes.MediaType.MD: + discType = "MiniDisc"; + discSubType = "MiniDisc"; + + break; + case CommonTypes.MediaType.MD60: + discType = "MiniDisc"; + discSubType = "MiniDisc (60 minute)"; + + break; + case CommonTypes.MediaType.MD74: + discType = "MiniDisc"; + discSubType = "MiniDisc (74 minute)"; + + break; + case CommonTypes.MediaType.MD80: + discType = "MiniDisc"; + discSubType = "MiniDisc (80 minute)"; + + break; + case CommonTypes.MediaType.MEGACD: + discType = "Compact Disc"; + discSubType = "Sega Mega CD"; + + break; + case CommonTypes.MediaType.PCD: + discType = "Compact Disc"; + discSubType = "Photo CD"; + + break; + case CommonTypes.MediaType.PlayStationMemoryCard: + discType = "PlayStation Memory Card"; + discSubType = "PlayStation Memory Card"; + + break; + case CommonTypes.MediaType.PlayStationMemoryCard2: + discType = "PlayStation Memory Card"; + discSubType = "PlayStation 2 Memory Card"; + + break; + case CommonTypes.MediaType.PS1CD: + discType = "Compact Disc"; + discSubType = "PlayStation Game Disc"; + + break; + case CommonTypes.MediaType.PS2CD: + discType = "Compact Disc"; + discSubType = "PlayStation 2 Game Disc"; + + break; + case CommonTypes.MediaType.PS2DVD: + discType = "DVD"; + discSubType = "PlayStation 2 Game Disc"; + + break; + case CommonTypes.MediaType.PS3BD: + discType = "Blu-ray"; + discSubType = "PlayStation 3 Game Disc"; + + break; + case CommonTypes.MediaType.PS3DVD: + discType = "DVD"; + discSubType = "PlayStation 3 Game Disc"; + + break; + case CommonTypes.MediaType.PS4BD: + discType = "Blu-ray"; + discSubType = "PlayStation 4 Game Disc"; + + break; + case CommonTypes.MediaType.PS5BD: + discType = "Blu-ray"; + discSubType = "PlayStation 5 Game Disc"; + + break; + case CommonTypes.MediaType.SACD: + discType = "SACD"; + discSubType = "Super Audio CD"; + + break; + case CommonTypes.MediaType.SegaCard: + discType = "Sega Card"; + discSubType = "Sega Card"; + + break; + case CommonTypes.MediaType.SATURNCD: + discType = "Compact Disc"; + discSubType = "Sega Saturn CD"; + + break; + case CommonTypes.MediaType.SVCD: + discType = "Compact Disc"; + discSubType = "Super Video CD"; + + break; + case CommonTypes.MediaType.CVD: + discType = "Compact Disc"; + discSubType = "China Video Disc"; + + break; + case CommonTypes.MediaType.SVOD: + discType = "SVOD"; + discSubType = "SVOD"; + + break; + case CommonTypes.MediaType.UDO: + discType = "UDO"; + discSubType = "UDO"; + + break; + case CommonTypes.MediaType.UMD: + discType = "UMD"; + discSubType = "Universal Media Disc"; + + break; + case CommonTypes.MediaType.VCD: + discType = "Compact Disc"; + discSubType = "Video CD"; + + break; + case CommonTypes.MediaType.Nuon: + discType = "DVD"; + discSubType = "Nuon"; + + break; + case CommonTypes.MediaType.XGD: + discType = "DVD"; + discSubType = "Xbox Game Disc (XGD)"; + + break; + case CommonTypes.MediaType.XGD2: + discType = "DVD"; + discSubType = "Xbox 360 Game Disc (XGD2)"; + + break; + case CommonTypes.MediaType.XGD3: + discType = "DVD"; + discSubType = "Xbox 360 Game Disc (XGD3)"; + + break; + case CommonTypes.MediaType.XGD4: + discType = "Blu-ray"; + discSubType = "Xbox One Game Disc (XGD4)"; + + break; + case CommonTypes.MediaType.FMTOWNS: + discType = "Compact Disc"; + discSubType = "FM-Towns"; + + break; + case CommonTypes.MediaType.Apple32SS: + discType = "5.25\" floppy"; + discSubType = "Apple DOS 3.2"; + + break; + case CommonTypes.MediaType.Apple32DS: + discType = "5.25\" floppy"; + discSubType = "Apple DOS 3.2 (double-sided)"; + + break; + case CommonTypes.MediaType.Apple33SS: + discType = "5.25\" floppy"; + discSubType = "Apple DOS 3.3"; + + break; + case CommonTypes.MediaType.Apple33DS: + discType = "5.25\" floppy"; + discSubType = "Apple DOS 3.3 (double-sided)"; + + break; + case CommonTypes.MediaType.AppleSonySS: + discType = "3.5\" floppy"; + discSubType = "Apple 400K"; + + break; + case CommonTypes.MediaType.AppleSonyDS: + discType = "3.5\" floppy"; + discSubType = "Apple 800K"; + + break; + case CommonTypes.MediaType.AppleFileWare: + discType = "5.25\" floppy"; + discSubType = "Apple FileWare"; + + break; + case CommonTypes.MediaType.RX50: + discType = "5.25\" floppy"; + discSubType = "DEC RX50"; + + break; + case CommonTypes.MediaType.DOS_525_SS_DD_8: + discType = "5.25\" floppy"; + discSubType = "IBM double-density, single-sided, 8 sectors"; + + break; + case CommonTypes.MediaType.DOS_525_SS_DD_9: + discType = "5.25\" floppy"; + discSubType = "IBM double-density, single-sided, 9 sectors"; + + break; + case CommonTypes.MediaType.DOS_525_DS_DD_8: + discType = "5.25\" floppy"; + discSubType = "IBM double-density, double-sided, 8 sectors"; + + break; + case CommonTypes.MediaType.DOS_525_DS_DD_9: + discType = "5.25\" floppy"; + discSubType = "IBM double-density, double-sided, 9 sectors"; + + break; + case CommonTypes.MediaType.DOS_525_HD: + discType = "5.25\" floppy"; + discSubType = "IBM high-density"; + + break; + case CommonTypes.MediaType.DOS_35_SS_DD_8: + discType = "3.5\" floppy"; + discSubType = "IBM double-density, single-sided, 8 sectors"; + + break; + case CommonTypes.MediaType.DOS_35_SS_DD_9: + discType = "3.5\" floppy"; + discSubType = "IBM double-density, single-sided, 9 sectors"; + + break; + case CommonTypes.MediaType.DOS_35_DS_DD_8: + discType = "3.5\" floppy"; + discSubType = "IBM double-density, double-sided, 8 sectors"; + + break; + case CommonTypes.MediaType.DOS_35_DS_DD_9: + discType = "3.5\" floppy"; + discSubType = "IBM double-density, double-sided, 9 sectors"; + + break; + case CommonTypes.MediaType.DOS_35_HD: + discType = "3.5\" floppy"; + discSubType = "IBM high-density"; + + break; + case CommonTypes.MediaType.DOS_35_ED: + discType = "3.5\" floppy"; + discSubType = "IBM extra-density"; + + break; + case CommonTypes.MediaType.Apricot_35: + discType = "3.5\" floppy"; + discSubType = "Apricot double-density, single-sided, 70 tracks"; + + break; + case CommonTypes.MediaType.DMF: + discType = "3.5\" floppy"; + discSubType = "Microsoft DMF"; + + break; + case CommonTypes.MediaType.DMF_82: + discType = "3.5\" floppy"; + discSubType = "Microsoft DMF (82-track)"; + + break; + case CommonTypes.MediaType.XDF_35: + discType = "3.5\" floppy"; + discSubType = "IBM XDF"; + + break; + case CommonTypes.MediaType.XDF_525: + discType = "5.25\" floppy"; + discSubType = "IBM XDF"; + + break; + case CommonTypes.MediaType.IBM23FD: + discType = "8\" floppy"; + discSubType = "IBM 23FD"; + + break; + case CommonTypes.MediaType.IBM33FD_128: + discType = "8\" floppy"; + discSubType = "IBM 33FD (128 bytes/sector)"; + + break; + case CommonTypes.MediaType.IBM33FD_256: + discType = "8\" floppy"; + discSubType = "IBM 33FD (256 bytes/sector)"; + + break; + case CommonTypes.MediaType.IBM33FD_512: + discType = "8\" floppy"; + discSubType = "IBM 33FD (512 bytes/sector)"; + + break; + case CommonTypes.MediaType.IBM43FD_128: + discType = "8\" floppy"; + discSubType = "IBM 43FD (128 bytes/sector)"; + + break; + case CommonTypes.MediaType.IBM43FD_256: + discType = "8\" floppy"; + discSubType = "IBM 43FD (256 bytes/sector)"; + + break; + case CommonTypes.MediaType.IBM53FD_256: + discType = "8\" floppy"; + discSubType = "IBM 53FD (256 bytes/sector)"; + + break; + case CommonTypes.MediaType.IBM53FD_512: + discType = "8\" floppy"; + discSubType = "IBM 53FD (512 bytes/sector)"; + + break; + case CommonTypes.MediaType.IBM53FD_1024: + discType = "8\" floppy"; + discSubType = "IBM 53FD (1024 bytes/sector)"; + + break; + case CommonTypes.MediaType.RX01: + discType = "8\" floppy"; + discSubType = "DEC RX-01"; + + break; + case CommonTypes.MediaType.RX02: + discType = "8\" floppy"; + discSubType = "DEC RX-02"; + + break; + case CommonTypes.MediaType.RX03: + discType = "8\" floppy"; + discSubType = "DEC RX-03"; + + break; + case CommonTypes.MediaType.ACORN_525_SS_SD_40: + discType = "5.25\" floppy"; + discSubType = "BBC Micro 100K"; + + break; + case CommonTypes.MediaType.ACORN_525_SS_SD_80: + discType = "5.25\" floppy"; + discSubType = "BBC Micro 200K"; + + break; + case CommonTypes.MediaType.ACORN_525_SS_DD_40: + discType = "5.25\" floppy"; + discSubType = "Acorn S"; + + break; + case CommonTypes.MediaType.ACORN_525_SS_DD_80: + discType = "5.25\" floppy"; + discSubType = "Acorn M"; + + break; + case CommonTypes.MediaType.ACORN_525_DS_DD: + discType = "5.25\" floppy"; + discSubType = "Acorn L"; + + break; + case CommonTypes.MediaType.ACORN_35_DS_DD: + discType = "3.5\" floppy"; + discSubType = "Acorn Archimedes"; + + break; + case CommonTypes.MediaType.ACORN_35_DS_HD: + discType = "3.5\" floppy"; + discSubType = "Acorn Archimedes high-density"; + + break; + case CommonTypes.MediaType.ATARI_525_SD: + discType = "5.25\" floppy"; + discSubType = "Atari single-density"; + + break; + case CommonTypes.MediaType.ATARI_525_ED: + discType = "5.25\" floppy"; + discSubType = "Atari enhanced-density"; + + break; + case CommonTypes.MediaType.ATARI_525_DD: + discType = "5.25\" floppy"; + discSubType = "Atari double-density"; + + break; + case CommonTypes.MediaType.ATARI_35_SS_DD: + discType = "3.5\" floppy"; + discSubType = "Atari ST double-density, single-sided, 10 sectors"; + + break; + case CommonTypes.MediaType.ATARI_35_DS_DD: + discType = "3.5\" floppy"; + discSubType = "Atari ST double-density, double-sided, 10 sectors"; + + break; + case CommonTypes.MediaType.ATARI_35_SS_DD_11: + discType = "3.5\" floppy"; + discSubType = "Atari ST double-density, single-sided, 11 sectors"; + + break; + case CommonTypes.MediaType.ATARI_35_DS_DD_11: + discType = "3.5\" floppy"; + discSubType = "Atari ST double-density, double-sided, 11 sectors"; + + break; + case CommonTypes.MediaType.CBM_1540: + case CommonTypes.MediaType.CBM_1540_Ext: + discType = "5.25\" floppy"; + discSubType = "Commodore 1540/1541"; + + break; + case CommonTypes.MediaType.CBM_1571: + discType = "5.25\" floppy"; + discSubType = "Commodore 1571"; + + break; + case CommonTypes.MediaType.CBM_35_DD: + discType = "3.5\" floppy"; + discSubType = "Commodore 1581"; + + break; + case CommonTypes.MediaType.CBM_AMIGA_35_DD: + discType = "3.5\" floppy"; + discSubType = "Amiga double-density"; + + break; + case CommonTypes.MediaType.CBM_AMIGA_35_HD: + discType = "3.5\" floppy"; + discSubType = "Amiga high-density"; + + break; + case CommonTypes.MediaType.NEC_8_SD: + discType = "8\" floppy"; + discSubType = "NEC single-sided"; + + break; + case CommonTypes.MediaType.NEC_8_DD: + discType = "8\" floppy"; + discSubType = "NEC double-sided"; + + break; + case CommonTypes.MediaType.NEC_525_SS: + discType = "5.25\" floppy"; + discSubType = "NEC single-sided"; + + break; + case CommonTypes.MediaType.NEC_525_HD: + discType = "5.25\" floppy"; + discSubType = "NEC high-density"; + + break; + case CommonTypes.MediaType.NEC_35_HD_8: + discType = "3.5\" floppy"; + discSubType = "NEC high-density"; + + break; + case CommonTypes.MediaType.NEC_35_HD_15: + discType = "3.5\" floppy"; + discSubType = "NEC high-density"; + + break; + case CommonTypes.MediaType.NEC_35_TD: + discType = "3.5\" floppy"; + discSubType = "NEC triple-density"; + + break; + case CommonTypes.MediaType.SHARP_525_9: + discType = "5.25\" floppy"; + discSubType = "Sharp (9 sectors per track)"; + + break; + case CommonTypes.MediaType.SHARP_35_9: + discType = "3.5\" floppy"; + discSubType = "Sharp (9 sectors per track)"; + + break; + case CommonTypes.MediaType.ECMA_54: + discType = "8\" floppy"; + discSubType = "ECMA-54"; + + break; + case CommonTypes.MediaType.ECMA_59: + discType = "8\" floppy"; + discSubType = "ECMA-59"; + + break; + case CommonTypes.MediaType.ECMA_69_8: + case CommonTypes.MediaType.ECMA_69_15: + case CommonTypes.MediaType.ECMA_69_26: + discType = "8\" floppy"; + discSubType = "ECMA-69"; + + break; + case CommonTypes.MediaType.ECMA_66: + discType = "5.25\" floppy"; + discSubType = "ECMA-66"; + + break; + case CommonTypes.MediaType.ECMA_70: + discType = "5.25\" floppy"; + discSubType = "ECMA-70"; + + break; + case CommonTypes.MediaType.ECMA_78: + case CommonTypes.MediaType.ECMA_78_2: + discType = "5.25\" floppy"; + discSubType = "ECMA-78"; + + break; + case CommonTypes.MediaType.ECMA_99_8: + case CommonTypes.MediaType.ECMA_99_15: + case CommonTypes.MediaType.ECMA_99_26: + discType = "5.25\" floppy"; + discSubType = "ECMA-99"; + + break; + case CommonTypes.MediaType.FDFORMAT_525_DD: + discType = "5.25\" floppy"; + discSubType = "FDFORMAT double-density"; + + break; + case CommonTypes.MediaType.FDFORMAT_525_HD: + discType = "5.25\" floppy"; + discSubType = "FDFORMAT high-density"; + + break; + case CommonTypes.MediaType.FDFORMAT_35_DD: + discType = "3.5\" floppy"; + discSubType = "FDFORMAT double-density"; + + break; + case CommonTypes.MediaType.FDFORMAT_35_HD: + discType = "3.5\" floppy"; + discSubType = "FDFORMAT high-density"; + + break; + case CommonTypes.MediaType.ECMA_260: + case CommonTypes.MediaType.ECMA_260_Double: + discType = "356mm magneto-optical"; + discSubType = "ECMA-260 / ISO 15898"; + + break; + case CommonTypes.MediaType.ECMA_183_512: + case CommonTypes.MediaType.ECMA_183: + discType = "5.25\" magneto-optical"; + discSubType = "ECMA-183"; + + break; + case CommonTypes.MediaType.ISO_10089: + case CommonTypes.MediaType.ISO_10089_512: + discType = "5.25\" magneto-optical"; + discSubType = "ISO 10089"; + + break; + case CommonTypes.MediaType.ECMA_184_512: + case CommonTypes.MediaType.ECMA_184: + discType = "5.25\" magneto-optical"; + discSubType = "ECMA-184"; + + break; + case CommonTypes.MediaType.ECMA_154: + discType = "3.5\" magneto-optical"; + discSubType = "ECMA-154"; + + break; + case CommonTypes.MediaType.ECMA_201: + case CommonTypes.MediaType.ECMA_201_ROM: + discType = "3.5\" magneto-optical"; + discSubType = "ECMA-201"; + + break; + case CommonTypes.MediaType.ISO_15041_512: + discType = "3.5\" magneto-optical"; + discSubType = "ISO 15041"; + + break; + case CommonTypes.MediaType.FlashDrive: + discType = "USB flash drive"; + discSubType = "USB flash drive"; + + break; + case CommonTypes.MediaType.SuperCDROM2: + discType = "Compact Disc"; + discSubType = "Super CD-ROM²"; + + break; + case CommonTypes.MediaType.LDROM2: + discType = "LaserDisc"; + discSubType = "LD-ROM²"; + + break; + case CommonTypes.MediaType.JaguarCD: + discType = "Compact Disc"; + discSubType = "Atari Jaguar CD"; + + break; + case CommonTypes.MediaType.MilCD: + discType = "Compact Disc"; + discSubType = "Sega MilCD"; + + break; + case CommonTypes.MediaType.ThreeDO: + discType = "Compact Disc"; + discSubType = "3DO"; + + break; + case CommonTypes.MediaType.PCFX: + discType = "Compact Disc"; + discSubType = "PC-FX"; + + break; + case CommonTypes.MediaType.NeoGeoCD: + discType = "Compact Disc"; + discSubType = "NEO-GEO CD"; + + break; + case CommonTypes.MediaType.CDTV: + discType = "Compact Disc"; + discSubType = "Commodore CDTV"; + + break; + case CommonTypes.MediaType.CD32: + discType = "Compact Disc"; + discSubType = "Amiga CD32"; + + break; + case CommonTypes.MediaType.Playdia: + discType = "Compact Disc"; + discSubType = "Bandai Playdia"; + + break; + case CommonTypes.MediaType.Pippin: + discType = "Compact Disc"; + discSubType = "Apple Pippin"; + + break; + case CommonTypes.MediaType.ZIP100: + discType = "Iomega ZIP"; + discSubType = "Iomega ZIP100"; + + break; + case CommonTypes.MediaType.ZIP250: + discType = "Iomega ZIP"; + discSubType = "Iomega ZIP250"; + + break; + case CommonTypes.MediaType.ZIP750: + discType = "Iomega ZIP"; + discSubType = "Iomega ZIP750"; + + break; + case CommonTypes.MediaType.AppleProfile: + discType = "Hard Disk Drive"; + discSubType = "Apple Profile"; + + break; + case CommonTypes.MediaType.AppleWidget: + discType = "Hard Disk Drive"; + discSubType = "Apple Widget"; + + break; + case CommonTypes.MediaType.AppleHD20: + discType = "Hard Disk Drive"; + discSubType = "Apple HD20"; + + break; + case CommonTypes.MediaType.PriamDataTower: + discType = "Hard Disk Drive"; + discSubType = "Priam DataTower"; + + break; + case CommonTypes.MediaType.DDS1: + discType = "Digital Data Storage"; + discSubType = "DDS"; + + break; + case CommonTypes.MediaType.DDS2: + discType = "Digital Data Storage"; + discSubType = "DDS-2"; + + break; + case CommonTypes.MediaType.DDS3: + discType = "Digital Data Storage"; + discSubType = "DDS-3"; + + break; + case CommonTypes.MediaType.DDS4: + discType = "Digital Data Storage"; + discSubType = "DDS-4"; + + break; + case CommonTypes.MediaType.PocketZip: + discType = "Iomega PocketZip"; + discSubType = "Iomega PocketZip"; + + break; + case CommonTypes.MediaType.CompactFloppy: + discType = "3\" floppy"; + discSubType = "Compact Floppy"; + + break; + case CommonTypes.MediaType.GENERIC_HDD: + discType = "Hard Disk Drive"; + discSubType = "Unknown"; + + break; + case CommonTypes.MediaType.MDData: + discType = "MiniDisc"; + discSubType = "MD-DATA"; + + break; + case CommonTypes.MediaType.MDData2: + discType = "MiniDisc"; + discSubType = "MD-DATA2"; + + break; + case CommonTypes.MediaType.UDO2: + discType = "UDO"; + discSubType = "UDO2"; + + break; + case CommonTypes.MediaType.UDO2_WORM: + discType = "UDO"; + discSubType = "UDO2 (WORM)"; + + break; + case CommonTypes.MediaType.ADR30: + discType = "Advanced Digital Recording"; + discSubType = "ADR 30"; + + break; + case CommonTypes.MediaType.ADR50: + discType = "Advanced Digital Recording"; + discSubType = "ADR 50"; + + break; + case CommonTypes.MediaType.ADR260: + discType = "Advanced Digital Recording"; + discSubType = "ADR 2.60"; + + break; + case CommonTypes.MediaType.ADR2120: + discType = "Advanced Digital Recording"; + discSubType = "ADR 2.120"; + + break; + case CommonTypes.MediaType.AIT1: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-1"; + + break; + case CommonTypes.MediaType.AIT1Turbo: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-1 Turbo"; + + break; + case CommonTypes.MediaType.AIT2: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-2"; + + break; + case CommonTypes.MediaType.AIT2Turbo: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-2 Turbo"; + + break; + case CommonTypes.MediaType.AIT3: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-3"; + + break; + case CommonTypes.MediaType.AIT3Ex: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-3Ex"; + + break; + case CommonTypes.MediaType.AIT3Turbo: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-3 Turbo"; + + break; + case CommonTypes.MediaType.AIT4: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-4"; + + break; + case CommonTypes.MediaType.AIT5: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-5"; + + break; + case CommonTypes.MediaType.AITETurbo: + discType = "Advanced Intelligent Tape"; + discSubType = "AIT-E Turbo"; + + break; + case CommonTypes.MediaType.SAIT1: + discType = "Super Advanced Intelligent Tape"; + discSubType = "SAIT-1"; + + break; + case CommonTypes.MediaType.SAIT2: + discType = "Super Advanced Intelligent Tape"; + discSubType = "SAIT-2"; + + break; + case CommonTypes.MediaType.Bernoulli: + case CommonTypes.MediaType.Bernoulli10: + discType = "Iomega Bernoulli Box"; + discSubType = "Iomega Bernoulli Box 10Mb"; + + break; + case CommonTypes.MediaType.Bernoulli20: + discType = "Iomega Bernoulli Box"; + discSubType = "Iomega Bernoulli Box 20Mb"; + + break; + case CommonTypes.MediaType.BernoulliBox2_20: + case CommonTypes.MediaType.Bernoulli2: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 20Mb"; + + break; + case CommonTypes.MediaType.Bernoulli35: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 35Mb"; + + break; + case CommonTypes.MediaType.Bernoulli44: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 44Mb"; + + break; + case CommonTypes.MediaType.Bernoulli65: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 65Mb"; + + break; + case CommonTypes.MediaType.Bernoulli90: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 90Mb"; + + break; + case CommonTypes.MediaType.Bernoulli105: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 105Mb"; + + break; + case CommonTypes.MediaType.Bernoulli150: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 150Mb"; + + break; + case CommonTypes.MediaType.Bernoulli230: + discType = "Iomega Bernoulli Box II"; + discSubType = "Iomega Bernoulli Box II 230Mb"; + + break; + case CommonTypes.MediaType.Ditto: + discType = "Iomega Ditto"; + discSubType = "Iomega Ditto"; + + break; + case CommonTypes.MediaType.DittoMax: + discType = "Iomega Ditto"; + discSubType = "Iomega Ditto Max"; + + break; + case CommonTypes.MediaType.Jaz: + discType = "Iomega Jaz"; + discSubType = "Iomega Jaz 1GB"; + + break; + case CommonTypes.MediaType.Jaz2: + discType = "Iomega Jaz"; + discSubType = "Iomega Jaz 2GB"; + + break; + case CommonTypes.MediaType.REV35: + discType = "Iomega REV"; + discSubType = "Iomega REV-35"; + + break; + case CommonTypes.MediaType.REV70: + discType = "Iomega REV"; + discSubType = "Iomega REV-70"; + + break; + case CommonTypes.MediaType.REV120: + discType = "Iomega REV"; + discSubType = "Iomega REV-120"; + + break; + case CommonTypes.MediaType.CompactFlash: + discType = "Compact Flash"; + discSubType = "Compact Flash"; + + break; + case CommonTypes.MediaType.CompactFlashType2: + discType = "Compact Flash"; + discSubType = "Compact Flash Type 2"; + + break; + case CommonTypes.MediaType.CFast: + discType = "Compact Flash"; + discSubType = "CFast"; + + break; + case CommonTypes.MediaType.DigitalAudioTape: + discType = "Digital Audio Tape"; + discSubType = "Digital Audio Tape"; + + break; + case CommonTypes.MediaType.DAT72: + discType = "Digital Data Storage"; + discSubType = "DAT-72"; + + break; + case CommonTypes.MediaType.DAT160: + discType = "Digital Data Storage"; + discSubType = "DAT-160"; + + break; + case CommonTypes.MediaType.DAT320: + discType = "Digital Data Storage"; + discSubType = "DAT-320"; + + break; + case CommonTypes.MediaType.DECtapeII: + discType = "DECtape"; + discSubType = "DECtape II"; + + break; + case CommonTypes.MediaType.CompactTapeI: + discType = "CompacTape"; + discSubType = "CompacTape"; + + break; + case CommonTypes.MediaType.CompactTapeII: + discType = "CompacTape"; + discSubType = "CompacTape II"; + + break; + case CommonTypes.MediaType.DLTtapeIII: + discType = "Digital Linear Tape"; + discSubType = "DLTtape III"; + + break; + case CommonTypes.MediaType.DLTtapeIIIxt: + discType = "Digital Linear Tape"; + discSubType = "DLTtape IIIXT"; + + break; + case CommonTypes.MediaType.DLTtapeIV: + discType = "Digital Linear Tape"; + discSubType = "DLTtape IV"; + + break; + case CommonTypes.MediaType.DLTtapeS4: + discType = "Digital Linear Tape"; + discSubType = "DLTtape S4"; + + break; + case CommonTypes.MediaType.SDLT1: + discType = "Super Digital Linear Tape"; + discSubType = "SDLTtape I"; + + break; + case CommonTypes.MediaType.SDLT2: + discType = "Super Digital Linear Tape"; + discSubType = "SDLTtape II"; + + break; + case CommonTypes.MediaType.VStapeI: + discType = "Digital Linear Tape"; + discSubType = "DLTtape VS1"; + + break; + case CommonTypes.MediaType.Data8: + discType = "Data8"; + discSubType = "Data8"; + + break; + case CommonTypes.MediaType.MiniDV: + discType = "DV tape"; + discSubType = "MiniDV"; + + break; + case CommonTypes.MediaType.Exatape15m: + discType = "Exatape"; + discSubType = "Exatape (15m)"; + + break; + case CommonTypes.MediaType.Exatape22m: + discType = "Exatape"; + discSubType = "Exatape (22m)"; + + break; + case CommonTypes.MediaType.Exatape22mAME: + discType = "Exatape"; + discSubType = "Exatape (22m AME)"; + + break; + case CommonTypes.MediaType.Exatape28m: + discType = "Exatape"; + discSubType = "Exatape (28m)"; + + break; + case CommonTypes.MediaType.Exatape40m: + discType = "Exatape"; + discSubType = "Exatape (40m)"; + + break; + case CommonTypes.MediaType.Exatape45m: + discType = "Exatape"; + discSubType = "Exatape (45m)"; + + break; + case CommonTypes.MediaType.Exatape54m: + discType = "Exatape"; + discSubType = "Exatape (54m)"; + + break; + case CommonTypes.MediaType.Exatape75m: + discType = "Exatape"; + discSubType = "Exatape (75m)"; + + break; + case CommonTypes.MediaType.Exatape76m: + discType = "Exatape"; + discSubType = "Exatape (76m)"; + + break; + case CommonTypes.MediaType.Exatape80m: + discType = "Exatape"; + discSubType = "Exatape (80m)"; + + break; + case CommonTypes.MediaType.Exatape106m: + discType = "Exatape"; + discSubType = "Exatape (106m)"; + + break; + case CommonTypes.MediaType.Exatape112m: + discType = "Exatape"; + discSubType = "Exatape (112m)"; + + break; + case CommonTypes.MediaType.Exatape125m: + discType = "Exatape"; + discSubType = "Exatape (125m)"; + + break; + case CommonTypes.MediaType.Exatape150m: + discType = "Exatape"; + discSubType = "Exatape (150m)"; + + break; + case CommonTypes.MediaType.Exatape160mXL: + discType = "Exatape"; + discSubType = "Exatape XL (160m)"; + + break; + case CommonTypes.MediaType.Exatape170m: + discType = "Exatape"; + discSubType = "Exatape (170m)"; + + break; + case CommonTypes.MediaType.Exatape225m: + discType = "Exatape"; + discSubType = "Exatape (225m)"; + + break; + case CommonTypes.MediaType.EZ135: + discType = "3.5\" SyQuest cartridge"; + discSubType = "EZ135"; + + break; + case CommonTypes.MediaType.EZ230: + discType = "3.5\" SyQuest cartridge"; + discSubType = "EZ230"; + + break; + case CommonTypes.MediaType.Quest: + discType = "3.5\" SyQuest cartridge"; + discSubType = "Quest"; + + break; + case CommonTypes.MediaType.SparQ: + discType = "3.5\" SyQuest cartridge"; + discSubType = "SparQ"; + + break; + case CommonTypes.MediaType.SQ100: + discType = "3.9\" SyQuest cartridge"; + discSubType = "SQ100"; + + break; + case CommonTypes.MediaType.SQ200: + discType = "3.9\" SyQuest cartridge"; + discSubType = "SQ200"; + + break; + case CommonTypes.MediaType.SQ300: + discType = "3.9\" SyQuest cartridge"; + discSubType = "SQ300"; + + break; + case CommonTypes.MediaType.SQ310: + discType = "3.5\" SyQuest cartridge"; + discSubType = "SQ310"; + + break; + case CommonTypes.MediaType.SQ327: + discType = "3.5\" SyQuest cartridge"; + discSubType = "SQ327"; + + break; + case CommonTypes.MediaType.SQ400: + discType = "5.25\" SyQuest cartridge"; + discSubType = "SQ400"; + + break; + case CommonTypes.MediaType.SQ800: + discType = "5.25\" SyQuest cartridge"; + discSubType = "SQ800"; + + break; + case CommonTypes.MediaType.SQ1500: + discType = "3.5\" SyQuest cartridge"; + discSubType = "SQ1500"; + + break; + case CommonTypes.MediaType.SQ2000: + discType = "5.25\" SyQuest cartridge"; + discSubType = "SQ2000"; + + break; + case CommonTypes.MediaType.SyJet: + discType = "3.5\" SyQuest cartridge"; + discSubType = "SyJet"; + + break; + case CommonTypes.MediaType.LTO: + discType = "Linear Tape-Open"; + discSubType = "LTO"; + + break; + case CommonTypes.MediaType.LTO2: + discType = "Linear Tape-Open"; + discSubType = "LTO-2"; + + break; + case CommonTypes.MediaType.LTO3: + discType = "Linear Tape-Open"; + discSubType = "LTO-3"; + + break; + case CommonTypes.MediaType.LTO3WORM: + discType = "Linear Tape-Open"; + discSubType = "LTO-3 (WORM)"; + + break; + case CommonTypes.MediaType.LTO4: + discType = "Linear Tape-Open"; + discSubType = "LTO-4"; + + break; + case CommonTypes.MediaType.LTO4WORM: + discType = "Linear Tape-Open"; + discSubType = "LTO-4 (WORM)"; + + break; + case CommonTypes.MediaType.LTO5: + discType = "Linear Tape-Open"; + discSubType = "LTO-5"; + + break; + case CommonTypes.MediaType.LTO5WORM: + discType = "Linear Tape-Open"; + discSubType = "LTO-5 (WORM)"; + + break; + case CommonTypes.MediaType.LTO6: + discType = "Linear Tape-Open"; + discSubType = "LTO-6"; + + break; + case CommonTypes.MediaType.LTO6WORM: + discType = "Linear Tape-Open"; + discSubType = "LTO-6 (WORM)"; + + break; + case CommonTypes.MediaType.LTO7: + discType = "Linear Tape-Open"; + discSubType = "LTO-7"; + + break; + case CommonTypes.MediaType.LTO7WORM: + discType = "Linear Tape-Open"; + discSubType = "LTO-7 (WORM)"; + + break; + case CommonTypes.MediaType.MemoryStick: + discType = "Memory Stick"; + discSubType = "Memory Stick"; + + break; + case CommonTypes.MediaType.MemoryStickDuo: + discType = "Memory Stick"; + discSubType = "Memory Stick Duo"; + + break; + case CommonTypes.MediaType.MemoryStickMicro: + discType = "Memory Stick"; + discSubType = "Memory Stick Micro"; + + break; + case CommonTypes.MediaType.MemoryStickPro: + discType = "Memory Stick"; + discSubType = "Memory Stick Pro"; + + break; + case CommonTypes.MediaType.MemoryStickProDuo: + discType = "Memory Stick"; + discSubType = "Memory Stick PRO Duo"; + + break; + case CommonTypes.MediaType.SecureDigital: + discType = "Secure Digital"; + discSubType = "Secure Digital"; + + break; + case CommonTypes.MediaType.miniSD: + discType = "Secure Digital"; + discSubType = "miniSD"; + + break; + case CommonTypes.MediaType.microSD: + discType = "Secure Digital"; + discSubType = "microSD"; + + break; + case CommonTypes.MediaType.MMC: + discType = "MultiMediaCard"; + discSubType = "MultiMediaCard"; + + break; + case CommonTypes.MediaType.MMCmicro: + discType = "MultiMediaCard"; + discSubType = "MMCmicro"; + + break; + case CommonTypes.MediaType.RSMMC: + discType = "MultiMediaCard"; + discSubType = "Reduced-Size MultiMediaCard"; + + break; + case CommonTypes.MediaType.MMCplus: + discType = "MultiMediaCard"; + discSubType = "MMCplus"; + + break; + case CommonTypes.MediaType.MMCmobile: + discType = "MultiMediaCard"; + discSubType = "MMCmobile"; + + break; + case CommonTypes.MediaType.MLR1: + discType = "Scalable Linear Recording"; + discSubType = "MLR1"; + + break; + case CommonTypes.MediaType.MLR1SL: + discType = "Scalable Linear Recording"; + discSubType = "MLR1 SL"; + + break; + case CommonTypes.MediaType.MLR3: + discType = "Scalable Linear Recording"; + discSubType = "MLR3"; + + break; + case CommonTypes.MediaType.SLR1: + discType = "Scalable Linear Recording"; + discSubType = "SLR1"; + + break; + case CommonTypes.MediaType.SLR2: + discType = "Scalable Linear Recording"; + discSubType = "SLR2"; + + break; + case CommonTypes.MediaType.SLR3: + discType = "Scalable Linear Recording"; + discSubType = "SLR3"; + + break; + case CommonTypes.MediaType.SLR32: + discType = "Scalable Linear Recording"; + discSubType = "SLR32"; + + break; + case CommonTypes.MediaType.SLR32SL: + discType = "Scalable Linear Recording"; + discSubType = "SLR32 SL"; + + break; + case CommonTypes.MediaType.SLR4: + discType = "Scalable Linear Recording"; + discSubType = "SLR4"; + + break; + case CommonTypes.MediaType.SLR5: + discType = "Scalable Linear Recording"; + discSubType = "SLR5"; + + break; + case CommonTypes.MediaType.SLR5SL: + discType = "Scalable Linear Recording"; + discSubType = "SLR5 SL"; + + break; + case CommonTypes.MediaType.SLR6: + discType = "Scalable Linear Recording"; + discSubType = "SLR6"; + + break; + case CommonTypes.MediaType.SLRtape7: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape7"; + + break; + case CommonTypes.MediaType.SLRtape7SL: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape7 SL"; + + break; + case CommonTypes.MediaType.SLRtape24: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape24"; + + break; + case CommonTypes.MediaType.SLRtape24SL: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape24 SL"; + + break; + case CommonTypes.MediaType.SLRtape40: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape40"; + + break; + case CommonTypes.MediaType.SLRtape50: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape50"; + + break; + case CommonTypes.MediaType.SLRtape60: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape60"; + + break; + case CommonTypes.MediaType.SLRtape75: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape75"; + + break; + case CommonTypes.MediaType.SLRtape100: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape100"; + + break; + case CommonTypes.MediaType.SLRtape140: + discType = "Scalable Linear Recording"; + discSubType = "SLRtape140"; + + break; + case CommonTypes.MediaType.QIC11: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-11"; + + break; + case CommonTypes.MediaType.QIC24: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-24"; + + break; + case CommonTypes.MediaType.QIC40: + discType = "Quarter-inch mini cartridge"; + discSubType = "QIC-40"; + + break; + case CommonTypes.MediaType.QIC80: + discType = "Quarter-inch mini cartridge"; + discSubType = "QIC-80"; + + break; + case CommonTypes.MediaType.QIC120: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-120"; + + break; + case CommonTypes.MediaType.QIC150: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-150"; + + break; + case CommonTypes.MediaType.QIC320: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-320"; + + break; + case CommonTypes.MediaType.QIC525: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-525"; + + break; + case CommonTypes.MediaType.QIC1350: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-1350"; + + break; + case CommonTypes.MediaType.QIC3010: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-3010"; + + break; + case CommonTypes.MediaType.QIC3020: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-3020"; + + break; + case CommonTypes.MediaType.QIC3080: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-3080"; + + break; + case CommonTypes.MediaType.QIC3095: + discType = "Quarter-inch cartridge"; + discSubType = "QIC-3095"; + + break; + case CommonTypes.MediaType.Travan: + discType = "Travan"; + discSubType = "TR-1"; + + break; + case CommonTypes.MediaType.Travan1Ex: + discType = "Travan"; + discSubType = "TR-1 Ex"; + + break; + case CommonTypes.MediaType.Travan3: + discType = "Travan"; + discSubType = "TR-3"; + + break; + case CommonTypes.MediaType.Travan3Ex: + discType = "Travan"; + discSubType = "TR-3 Ex"; + + break; + case CommonTypes.MediaType.Travan4: + discType = "Travan"; + discSubType = "TR-4"; + + break; + case CommonTypes.MediaType.Travan5: + discType = "Travan"; + discSubType = "TR-5"; + + break; + case CommonTypes.MediaType.Travan7: + discType = "Travan"; + discSubType = "TR-7"; + + break; + case CommonTypes.MediaType.VXA1: + discType = "VXA"; + discSubType = "VXA-1"; + + break; + case CommonTypes.MediaType.VXA2: + discType = "VXA"; + discSubType = "VXA-2"; + + break; + case CommonTypes.MediaType.VXA3: + discType = "VXA"; + discSubType = "VXA-3"; + + break; + case CommonTypes.MediaType.ECMA_153: + case CommonTypes.MediaType.ECMA_153_512: + discType = "5.25\" magneto-optical"; + discSubType = "ECMA-153"; + + break; + case CommonTypes.MediaType.ECMA_189: + discType = "300mm magneto optical"; + discSubType = "ECMA-189"; + + break; + case CommonTypes.MediaType.ECMA_190: + discType = "300mm magneto optical"; + discSubType = "ECMA-190"; + + break; + case CommonTypes.MediaType.ECMA_195: + case CommonTypes.MediaType.ECMA_195_512: + discType = "5.25\" magneto-optical"; + discSubType = "ECMA-195"; + + break; + case CommonTypes.MediaType.ECMA_223: + case CommonTypes.MediaType.ECMA_223_512: + discType = "3.5\" magneto-optical"; + discSubType = "ECMA-223"; + + break; + case CommonTypes.MediaType.ECMA_238: + discType = "5.25\" magneto-optical"; + discSubType = "ECMA-238"; + + break; + case CommonTypes.MediaType.ECMA_239: + discType = "3.5\" magneto-optical"; + discSubType = "ECMA-239"; + + break; + case CommonTypes.MediaType.ECMA_280: + discType = "5.25\" magneto-optical"; + discSubType = "ECMA-280"; + + break; + case CommonTypes.MediaType.ECMA_317: + discType = "300mm magneto optical"; + discSubType = "ECMA-317"; + + break; + case CommonTypes.MediaType.ECMA_322: + case CommonTypes.MediaType.ECMA_322_512: + case CommonTypes.MediaType.ECMA_322_1k: + case CommonTypes.MediaType.ECMA_322_2k: + discType = "5.25\" magneto-optical"; + discSubType = "ECMA-322 / ISO 22092"; + + break; + case CommonTypes.MediaType.ISO_15286: + case CommonTypes.MediaType.ISO_15286_1024: + case CommonTypes.MediaType.ISO_15286_512: + discType = "5.25\" magneto-optical"; + discSubType = "ISO-15286"; + + break; + case CommonTypes.MediaType.ISO_14517: + case CommonTypes.MediaType.ISO_14517_512: + discType = "5.25\" magneto-optical"; + discSubType = "ISO-14517"; + + break; + case CommonTypes.MediaType.GigaMo: + discType = "3.5\" magneto-optical"; + discSubType = "GIGAMO"; + + break; + case CommonTypes.MediaType.GigaMo2: + discType = "3.5\" magneto-optical"; + discSubType = "2.3GB GIGAMO"; + + break; + case CommonTypes.MediaType.UnknownMO: + discType = "Magneto-optical"; + discSubType = "Unknown"; + + break; + case CommonTypes.MediaType.Floptical: + discType = "Floptical"; + discSubType = "Floptical"; + + break; + case CommonTypes.MediaType.HiFD: + discType = "HiFD"; + discSubType = "HiFD"; + + break; + case CommonTypes.MediaType.LS120: + discType = "SuperDisk"; + discSubType = "LS-120"; + + break; + case CommonTypes.MediaType.LS240: + discType = "SuperDisk"; + discSubType = "LS-240"; + + break; + case CommonTypes.MediaType.FD32MB: + discType = "3.5\" floppy"; + discSubType = "FD32MB"; + + break; + case CommonTypes.MediaType.UHD144: + discType = "UHD144"; + discSubType = "UHD144"; + + break; + case CommonTypes.MediaType.VCDHD: + discType = "VCDHD"; + discSubType = "VCDHD"; + + break; + case CommonTypes.MediaType.HuCard: + discType = "HuCard"; + discSubType = "HuCard"; + + break; + case CommonTypes.MediaType.CompactCassette: + discType = "Compact Cassette"; + discSubType = "Compact Cassette"; + + break; + case CommonTypes.MediaType.Dcas25: + discType = "Compact Cassette"; + discSubType = "D/CAS-25"; + + break; + case CommonTypes.MediaType.Dcas85: + discType = "Compact Cassette"; + discSubType = "D/CAS-85"; + + break; + case CommonTypes.MediaType.Dcas103: + discType = "Compact Cassette"; + discSubType = "D/CAS-103"; + + break; + case CommonTypes.MediaType.PCCardTypeI: + discType = "PCMCIA Card"; + discSubType = "PC-Card Type I"; + + break; + case CommonTypes.MediaType.PCCardTypeII: + discType = "PCMCIA Card"; + discSubType = "PC-Card Type II"; + + break; + case CommonTypes.MediaType.PCCardTypeIII: + discType = "PCMCIA Card"; + discSubType = "PC-Card Type III"; + + break; + case CommonTypes.MediaType.PCCardTypeIV: + discType = "PCMCIA Card"; + discSubType = "PC-Card Type IV"; + + break; + case CommonTypes.MediaType.ExpressCard34: + discType = "Express Card"; + discSubType = "Express Card (34mm)"; + + break; + case CommonTypes.MediaType.ExpressCard54: + discType = "Express Card"; + discSubType = "Express Card (54mm)"; + + break; + case CommonTypes.MediaType.FamicomGamePak: + discType = "Nintendo Famicom Game Pak"; + discSubType = "Nintendo Famicom Game Pak"; + + break; + case CommonTypes.MediaType.GameBoyAdvanceGamePak: + discType = "Nintendo Game Boy Advance Game Pak"; + discSubType = "Nintendo Game Boy Advance Game Pak"; + + break; + case CommonTypes.MediaType.GameBoyGamePak: + discType = "Nintendo Game Boy Game Pak"; + discSubType = "Nintendo Game Boy Game Pak"; + + break; + case CommonTypes.MediaType.N64DD: + discType = "Nintendo 64 Disk"; + discSubType = "Nintendo 64 Disk"; + + break; + case CommonTypes.MediaType.N64GamePak: + discType = "Nintendo 64 Game Pak"; + discSubType = "Nintendo 64 Game Pak"; + + break; + case CommonTypes.MediaType.NESGamePak: + discType = "Nintendo Entertainment System Game Pak"; + discSubType = "Nintendo Entertainment System Game Pak"; + + break; + case CommonTypes.MediaType.Nintendo3DSGameCard: + discType = "Nintendo 3DS Game Card"; + discSubType = "Nintendo 3DS Game Card"; + + break; + case CommonTypes.MediaType.NintendoDiskCard: + discType = "Nintendo Disk Card"; + discSubType = "Nintendo Disk Card"; + + break; + case CommonTypes.MediaType.NintendoDSGameCard: + discType = "Nintendo DS Game Card"; + discSubType = "Nintendo DS Game Card"; + + break; + case CommonTypes.MediaType.NintendoDSiGameCard: + discType = "Nintendo DSi Game Card"; + discSubType = "Nintendo DSi Game Card"; + + break; + case CommonTypes.MediaType.SNESGamePak: + discType = "Super Nintendo Game Pak"; + discSubType = "Super Nintendo Game Pak"; + + break; + case CommonTypes.MediaType.SNESGamePakUS: + discType = "Super Nintendo Game Pak (US)"; + discSubType = "Super Nintendo Game Pak (US)"; + + break; + case CommonTypes.MediaType.SwitchGameCard: + discType = "Nintendo Switch Game Card"; + discSubType = "Nintendo Switch Game Card"; + + break; + case CommonTypes.MediaType.IBM3470: + discType = "IBM 3470"; + discSubType = "IBM 3470"; + + break; + case CommonTypes.MediaType.IBM3480: + discType = "IBM 3480"; + discSubType = "IBM 3480"; + + break; + case CommonTypes.MediaType.IBM3490: + discType = "IBM 3490"; + discSubType = "IBM 3490"; + + break; + case CommonTypes.MediaType.IBM3490E: + discType = "IBM 3490E"; + discSubType = "IBM 3490E"; + + break; + case CommonTypes.MediaType.IBM3592: + discType = "IBM 3592"; + discSubType = "IBM 3592"; + + break; + case CommonTypes.MediaType.STK4480: + discType = "STK 4480"; + discSubType = "STK 4480"; + + break; + case CommonTypes.MediaType.STK4490: + discType = "STK 4490"; + discSubType = "STK 4490"; + + break; + case CommonTypes.MediaType.STK9490: + discType = "STK 9490"; + discSubType = "STK 9490"; + + break; + case CommonTypes.MediaType.T9840A: + discType = "STK T-9840"; + discSubType = "STK T-9840A"; + + break; + case CommonTypes.MediaType.T9840B: + discType = "STK T-9840"; + discSubType = "STK T-9840B"; + + break; + case CommonTypes.MediaType.T9840C: + discType = "STK T-9840"; + discSubType = "STK T-9840C"; + + break; + case CommonTypes.MediaType.T9840D: + discType = "STK T-9840"; + discSubType = "STK T-9840D"; + + break; + case CommonTypes.MediaType.T9940A: + discType = "STK T-9940"; + discSubType = "STK T-9940A"; + + break; + case CommonTypes.MediaType.T9940B: + discType = "STK T-9840"; + discSubType = "STK T-9840B"; + + break; + case CommonTypes.MediaType.T10000A: + discType = "STK T-10000"; + discSubType = "STK T-10000A"; + + break; + case CommonTypes.MediaType.T10000B: + discType = "STK T-10000"; + discSubType = "STK T-10000B"; + + break; + case CommonTypes.MediaType.T10000C: + discType = "STK T-10000"; + discSubType = "STK T-10000C"; + + break; + case CommonTypes.MediaType.T10000D: + discType = "STK T-10000"; + discSubType = "STK T-10000D"; + + break; + case CommonTypes.MediaType.DemiDiskette: + discType = "DemiDiskette"; + discSubType = "DemiDiskette"; + + break; + case CommonTypes.MediaType.QuickDisk: + discType = "QuickDisk"; + discSubType = "QuickDisk"; + + break; + case CommonTypes.MediaType.VideoFloppy: + discType = "VideoFloppy"; + discSubType = "VideoFloppy"; + + break; + case CommonTypes.MediaType.Wafer: + discType = "Wafer"; + discSubType = "Wafer"; + + break; + case CommonTypes.MediaType.ZXMicrodrive: + discType = "ZX Microdrive"; + discSubType = "ZX Microdrive"; + + break; + case CommonTypes.MediaType.BeeCard: + discType = "BeeCard"; + discSubType = "BeeCard"; + + break; + case CommonTypes.MediaType.Borsu: + discType = "Borsu"; + discSubType = "Borsu"; + + break; + case CommonTypes.MediaType.DataStore: + discType = "DataStore"; + discSubType = "DataStore"; + + break; + case CommonTypes.MediaType.DIR: + discType = "DIR"; + discSubType = "DIR"; + + break; + case CommonTypes.MediaType.DST: + discType = "DST"; + discSubType = "DST"; + + break; + case CommonTypes.MediaType.DTF: + discType = "DTF"; + discSubType = "DTF"; + + break; + case CommonTypes.MediaType.DTF2: + discType = "DTF2"; + discSubType = "DTF2"; + + break; + case CommonTypes.MediaType.Flextra3020: + discType = "Flextra"; + discSubType = "Flextra 3020"; + + break; + case CommonTypes.MediaType.Flextra3225: + discType = "Flextra"; + discSubType = "Flextra 3225"; + + break; + case CommonTypes.MediaType.HiTC1: + discType = "HiTC"; + discSubType = "HiTC1"; + + break; + case CommonTypes.MediaType.HiTC2: + discType = "HiTC"; + discSubType = "HiTC2"; + + break; + case CommonTypes.MediaType.LT1: + discType = "LT1"; + discSubType = "LT1"; + + break; + case CommonTypes.MediaType.MiniCard: + discType = "MiniCard"; + discSubType = "MiniCard"; + + break; + case CommonTypes.MediaType.Orb: + discType = "Orb"; + discSubType = "Orb"; + + break; + case CommonTypes.MediaType.Orb5: + discType = "Orb"; + discSubType = "Orb5"; + + break; + case CommonTypes.MediaType.SmartMedia: + discType = "SmartMedia"; + discSubType = "SmartMedia"; + + break; + case CommonTypes.MediaType.xD: + discType = "xD"; + discSubType = "xD"; + + break; + case CommonTypes.MediaType.XQD: + discType = "XQD"; + discSubType = "XQD"; + + break; + case CommonTypes.MediaType.DataPlay: + discType = "DataPlay"; + discSubType = "DataPlay"; + + break; + case CommonTypes.MediaType.PD650: + discType = "PD650"; + discSubType = "PD650"; + + break; + case CommonTypes.MediaType.PD650_WORM: + discType = "PD650"; + discSubType = "PD650 (WORM)"; + + break; + case CommonTypes.MediaType.RA60: + discType = "Hard Disk Drive"; + discSubType = "DEC RA-60"; + + break; + case CommonTypes.MediaType.RA80: + discType = "Hard Disk Drive"; + discSubType = "DEC RA-80"; + + break; + case CommonTypes.MediaType.RA81: + discType = "Hard Disk Drive"; + discSubType = "DEC RA-81"; + + break; + case CommonTypes.MediaType.RC25: + discType = "Hard Disk Drive"; + discSubType = "DEC RC-25"; + + break; + case CommonTypes.MediaType.RD31: + discType = "Hard Disk Drive"; + discSubType = "DEC RD-31"; + + break; + case CommonTypes.MediaType.RD32: + discType = "Hard Disk Drive"; + discSubType = "DEC RD-32"; + + break; + case CommonTypes.MediaType.RD51: + discType = "Hard Disk Drive"; + discSubType = "DEC RD-51"; + + break; + case CommonTypes.MediaType.RD52: + discType = "Hard Disk Drive"; + discSubType = "DEC RD-52"; + + break; + case CommonTypes.MediaType.RD53: + discType = "Hard Disk Drive"; + discSubType = "DEC RD-53"; + + break; + case CommonTypes.MediaType.RD54: + discType = "Hard Disk Drive"; + discSubType = "DEC RD-54"; + + break; + case CommonTypes.MediaType.RK06: + case CommonTypes.MediaType.RK06_18: + discType = "Hard Disk Drive"; + discSubType = "DEC RK-06"; + + break; + case CommonTypes.MediaType.RK07: + case CommonTypes.MediaType.RK07_18: + discType = "Hard Disk Drive"; + discSubType = "DEC RK-07"; + + break; + case CommonTypes.MediaType.RM02: + discType = "Hard Disk Drive"; + discSubType = "DEC RM-02"; + + break; + case CommonTypes.MediaType.RM03: + discType = "Hard Disk Drive"; + discSubType = "DEC RM-03"; + + break; + case CommonTypes.MediaType.RM05: + discType = "Hard Disk Drive"; + discSubType = "DEC RM-05"; + + break; + case CommonTypes.MediaType.RP02: + case CommonTypes.MediaType.RP02_18: + discType = "Hard Disk Drive"; + discSubType = "DEC RP-02"; + + break; + case CommonTypes.MediaType.RP03: + case CommonTypes.MediaType.RP03_18: + discType = "Hard Disk Drive"; + discSubType = "DEC RP-03"; + + break; + case CommonTypes.MediaType.RP04: + case CommonTypes.MediaType.RP04_18: + discType = "Hard Disk Drive"; + discSubType = "DEC RP-04"; + + break; + case CommonTypes.MediaType.RP05: + case CommonTypes.MediaType.RP05_18: + discType = "Hard Disk Drive"; + discSubType = "DEC RP-05"; + + break; + case CommonTypes.MediaType.RP06: + case CommonTypes.MediaType.RP06_18: + discType = "Hard Disk Drive"; + discSubType = "DEC RP-06"; + + break; + case CommonTypes.MediaType.RDX: + discType = "RDX"; + discSubType = "RDX"; + + break; + case CommonTypes.MediaType.RDX320: + discType = "RDX"; + discSubType = "RDX 320"; + + break; + case CommonTypes.MediaType.Zone_HDD: + discType = "Zoned Hard Disk Drive"; + discSubType = "Unknown"; + + break; + case CommonTypes.MediaType.Microdrive: + discType = "Hard Disk Drive"; + discSubType = "Microdrive"; + + break; + case CommonTypes.MediaType.VideoNow: + discType = "VideoNow"; + discSubType = "VideoNow"; + + break; + case CommonTypes.MediaType.VideoNowColor: + discType = "VideoNow"; + discSubType = "VideoNow Color"; + + break; + case CommonTypes.MediaType.VideoNowXp: + discType = "VideoNow"; + discSubType = "VideoNow XP"; + + break; + case CommonTypes.MediaType.KodakVerbatim3: + discType = "Kodak Verbatim"; + discSubType = "Kodak Verbatim (3 Mb)"; + + break; + case CommonTypes.MediaType.KodakVerbatim6: + discType = "Kodak Verbatim"; + discSubType = "Kodak Verbatim (6 Mb)"; + + break; + case CommonTypes.MediaType.KodakVerbatim12: + discType = "Kodak Verbatim"; + discSubType = "Kodak Verbatim (12 Mb)"; + + break; + case CommonTypes.MediaType.ProfessionalDisc: + discType = "Sony Professional Disc"; + discSubType = "Sony Professional Disc (single layer)"; + + break; + case CommonTypes.MediaType.ProfessionalDiscDual: + discType = "Sony Professional Disc"; + discSubType = "Sony Professional Disc (double layer)"; + + break; + case CommonTypes.MediaType.ProfessionalDiscTriple: + discType = "Sony Professional Disc"; + discSubType = "Sony Professional Disc (triple layer)"; + + break; + case CommonTypes.MediaType.ProfessionalDiscQuad: + discType = "Sony Professional Disc"; + discSubType = "Sony Professional Disc (quad layer)"; + + break; + case CommonTypes.MediaType.PDD: + discType = "Sony Professional Disc for DATA"; + discSubType = "Sony Professional Disc for DATA"; + + break; + case CommonTypes.MediaType.PDD_WORM: + discType = "Sony Professional Disc for DATA"; + discSubType = "Sony Professional Disc for DATA (write-once)"; + + break; + case CommonTypes.MediaType.ArchivalDisc: + discType = "Archival Disc"; + discSubType = "Archival Disc"; + + break; + case CommonTypes.MediaType.ArchivalDisc2: + discType = "Archival Disc"; + discSubType = "Archival Disc (2nd generation)"; + + break; + case CommonTypes.MediaType.ArchivalDisc3: + discType = "Archival Disc"; + discSubType = "Archival Disc (3rd generation)"; + + break; + case CommonTypes.MediaType.ODC300R: + discType = "Optical Disc Archive"; + discSubType = "ODC300R"; + + break; + case CommonTypes.MediaType.ODC300RE: + discType = "Optical Disc Archive"; + discSubType = "ODC300RE"; + + break; + case CommonTypes.MediaType.ODC600R: + discType = "Optical Disc Archive"; + discSubType = "ODC600R"; + + break; + case CommonTypes.MediaType.ODC600RE: + discType = "Optical Disc Archive"; + discSubType = "ODC600RE"; + + break; + case CommonTypes.MediaType.ODC1200RE: + discType = "Optical Disc Archive"; + discSubType = "ODC1200RE"; + + break; + case CommonTypes.MediaType.ODC1500R: + discType = "Optical Disc Archive"; + discSubType = "ODC1500R"; + + break; + case CommonTypes.MediaType.ODC3300R: + discType = "Optical Disc Archive"; + discSubType = "ODC3300R"; + + break; + case CommonTypes.MediaType.ODC5500R: + discType = "Optical Disc Archive"; + discSubType = "ODC5500R"; + + break; + case CommonTypes.MediaType.MetaFloppy_Mod_I: + discType = "5.25\" floppy"; + discSubType = "Micropolis MetaFloppy Mod I"; + + break; + case CommonTypes.MediaType.MetaFloppy_Mod_II: + discType = "5.25\" floppy"; + discSubType = "Micropolis MetaFloppy Mod II"; + + break; + case CommonTypes.MediaType.HF12: + discType = "HyperFlex"; + discSubType = "HyperFlex (12Mb)"; + + break; + case CommonTypes.MediaType.HF24: + discType = "HyperFlex"; + discSubType = "HyperFlex (24Mb)"; + + break; + default: + discType = "Unknown"; + discSubType = "Unknown"; + + break; + } + + return (discType, discSubType); + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Metadata/Resume.cs b/Aaru.CommonTypes/Metadata/Resume.cs new file mode 100644 index 000000000..7aaca0c16 --- /dev/null +++ b/Aaru.CommonTypes/Metadata/Resume.cs @@ -0,0 +1,93 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Resume.cs +// Author(s) : Natalia Portillo +// +// 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; } +} + +/// Information that allows to resume a dump +[Serializable] +[XmlRoot("DicResume", Namespace = "", IsNullable = false)] +public class Resume +{ + /// List of blocks that returned an error on reading + [XmlArrayItem("Block")] + public List BadBlocks; + /// List of CD subchannels that did not read correctly + [XmlArrayItem("Block")] + public List BadSubchannels; + /// Extents of BLANK sectors for magneto-opticals + [XmlArrayItem("Extent")] + public Extent[] BlankExtents; + /// Date/time this resume file was created + [XmlElement(DataType = "dateTime")] + public DateTime CreationDate; + /// Last block on media + public ulong LastBlock; + /// Date/time this resume file was last written to + [XmlElement(DataType = "dateTime")] + public DateTime LastWriteDate; + /// Title keys that has not been read + [XmlArrayItem("Block")] + public List MissingTitleKeys; + /// Next block to read + public ulong NextBlock; + /// Is media removable? + public bool Removable; + /// Is media a tape? + public bool Tape; + /// List of dump tries + [XmlArrayItem("DumpTry")] + public List Tries; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Metadata/Statistics.cs b/Aaru.CommonTypes/Metadata/Statistics.cs new file mode 100644 index 000000000..58bad04d1 --- /dev/null +++ b/Aaru.CommonTypes/Metadata/Statistics.cs @@ -0,0 +1,345 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Statistics.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Statistics +[XmlRoot("DicStats", Namespace = "", IsNullable = false)] +public class Stats +{ + /// Executed commands + public CommandsStats Commands; + + /// Operating systems Aaru has run from + [XmlArrayItem("OperatingSystem")] + public List OperatingSystems { get; set; } + + /// Aaru versions + [XmlArrayItem("Version")] + public List Versions { get; set; } + + /// Detected filesystems + [XmlArrayItem("Filesystem")] + public List Filesystems { get; set; } + + /// Detected partitioning schemes + [XmlArrayItem("Scheme")] + public List Partitions { get; set; } + + /// Media image formats + [XmlArrayItem("Format")] + public List MediaImages { get; set; } + + /// Used filters + [XmlArrayItem("Filter", IsNullable = true)] + public List Filters { get; set; } + + /// Found devices + [XmlArrayItem("Device", IsNullable = true)] + public List Devices { get; set; } + + /// Found media types, real, and in image + [XmlArrayItem("Media")] + public List Medias { get; set; } + + /// Benchmark statistics + public BenchmarkStats Benchmark { get; set; } + + /// Media scanning statistics + public MediaScanStats MediaScan { get; set; } + + /// Image verification statistics + 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; + +/// DTO for statistics +[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")] +public class StatsDto +{ + /// Executed commands + public List Commands { get; set; } + + /// Operating systems Aaru has run from + public List OperatingSystems { get; set; } + + /// Aaru versions + public List Versions { get; set; } + + /// Detected filesystems + public List Filesystems { get; set; } + + /// Detected partitioning schemes + public List Partitions { get; set; } + + /// Media image formats + public List MediaFormats { get; set; } + + /// Used filters + public List Filters { get; set; } + + /// Found devices + public List Devices { get; set; } + + /// Found media types, real, and in image + public List Medias { get; set; } + + /// Remote applications + public List RemoteApplications { get; set; } + + /// Remote application architectures + public List RemoteArchitectures { get; set; } + + /// Operating systems where a remote application has been running + public List RemoteOperatingSystems { get; set; } +} + +/// Command execution statistics +[SuppressMessage("ReSharper", "UnassignedField.Global")] +public class CommandsStats +{ + /// Number of times the filesystem info command has been used + public long Analyze; + /// Number of times the benchmark command has been used + public long Benchmark; + /// Number of times the image checksum command has been used + public long Checksum; + /// Number of times the image compare command has been used + public long Compare; + /// Number of times the image convert command has been used + public long ConvertImage; + /// Number of times the image create-sidecar command has been used + public long CreateSidecar; + /// Number of times the image decode command has been used + public long Decode; + /// Number of times the device info command has been used + public long DeviceInfo; + /// Number of times the device report command has been used + public long DeviceReport; + /// Number of times the media dump command has been used + public long DumpMedia; + /// Number of times the image entropy command has been used + public long Entropy; + /// Number of times the filesystem extract command has been used + public long ExtractFiles; + /// Number of times the list formats command has been used + public long Formats; + /// Number of times the image info command has been used + public long ImageInfo; + /// Number of times the device list command has been used + public long ListDevices; + /// Number of times the list encodings command has been used + public long ListEncodings; + /// Number of times the filesystem ls command has been used + public long Ls; + /// Number of times the media info command has been used + public long MediaInfo; + /// Number of times the media scan command has been used + public long MediaScan; + /// Number of times the image printhex command has been used + public long PrintHex; + /// Number of times the image verify command has been used + public long Verify; +} + +/// Statistics of verified media +public class VerifiedItems +{ + /// Number of correct images + public long Correct; + /// Number of failed images + public long Failed; +} + +/// Verification statistics +public class VerifyStats +{ + /// Image verification statistics + public VerifiedItems MediaImages; + /// Image contents verification statistics + public ScannedSectors Sectors; +} + +/// Image contents verification statistics +public class ScannedSectors +{ + /// Sectors found to be correct + public long Correct; + /// Sectors found to be incorrect + public long Error; + /// Total number of verified sectors + public long Total; + /// Total number of sectors that could not be verified + public long Unverifiable; +} + +/// Media scanning time statistics +[SuppressMessage("ReSharper", "InconsistentNaming")] +public class TimeStats +{ + /// Number of sectors that took more than 3ms but less than 100ms to read + public long LessThan10ms; + /// Number of sectors that took more than 50ms but less than 150ms to read + public long LessThan150ms; + /// Number of sectors that took less than 3ms to read + public long LessThan3ms; + /// Number of sectors that took more than 150ms but less than 500ms to read + public long LessThan500ms; + /// Number of sectors that took more than 10ms but less than 50ms to read + public long LessThan50ms; + /// Number of sectors that took more than 500ms to read + public long MoreThan500ms; +} + +/// Media scanning statistics +public class MediaScanStats +{ + /// Statistics of scanned sectors + public ScannedSectors Sectors; + /// Scan time statistics + public TimeStats Times; +} + +/// Checksum type statistics +[SuppressMessage("ReSharper", "InconsistentNaming")] +public class ChecksumStats +{ + /// Checksum algorithm + [XmlAttribute] + public string algorithm; + /// Time taken to execute algorithm + [XmlText] + public double Value; +} + +/// Benchmark statistics +public class BenchmarkStats +{ + /// Total time taken to run the checksum algorithms in parallel + public double All; + /// List of time taken by each checksum algorithm + [XmlElement("Checksum")] + public List Checksum; + /// Time taken to benchmark entropy calculation + public double Entropy; + /// Maximum amount of memory used while running the benchmark + public long MaxMemory; + /// Minimum amount of memory used while running the benchmark + public long MinMemory; + /// Total time taken to run the checksum algorithms sequentially + public double Sequential; +} + +/// Media statistics +[SuppressMessage("ReSharper", "InconsistentNaming")] +public class MediaStats +{ + /// Media type + [XmlAttribute(AttributeName = "type")] + [JsonPropertyName("type")] + public string MediaType; + /// Found in a real device? + [XmlAttribute] + public bool real; + /// Number of times it has been found + [XmlText] + public long Value; +} + +/// Device statistics +public class DeviceStats +{ + /// Is manufacturer null? + [XmlIgnore] + public bool ManufacturerSpecified; + + /// Manufacturer string + public string Manufacturer { get; set; } + + /// Model string + public string Model { get; set; } + + /// Revision or firmware version + public string Revision { get; set; } + + /// Bus the device was attached to + public string Bus { get; set; } +} + +/// Name=value pair statistics +[SuppressMessage("ReSharper", "InconsistentNaming")] +public class NameValueStats +{ + /// Name + [XmlAttribute] + public string name { get; set; } + + /// Number of times it has been used/found + [XmlText] + public long Value { get; set; } +} + +/// Operating system statistics +[SuppressMessage("ReSharper", "InconsistentNaming")] +public class OsStats +{ + /// Operating system name + [XmlAttribute] + public string name { get; set; } + + /// Operating system version + [XmlAttribute] + public string version { get; set; } + + /// Number of times Aaru run on it + [XmlText] + public long Value { get; set; } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Metadata/Version.cs b/Aaru.CommonTypes/Metadata/Version.cs new file mode 100644 index 000000000..fd18d5a85 --- /dev/null +++ b/Aaru.CommonTypes/Metadata/Version.cs @@ -0,0 +1,55 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Statistics.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// Manages Aaru's version for metadata +public static class Version +{ + /// Gets XML software type for the running version + /// XML software type + public static Software GetSoftware() => new() + { + Name = "Aaru", + OperatingSystem = DetectOS.GetRealPlatformID().ToString(), + Version = typeof(Version).Assembly.GetName().Version?.ToString() + }; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Metadata/cicm.cs b/Aaru.CommonTypes/Metadata/cicm.cs new file mode 100644 index 000000000..18063588b --- /dev/null +++ b/Aaru.CommonTypes/Metadata/cicm.cs @@ -0,0 +1,7390 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +//This source code was auto-generated by MonoXSD +// + +using System; +using System.CodeDom.Compiler; +using System.ComponentModel; +using System.Diagnostics; +using System.Xml.Serialization; + +namespace Schemas; + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code"), + XmlRoot("CICMMetadata", Namespace = "", IsNullable = false), Obsolete("Will be removed in Aaru 7")] +public class CICMMetadataType +{ + string[] developerField; + + string[] publisherField; + + string[] authorField; + + string[] performerField; + + string nameField; + + string versionField; + + CICMMetadataTypeReleaseType releaseTypeField; + + bool releaseTypeFieldSpecified; + + DateTime releaseDateField; + + bool releaseDateFieldSpecified; + + BarcodeType[] barcodesField; + + string partNumberField; + + string serialNumberField; + + string[] keywordsField; + + MagazineType[] magazineField; + + BookType[] bookField; + + string[] categoriesField; + + string[] subcategoriesField; + + LanguagesTypeLanguage[] languagesField; + + string[] systemsField; + + ArchitecturesTypeArchitecture[] architecturesField; + + RequiredOperatingSystemType[] requiredOperatingSystemsField; + + UserManualType[] userManualField; + + OpticalDiscType[] opticalDiscField; + + AdvertisementType[] advertisementField; + + LinearMediaType[] linearMediaField; + + PCIType[] pCICardField; + + BlockMediaType[] blockMediaField; + + AudioMediaType[] audioMediaField; + + /// + [XmlElement("Developer")] + public string[] Developer + { + get => developerField; + set => developerField = value; + } + + /// + [XmlElement("Publisher")] + public string[] Publisher + { + get => publisherField; + set => publisherField = value; + } + + /// + [XmlElement("Author")] + public string[] Author + { + get => authorField; + set => authorField = value; + } + + /// + [XmlElement("Performer")] + public string[] Performer + { + get => performerField; + set => performerField = value; + } + + /// + public string Name + { + get => nameField; + set => nameField = value; + } + + /// + public string Version + { + get => versionField; + set => versionField = value; + } + + /// + public CICMMetadataTypeReleaseType ReleaseType + { + get => releaseTypeField; + set => releaseTypeField = value; + } + + /// + [XmlIgnore] + public bool ReleaseTypeSpecified + { + get => releaseTypeFieldSpecified; + set => releaseTypeFieldSpecified = value; + } + + /// + [XmlElement(DataType = "date")] + public DateTime ReleaseDate + { + get => releaseDateField; + set => releaseDateField = value; + } + + /// + [XmlIgnore] + public bool ReleaseDateSpecified + { + get => releaseDateFieldSpecified; + set => releaseDateFieldSpecified = value; + } + + /// + [XmlArrayItem("Barcode", IsNullable = false)] + public BarcodeType[] Barcodes + { + get => barcodesField; + set => barcodesField = value; + } + + /// + public string PartNumber + { + get => partNumberField; + set => partNumberField = value; + } + + /// + public string SerialNumber + { + get => serialNumberField; + set => serialNumberField = value; + } + + /// + [XmlArrayItem("Keyword", IsNullable = false)] + public string[] Keywords + { + get => keywordsField; + set => keywordsField = value; + } + + /// + [XmlElement("Magazine")] + public MagazineType[] Magazine + { + get => magazineField; + set => magazineField = value; + } + + /// + [XmlElement("Book")] + public BookType[] Book + { + get => bookField; + set => bookField = value; + } + + /// + [XmlArrayItem("Category", IsNullable = false)] + public string[] Categories + { + get => categoriesField; + set => categoriesField = value; + } + + /// + [XmlArrayItem("Subcategory", IsNullable = false)] + public string[] Subcategories + { + get => subcategoriesField; + set => subcategoriesField = value; + } + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Languages + { + get => languagesField; + set => languagesField = value; + } + + /// + [XmlArrayItem("System", IsNullable = false)] + public string[] Systems + { + get => systemsField; + set => systemsField = value; + } + + /// + [XmlArrayItem("Architecture", IsNullable = false)] + public ArchitecturesTypeArchitecture[] Architectures + { + get => architecturesField; + set => architecturesField = value; + } + + /// + [XmlArrayItem("RequiredOperatingSystem", IsNullable = false)] + public RequiredOperatingSystemType[] RequiredOperatingSystems + { + get => requiredOperatingSystemsField; + set => requiredOperatingSystemsField = value; + } + + /// + [XmlElement("UserManual")] + public UserManualType[] UserManual + { + get => userManualField; + set => userManualField = value; + } + + /// + [XmlElement("OpticalDisc")] + public OpticalDiscType[] OpticalDisc + { + get => opticalDiscField; + set => opticalDiscField = value; + } + + /// + [XmlElement("Advertisement")] + public AdvertisementType[] Advertisement + { + get => advertisementField; + set => advertisementField = value; + } + + /// + [XmlElement("LinearMedia")] + public LinearMediaType[] LinearMedia + { + get => linearMediaField; + set => linearMediaField = value; + } + + /// + [XmlElement("PCICard")] + public PCIType[] PCICard + { + get => pCICardField; + set => pCICardField = value; + } + + /// + [XmlElement("BlockMedia")] + public BlockMediaType[] BlockMedia + { + get => blockMediaField; + set => blockMediaField = value; + } + + /// + [XmlElement("AudioMedia")] + public AudioMediaType[] AudioMedia + { + get => audioMediaField; + set => audioMediaField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum CICMMetadataTypeReleaseType +{ + /// + Retail, + + /// + Bundle, + + /// + Coverdisc, + + /// + Subscription, + + /// + Demo, + + /// + OEM, + + /// + Shareware, + + /// + FOSS, + + /// + Adware, + + /// + Donationware, + + /// + [XmlEnum("Digital download")] + Digitaldownload, + + /// + SaaS +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class BarcodeType +{ + BarcodeTypeType typeField; + + string valueField; + + /// + [XmlAttribute] + public BarcodeTypeType type + { + get => typeField; + set => typeField = value; + } + + /// + [XmlText] + public string Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum BarcodeTypeType +{ + /// + aztec, + + /// + codabar, + + /// + code11, + + /// + code128, + + /// + code39, + + /// + code93, + + /// + cpcbinary, + + /// + ezcode, + + /// + fim, + + /// + itf, + + /// + itf14, + + /// + ean13, + + /// + ean8, + + /// + maxicode, + + /// + isbn, + + /// + isrc, + + /// + msi, + + /// + tof, + + /// + shotcode, + + /// + rm4scc, + + /// + qr, + + /// + ean5, + + /// + ean2, + + /// + [XmlEnum("qr")] + qr1, + + /// + postnet, + + /// + postbar, + + /// + plessey, + + /// + pharmacode, + + /// + pdf417, + + /// + patchcode +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class AudioBlockType +{ + ImageType imageField; + + ulong sizeField; + + string accoustIDField; + + ChecksumType[] checksumsField; + + string formatField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + public string AccoustID + { + get => accoustIDField; + set => accoustIDField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + public string Format + { + get => formatField; + set => formatField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ImageType +{ + string formatField; + + ulong offsetField; + + bool offsetFieldSpecified; + + string valueField; + + /// + [XmlAttribute] + public string format + { + get => formatField; + set => formatField = value; + } + + /// + [XmlAttribute] + public ulong offset + { + get => offsetField; + set => offsetField = value; + } + + /// + [XmlIgnore] + public bool offsetSpecified + { + get => offsetFieldSpecified; + set => offsetFieldSpecified = value; + } + + /// + [XmlText] + public string Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ChecksumType +{ + ChecksumTypeType typeField; + + string valueField; + + /// + [XmlAttribute] + public ChecksumTypeType type + { + get => typeField; + set => typeField = value; + } + + /// + [XmlText] + public string Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum ChecksumTypeType +{ + /// + 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 +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class AudioMediaType +{ + ImageType imageField; + + ulong sizeField; + + ChecksumType[] checksumsField; + + SequenceType sequenceField; + + string partNumberField; + + string serialNumberField; + + string manufacturerField; + + string modelField; + + string accoustIDField; + + AudioBlockType[] blockField; + + string copyProtectionField; + + DimensionsType dimensionsField; + + ScansType scansField; + + DumpHardwareType[] dumpHardwareArrayField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + public SequenceType Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + public string PartNumber + { + get => partNumberField; + set => partNumberField = value; + } + + /// + public string SerialNumber + { + get => serialNumberField; + set => serialNumberField = value; + } + + /// + public string Manufacturer + { + get => manufacturerField; + set => manufacturerField = value; + } + + /// + public string Model + { + get => modelField; + set => modelField = value; + } + + /// + public string AccoustID + { + get => accoustIDField; + set => accoustIDField = value; + } + + /// + [XmlElement("Block")] + public AudioBlockType[] Block + { + get => blockField; + set => blockField = value; + } + + /// + public string CopyProtection + { + get => copyProtectionField; + set => copyProtectionField = value; + } + + /// + public DimensionsType Dimensions + { + get => dimensionsField; + set => dimensionsField = value; + } + + /// + public ScansType Scans + { + get => scansField; + set => scansField = value; + } + + /// + [XmlArrayItem("DumpHardware", IsNullable = false)] + public DumpHardwareType[] DumpHardwareArray + { + get => dumpHardwareArrayField; + set => dumpHardwareArrayField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class SequenceType +{ + string mediaTitleField; + + uint mediaSequenceField; + + uint totalMediaField; + + byte sideField; + + bool sideFieldSpecified; + + byte layerField; + + bool layerFieldSpecified; + + /// + public string MediaTitle + { + get => mediaTitleField; + set => mediaTitleField = value; + } + + /// + public uint MediaSequence + { + get => mediaSequenceField; + set => mediaSequenceField = value; + } + + /// + public uint TotalMedia + { + get => totalMediaField; + set => totalMediaField = value; + } + + /// + public byte Side + { + get => sideField; + set => sideField = value; + } + + /// + [XmlIgnore] + public bool SideSpecified + { + get => sideFieldSpecified; + set => sideFieldSpecified = value; + } + + /// + public byte Layer + { + get => layerField; + set => layerField = value; + } + + /// + [XmlIgnore] + public bool LayerSpecified + { + get => layerFieldSpecified; + set => layerFieldSpecified = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class DimensionsType +{ + double diameterField; + + bool diameterFieldSpecified; + + double heightField; + + bool heightFieldSpecified; + + double widthField; + + bool widthFieldSpecified; + + double thicknessField; + + /// + public double Diameter + { + get => diameterField; + set => diameterField = value; + } + + /// + [XmlIgnore] + public bool DiameterSpecified + { + get => diameterFieldSpecified; + set => diameterFieldSpecified = value; + } + + /// + public double Height + { + get => heightField; + set => heightField = value; + } + + /// + [XmlIgnore] + public bool HeightSpecified + { + get => heightFieldSpecified; + set => heightFieldSpecified = value; + } + + /// + public double Width + { + get => widthField; + set => widthField = value; + } + + /// + [XmlIgnore] + public bool WidthSpecified + { + get => widthFieldSpecified; + set => widthFieldSpecified = value; + } + + /// + public double Thickness + { + get => thicknessField; + set => thicknessField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ScansType +{ + CaseScanType caseScanField; + + MediaScanType scanField; + + /// + public CaseScanType CaseScan + { + get => caseScanField; + set => caseScanField = value; + } + + /// + public MediaScanType Scan + { + get => scanField; + set => scanField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class CaseScanType +{ + CaseScanTypeCaseScanElement caseScanElementField; + + ScanType scanField; + + /// + public CaseScanTypeCaseScanElement CaseScanElement + { + get => caseScanElementField; + set => caseScanElementField = value; + } + + /// + public ScanType Scan + { + get => scanField; + set => scanField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum CaseScanTypeCaseScanElement +{ + /// + sleeve, + + /// + inner, + + /// + inlay, + + /// + frontback, + + /// + frontfull, + + /// + boxfront, + + /// + boxback, + + /// + boxspine, + + /// + external +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ScanType +{ + FileType fileField; + + ChecksumType[] checksumsField; + + ScannerType[] scannerField; + + ScanProcessingType[] scanProcessingField; + + OCRType[] oCRField; + + /// + public FileType File + { + get => fileField; + set => fileField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlElement("Scanner")] + public ScannerType[] Scanner + { + get => scannerField; + set => scannerField = value; + } + + /// + [XmlElement("ScanProcessing")] + public ScanProcessingType[] ScanProcessing + { + get => scanProcessingField; + set => scanProcessingField = value; + } + + /// + [XmlElement("OCR")] + public OCRType[] OCR + { + get => oCRField; + set => oCRField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class FileType +{ + string formatField; + + string valueField; + + /// + [XmlAttribute] + public string format + { + get => formatField; + set => formatField = value; + } + + /// + [XmlText] + public string Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ScannerType +{ + string authorField; + + string manufacturerField; + + string modelField; + + string serialField; + + string softwareField; + + string softwareVersionField; + + /// + public string Author + { + get => authorField; + set => authorField = value; + } + + /// + public string Manufacturer + { + get => manufacturerField; + set => manufacturerField = value; + } + + /// + public string Model + { + get => modelField; + set => modelField = value; + } + + /// + public string Serial + { + get => serialField; + set => serialField = value; + } + + /// + public string Software + { + get => softwareField; + set => softwareField = value; + } + + /// + public string SoftwareVersion + { + get => softwareVersionField; + set => softwareVersionField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ScanProcessingType +{ + string authorField; + + string softwareField; + + string softwareVersionField; + + /// + public string Author + { + get => authorField; + set => authorField = value; + } + + /// + public string Software + { + get => softwareField; + set => softwareField = value; + } + + /// + public string SoftwareVersion + { + get => softwareVersionField; + set => softwareVersionField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class OCRType +{ + string authorField; + + string softwareField; + + string softwareVersionField; + + LanguagesTypeLanguage[] languageField; + + /// + public string Author + { + get => authorField; + set => authorField = value; + } + + /// + public string Software + { + get => softwareField; + set => softwareField = value; + } + + /// + public string SoftwareVersion + { + get => softwareVersionField; + set => softwareVersionField = value; + } + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Language + { + get => languageField; + set => languageField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum LanguagesTypeLanguage +{ + /// + 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, + + /// + [XmlEnum("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 +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class MediaScanType +{ + MediaScanTypeMediaScanElement mediaScanElementField; + + ScanType scanField; + + /// + public MediaScanTypeMediaScanElement MediaScanElement + { + get => mediaScanElementField; + set => mediaScanElementField = value; + } + + /// + public ScanType Scan + { + get => scanField; + set => scanField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum MediaScanTypeMediaScanElement +{ + /// + up, + + /// + down, + + /// + front, + + /// + back, + + /// + left, + + /// + right +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class DumpHardwareType +{ + string manufacturerField; + + string modelField; + + string revisionField; + + string firmwareField; + + string serialField; + + ExtentType[] extentsField; + + SoftwareType softwareField; + + /// + public string Manufacturer + { + get => manufacturerField; + set => manufacturerField = value; + } + + /// + public string Model + { + get => modelField; + set => modelField = value; + } + + /// + public string Revision + { + get => revisionField; + set => revisionField = value; + } + + /// + public string Firmware + { + get => firmwareField; + set => firmwareField = value; + } + + /// + public string Serial + { + get => serialField; + set => serialField = value; + } + + /// + [XmlArrayItem("Extent", IsNullable = false)] + public ExtentType[] Extents + { + get => extentsField; + set => extentsField = value; + } + + /// + public SoftwareType Software + { + get => softwareField; + set => softwareField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ExtentType +{ + ulong startField; + + ulong endField; + + /// + public ulong Start + { + get => startField; + set => startField = value; + } + + /// + public ulong End + { + get => endField; + set => endField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class SoftwareType +{ + string nameField; + + string versionField; + + string operatingSystemField; + + /// + public string Name + { + get => nameField; + set => nameField = value; + } + + /// + public string Version + { + get => versionField; + set => versionField = value; + } + + /// + public string OperatingSystem + { + get => operatingSystemField; + set => operatingSystemField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class BlockTrackType +{ + ImageType imageField; + + ulong sizeField; + + ushort headField; + + uint cylinderField; + + ulong startSectorField; + + ulong endSectorField; + + ulong sectorsField; + + uint bytesPerSectorField; + + ChecksumType[] checksumsField; + + string formatField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + public ushort Head + { + get => headField; + set => headField = value; + } + + /// + public uint Cylinder + { + get => cylinderField; + set => cylinderField = value; + } + + /// + public ulong StartSector + { + get => startSectorField; + set => startSectorField = value; + } + + /// + public ulong EndSector + { + get => endSectorField; + set => endSectorField = value; + } + + /// + public ulong Sectors + { + get => sectorsField; + set => sectorsField = value; + } + + /// + public uint BytesPerSector + { + get => bytesPerSectorField; + set => bytesPerSectorField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + public string Format + { + get => formatField; + set => formatField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class USBType +{ + ushort vendorIDField; + + ushort productIDField; + + DumpType descriptorsField; + + /// + public ushort VendorID + { + get => vendorIDField; + set => vendorIDField = value; + } + + /// + public ushort ProductID + { + get => productIDField; + set => productIDField = value; + } + + /// + public DumpType Descriptors + { + get => descriptorsField; + set => descriptorsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class DumpType +{ + string imageField; + + ulong sizeField; + + ChecksumType[] checksumsField; + + /// + public string Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class EVPDType +{ + string imageField; + + ulong sizeField; + + ChecksumType[] checksumsField; + + byte pageField; + + bool pageFieldSpecified; + + /// + public string Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlAttribute] + public byte page + { + get => pageField; + set => pageField = value; + } + + /// + [XmlIgnore] + public bool pageSpecified + { + get => pageFieldSpecified; + set => pageFieldSpecified = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class SCSIType +{ + DumpType inquiryField; + + EVPDType[] eVPDField; + + DumpType modeSenseField; + + DumpType modeSense10Field; + + DumpType logSenseField; + + /// + public DumpType Inquiry + { + get => inquiryField; + set => inquiryField = value; + } + + /// + [XmlElement("EVPD")] + public EVPDType[] EVPD + { + get => eVPDField; + set => eVPDField = value; + } + + /// + public DumpType ModeSense + { + get => modeSenseField; + set => modeSenseField = value; + } + + /// + public DumpType ModeSense10 + { + get => modeSense10Field; + set => modeSense10Field = value; + } + + /// + public DumpType LogSense + { + get => logSenseField; + set => logSenseField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class MultiMediaCardType +{ + DumpType cIDField; + + DumpType cSDField; + + DumpType extendedCSDField; + + DumpType oCRField; + + /// + public DumpType CID + { + get => cIDField; + set => cIDField = value; + } + + /// + public DumpType CSD + { + get => cSDField; + set => cSDField = value; + } + + /// + public DumpType ExtendedCSD + { + get => extendedCSDField; + set => extendedCSDField = value; + } + + /// + public DumpType OCR + { + get => oCRField; + set => oCRField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class SecureDigitalType +{ + DumpType cIDField; + + DumpType cSDField; + + DumpType sCRField; + + DumpType oCRField; + + /// + public DumpType CID + { + get => cIDField; + set => cIDField = value; + } + + /// + public DumpType CSD + { + get => cSDField; + set => cSDField = value; + } + + /// + public DumpType SCR + { + get => sCRField; + set => sCRField = value; + } + + /// + public DumpType OCR + { + get => oCRField; + set => oCRField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ATAType +{ + DumpType identifyField; + + /// + public DumpType Identify + { + get => identifyField; + set => identifyField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class TapeFileType +{ + ImageType imageField; + + ulong sizeField; + + ulong sequenceField; + + ulong blockSizeField; + + ulong startBlockField; + + ulong endBlockField; + + ChecksumType[] checksumsField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + public ulong Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + public ulong BlockSize + { + get => blockSizeField; + set => blockSizeField = value; + } + + /// + public ulong StartBlock + { + get => startBlockField; + set => startBlockField = value; + } + + /// + public ulong EndBlock + { + get => endBlockField; + set => endBlockField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class TapePartitionType +{ + ImageType imageField; + + ulong sizeField; + + ulong sequenceField; + + ulong startBlockField; + + ulong endBlockField; + + ChecksumType[] checksumsField; + + TapeFileType[] fileField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + public ulong Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + public ulong StartBlock + { + get => startBlockField; + set => startBlockField = value; + } + + /// + public ulong EndBlock + { + get => endBlockField; + set => endBlockField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlElement("File")] + public TapeFileType[] File + { + get => fileField; + set => fileField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class BlockSizeType +{ + uint startingBlockField; + + uint valueField; + + /// + [XmlAttribute] + public uint startingBlock + { + get => startingBlockField; + set => startingBlockField = value; + } + + /// + [XmlText] + public uint Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class BlockMediaType +{ + ImageType imageField; + + ulong sizeField; + + ChecksumType[] checksumsField; + + ChecksumType[] contentChecksumsField; + + SequenceType sequenceField; + + string manufacturerField; + + string modelField; + + string serialField; + + string firmwareField; + + string interfaceField; + + string partNumberField; + + string serialNumberField; + + uint physicalBlockSizeField; + + uint logicalBlockSizeField; + + ulong logicalBlocksField; + + BlockSizeType[] variableBlockSizeField; + + TapePartitionType[] tapeInformationField; + + ScansType scansField; + + ATAType aTAField; + + PCIType pCIField; + + PCMCIAType pCMCIAField; + + SecureDigitalType secureDigitalField; + + MultiMediaCardType multiMediaCardField; + + SCSIType sCSIField; + + USBType uSBField; + + DumpType mAMField; + + ushort headsField; + + bool headsFieldSpecified; + + uint cylindersField; + + bool cylindersFieldSpecified; + + ulong sectorsPerTrackField; + + bool sectorsPerTrackFieldSpecified; + + BlockTrackType[] trackField; + + string copyProtectionField; + + DimensionsType dimensionsField; + + PartitionType[] fileSystemInformationField; + + DumpHardwareType[] dumpHardwareArrayField; + + string diskTypeField; + + string diskSubTypeField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] ContentChecksums + { + get => contentChecksumsField; + set => contentChecksumsField = value; + } + + /// + public SequenceType Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + public string Manufacturer + { + get => manufacturerField; + set => manufacturerField = value; + } + + /// + public string Model + { + get => modelField; + set => modelField = value; + } + + /// + public string Serial + { + get => serialField; + set => serialField = value; + } + + /// + public string Firmware + { + get => firmwareField; + set => firmwareField = value; + } + + /// + public string Interface + { + get => interfaceField; + set => interfaceField = value; + } + + /// + public string PartNumber + { + get => partNumberField; + set => partNumberField = value; + } + + /// + public string SerialNumber + { + get => serialNumberField; + set => serialNumberField = value; + } + + /// + public uint PhysicalBlockSize + { + get => physicalBlockSizeField; + set => physicalBlockSizeField = value; + } + + /// + public uint LogicalBlockSize + { + get => logicalBlockSizeField; + set => logicalBlockSizeField = value; + } + + /// + public ulong LogicalBlocks + { + get => logicalBlocksField; + set => logicalBlocksField = value; + } + + /// + [XmlArrayItem("BlockSize", IsNullable = false)] + public BlockSizeType[] VariableBlockSize + { + get => variableBlockSizeField; + set => variableBlockSizeField = value; + } + + /// + [XmlArrayItem("Partition", IsNullable = false)] + public TapePartitionType[] TapeInformation + { + get => tapeInformationField; + set => tapeInformationField = value; + } + + /// + public ScansType Scans + { + get => scansField; + set => scansField = value; + } + + /// + public ATAType ATA + { + get => aTAField; + set => aTAField = value; + } + + /// + public PCIType PCI + { + get => pCIField; + set => pCIField = value; + } + + /// + public PCMCIAType PCMCIA + { + get => pCMCIAField; + set => pCMCIAField = value; + } + + /// + public SecureDigitalType SecureDigital + { + get => secureDigitalField; + set => secureDigitalField = value; + } + + /// + public MultiMediaCardType MultiMediaCard + { + get => multiMediaCardField; + set => multiMediaCardField = value; + } + + /// + public SCSIType SCSI + { + get => sCSIField; + set => sCSIField = value; + } + + /// + public USBType USB + { + get => uSBField; + set => uSBField = value; + } + + /// + public DumpType MAM + { + get => mAMField; + set => mAMField = value; + } + + /// + public ushort Heads + { + get => headsField; + set => headsField = value; + } + + /// + [XmlIgnore] + public bool HeadsSpecified + { + get => headsFieldSpecified; + set => headsFieldSpecified = value; + } + + /// + public uint Cylinders + { + get => cylindersField; + set => cylindersField = value; + } + + /// + [XmlIgnore] + public bool CylindersSpecified + { + get => cylindersFieldSpecified; + set => cylindersFieldSpecified = value; + } + + /// + public ulong SectorsPerTrack + { + get => sectorsPerTrackField; + set => sectorsPerTrackField = value; + } + + /// + [XmlIgnore] + public bool SectorsPerTrackSpecified + { + get => sectorsPerTrackFieldSpecified; + set => sectorsPerTrackFieldSpecified = value; + } + + /// + [XmlElement("Track")] + public BlockTrackType[] Track + { + get => trackField; + set => trackField = value; + } + + /// + public string CopyProtection + { + get => copyProtectionField; + set => copyProtectionField = value; + } + + /// + public DimensionsType Dimensions + { + get => dimensionsField; + set => dimensionsField = value; + } + + /// + [XmlArrayItem("Partition", IsNullable = false)] + public PartitionType[] FileSystemInformation + { + get => fileSystemInformationField; + set => fileSystemInformationField = value; + } + + /// + [XmlArrayItem("DumpHardware", IsNullable = false)] + public DumpHardwareType[] DumpHardwareArray + { + get => dumpHardwareArrayField; + set => dumpHardwareArrayField = value; + } + + /// + public string DiskType + { + get => diskTypeField; + set => diskTypeField = value; + } + + /// + public string DiskSubType + { + get => diskSubTypeField; + set => diskSubTypeField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class PCIType +{ + ushort vendorIDField; + + ushort deviceIDField; + + DumpType configurationField; + + LinearMediaType expansionROMField; + + /// + public ushort VendorID + { + get => vendorIDField; + set => vendorIDField = value; + } + + /// + public ushort DeviceID + { + get => deviceIDField; + set => deviceIDField = value; + } + + /// + public DumpType Configuration + { + get => configurationField; + set => configurationField = value; + } + + /// + public LinearMediaType ExpansionROM + { + get => expansionROMField; + set => expansionROMField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class LinearMediaType +{ + ImageType imageField; + + ulong sizeField; + + ChecksumType[] imageChecksumsField; + + ChecksumType[] checksumsField; + + string partNumberField; + + string serialNumberField; + + string titleField; + + uint sequenceField; + + bool sequenceFieldSpecified; + + uint imageInterleaveField; + + bool imageInterleaveFieldSpecified; + + uint interleaveField; + + bool interleaveFieldSpecified; + + string manufacturerField; + + string modelField; + + string packageField; + + string interfaceField; + + DimensionsType dimensionsField; + + ScansType scansField; + + DumpHardwareType[] dumpHardwareArrayField; + + PCMCIAType pCMCIAField; + + string copyProtectionField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] ImageChecksums + { + get => imageChecksumsField; + set => imageChecksumsField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + public string PartNumber + { + get => partNumberField; + set => partNumberField = value; + } + + /// + public string SerialNumber + { + get => serialNumberField; + set => serialNumberField = value; + } + + /// + public string Title + { + get => titleField; + set => titleField = value; + } + + /// + public uint Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + [XmlIgnore] + public bool SequenceSpecified + { + get => sequenceFieldSpecified; + set => sequenceFieldSpecified = value; + } + + /// + public uint ImageInterleave + { + get => imageInterleaveField; + set => imageInterleaveField = value; + } + + /// + [XmlIgnore] + public bool ImageInterleaveSpecified + { + get => imageInterleaveFieldSpecified; + set => imageInterleaveFieldSpecified = value; + } + + /// + public uint Interleave + { + get => interleaveField; + set => interleaveField = value; + } + + /// + [XmlIgnore] + public bool InterleaveSpecified + { + get => interleaveFieldSpecified; + set => interleaveFieldSpecified = value; + } + + /// + public string Manufacturer + { + get => manufacturerField; + set => manufacturerField = value; + } + + /// + public string Model + { + get => modelField; + set => modelField = value; + } + + /// + public string Package + { + get => packageField; + set => packageField = value; + } + + /// + public string Interface + { + get => interfaceField; + set => interfaceField = value; + } + + /// + public DimensionsType Dimensions + { + get => dimensionsField; + set => dimensionsField = value; + } + + /// + public ScansType Scans + { + get => scansField; + set => scansField = value; + } + + /// + [XmlArrayItem("DumpHardware", IsNullable = false)] + public DumpHardwareType[] DumpHardwareArray + { + get => dumpHardwareArrayField; + set => dumpHardwareArrayField = value; + } + + /// + public PCMCIAType PCMCIA + { + get => pCMCIAField; + set => pCMCIAField = value; + } + + /// + public string CopyProtection + { + get => copyProtectionField; + set => copyProtectionField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class PCMCIAType +{ + DumpType cISField; + + string complianceField; + + ushort manufacturerCodeField; + + bool manufacturerCodeFieldSpecified; + + ushort cardCodeField; + + bool cardCodeFieldSpecified; + + string manufacturerField; + + string productNameField; + + string[] additionalInformationField; + + /// + public DumpType CIS + { + get => cISField; + set => cISField = value; + } + + /// + public string Compliance + { + get => complianceField; + set => complianceField = value; + } + + /// + public ushort ManufacturerCode + { + get => manufacturerCodeField; + set => manufacturerCodeField = value; + } + + /// + [XmlIgnore] + public bool ManufacturerCodeSpecified + { + get => manufacturerCodeFieldSpecified; + set => manufacturerCodeFieldSpecified = value; + } + + /// + public ushort CardCode + { + get => cardCodeField; + set => cardCodeField = value; + } + + /// + [XmlIgnore] + public bool CardCodeSpecified + { + get => cardCodeFieldSpecified; + set => cardCodeFieldSpecified = value; + } + + /// + public string Manufacturer + { + get => manufacturerField; + set => manufacturerField = value; + } + + /// + public string ProductName + { + get => productNameField; + set => productNameField = value; + } + + /// + [XmlElement("AdditionalInformation")] + public string[] AdditionalInformation + { + get => additionalInformationField; + set => additionalInformationField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class PartitionType +{ + uint sequenceField; + + string nameField; + + string typeField; + + ulong startSectorField; + + ulong endSectorField; + + string descriptionField; + + FileSystemType[] fileSystemsField; + + /// + public uint Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + public string Name + { + get => nameField; + set => nameField = value; + } + + /// + public string Type + { + get => typeField; + set => typeField = value; + } + + /// + public ulong StartSector + { + get => startSectorField; + set => startSectorField = value; + } + + /// + public ulong EndSector + { + get => endSectorField; + set => endSectorField = value; + } + + /// + public string Description + { + get => descriptionField; + set => descriptionField = value; + } + + /// + [XmlArrayItem("FileSystem", IsNullable = false)] + public FileSystemType[] FileSystems + { + get => fileSystemsField; + set => fileSystemsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class FileSystemType +{ + string typeField; + + DateTime creationDateField; + + bool creationDateFieldSpecified; + + DateTime modificationDateField; + + bool modificationDateFieldSpecified; + + DateTime backupDateField; + + bool backupDateFieldSpecified; + + uint clusterSizeField; + + ulong clustersField; + + ulong filesField; + + bool filesFieldSpecified; + + bool bootableField; + + string volumeSerialField; + + string volumeNameField; + + ulong freeClustersField; + + bool freeClustersFieldSpecified; + + bool dirtyField; + + DateTime expirationDateField; + + bool expirationDateFieldSpecified; + + DateTime effectiveDateField; + + bool effectiveDateFieldSpecified; + + string systemIdentifierField; + + string volumeSetIdentifierField; + + string publisherIdentifierField; + + string dataPreparerIdentifierField; + + string applicationIdentifierField; + + FilesystemContentsType contentsField; + + /// + public string Type + { + get => typeField; + set => typeField = value; + } + + /// + public DateTime CreationDate + { + get => creationDateField; + set => creationDateField = value; + } + + /// + [XmlIgnore] + public bool CreationDateSpecified + { + get => creationDateFieldSpecified; + set => creationDateFieldSpecified = value; + } + + /// + public DateTime ModificationDate + { + get => modificationDateField; + set => modificationDateField = value; + } + + /// + [XmlIgnore] + public bool ModificationDateSpecified + { + get => modificationDateFieldSpecified; + set => modificationDateFieldSpecified = value; + } + + /// + public DateTime BackupDate + { + get => backupDateField; + set => backupDateField = value; + } + + /// + [XmlIgnore] + public bool BackupDateSpecified + { + get => backupDateFieldSpecified; + set => backupDateFieldSpecified = value; + } + + /// + public uint ClusterSize + { + get => clusterSizeField; + set => clusterSizeField = value; + } + + /// + public ulong Clusters + { + get => clustersField; + set => clustersField = value; + } + + /// + public ulong Files + { + get => filesField; + set => filesField = value; + } + + /// + [XmlIgnore] + public bool FilesSpecified + { + get => filesFieldSpecified; + set => filesFieldSpecified = value; + } + + /// + public bool Bootable + { + get => bootableField; + set => bootableField = value; + } + + /// + public string VolumeSerial + { + get => volumeSerialField; + set => volumeSerialField = value; + } + + /// + public string VolumeName + { + get => volumeNameField; + set => volumeNameField = value; + } + + /// + public ulong FreeClusters + { + get => freeClustersField; + set => freeClustersField = value; + } + + /// + [XmlIgnore] + public bool FreeClustersSpecified + { + get => freeClustersFieldSpecified; + set => freeClustersFieldSpecified = value; + } + + /// + public bool Dirty + { + get => dirtyField; + set => dirtyField = value; + } + + /// + public DateTime ExpirationDate + { + get => expirationDateField; + set => expirationDateField = value; + } + + /// + [XmlIgnore] + public bool ExpirationDateSpecified + { + get => expirationDateFieldSpecified; + set => expirationDateFieldSpecified = value; + } + + /// + public DateTime EffectiveDate + { + get => effectiveDateField; + set => effectiveDateField = value; + } + + /// + [XmlIgnore] + public bool EffectiveDateSpecified + { + get => effectiveDateFieldSpecified; + set => effectiveDateFieldSpecified = value; + } + + /// + public string SystemIdentifier + { + get => systemIdentifierField; + set => systemIdentifierField = value; + } + + /// + public string VolumeSetIdentifier + { + get => volumeSetIdentifierField; + set => volumeSetIdentifierField = value; + } + + /// + public string PublisherIdentifier + { + get => publisherIdentifierField; + set => publisherIdentifierField = value; + } + + /// + public string DataPreparerIdentifier + { + get => dataPreparerIdentifierField; + set => dataPreparerIdentifierField = value; + } + + /// + public string ApplicationIdentifier + { + get => applicationIdentifierField; + set => applicationIdentifierField = value; + } + + /// + public FilesystemContentsType Contents + { + get => contentsField; + set => contentsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class FilesystemContentsType +{ + ContentsFileType[] fileField; + + DirectoryType[] directoryField; + + string namespaceField; + + /// + [XmlElement("File")] + public ContentsFileType[] File + { + get => fileField; + set => fileField = value; + } + + /// + [XmlElement("Directory")] + public DirectoryType[] Directory + { + get => directoryField; + set => directoryField = value; + } + + /// + [XmlAttribute] + public string @namespace + { + get => namespaceField; + set => namespaceField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ContentsFileType +{ + ChecksumType[] checksumsField; + + ExtendedAttributeType[] extendedAttributesField; + + string nameField; + + DateTime creationTimeField; + + bool creationTimeFieldSpecified; + + DateTime accessTimeField; + + bool accessTimeFieldSpecified; + + DateTime statusChangeTimeField; + + bool statusChangeTimeFieldSpecified; + + DateTime backupTimeField; + + bool backupTimeFieldSpecified; + + DateTime lastWriteTimeField; + + bool lastWriteTimeFieldSpecified; + + ulong attributesField; + + uint posixModeField; + + bool posixModeFieldSpecified; + + ulong deviceNumberField; + + bool deviceNumberFieldSpecified; + + ulong posixGroupIdField; + + bool posixGroupIdFieldSpecified; + + ulong inodeField; + + ulong linksField; + + ulong posixUserIdField; + + bool posixUserIdFieldSpecified; + + ulong lengthField; + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlArrayItem("ExtendedAttribute", IsNullable = false)] + public ExtendedAttributeType[] ExtendedAttributes + { + get => extendedAttributesField; + set => extendedAttributesField = value; + } + + /// + [XmlAttribute] + public string name + { + get => nameField; + set => nameField = value; + } + + /// + [XmlAttribute] + public DateTime creationTime + { + get => creationTimeField; + set => creationTimeField = value; + } + + /// + [XmlIgnore] + public bool creationTimeSpecified + { + get => creationTimeFieldSpecified; + set => creationTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime accessTime + { + get => accessTimeField; + set => accessTimeField = value; + } + + /// + [XmlIgnore] + public bool accessTimeSpecified + { + get => accessTimeFieldSpecified; + set => accessTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime statusChangeTime + { + get => statusChangeTimeField; + set => statusChangeTimeField = value; + } + + /// + [XmlIgnore] + public bool statusChangeTimeSpecified + { + get => statusChangeTimeFieldSpecified; + set => statusChangeTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime backupTime + { + get => backupTimeField; + set => backupTimeField = value; + } + + /// + [XmlIgnore] + public bool backupTimeSpecified + { + get => backupTimeFieldSpecified; + set => backupTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime lastWriteTime + { + get => lastWriteTimeField; + set => lastWriteTimeField = value; + } + + /// + [XmlIgnore] + public bool lastWriteTimeSpecified + { + get => lastWriteTimeFieldSpecified; + set => lastWriteTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong attributes + { + get => attributesField; + set => attributesField = value; + } + + /// + [XmlAttribute] + public uint posixMode + { + get => posixModeField; + set => posixModeField = value; + } + + /// + [XmlIgnore] + public bool posixModeSpecified + { + get => posixModeFieldSpecified; + set => posixModeFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong deviceNumber + { + get => deviceNumberField; + set => deviceNumberField = value; + } + + /// + [XmlIgnore] + public bool deviceNumberSpecified + { + get => deviceNumberFieldSpecified; + set => deviceNumberFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong posixGroupId + { + get => posixGroupIdField; + set => posixGroupIdField = value; + } + + /// + [XmlIgnore] + public bool posixGroupIdSpecified + { + get => posixGroupIdFieldSpecified; + set => posixGroupIdFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong inode + { + get => inodeField; + set => inodeField = value; + } + + /// + [XmlAttribute] + public ulong links + { + get => linksField; + set => linksField = value; + } + + /// + [XmlAttribute] + public ulong posixUserId + { + get => posixUserIdField; + set => posixUserIdField = value; + } + + /// + [XmlIgnore] + public bool posixUserIdSpecified + { + get => posixUserIdFieldSpecified; + set => posixUserIdFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong length + { + get => lengthField; + set => lengthField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class ExtendedAttributeType +{ + ChecksumType[] checksumsField; + + string nameField; + + ulong lengthField; + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlAttribute] + public string name + { + get => nameField; + set => nameField = value; + } + + /// + [XmlAttribute] + public ulong length + { + get => lengthField; + set => lengthField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class DirectoryType +{ + ContentsFileType[] fileField; + + DirectoryType[] directoryField; + + string nameField; + + DateTime creationTimeField; + + bool creationTimeFieldSpecified; + + DateTime accessTimeField; + + bool accessTimeFieldSpecified; + + DateTime statusChangeTimeField; + + bool statusChangeTimeFieldSpecified; + + DateTime backupTimeField; + + bool backupTimeFieldSpecified; + + DateTime lastWriteTimeField; + + bool lastWriteTimeFieldSpecified; + + ulong attributesField; + + uint posixModeField; + + bool posixModeFieldSpecified; + + ulong deviceNumberField; + + bool deviceNumberFieldSpecified; + + ulong posixGroupIdField; + + bool posixGroupIdFieldSpecified; + + ulong inodeField; + + bool inodeFieldSpecified; + + ulong linksField; + + bool linksFieldSpecified; + + ulong posixUserIdField; + + bool posixUserIdFieldSpecified; + + /// + [XmlElement("File")] + public ContentsFileType[] File + { + get => fileField; + set => fileField = value; + } + + /// + [XmlElement("Directory")] + public DirectoryType[] Directory + { + get => directoryField; + set => directoryField = value; + } + + /// + [XmlAttribute] + public string name + { + get => nameField; + set => nameField = value; + } + + /// + [XmlAttribute] + public DateTime creationTime + { + get => creationTimeField; + set => creationTimeField = value; + } + + /// + [XmlIgnore] + public bool creationTimeSpecified + { + get => creationTimeFieldSpecified; + set => creationTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime accessTime + { + get => accessTimeField; + set => accessTimeField = value; + } + + /// + [XmlIgnore] + public bool accessTimeSpecified + { + get => accessTimeFieldSpecified; + set => accessTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime statusChangeTime + { + get => statusChangeTimeField; + set => statusChangeTimeField = value; + } + + /// + [XmlIgnore] + public bool statusChangeTimeSpecified + { + get => statusChangeTimeFieldSpecified; + set => statusChangeTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime backupTime + { + get => backupTimeField; + set => backupTimeField = value; + } + + /// + [XmlIgnore] + public bool backupTimeSpecified + { + get => backupTimeFieldSpecified; + set => backupTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public DateTime lastWriteTime + { + get => lastWriteTimeField; + set => lastWriteTimeField = value; + } + + /// + [XmlIgnore] + public bool lastWriteTimeSpecified + { + get => lastWriteTimeFieldSpecified; + set => lastWriteTimeFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong attributes + { + get => attributesField; + set => attributesField = value; + } + + /// + [XmlAttribute] + public uint posixMode + { + get => posixModeField; + set => posixModeField = value; + } + + /// + [XmlIgnore] + public bool posixModeSpecified + { + get => posixModeFieldSpecified; + set => posixModeFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong deviceNumber + { + get => deviceNumberField; + set => deviceNumberField = value; + } + + /// + [XmlIgnore] + public bool deviceNumberSpecified + { + get => deviceNumberFieldSpecified; + set => deviceNumberFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong posixGroupId + { + get => posixGroupIdField; + set => posixGroupIdField = value; + } + + /// + [XmlIgnore] + public bool posixGroupIdSpecified + { + get => posixGroupIdFieldSpecified; + set => posixGroupIdFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong inode + { + get => inodeField; + set => inodeField = value; + } + + /// + [XmlIgnore] + public bool inodeSpecified + { + get => inodeFieldSpecified; + set => inodeFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong links + { + get => linksField; + set => linksField = value; + } + + /// + [XmlIgnore] + public bool linksSpecified + { + get => linksFieldSpecified; + set => linksFieldSpecified = value; + } + + /// + [XmlAttribute] + public ulong posixUserId + { + get => posixUserIdField; + set => posixUserIdField = value; + } + + /// + [XmlIgnore] + public bool posixUserIdSpecified + { + get => posixUserIdFieldSpecified; + set => posixUserIdFieldSpecified = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class CoordinatesType +{ + double latitudeField; + + double longitudeField; + + /// + public double Latitude + { + get => latitudeField; + set => latitudeField = value; + } + + /// + public double Longitude + { + get => longitudeField; + set => longitudeField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class RecordingType +{ + string broadcasterField; + + string broadcastPlatformField; + + RecordingTypeSourceFormat sourceFormatField; + + DateTime timestampField; + + SoftwareType[] softwareField; + + CoordinatesType coordinatesField; + + /// + public string Broadcaster + { + get => broadcasterField; + set => broadcasterField = value; + } + + /// + public string BroadcastPlatform + { + get => broadcastPlatformField; + set => broadcastPlatformField = value; + } + + /// + public RecordingTypeSourceFormat SourceFormat + { + get => sourceFormatField; + set => sourceFormatField = value; + } + + /// + public DateTime Timestamp + { + get => timestampField; + set => timestampField = value; + } + + /// + [XmlElement("Software")] + public SoftwareType[] Software + { + get => softwareField; + set => softwareField = value; + } + + /// + public CoordinatesType Coordinates + { + get => coordinatesField; + set => coordinatesField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum RecordingTypeSourceFormat +{ + /// + [XmlEnum("ITU-A")] + ITUA, + + /// + [XmlEnum("ITU-B")] + ITUB, + + /// + [XmlEnum("ITU-C")] + ITUC, + + /// + [XmlEnum("ITU-D")] + ITUD, + + /// + [XmlEnum("ITU-E")] + ITUE, + + /// + [XmlEnum("ITU-F")] + ITUF, + + /// + [XmlEnum("ITU-G")] + ITUG, + + /// + [XmlEnum("ITU-H")] + ITUH, + + /// + [XmlEnum("ITU-I")] + ITUI, + + /// + [XmlEnum("ITU-J")] + ITUJ, + + /// + [XmlEnum("ITU-K")] + ITUK, + + /// + [XmlEnum("ITU-L")] + ITUL, + + /// + [XmlEnum("ITU-M")] + ITUM, + + /// + [XmlEnum("ITU-N")] + ITUN, + + /// + [XmlEnum("PAL-B")] + PALB, + + /// + [XmlEnum("SECAM-B")] + SECAMB, + + /// + [XmlEnum("PAL-D")] + PALD, + + /// + [XmlEnum("SECAM-D")] + SECAMD, + + /// + [XmlEnum("PAL-G")] + PALG, + + /// + [XmlEnum("SECAM-G")] + SECAMG, + + /// + [XmlEnum("PAL-H")] + PALH, + + /// + [XmlEnum("PAL-I")] + PALI, + + /// + [XmlEnum("PAL-K")] + PALK, + + /// + [XmlEnum("SECAM-K")] + SECAMK, + + /// + [XmlEnum("NTSC-M")] + NTSCM, + + /// + [XmlEnum("PAL-N")] + PALN, + + /// + [XmlEnum("PAL-M")] + PALM, + + /// + [XmlEnum("SECAM-M")] + SECAMM, + + /// + MUSE, + + /// + PALplus, + + /// + FM, + + /// + AM, + + /// + COFDM, + + /// + [XmlEnum("CAM-D")] + CAMD, + + /// + DAB, + + /// + [XmlEnum("DAB+")] + DAB1, + + /// + DRM, + + /// + [XmlEnum("DRM+")] + DRM1, + + /// + FMeXtra, + + /// + ATSC, + + /// + ATSC2, + + /// + ATSC3, + + /// + [XmlEnum("ATSC-M/H")] + ATSCMH, + + /// + [XmlEnum("DVB-T")] + DVBT, + + /// + [XmlEnum("DVB-T2")] + DVBT2, + + /// + [XmlEnum("DVB-S")] + DVBS, + + /// + [XmlEnum("DVB-S2")] + DVBS2, + + /// + [XmlEnum("DVB-S2X")] + DVBS2X, + + /// + [XmlEnum("DVB-C")] + DVBC, + + /// + [XmlEnum("DVB-C2")] + DVBC2, + + /// + [XmlEnum("DVB-H")] + DVBH, + + /// + [XmlEnum("DVB-NGH")] + DVBNGH, + + /// + [XmlEnum("DVB-SH")] + DVBSH, + + /// + [XmlEnum("ISDB-T")] + ISDBT, + + /// + [XmlEnum("ISDB-Tb")] + ISDBTb, + + /// + [XmlEnum("ISDB-S")] + ISDBS, + + /// + [XmlEnum("ISDB-C")] + ISDBC, + + /// + [XmlEnum("1seg")] + Item1seg, + + /// + DTMB, + + /// + CCMB, + + /// + [XmlEnum("T-DMB")] + TDMB, + + /// + [XmlEnum("S-DMB")] + SDMB, + + /// + IPTV, + + /// + [XmlEnum("DVB-MT")] + DVBMT, + + /// + [XmlEnum("DVB-MC")] + DVBMC, + + /// + [XmlEnum("DVB-MS")] + DVBMS, + + /// + ADR, + + /// + SDR +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class SubtitleTracksType +{ + LanguagesTypeLanguage[] languagesField; + + uint trackNumberField; + + string codecField; + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Languages + { + get => languagesField; + set => languagesField = value; + } + + /// + [XmlAttribute] + public uint TrackNumber + { + get => trackNumberField; + set => trackNumberField = value; + } + + /// + [XmlAttribute] + public string Codec + { + get => codecField; + set => codecField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class VideoTracksType +{ + LanguagesTypeLanguage[] languagesField; + + uint trackNumberField; + + string codecField; + + uint horizontalField; + + uint verticalField; + + long meanBitrateField; + + bool threeDField; + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Languages + { + get => languagesField; + set => languagesField = value; + } + + /// + [XmlAttribute] + public uint TrackNumber + { + get => trackNumberField; + set => trackNumberField = value; + } + + /// + [XmlAttribute] + public string Codec + { + get => codecField; + set => codecField = value; + } + + /// + [XmlAttribute] + public uint Horizontal + { + get => horizontalField; + set => horizontalField = value; + } + + /// + [XmlAttribute] + public uint Vertical + { + get => verticalField; + set => verticalField = value; + } + + /// + [XmlAttribute] + public long MeanBitrate + { + get => meanBitrateField; + set => meanBitrateField = value; + } + + /// + [XmlAttribute] + public bool ThreeD + { + get => threeDField; + set => threeDField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class AudioTracksType +{ + LanguagesTypeLanguage[] languagesField; + + uint trackNumberField; + + string accoustIDField; + + string codecField; + + uint channelsField; + + double sampleRateField; + + long meanBitrateField; + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Languages + { + get => languagesField; + set => languagesField = value; + } + + /// + [XmlAttribute] + public uint TrackNumber + { + get => trackNumberField; + set => trackNumberField = value; + } + + /// + [XmlAttribute] + public string AccoustID + { + get => accoustIDField; + set => accoustIDField = value; + } + + /// + [XmlAttribute] + public string Codec + { + get => codecField; + set => codecField = value; + } + + /// + [XmlAttribute] + public uint Channels + { + get => channelsField; + set => channelsField = value; + } + + /// + [XmlAttribute] + public double SampleRate + { + get => sampleRateField; + set => sampleRateField = value; + } + + /// + [XmlAttribute] + public long MeanBitrate + { + get => meanBitrateField; + set => meanBitrateField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class AdvertisementType +{ + string manufacturerField; + + string productField; + + FileType fileField; + + ulong fileSizeField; + + ulong framesField; + + bool framesFieldSpecified; + + double durationField; + + float meanFrameRateField; + + bool meanFrameRateFieldSpecified; + + ChecksumType[] checksumsField; + + AudioTracksType[] audioTrackField; + + VideoTracksType[] videoTrackField; + + SubtitleTracksType[] subtitleTrackField; + + RecordingType recordingField; + + /// + public string Manufacturer + { + get => manufacturerField; + set => manufacturerField = value; + } + + /// + public string Product + { + get => productField; + set => productField = value; + } + + /// + public FileType File + { + get => fileField; + set => fileField = value; + } + + /// + public ulong FileSize + { + get => fileSizeField; + set => fileSizeField = value; + } + + /// + public ulong Frames + { + get => framesField; + set => framesField = value; + } + + /// + [XmlIgnore] + public bool FramesSpecified + { + get => framesFieldSpecified; + set => framesFieldSpecified = value; + } + + /// + public double Duration + { + get => durationField; + set => durationField = value; + } + + /// + public float MeanFrameRate + { + get => meanFrameRateField; + set => meanFrameRateField = value; + } + + /// + [XmlIgnore] + public bool MeanFrameRateSpecified + { + get => meanFrameRateFieldSpecified; + set => meanFrameRateFieldSpecified = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlElement("AudioTrack")] + public AudioTracksType[] AudioTrack + { + get => audioTrackField; + set => audioTrackField = value; + } + + /// + [XmlElement("VideoTrack")] + public VideoTracksType[] VideoTrack + { + get => videoTrackField; + set => videoTrackField = value; + } + + /// + [XmlElement("SubtitleTrack")] + public SubtitleTracksType[] SubtitleTrack + { + get => subtitleTrackField; + set => subtitleTrackField = value; + } + + /// + public RecordingType Recording + { + get => recordingField; + set => recordingField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class SubChannelType +{ + ImageType imageField; + + ulong sizeField; + + ChecksumType[] checksumsField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class TrackFlagsType +{ + bool quadraphonicField; + + bool dataField; + + bool copyPermittedField; + + bool preEmphasisField; + + /// + public bool Quadraphonic + { + get => quadraphonicField; + set => quadraphonicField = value; + } + + /// + public bool Data + { + get => dataField; + set => dataField = value; + } + + /// + public bool CopyPermitted + { + get => copyPermittedField; + set => copyPermittedField = value; + } + + /// + public bool PreEmphasis + { + get => preEmphasisField; + set => preEmphasisField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class TrackIndexType +{ + ushort indexField; + + int valueField; + + /// + [XmlAttribute] + public ushort index + { + get => indexField; + set => indexField = value; + } + + /// + [XmlText] + public int Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class TrackSequenceType +{ + uint trackNumberField; + + uint sessionField; + + /// + public uint TrackNumber + { + get => trackNumberField; + set => trackNumberField = value; + } + + /// + public uint Session + { + get => sessionField; + set => sessionField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class TrackType +{ + ImageType imageField; + + ulong sizeField; + + TrackSequenceType sequenceField; + + string startMSFField; + + string endMSFField; + + ulong startSectorField; + + ulong endSectorField; + + TrackIndexType[] indexesField; + + TrackFlagsType flagsField; + + string iSRCField; + + TrackTypeTrackType trackType1Field; + + uint bytesPerSectorField; + + string accoustIDField; + + ChecksumType[] checksumsField; + + SubChannelType subChannelField; + + PartitionType[] fileSystemInformationField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + public TrackSequenceType Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + public string StartMSF + { + get => startMSFField; + set => startMSFField = value; + } + + /// + public string EndMSF + { + get => endMSFField; + set => endMSFField = value; + } + + /// + public ulong StartSector + { + get => startSectorField; + set => startSectorField = value; + } + + /// + public ulong EndSector + { + get => endSectorField; + set => endSectorField = value; + } + + /// + [XmlArrayItem("Index", IsNullable = false)] + public TrackIndexType[] Indexes + { + get => indexesField; + set => indexesField = value; + } + + /// + public TrackFlagsType Flags + { + get => flagsField; + set => flagsField = value; + } + + /// + public string ISRC + { + get => iSRCField; + set => iSRCField = value; + } + + /// + [XmlElement("TrackType")] + public TrackTypeTrackType TrackType1 + { + get => trackType1Field; + set => trackType1Field = value; + } + + /// + public uint BytesPerSector + { + get => bytesPerSectorField; + set => bytesPerSectorField = value; + } + + /// + public string AccoustID + { + get => accoustIDField; + set => accoustIDField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + public SubChannelType SubChannel + { + get => subChannelField; + set => subChannelField = value; + } + + /// + [XmlArrayItem("Partition", IsNullable = false)] + public PartitionType[] FileSystemInformation + { + get => fileSystemInformationField; + set => fileSystemInformationField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum TrackTypeTrackType +{ + /// + audio, + + /// + mode0, + + /// + mode1, + + /// + mode2, + + /// + m2f1, + + /// + m2f2, + + /// + dvd, + + /// + hddvd, + + /// + bluray, + + /// + ddcd +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class PS3EncryptionType +{ + string keyField; + + string serialField; + + /// + public string Key + { + get => keyField; + set => keyField = value; + } + + /// + public string Serial + { + get => serialField; + set => serialField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class XboxSecuritySectorsType +{ + uint requestVersionField; + + uint requestNumberField; + + DumpType securitySectorsField; + + /// + public uint RequestVersion + { + get => requestVersionField; + set => requestVersionField = value; + } + + /// + public uint RequestNumber + { + get => requestNumberField; + set => requestNumberField = value; + } + + /// + public DumpType SecuritySectors + { + get => securitySectorsField; + set => securitySectorsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class XboxType +{ + DumpType pFIField; + + DumpType dMIField; + + XboxSecuritySectorsType[] securitySectorsField; + + /// + public DumpType PFI + { + get => pFIField; + set => pFIField = value; + } + + /// + public DumpType DMI + { + get => dMIField; + set => dMIField = value; + } + + /// + [XmlElement("SecuritySectors")] + public XboxSecuritySectorsType[] SecuritySectors + { + get => securitySectorsField; + set => securitySectorsField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class BorderType +{ + string imageField; + + ulong sizeField; + + ChecksumType[] checksumsField; + + uint sessionField; + + bool sessionFieldSpecified; + + /// + public string Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlAttribute] + public uint session + { + get => sessionField; + set => sessionField = value; + } + + /// + [XmlIgnore] + public bool sessionSpecified + { + get => sessionFieldSpecified; + set => sessionFieldSpecified = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class CaseType +{ + CaseTypeCaseType caseType1Field; + + ScansType scansField; + + /// + [XmlElement("CaseType")] + public CaseTypeCaseType CaseType1 + { + get => caseType1Field; + set => caseType1Field = value; + } + + /// + public ScansType Scans + { + get => scansField; + set => scansField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum CaseTypeCaseType +{ + /// + 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 +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class LayeredTextType +{ + uint layerField; + + bool layerFieldSpecified; + + string valueField; + + /// + [XmlAttribute] + public uint layer + { + get => layerField; + set => layerField = value; + } + + /// + [XmlIgnore] + public bool layerSpecified + { + get => layerFieldSpecified; + set => layerFieldSpecified = value; + } + + /// + [XmlText] + public string Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class SectorsType +{ + uint layerField; + + bool layerFieldSpecified; + + ulong valueField; + + /// + [XmlAttribute] + public uint layer + { + get => layerField; + set => layerField = value; + } + + /// + [XmlIgnore] + public bool layerSpecified + { + get => layerFieldSpecified; + set => layerFieldSpecified = value; + } + + /// + [XmlText] + public ulong Value + { + get => valueField; + set => valueField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class LayersType +{ + SectorsType[] sectorsField; + + LayersTypeType typeField; + + bool typeFieldSpecified; + + /// + [XmlElement("Sectors")] + public SectorsType[] Sectors + { + get => sectorsField; + set => sectorsField = value; + } + + /// + [XmlAttribute] + public LayersTypeType type + { + get => typeField; + set => typeField = value; + } + + /// + [XmlIgnore] + public bool typeSpecified + { + get => typeFieldSpecified; + set => typeFieldSpecified = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum LayersTypeType +{ + /// + PTP, + + /// + OTP +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class OpticalDiscType +{ + ImageType imageField; + + ulong sizeField; + + SequenceType sequenceField; + + LayersType layersField; + + ChecksumType[] checksumsField; + + string partNumberField; + + string serialNumberField; + + LayeredTextType[] ringCodeField; + + LayeredTextType[] masteringSIDField; + + LayeredTextType[] toolstampField; + + LayeredTextType[] mouldSIDField; + + LayeredTextType[] mouldTextField; + + string discTypeField; + + string discSubTypeField; + + int offsetField; + + bool offsetFieldSpecified; + + uint[] tracksField; + + uint sessionsField; + + string copyProtectionField; + + DimensionsType dimensionsField; + + CaseType caseField; + + ScansType scansField; + + DumpType pFIField; + + DumpType dMIField; + + DumpType cMIField; + + DumpType bCAField; + + DumpType aTIPField; + + DumpType aDIPField; + + DumpType pMAField; + + DumpType dDSField; + + DumpType sAIField; + + DumpType lastRMDField; + + DumpType pRIField; + + DumpType mediaIDField; + + DumpType pFIRField; + + DumpType dCBField; + + DumpType diField; + + DumpType pACField; + + DumpType tOCField; + + DumpType leadInCdTextField; + + BorderType[] firstTrackPregrapField; + + BorderType[] leadInField; + + BorderType[] leadOutField; + + XboxType xboxField; + + PS3EncryptionType pS3EncryptionField; + + string mediaCatalogueNumberField; + + TrackType[] trackField; + + DumpHardwareType[] dumpHardwareArrayField; + + /// + public ImageType Image + { + get => imageField; + set => imageField = value; + } + + /// + public ulong Size + { + get => sizeField; + set => sizeField = value; + } + + /// + public SequenceType Sequence + { + get => sequenceField; + set => sequenceField = value; + } + + /// + public LayersType Layers + { + get => layersField; + set => layersField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + public string PartNumber + { + get => partNumberField; + set => partNumberField = value; + } + + /// + public string SerialNumber + { + get => serialNumberField; + set => serialNumberField = value; + } + + /// + [XmlElement("RingCode")] + public LayeredTextType[] RingCode + { + get => ringCodeField; + set => ringCodeField = value; + } + + /// + [XmlElement("MasteringSID")] + public LayeredTextType[] MasteringSID + { + get => masteringSIDField; + set => masteringSIDField = value; + } + + /// + [XmlElement("Toolstamp")] + public LayeredTextType[] Toolstamp + { + get => toolstampField; + set => toolstampField = value; + } + + /// + [XmlElement("MouldSID")] + public LayeredTextType[] MouldSID + { + get => mouldSIDField; + set => mouldSIDField = value; + } + + /// + [XmlElement("MouldText")] + public LayeredTextType[] MouldText + { + get => mouldTextField; + set => mouldTextField = value; + } + + /// + public string DiscType + { + get => discTypeField; + set => discTypeField = value; + } + + /// + public string DiscSubType + { + get => discSubTypeField; + set => discSubTypeField = value; + } + + /// + public int Offset + { + get => offsetField; + set => offsetField = value; + } + + /// + [XmlIgnore] + public bool OffsetSpecified + { + get => offsetFieldSpecified; + set => offsetFieldSpecified = value; + } + + /// + [XmlElement("Tracks")] + public uint[] Tracks + { + get => tracksField; + set => tracksField = value; + } + + /// + public uint Sessions + { + get => sessionsField; + set => sessionsField = value; + } + + /// + public string CopyProtection + { + get => copyProtectionField; + set => copyProtectionField = value; + } + + /// + public DimensionsType Dimensions + { + get => dimensionsField; + set => dimensionsField = value; + } + + /// + public CaseType Case + { + get => caseField; + set => caseField = value; + } + + /// + public ScansType Scans + { + get => scansField; + set => scansField = value; + } + + /// + public DumpType PFI + { + get => pFIField; + set => pFIField = value; + } + + /// + public DumpType DMI + { + get => dMIField; + set => dMIField = value; + } + + /// + public DumpType CMI + { + get => cMIField; + set => cMIField = value; + } + + /// + public DumpType BCA + { + get => bCAField; + set => bCAField = value; + } + + /// + public DumpType ATIP + { + get => aTIPField; + set => aTIPField = value; + } + + /// + public DumpType ADIP + { + get => aDIPField; + set => aDIPField = value; + } + + /// + public DumpType PMA + { + get => pMAField; + set => pMAField = value; + } + + /// + public DumpType DDS + { + get => dDSField; + set => dDSField = value; + } + + /// + public DumpType SAI + { + get => sAIField; + set => sAIField = value; + } + + /// + public DumpType LastRMD + { + get => lastRMDField; + set => lastRMDField = value; + } + + /// + public DumpType PRI + { + get => pRIField; + set => pRIField = value; + } + + /// + public DumpType MediaID + { + get => mediaIDField; + set => mediaIDField = value; + } + + /// + public DumpType PFIR + { + get => pFIRField; + set => pFIRField = value; + } + + /// + public DumpType DCB + { + get => dCBField; + set => dCBField = value; + } + + /// + public DumpType DI + { + get => diField; + set => diField = value; + } + + /// + public DumpType PAC + { + get => pACField; + set => pACField = value; + } + + /// + public DumpType TOC + { + get => tOCField; + set => tOCField = value; + } + + /// + public DumpType LeadInCdText + { + get => leadInCdTextField; + set => leadInCdTextField = value; + } + + /// + [XmlElement("FirstTrackPregrap")] + public BorderType[] FirstTrackPregrap + { + get => firstTrackPregrapField; + set => firstTrackPregrapField = value; + } + + /// + [XmlElement("LeadIn")] + public BorderType[] LeadIn + { + get => leadInField; + set => leadInField = value; + } + + /// + [XmlElement("LeadOut")] + public BorderType[] LeadOut + { + get => leadOutField; + set => leadOutField = value; + } + + /// + public XboxType Xbox + { + get => xboxField; + set => xboxField = value; + } + + /// + public PS3EncryptionType PS3Encryption + { + get => pS3EncryptionField; + set => pS3EncryptionField = value; + } + + /// + public string MediaCatalogueNumber + { + get => mediaCatalogueNumberField; + set => mediaCatalogueNumberField = value; + } + + /// + [XmlElement("Track")] + public TrackType[] Track + { + get => trackField; + set => trackField = value; + } + + /// + [XmlArrayItem("DumpHardware", IsNullable = false)] + public DumpHardwareType[] DumpHardwareArray + { + get => dumpHardwareArrayField; + set => dumpHardwareArrayField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class UserManualType +{ + LanguagesTypeLanguage[] languageField; + + uint pagesField; + + string pageSizeField; + + ScanType scanField; + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Language + { + get => languageField; + set => languageField = value; + } + + /// + public uint Pages + { + get => pagesField; + set => pagesField = value; + } + + /// + public string PageSize + { + get => pageSizeField; + set => pageSizeField = value; + } + + /// + public ScanType Scan + { + get => scanField; + set => scanField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class RequiredOperatingSystemType +{ + string nameField; + + string[] versionField; + + /// + public string Name + { + get => nameField; + set => nameField = value; + } + + /// + [XmlElement("Version")] + public string[] Version + { + get => versionField; + set => versionField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class BookType +{ + BarcodeType[] barcodesField; + + CoverType coverField; + + string nameField; + + string editorialField; + + string authorField; + + DateTime publicationDateField; + + bool publicationDateFieldSpecified; + + LanguagesTypeLanguage[] languageField; + + uint pagesField; + + bool pagesFieldSpecified; + + string pageSizeField; + + ScanType scanField; + + /// + [XmlArrayItem("Barcode", IsNullable = false)] + public BarcodeType[] Barcodes + { + get => barcodesField; + set => barcodesField = value; + } + + /// + public CoverType Cover + { + get => coverField; + set => coverField = value; + } + + /// + public string Name + { + get => nameField; + set => nameField = value; + } + + /// + public string Editorial + { + get => editorialField; + set => editorialField = value; + } + + /// + public string Author + { + get => authorField; + set => authorField = value; + } + + /// + [XmlElement(DataType = "date")] + public DateTime PublicationDate + { + get => publicationDateField; + set => publicationDateField = value; + } + + /// + [XmlIgnore] + public bool PublicationDateSpecified + { + get => publicationDateFieldSpecified; + set => publicationDateFieldSpecified = value; + } + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Language + { + get => languageField; + set => languageField = value; + } + + /// + public uint Pages + { + get => pagesField; + set => pagesField = value; + } + + /// + [XmlIgnore] + public bool PagesSpecified + { + get => pagesFieldSpecified; + set => pagesFieldSpecified = value; + } + + /// + public string PageSize + { + get => pageSizeField; + set => pageSizeField = value; + } + + /// + public ScanType Scan + { + get => scanField; + set => scanField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class CoverType +{ + FileType fileField; + + ChecksumType[] checksumsField; + + byte[] thumbnailField; + + /// + public FileType File + { + get => fileField; + set => fileField = value; + } + + /// + [XmlArrayItem("Checksum", IsNullable = false)] + public ChecksumType[] Checksums + { + get => checksumsField; + set => checksumsField = value; + } + + /// + [XmlElement(DataType = "base64Binary")] + public byte[] Thumbnail + { + get => thumbnailField; + set => thumbnailField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, DebuggerStepThrough, DesignerCategory("code")] +public class MagazineType +{ + BarcodeType[] barcodesField; + + CoverType coverField; + + string nameField; + + string editorialField; + + DateTime publicationDateField; + + bool publicationDateFieldSpecified; + + uint numberField; + + bool numberFieldSpecified; + + LanguagesTypeLanguage[] languageField; + + uint pagesField; + + bool pagesFieldSpecified; + + string pageSizeField; + + ScanType scanField; + + /// + [XmlArrayItem("Barcode", IsNullable = false)] + public BarcodeType[] Barcodes + { + get => barcodesField; + set => barcodesField = value; + } + + /// + public CoverType Cover + { + get => coverField; + set => coverField = value; + } + + /// + public string Name + { + get => nameField; + set => nameField = value; + } + + /// + public string Editorial + { + get => editorialField; + set => editorialField = value; + } + + /// + [XmlElement(DataType = "date")] + public DateTime PublicationDate + { + get => publicationDateField; + set => publicationDateField = value; + } + + /// + [XmlIgnore] + public bool PublicationDateSpecified + { + get => publicationDateFieldSpecified; + set => publicationDateFieldSpecified = value; + } + + /// + public uint Number + { + get => numberField; + set => numberField = value; + } + + /// + [XmlIgnore] + public bool NumberSpecified + { + get => numberFieldSpecified; + set => numberFieldSpecified = value; + } + + /// + [XmlArrayItem("Language", IsNullable = false)] + public LanguagesTypeLanguage[] Language + { + get => languageField; + set => languageField = value; + } + + /// + public uint Pages + { + get => pagesField; + set => pagesField = value; + } + + /// + [XmlIgnore] + public bool PagesSpecified + { + get => pagesFieldSpecified; + set => pagesFieldSpecified = value; + } + + /// + public string PageSize + { + get => pageSizeField; + set => pageSizeField = value; + } + + /// + public ScanType Scan + { + get => scanField; + set => scanField = value; + } +} + +/// +[GeneratedCode("xsd", "0.0.0.0"), SerializableAttribute, XmlType(AnonymousType = true)] +public enum ArchitecturesTypeArchitecture +{ + /// + [XmlEnum("4004")] + Item4004, + + /// + [XmlEnum("4040")] + Item4040, + + /// + [XmlEnum("6502")] + Item6502, + + /// + [XmlEnum("65816")] + Item65816, + + /// + [XmlEnum("8008")] + Item8008, + + /// + [XmlEnum("8051")] + Item8051, + + /// + [XmlEnum("8080")] + Item8080, + + /// + [XmlEnum("8085")] + Item8085, + + /// + 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 +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Partition.cs b/Aaru.CommonTypes/Partition.cs new file mode 100644 index 000000000..44a23b2a3 --- /dev/null +++ b/Aaru.CommonTypes/Partition.cs @@ -0,0 +1,120 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Partition.cs +// Author(s) : Natalia Portillo +// +// 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; + +/// +/// Partition structure. +public struct Partition : IEquatable, IComparable +{ + /// Partition number, 0-started + public ulong Sequence; + /// Partition type + public string Type; + /// Partition name (if the scheme supports it) + public string Name; + /// Start of the partition, in bytes + public ulong Offset; + /// LBA of partition start + public ulong Start; + /// Length in bytes of the partition + public ulong Size; + /// Length in sectors of the partition + public ulong Length; + /// Information that does not find space in this struct + public string Description; + + /// LBA of last partition sector + public readonly ulong End => Start + Length - 1; + + /// Name of partition scheme that contains this partition + public string Scheme; + + /// + /// Compares two partitions + /// Partition to compare with + /// 0 if both partitions start and end at the same sector + public bool Equals(Partition other) => Start == other.Start && Length == other.Length; + + /// + public override bool Equals(object obj) => obj is Partition partition && Equals(partition); + + /// + + // ReSharper disable once NonReadonlyMemberInGetHashCode + public readonly override int GetHashCode() => Start.GetHashCode() + End.GetHashCode(); + + /// + /// 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. + /// + /// Partition to compare with + /// A value that indicates the relative equality of the partitions being compared. + /// + 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; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/PluginRegister.cs b/Aaru.CommonTypes/PluginRegister.cs new file mode 100644 index 000000000..1ec417a56 --- /dev/null +++ b/Aaru.CommonTypes/PluginRegister.cs @@ -0,0 +1,284 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : PluginRegister.cs +// Author(s) : Natalia Portillo +// +// Component : Common types. +// +// --[ Description ] ---------------------------------------------------------- +// +// Gets lists of all known plugins. +// +// --[ 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2023 Natalia Portillo +// ****************************************************************************/ + +using System; +using System.Collections.Generic; +using System.IO; +using Aaru.CommonTypes.Enums; +using Aaru.CommonTypes.Interfaces; +using Microsoft.Extensions.DependencyInjection; + +namespace Aaru.CommonTypes; + +public class PluginRegister +{ + static PluginRegister _instance; + + + IServiceProvider _serviceProvider; + IServiceCollection _services; + + PluginRegister() {} + + /// List of byte addressable image plugins + public SortedDictionary ByteAddressableImages + { + get + { + SortedDictionary byteAddressableImages = new(); + foreach(IByteAddressableImage plugin in _serviceProvider.GetServices()) + byteAddressableImages[plugin.Name.ToLower()] = plugin; + + return byteAddressableImages; + } + } + + /// List of writable media image plugins + public SortedDictionary WritableImages + { + get + { + SortedDictionary mediaImages = new(); + foreach(IBaseWritableImage plugin in _serviceProvider.GetServices()) + mediaImages[plugin.Name.ToLower()] = plugin; + + return mediaImages; + } + } + + /// List of writable floppy image plugins + public SortedDictionary WritableFloppyImages + { + get + { + SortedDictionary floppyImages = new(); + foreach(IWritableFloppyImage plugin in _serviceProvider.GetServices()) + floppyImages[plugin.Name.ToLower()] = plugin; + + return floppyImages; + } + } + + /// List of floppy image plugins + public SortedDictionary FloppyImages + { + get + { + SortedDictionary floppyImages = new(); + foreach(IFloppyImage plugin in _serviceProvider.GetServices()) + floppyImages[plugin.Name.ToLower()] = plugin; + + return floppyImages; + } + } + + /// List of all media image plugins + public SortedDictionary MediaImages + { + get + { + SortedDictionary mediaImages = new(); + foreach(IMediaImage plugin in _serviceProvider.GetServices()) + mediaImages[plugin.Name.ToLower()] = plugin; + + return mediaImages; + } + } + + /// List of read-only filesystem plugins + public SortedDictionary ReadOnlyFilesystems + { + get + { + SortedDictionary readOnlyFilesystems = new(); + foreach(IReadOnlyFilesystem plugin in _serviceProvider.GetServices()) + readOnlyFilesystems[plugin.Name.ToLower()] = plugin; + + return readOnlyFilesystems; + } + } + + /// List of all filesystem plugins + public SortedDictionary Filesystems + { + get + { + SortedDictionary filesystems = new(); + foreach(IFilesystem plugin in _serviceProvider.GetServices()) + filesystems[plugin.Name.ToLower()] = plugin; + + return filesystems; + } + } + + /// List of all archive formats + public SortedDictionary Archives + { + get + { + SortedDictionary archives = new(); + foreach(IArchive plugin in _serviceProvider.GetServices()) + archives[plugin.Name.ToLower()] = plugin; + + return archives; + } + } + + /// List of all partition plugins + public SortedDictionary Partitions + { + get + { + SortedDictionary partitions = new(); + foreach(IPartition plugin in _serviceProvider.GetServices()) + partitions[plugin.Name.ToLower()] = plugin; + + return partitions; + } + } + + /// List of filter plugins + public SortedDictionary Filters + { + get + { + SortedDictionary filters = new(); + foreach(IFilter plugin in _serviceProvider.GetServices()) + filters[plugin.Name.ToLower()] = plugin; + + return filters; + } + } + + /// List of checksum plugins + public SortedDictionary Checksums + { + get + { + SortedDictionary checksums = new(); + foreach(IChecksum plugin in _serviceProvider.GetServices()) + checksums[plugin.Name.ToLower()] = plugin; + + return checksums; + } + } + + /// Gets a singleton with all the known plugins + public static PluginRegister Singleton + { + get + { + if(_instance != null) + return _instance; + + _instance = new PluginRegister + { + _services = new ServiceCollection() + }; + + _instance._serviceProvider = _instance._services.BuildServiceProvider(); + + return _instance; + } + } + + + /// + /// Replaces registered plugins list of this instance with the new ones provided by the providen registrators. + /// + /// List of plugin registrators as obtained from the assemblies that implement them. + public void InitPlugins(IEnumerable registrators) + { + _services = new ServiceCollection(); + + foreach(IPluginRegister registrator in registrators) + AddPlugins(registrator); + + _instance._serviceProvider = _instance._services.BuildServiceProvider(); + } + + /// Adds plugins to the central plugin register + /// Plugin register + void AddPlugins(IPluginRegister pluginRegister) + { + pluginRegister.RegisterChecksumPlugins(_services); + pluginRegister.RegisterFilesystemPlugins(_services); + pluginRegister.RegisterFilterPlugins(_services); + pluginRegister.RegisterReadOnlyFilesystemPlugins(_services); + pluginRegister.RegisterFloppyImagePlugins(_services); + pluginRegister.RegisterMediaImagePlugins(_services); + pluginRegister.RegisterPartitionPlugins(_services); + pluginRegister.RegisterWritableFloppyImagePlugins(_services); + pluginRegister.RegisterWritableImagePlugins(_services); + pluginRegister.RegisterArchivePlugins(_services); + pluginRegister.RegisterByteAddressablePlugins(_services); + } + + /// Gets the filter that allows to read the specified path + /// Path + /// The filter that allows reading the specified path + public IFilter GetFilter(string path) + { + IFilter noFilter = null; + + foreach(IFilter filter in Filters.Values) + { + try + { + if(filter.Id != new Guid("12345678-AAAA-BBBB-CCCC-123456789000")) + { + if(!filter.Identify(path)) + continue; + + var foundFilter = + (IFilter)filter.GetType().GetConstructor(Type.EmptyTypes)?.Invoke(Array.Empty()); + + if(foundFilter?.Open(path) == ErrorNumber.NoError) + return foundFilter; + } + else + noFilter = filter; + } + catch(IOException) + { + // Ignore and continue + } + } + + if(!noFilter?.Identify(path) == true) + return null; + + noFilter?.Open(path); + + return noFilter; + } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/Devices/ATA/Identify.cs b/Aaru.CommonTypes/Structs/Devices/ATA/Identify.cs new file mode 100644 index 000000000..d705ed869 --- /dev/null +++ b/Aaru.CommonTypes/Structs/Devices/ATA/Identify.cs @@ -0,0 +1,1276 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Identify.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures for ATA devices. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines a high level interpretation of the ATA IDENTIFY response. +// +// --[ 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 + +using System; +using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; +using System.Text; +using Aaru.Console; +using Aaru.Helpers; +using Marshal = Aaru.Helpers.Marshal; + +namespace Aaru.CommonTypes.Structs.Devices.ATA; + +/// +/// Information from following standards: T10-791D rev. 4c (ATA) T10-948D rev. 4c (ATA-2) T13-1153D rev. 18 +/// (ATA/ATAPI-4) T13-1321D rev. 3 (ATA/ATAPI-5) T13-1410D rev. 3b (ATA/ATAPI-6) T13-1532D rev. 4b (ATA/ATAPI-7) +/// T13-1699D rev. 3f (ATA8-ACS) T13-1699D rev. 4a (ATA8-ACS) T13-2015D rev. 2 (ACS-2) T13-2161D rev. 5 (ACS-3) CF+ +/// & CF Specification rev. 1.4 (CFA) +/// +[SuppressMessage("ReSharper", "InconsistentNaming")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +public static class Identify +{ +#region CapabilitiesBit enum + + /// Capabilities flag bits. + [Flags] + public enum CapabilitiesBit : ushort + { + /// ATAPI: Interleaved DMA supported + InterleavedDMA = 0x8000, + /// ATAPI: Command queueing supported + CommandQueue = 0x4000, + /// Standby timer values are standard + StandardStandbyTimer = 0x2000, + /// ATAPI: Overlap operation supported + OverlapOperation = 0x2000, + /// ATAPI: ATA software reset required Obsoleted in ATA/ATAPI-4 + RequiresATASoftReset = 0x1000, + /// IORDY is supported + IORDY = 0x0800, + /// IORDY can be disabled + CanDisableIORDY = 0x0400, + /// LBA is supported + LBASupport = 0x0200, + /// DMA is supported + DMASupport = 0x0100, + /// Vendor unique Obsoleted in ATA/ATAPI-4 + VendorBit7 = 0x0080, + /// Vendor unique Obsoleted in ATA/ATAPI-4 + VendorBit6 = 0x0040, + /// Vendor unique Obsoleted in ATA/ATAPI-4 + VendorBit5 = 0x0020, + /// Vendor unique Obsoleted in ATA/ATAPI-4 + VendorBit4 = 0x0010, + /// Vendor unique Obsoleted in ATA/ATAPI-4 + VendorBit3 = 0x0008, + /// Vendor unique Obsoleted in ATA/ATAPI-4 + VendorBit2 = 0x0004, + /// Long Physical Alignment setting bit 1 + PhysicalAlignment1 = 0x0002, + /// Long Physical Alignment setting bit 0 + PhysicalAlignment0 = 0x0001 + } + +#endregion + +#region CapabilitiesBit2 enum + + /// More capabilities flag bits. + [Flags] + public enum CapabilitiesBit2 : ushort + { + /// MUST NOT be set + MustBeClear = 0x8000, + /// MUST be set + MustBeSet = 0x4000, + #pragma warning disable 1591 + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + Reserved07 = 0x0080, + Reserved06 = 0x0040, + Reserved05 = 0x0020, + Reserved04 = 0x0010, + Reserved03 = 0x0008, + Reserved02 = 0x0004, + Reserved01 = 0x0002, + #pragma warning restore 1591 + /// Indicates a device specific minimum standby timer value + SpecificStandbyTimer = 0x0001 + } + +#endregion + +#region CapabilitiesBit3 enum + + /// Even more capabilities flag bits. + [Flags] + public enum CapabilitiesBit3 : byte + { + /// BLOCK ERASE EXT supported + BlockErase = 0x0080, + /// OVERWRITE EXT supported + Overwrite = 0x0040, + /// CRYPTO SCRAMBLE EXT supported + CryptoScramble = 0x0020, + /// Sanitize feature set is supported + Sanitize = 0x0010, + /// If unset, sanitize commands are specified by ACS-2 + SanitizeCommands = 0x0008, + /// SANITIZE ANTIFREEZE LOCK EXT is supported + SanitizeAntifreeze = 0x0004, + #pragma warning disable 1591 + Reserved01 = 0x0002, + #pragma warning restore 1591 + /// Multiple logical sector setting is valid + MultipleValid = 0x0001 + } + +#endregion + +#region CommandSetBit enum + + /// Command set flag bits. + [Flags] + public enum CommandSetBit : ushort + { + /// Already obsolete in ATA/ATAPI-4, reserved in ATA3 + Obsolete15 = 0x8000, + /// NOP is supported + Nop = 0x4000, + /// READ BUFFER is supported + ReadBuffer = 0x2000, + /// WRITE BUFFER is supported + WriteBuffer = 0x1000, + /// Already obsolete in ATA/ATAPI-4, reserved in ATA3 + Obsolete11 = 0x0800, + /// Host Protected Area is supported + HPA = 0x0400, + /// DEVICE RESET is supported + DeviceReset = 0x0200, + /// SERVICE interrupt is supported + Service = 0x0100, + /// Release is supported + Release = 0x0080, + /// Look-ahead is supported + LookAhead = 0x0040, + /// Write cache is supported + WriteCache = 0x0020, + /// PACKET command set is supported + Packet = 0x0010, + /// Power Management feature set is supported + PowerManagement = 0x0008, + /// Removable Media feature set is supported + RemovableMedia = 0x0004, + /// Security Mode feature set is supported + SecurityMode = 0x0002, + /// SMART feature set is supported + SMART = 0x0001 + } + +#endregion + +#region CommandSetBit2 enum + + /// More command set flag bits. + [Flags] + public enum CommandSetBit2 : ushort + { + /// MUST NOT be set + MustBeClear = 0x8000, + /// MUST BE SET + MustBeSet = 0x4000, + /// FLUSH CACHE EXT supported + FlushCacheExt = 0x2000, + /// FLUSH CACHE supported + FlushCache = 0x1000, + /// Device Configuration Overlay feature set supported + DCO = 0x0800, + /// 48-bit LBA supported + LBA48 = 0x0400, + /// Automatic Acoustic Management supported + AAM = 0x0200, + /// SET MAX security extension supported + SetMax = 0x0100, + /// Address Offset Reserved Area Boot NCITS TR27:2001 + AddressOffsetReservedAreaBoot = 0x0080, + /// SET FEATURES required to spin-up + SetFeaturesRequired = 0x0040, + /// Power-Up in standby feature set supported + PowerUpInStandby = 0x0020, + /// Removable Media Status Notification feature set is supported + RemovableNotification = 0x0010, + /// Advanced Power Management feature set is supported + APM = 0x0008, + /// Compact Flash feature set is supported + CompactFlash = 0x0004, + /// READ DMA QUEUED and WRITE DMA QUEUED are supported + RWQueuedDMA = 0x0002, + /// DOWNLOAD MICROCODE is supported + DownloadMicrocode = 0x0001 + } + +#endregion + +#region CommandSetBit3 enum + + /// Even more command set flag bits. + [Flags] + public enum CommandSetBit3 : ushort + { + /// MUST NOT be set + MustBeClear = 0x8000, + /// MUST BE SET + MustBeSet = 0x4000, + /// IDLE IMMEDIATE with UNLOAD FEATURE is supported + IdleImmediate = 0x2000, + /// Reserved for INCITS TR-37/2004 + Reserved12 = 0x1000, + /// Reserved for INCITS TR-37/2004 + Reserved11 = 0x0800, + /// URG bit is supported in WRITE STREAM DMA EXT and WRITE STREAM EXT + WriteURG = 0x0400, + /// URG bit is supported in READ STREAM DMA EXT and READ STREAM EXT + ReadURG = 0x0200, + /// 64-bit World Wide Name is supported + WWN = 0x0100, + /// WRITE DMA QUEUED FUA EXT is supported + FUAWriteQ = 0x0080, + /// WRITE DMA FUA EXT and WRITE MULTIPLE FUA EXT are supported + FUAWrite = 0x0040, + /// General Purpose Logging feature supported + GPL = 0x0020, + /// Streaming feature set is supported + Streaming = 0x0010, + /// Media Card Pass Through command set supported + MCPT = 0x0008, + /// Media serial number supported + MediaSerial = 0x0004, + /// SMART self-test supported + SMARTSelfTest = 0x0002, + /// SMART error logging supported + SMARTLog = 0x0001 + } + +#endregion + +#region CommandSetBit4 enum + + /// Yet more command set flag bits. + [Flags] + public enum CommandSetBit4 : ushort + { + /// MUST NOT be set + MustBeClear = 0x8000, + /// MUST be set + MustBeSet = 0x4000, + #pragma warning disable 1591 + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + #pragma warning restore 1591 + /// DSN feature set is supported + DSN = 0x0200, + /// Accessible Max Address Configuration is supported + AMAC = 0x0100, + /// Extended Power Conditions is supported + ExtPowerCond = 0x0080, + /// Extended Status Reporting is supported + ExtStatusReport = 0x0040, + /// Free-fall Control feature set is supported + FreeFallControl = 0x0020, + /// Supports segmented feature in DOWNLOAD MICROCODE + SegmentedDownloadMicrocode = 0x0010, + /// READ/WRITE DMA EXT GPL are supported + RWDMAExtGpl = 0x0008, + /// WRITE UNCORRECTABLE is supported + WriteUnc = 0x0004, + /// Write/Read/Verify is supported + WRV = 0x0002, + /// Reserved for DT1825 + DT1825 = 0x0001 + } + +#endregion + +#region CommandSetBit5 enum + + /// Yet again more command set flag bits. + [Flags] + public enum CommandSetBit5 : ushort + { + /// Supports CFast Specification + CFast = 0x8000, + /// Deterministic read after TRIM is supported + DeterministicTrim = 0x4000, + /// Long physical sector alignment error reporting control is supported + LongPhysSectorAligError = 0x2000, + /// DEVICE CONFIGURATION IDENTIFY DMA and DEVICE CONFIGURATION SET DMA are supported + DeviceConfDMA = 0x1000, + /// READ BUFFER DMA is supported + ReadBufferDMA = 0x0800, + /// WRITE BUFFER DMA is supported + WriteBufferDMA = 0x0400, + /// SET PASSWORD DMA and SET UNLOCK DMA are supported + SetMaxDMA = 0x0200, + /// DOWNLOAD MICROCODE DMA is supported + DownloadMicroCodeDMA = 0x0100, + /// Reserved for IEEE-1667 + IEEE1667 = 0x0080, + /// Optional ATA 28-bit commands are supported + Ata28 = 0x0040, + /// Read zero after TRIM is supported + ReadZeroTrim = 0x0020, + /// Device encrypts all user data + Encrypted = 0x0010, + /// Extended number of user addressable sectors is supported + ExtSectors = 0x0008, + /// All write cache is non-volatile + AllCacheNV = 0x0004, + /// Zoned capabilities bit 1 + ZonedBit1 = 0x0002, + /// Zoned capabilities bit 0 + ZonedBit0 = 0x0001 + } + +#endregion + +#region DataSetMgmtBit enum + + /// Data set management flag bits. + [Flags] + public enum DataSetMgmtBit : ushort + { + #pragma warning disable 1591 + Reserved15 = 0x8000, + Reserved14 = 0x4000, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + Reserved07 = 0x0080, + Reserved06 = 0x0040, + Reserved05 = 0x0020, + Reserved04 = 0x0010, + Reserved03 = 0x0008, + Reserved02 = 0x0004, + Reserved01 = 0x0002, + #pragma warning restore 1591 + /// TRIM is supported + Trim = 0x0001 + } + +#endregion + +#region DeviceFormFactorEnum enum + + /// Device form factor + public enum DeviceFormFactorEnum : ushort + { + /// Size not reported + NotReported = 0, + /// 5.25" + FiveAndQuarter = 1, + /// 3.5" + ThreeAndHalf = 2, + /// 2.5" + TwoAndHalf = 3, + /// 1.8" + OnePointEight = 4, + /// Less than 1.8" + LessThanOnePointEight = 5 + } + +#endregion + +#region ExtendedIdentifyBit enum + + /// Extended identify flag bits. + [Flags] + public enum ExtendedIdentifyBit : byte + { + /// Reserved + Reserved07 = 0x80, + /// Reserved + Reserved06 = 0x40, + /// Reserved + Reserved05 = 0x20, + /// Reserved + Reserved04 = 0x10, + /// Reserved + Reserved03 = 0x08, + /// Identify word 88 is valid + Word88Valid = 0x04, + /// Identify words 64 to 70 are valid + Words64to70Valid = 0x02, + /// Identify words 54 to 58 are valid + Words54to58Valid = 0x01 + } + +#endregion + +#region GeneralConfigurationBit enum + + /// General configuration flag bits. + [Flags] + public enum GeneralConfigurationBit : ushort + { + /// Set on ATAPI + NonMagnetic = 0x8000, + /// Format speed tolerance gap is required Obsoleted in ATA-2 + FormatGapReq = 0x4000, + /// Track offset option is available Obsoleted in ATA-2 + TrackOffset = 0x2000, + /// Data strobe offset option is available Obsoleted in ATA-2 + DataStrobeOffset = 0x1000, + /// Rotational speed tolerance is higher than 0,5% Obsoleted in ATA-2 + RotationalSpeedTolerance = 0x0800, + /// Disk transfer rate is > 10 Mb/s Obsoleted in ATA-2 + UltraFastIDE = 0x0400, + /// Disk transfer rate is > 5 Mb/s but <= 10 Mb/s Obsoleted in ATA-2 + FastIDE = 0x0200, + /// Disk transfer rate is <= 5 Mb/s Obsoleted in ATA-2 + SlowIDE = 0x0100, + /// Drive uses removable media + Removable = 0x0080, + /// Drive is fixed Obsoleted in ATA/ATAPI-6 + Fixed = 0x0040, + /// Spindle motor control is implemented Obsoleted in ATA-2 + SpindleControl = 0x0020, + /// Head switch time is bigger than 15 µsec. Obsoleted in ATA-2 + HighHeadSwitch = 0x0010, + /// Drive is not MFM encoded Obsoleted in ATA-2 + NotMFM = 0x0008, + /// Drive is soft sectored Obsoleted in ATA-2 + SoftSector = 0x0004, + /// Response incomplete Since ATA/ATAPI-5 + IncompleteResponse = 0x0004, + /// Drive is hard sectored Obsoleted in ATA-2 + HardSector = 0x0002, + /// Reserved + Reserved = 0x0001 + } + +#endregion + +#region MajorVersionBit enum + + /// Word 80 Major version + [Flags] + public enum MajorVersionBit : ushort + { + #pragma warning disable 1591 + Reserved15 = 0x8000, + Reserved14 = 0x4000, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + #pragma warning restore 1591 + /// ACS-4 + ACS4 = 0x0800, + /// ACS-3 + ACS3 = 0x0400, + /// ACS-2 + ACS2 = 0x0200, + /// ATA8-ACS + Ata8ACS = 0x0100, + /// ATA/ATAPI-7 + AtaAtapi7 = 0x0080, + /// ATA/ATAPI-6 + AtaAtapi6 = 0x0040, + /// ATA/ATAPI-5 + AtaAtapi5 = 0x0020, + /// ATA/ATAPI-4 + AtaAtapi4 = 0x0010, + /// ATA-3 + Ata3 = 0x0008, + /// ATA-2 + Ata2 = 0x0004, + /// ATA-1 + Ata1 = 0x0002, + #pragma warning disable 1591 + Reserved00 = 0x0001 + #pragma warning restore 1591 + } + +#endregion + +#region SATACapabilitiesBit enum + + /// SATA capabilities flags + [Flags] + public enum SATACapabilitiesBit : ushort + { + /// Supports READ LOG DMA EXT + ReadLogDMAExt = 0x8000, + /// Supports device automatic partial to slumber transitions + DevSlumbTrans = 0x4000, + /// Supports host automatic partial to slumber transitions + HostSlumbTrans = 0x2000, + /// Supports NCQ priority + NCQPriority = 0x1000, + /// Supports unload while NCQ commands are outstanding + UnloadNCQ = 0x0800, + /// Supports PHY Event Counters + PHYEventCounter = 0x0400, + /// Supports receipt of host initiated power management requests + PowerReceipt = 0x0200, + /// Supports NCQ + NCQ = 0x0100, + #pragma warning disable 1591 + Reserved07 = 0x0080, + Reserved06 = 0x0040, + Reserved05 = 0x0020, + Reserved04 = 0x0010, + #pragma warning restore 1591 + /// Supports SATA Gen. 3 Signaling Speed (6.0Gb/s) + Gen3Speed = 0x0008, + /// Supports SATA Gen. 2 Signaling Speed (3.0Gb/s) + Gen2Speed = 0x0004, + /// Supports SATA Gen. 1 Signaling Speed (1.5Gb/s) + Gen1Speed = 0x0002, + /// MUST NOT be set + Clear = 0x0001 + } + +#endregion + +#region SATACapabilitiesBit2 enum + + /// More SATA capabilities flags + [Flags] + public enum SATACapabilitiesBit2 : ushort + { + #pragma warning disable 1591 + Reserved15 = 0x8000, + Reserved14 = 0x4000, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + Reserved07 = 0x0080, + #pragma warning restore 1591 + /// Supports RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED + FPDMAQ = 0x0040, + /// Supports NCQ Queue Management + NCQMgmt = 0x0020, + /// ATAPI: Supports host environment detect + HostEnvDetect = 0x0020, + /// Supports NCQ streaming + NCQStream = 0x0010, + /// ATAPI: Supports device attention on slimline connected devices + DevAttSlimline = 0x0010, + /// Coded value indicating current negotiated Serial ATA signal speed + CurrentSpeedBit2 = 0x0008, + /// Coded value indicating current negotiated Serial ATA signal speed + CurrentSpeedBit1 = 0x0004, + /// Coded value indicating current negotiated Serial ATA signal speed + CurrentSpeedBit0 = 0x0002, + /// MUST NOT be set + Clear = 0x0001 + } + +#endregion + +#region SATAFeaturesBit enum + + /// SATA features flags + [Flags] + public enum SATAFeaturesBit : ushort + { + #pragma warning disable 1591 + Reserved15 = 0x8000, + Reserved14 = 0x4000, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + #pragma warning restore 1591 + /// Supports NCQ autosense + NCQAutoSense = 0x0080, + /// Automatic Partial to Slumber transitions are enabled + EnabledSlumber = 0x0080, + /// Supports Software Settings Preservation + SettingsPreserve = 0x0040, + /// Supports hardware feature control + HardwareFeatureControl = 0x0020, + /// ATAPI: Asynchronous notification + AsyncNotification = 0x0020, + /// Supports in-order data delivery + InOrderData = 0x0010, + /// Supports initiating power management + InitPowerMgmt = 0x0008, + /// Supports DMA Setup auto-activation + DMASetup = 0x0004, + /// Supports non-zero buffer offsets + NonZeroBufferOffset = 0x0002, + /// MUST NOT be set + Clear = 0x0001 + } + +#endregion + +#region SCTCommandTransportBit enum + + /// SCT Command Transport flags + [Flags] + public enum SCTCommandTransportBit : ushort + { + #pragma warning disable 1591 + Vendor15 = 0x8000, + Vendor14 = 0x4000, + Vendor13 = 0x2000, + Vendor12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + Reserved07 = 0x0080, + Reserved06 = 0x0040, + #pragma warning restore 1591 + /// SCT Command Transport Data Tables supported + DataTables = 0x0020, + /// SCT Command Transport Features Control supported + FeaturesControl = 0x0010, + /// SCT Command Transport Error Recovery Control supported + ErrorRecoveryControl = 0x0008, + /// SCT Command Transport Write Same supported + WriteSame = 0x0004, + /// SCT Command Transport Long Sector Address supported + LongSectorAccess = 0x0002, + /// SCT Command Transport supported + Supported = 0x0001 + } + +#endregion + +#region SecurityStatusBit enum + + /// Security status flag bits. + [Flags] + public enum SecurityStatusBit : ushort + { + #pragma warning disable 1591 + Reserved15 = 0x8000, + Reserved14 = 0x4000, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + #pragma warning restore 1591 + /// Maximum security level + Maximum = 0x0100, + #pragma warning disable 1591 + Reserved07 = 0x0080, + Reserved06 = 0x0040, + #pragma warning restore 1591 + /// Supports enhanced security erase + Enhanced = 0x0020, + /// Security count expired + Expired = 0x0010, + /// Security frozen + Frozen = 0x0008, + /// Security locked + Locked = 0x0004, + /// Security enabled + Enabled = 0x0002, + /// Security supported + Supported = 0x0001 + } + +#endregion + +#region SpecificConfigurationEnum enum + + /// Specific configuration flags + public enum SpecificConfigurationEnum : ushort + { + /// Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete + RequiresSetIncompleteResponse = 0x37C8, + /// Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is complete + RequiresSetCompleteResponse = 0x738C, + /// Device does not requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete + NotRequiresSetIncompleteResponse = 0x8C73, + /// Device does not requires SET FEATURES to spin up and IDENTIFY DEVICE response is complete + NotRequiresSetCompleteResponse = 0xC837 + } + +#endregion + +#region TransferMode enum + + /// Transfer mode flags + [Flags] + public enum TransferMode : byte + { + #pragma warning disable 1591 + Mode7 = 0x80, + Mode6 = 0x40, + Mode5 = 0x20, + Mode4 = 0x10, + Mode3 = 0x08, + Mode2 = 0x04, + Mode1 = 0x02, + Mode0 = 0x01 + #pragma warning restore 1591 + } + +#endregion + +#region TrustedComputingBit enum + + /// Trusted Computing flags + [Flags] + public enum TrustedComputingBit : ushort + { + /// MUST NOT be set + Clear = 0x8000, + /// MUST be set + Set = 0x4000, + #pragma warning disable 1591 + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + Reserved07 = 0x0080, + Reserved06 = 0x0040, + Reserved05 = 0x0020, + Reserved04 = 0x0010, + Reserved03 = 0x0008, + Reserved02 = 0x0004, + Reserved01 = 0x0002, + #pragma warning restore 1591 + /// Trusted Computing feature set is supported + TrustedComputing = 0x0001 + } + +#endregion + + const string MODULE_NAME = "ATA/ATAPI IDENTIFY decoder"; + + /// Decodes a raw IDENTIFY DEVICE response + /// Raw IDENTIFY DEVICE response + /// Decoded IDENTIFY DEVICE + public static IdentifyDevice? Decode(byte[] IdentifyDeviceResponse) + { + if(IdentifyDeviceResponse == null) + return null; + + if(IdentifyDeviceResponse.Length != 512) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.IDENTIFY_response_is_different_than_512_bytes_not_decoding); + + return null; + } + + IdentifyDevice ATAID = Marshal.ByteArrayToStructureLittleEndian(IdentifyDeviceResponse); + + ATAID.WWN = DescrambleWWN(ATAID.WWN); + ATAID.WWNExtension = DescrambleWWN(ATAID.WWNExtension); + + ATAID.SerialNumber = DescrambleATAString(IdentifyDeviceResponse, 10 * 2, 20); + ATAID.FirmwareRevision = DescrambleATAString(IdentifyDeviceResponse, 23 * 2, 8); + ATAID.Model = DescrambleATAString(IdentifyDeviceResponse, 27 * 2, 40); + ATAID.AdditionalPID = DescrambleATAString(IdentifyDeviceResponse, 170 * 2, 8); + ATAID.MediaSerial = DescrambleATAString(IdentifyDeviceResponse, 176 * 2, 40); + ATAID.MediaManufacturer = DescrambleATAString(IdentifyDeviceResponse, 196 * 2, 20); + + return ATAID; + } + + /// Encodes a raw IDENTIFY DEVICE response + /// Decoded IDENTIFY DEVICE + /// Raw IDENTIFY DEVICE response + public static byte[] Encode(IdentifyDevice? identify) + { + if(identify is null) + return null; + + IdentifyDevice ataId = identify.Value; + + ataId.WWN = DescrambleWWN(ataId.WWN); + ataId.WWNExtension = DescrambleWWN(ataId.WWNExtension); + + var buf = new byte[512]; + nint ptr = System.Runtime.InteropServices.Marshal.AllocHGlobal(512); + System.Runtime.InteropServices.Marshal.StructureToPtr(ataId, ptr, false); + System.Runtime.InteropServices.Marshal.Copy(ptr, buf, 0, 512); + System.Runtime.InteropServices.Marshal.FreeHGlobal(ptr); + + byte[] str = ScrambleATAString(ataId.SerialNumber, 20); + Array.Copy(str, 0, buf, 10 * 2, 20); + str = ScrambleATAString(ataId.FirmwareRevision, 8); + Array.Copy(str, 0, buf, 23 * 2, 8); + str = ScrambleATAString(ataId.Model, 40); + Array.Copy(str, 0, buf, 27 * 2, 40); + str = ScrambleATAString(ataId.AdditionalPID, 8); + Array.Copy(str, 0, buf, 170 * 2, 8); + str = ScrambleATAString(ataId.MediaSerial, 40); + Array.Copy(str, 0, buf, 176 * 2, 40); + str = ScrambleATAString(ataId.MediaManufacturer, 20); + Array.Copy(str, 0, buf, 196 * 2, 20); + + return buf; + } + + static ulong DescrambleWWN(ulong WWN) + { + byte[] qwb = BitConverter.GetBytes(WWN); + var qword = new byte[8]; + + qword[7] = qwb[1]; + qword[6] = qwb[0]; + qword[5] = qwb[3]; + qword[4] = qwb[2]; + qword[3] = qwb[5]; + qword[2] = qwb[4]; + qword[1] = qwb[7]; + qword[0] = qwb[6]; + + return BitConverter.ToUInt64(qword, 0); + } + + static string DescrambleATAString(IList buffer, int offset, int length) + { + byte[] outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length]; + + for(var i = 0; i < length; i += 2) + { + outbuf[i] = buffer[offset + i + 1]; + outbuf[i + 1] = buffer[offset + i]; + } + + string outStr = StringHandlers.CToString(outbuf); + + return outStr.Trim(); + } + + static byte[] ScrambleATAString(string str, int length) + { + var buf = new byte[length]; + + for(var i = 0; i < length; i++) + buf[i] = 0x20; + + if(str is null) + return buf; + + byte[] bytes = Encoding.ASCII.GetBytes(str); + + if(bytes.Length % 2 != 0) + { + var tmp = new byte[bytes.Length + 1]; + tmp[^1] = 0x20; + Array.Copy(bytes, 0, tmp, 0, bytes.Length); + bytes = tmp; + } + + for(var i = 0; i < bytes.Length; i += 2) + { + buf[i] = bytes[i + 1]; + buf[i + 1] = bytes[i]; + } + + return buf; + } + +#region Nested type: IdentifyDevice + + /// IDENTIFY DEVICE decoded response + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)] + public struct IdentifyDevice + { + /// + /// Word 0 General device configuration On ATAPI devices: Bits 12 to 8 indicate device type as SCSI defined Bits 6 + /// to 5: 0 = Device shall set DRQ within 3 ms of receiving PACKET 1 = Device shall assert INTRQ when DRQ is set to one + /// 2 = Device shall set DRQ within 50 µs of receiving PACKET Bits 1 to 0: 0 = 12 byte command packet 1 = 16 byte + /// command packet CompactFlash is 0x848A (non magnetic, removable, not MFM, hardsector, and UltraFAST) + /// + public GeneralConfigurationBit GeneralConfiguration; + /// Word 1 Cylinders in default translation mode Obsoleted in ATA/ATAPI-6 + public ushort Cylinders; + /// Word 2 Specific configuration + public SpecificConfigurationEnum SpecificConfiguration; + /// Word 3 Heads in default translation mode Obsoleted in ATA/ATAPI-6 + public ushort Heads; + /// Word 4 Unformatted bytes per track in default translation mode Obsoleted in ATA-2 + public ushort UnformattedBPT; + /// Word 5 Unformatted bytes per sector in default translation mode Obsoleted in ATA-2 + public ushort UnformattedBPS; + /// Word 6 Sectors per track in default translation mode Obsoleted in ATA/ATAPI-6 + public ushort SectorsPerTrack; + /// Words 7 to 8 CFA: Number of sectors per card + public uint SectorsPerCard; + /// Word 9 Vendor unique Obsoleted in ATA/ATAPI-4 + public ushort VendorWord9; + /// Words 10 to 19 Device serial number, right justified, padded with spaces + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] + public string SerialNumber; + /// + /// Word 20 Manufacturer defined Obsoleted in ATA-2 0x0001 = single ported single sector buffer 0x0002 = dual + /// ported multi sector buffer 0x0003 = dual ported multi sector buffer with reading + /// + public ushort BufferType; + /// Word 21 Size of buffer in 512 byte increments Obsoleted in ATA-2 + public ushort BufferSize; + /// Word 22 Bytes of ECC available in READ/WRITE LONG commands Obsoleted in ATA/ATAPI-4 + public ushort EccBytes; + /// Words 23 to 26 Firmware revision, left justified, padded with spaces + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] + public string FirmwareRevision; + /// Words 27 to 46 Model number, left justified, padded with spaces + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] + public string Model; + /// + /// Word 47 bits 7 to 0 Maximum number of sectors that can be transferred per interrupt on read and write multiple + /// commands + /// + public byte MultipleMaxSectors; + /// Word 47 bits 15 to 8 Vendor unique ATA/ATAPI-4 says it must be 0x80 + public byte VendorWord47; + /// + /// Word 48 ATA-1: Set to 1 if it can perform doubleword I/O ATA-2 to ATA/ATAPI-7: Reserved ATA8-ACS: Trusted + /// Computing feature set + /// + public TrustedComputingBit TrustedComputing; + /// Word 49 Capabilities + public CapabilitiesBit Capabilities; + /// Word 50 Capabilities + public CapabilitiesBit2 Capabilities2; + /// Word 51 bits 7 to 0 Vendor unique Obsoleted in ATA/ATAPI-4 + public byte VendorWord51; + /// Word 51 bits 15 to 8 Transfer timing mode in PIO Obsoleted in ATA/ATAPI-4 + public byte PIOTransferTimingMode; + /// Word 52 bits 7 to 0 Vendor unique Obsoleted in ATA/ATAPI-4 + public byte VendorWord52; + /// Word 52 bits 15 to 8 Transfer timing mode in DMA Obsoleted in ATA/ATAPI-4 + public byte DMATransferTimingMode; + /// Word 53 bits 7 to 0 Reports if words 54 to 58 are valid + public ExtendedIdentifyBit ExtendedIdentify; + /// Word 53 bits 15 to 8 Free-fall Control Sensitivity + public byte FreeFallSensitivity; + /// Word 54 Cylinders in current translation mode Obsoleted in ATA/ATAPI-6 + public ushort CurrentCylinders; + /// Word 55 Heads in current translation mode Obsoleted in ATA/ATAPI-6 + public ushort CurrentHeads; + /// Word 56 Sectors per track in current translation mode Obsoleted in ATA/ATAPI-6 + public ushort CurrentSectorsPerTrack; + /// Words 57 to 58 Total sectors currently user-addressable Obsoleted in ATA/ATAPI-6 + public uint CurrentSectors; + /// Word 59 bits 7 to 0 Number of sectors currently set to transfer on a READ/WRITE MULTIPLE command + public byte MultipleSectorNumber; + /// Word 59 bits 15 to 8 Indicates if is valid + public CapabilitiesBit3 Capabilities3; + /// Words 60 to 61 If drive supports LBA, how many sectors are addressable using LBA + public uint LBASectors; + /// + /// Word 62 bits 7 to 0 Single word DMA modes available Obsoleted in ATA/ATAPI-4 In ATAPI it's not obsolete, + /// indicates UDMA mode (UDMA7 is instead MDMA0) + /// + public TransferMode DMASupported; + /// + /// Word 62 bits 15 to 8 Single word DMA mode currently active Obsoleted in ATA/ATAPI-4 In ATAPI it's not + /// obsolete, bits 0 and 1 indicate MDMA mode+1, bit 10 indicates DMA is supported and bit 15 indicates DMADIR bit in + /// PACKET is required for DMA transfers + /// + public TransferMode DMAActive; + /// Word 63 bits 7 to 0 Multiword DMA modes available + public TransferMode MDMASupported; + /// Word 63 bits 15 to 8 Multiword DMA mode currently active + public TransferMode MDMAActive; + + /// Word 64 bits 7 to 0 Supported Advanced PIO transfer modes + public TransferMode APIOSupported; + /// Word 64 bits 15 to 8 Reserved + public byte ReservedWord64; + /// Word 65 Minimum MDMA transfer cycle time per word in nanoseconds + public ushort MinMDMACycleTime; + /// Word 66 Recommended MDMA transfer cycle time per word in nanoseconds + public ushort RecMDMACycleTime; + /// Word 67 Minimum PIO transfer cycle time without flow control in nanoseconds + public ushort MinPIOCycleTimeNoFlow; + /// Word 68 Minimum PIO transfer cycle time with IORDY flow control in nanoseconds + public ushort MinPIOCycleTimeFlow; + + /// Word 69 Additional supported + public CommandSetBit5 CommandSet5; + /// Word 70 Reserved + public ushort ReservedWord70; + /// Word 71 ATAPI: Typical time in ns from receipt of PACKET to release bus + public ushort PacketBusRelease; + /// Word 72 ATAPI: Typical time in ns from receipt of SERVICE to clear BSY + public ushort ServiceBusyClear; + /// Word 73 Reserved + public ushort ReservedWord73; + /// Word 74 Reserved + public ushort ReservedWord74; + + /// Word 75 Maximum Queue depth + public ushort MaxQueueDepth; + + /// Word 76 Serial ATA Capabilities + public SATACapabilitiesBit SATACapabilities; + /// Word 77 Serial ATA Additional Capabilities + public SATACapabilitiesBit2 SATACapabilities2; + + /// Word 78 Supported Serial ATA features + public SATAFeaturesBit SATAFeatures; + /// Word 79 Enabled Serial ATA features + public SATAFeaturesBit EnabledSATAFeatures; + + /// Word 80 Major version of ATA/ATAPI standard supported + public MajorVersionBit MajorVersion; + /// Word 81 Minimum version of ATA/ATAPI standard supported + public ushort MinorVersion; + + /// Word 82 Supported command/feature sets + public CommandSetBit CommandSet; + /// Word 83 Supported command/feature sets + public CommandSetBit2 CommandSet2; + /// Word 84 Supported command/feature sets + public CommandSetBit3 CommandSet3; + + /// Word 85 Enabled command/feature sets + public CommandSetBit EnabledCommandSet; + /// Word 86 Enabled command/feature sets + public CommandSetBit2 EnabledCommandSet2; + /// Word 87 Enabled command/feature sets + public CommandSetBit3 EnabledCommandSet3; + + /// Word 88 bits 7 to 0 Supported Ultra DMA transfer modes + public TransferMode UDMASupported; + /// Word 88 bits 15 to 8 Selected Ultra DMA transfer modes + public TransferMode UDMAActive; + + /// Word 89 Time required for security erase completion + public ushort SecurityEraseTime; + /// Word 90 Time required for enhanced security erase completion + public ushort EnhancedSecurityEraseTime; + /// Word 91 Current advanced power management value + public ushort CurrentAPM; + + /// Word 92 Master password revision code + public ushort MasterPasswordRevisionCode; + /// Word 93 Hardware reset result + public ushort HardwareResetResult; + + /// Word 94 bits 7 to 0 Current AAM value + public byte CurrentAAM; + /// Word 94 bits 15 to 8 Vendor's recommended AAM value + public byte RecommendedAAM; + + /// Word 95 Stream minimum request size + public ushort StreamMinReqSize; + /// Word 96 Streaming transfer time in DMA + public ushort StreamTransferTimeDMA; + /// Word 97 Streaming access latency in DMA and PIO + public ushort StreamAccessLatency; + /// Words 98 to 99 Streaming performance granularity + public uint StreamPerformanceGranularity; + + /// Words 100 to 103 48-bit LBA addressable sectors + public ulong LBA48Sectors; + + /// Word 104 Streaming transfer time in PIO + public ushort StreamTransferTimePIO; + + /// Word 105 Maximum number of 512-byte block per DATA SET MANAGEMENT command + public ushort DataSetMgmtSize; + + /// + /// Word 106 Bit 15 should be zero Bit 14 should be one Bit 13 set indicates device has multiple logical sectors + /// per physical sector Bit 12 set indicates logical sector has more than 256 words (512 bytes) Bits 11 to 4 are + /// reserved Bits 3 to 0 indicate power of two of logical sectors per physical sector + /// + public ushort PhysLogSectorSize; + + /// Word 107 Interseek delay for ISO-7779 acoustic testing, in microseconds + public ushort InterseekDelay; + + /// Words 108 to 111 World Wide Name + public ulong WWN; + + /// Words 112 to 115 Reserved for WWN extension to 128 bit + public ulong WWNExtension; + + /// Word 116 Reserved for technical report + public ushort ReservedWord116; + + /// Words 117 to 118 Words per logical sector + public uint LogicalSectorWords; + + /// Word 119 Supported command/feature sets + public CommandSetBit4 CommandSet4; + /// Word 120 Supported command/feature sets + public CommandSetBit4 EnabledCommandSet4; + + /// Words 121 to 125 Reserved + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] + public ushort[] ReservedWords121; + + /// Word 126 ATAPI byte count limit + public ushort ATAPIByteCount; + + /// + /// Word 127 Removable Media Status Notification feature set support Bits 15 to 2 are reserved Bits 1 to 0 must be + /// 0 for not supported or 1 for supported. 2 and 3 are reserved. Obsoleted in ATA8-ACS + /// + public ushort RemovableStatusSet; + + /// Word 128 Security status + public SecurityStatusBit SecurityStatus; + + /// Words 129 to 159 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)] + public ushort[] ReservedWords129; + + /// + /// Word 160 CFA power mode Bit 15 must be set Bit 13 indicates mode 1 is required for one or more commands Bit 12 + /// indicates mode 1 is disabled Bits 11 to 0 indicates maximum current in mA + /// + public ushort CFAPowerMode; + + /// Words 161 to 167 Reserved for CFA + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] + public ushort[] ReservedCFA; + + /// Word 168 Bits 15 to 4, reserved Bits 3 to 0, device nominal form factor + public DeviceFormFactorEnum DeviceFormFactor; + /// Word 169 DATA SET MANAGEMENT support + public DataSetMgmtBit DataSetMgmt; + /// Words 170 to 173 Additional product identifier + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] + public string AdditionalPID; + + /// Word 174 Reserved + public ushort ReservedWord174; + /// Word 175 Reserved + public ushort ReservedWord175; + + /// Words 176 to 195 Current media serial number + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] + public string MediaSerial; + /// Words 196 to 205 Current media manufacturer + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] + public string MediaManufacturer; + + /// Word 206 SCT Command Transport features + public SCTCommandTransportBit SCTCommandTransport; + + /// Word 207 Reserved for CE-ATA + public ushort ReservedCEATAWord207; + /// Word 208 Reserved for CE-ATA + public ushort ReservedCEATAWord208; + + /// + /// Word 209 Alignment of logical block within a larger physical block Bit 15 shall be cleared to zero Bit 14 + /// shall be set to one Bits 13 to 0 indicate logical sector offset within the first physical sector + /// + public ushort LogicalAlignment; + + /// Words 210 to 211 Write/Read/Verify sector count mode 3 only + public uint WRVSectorCountMode3; + /// Words 212 to 213 Write/Read/Verify sector count mode 2 only + public uint WRVSectorCountMode2; + + /// + /// Word 214 NV Cache capabilities Bits 15 to 12 feature set version Bits 11 to 18 power mode feature set version + /// Bits 7 to 5 reserved Bit 4 feature set enabled Bits 3 to 2 reserved Bit 1 power mode feature set enabled Bit 0 + /// power mode feature set supported + /// + public ushort NVCacheCaps; + /// Words 215 to 216 NV Cache Size in Logical BLocks + public uint NVCacheSize; + /// Word 217 Nominal media rotation rate In ACS-1 meant NV Cache read speed in MB/s + public ushort NominalRotationRate; + /// Word 218 NV Cache write speed in MB/s Reserved since ACS-2 + public ushort NVCacheWriteSpeed; + /// Word 219 bits 7 to 0 Estimated device spin up in seconds + public byte NVEstimatedSpinUp; + /// Word 219 bits 15 to 8 NV Cache reserved + public byte NVReserved; + + /// Word 220 bits 7 to 0 Write/Read/Verify feature set current mode + public byte WRVMode; + /// Word 220 bits 15 to 8 Reserved + public byte WRVReserved; + + /// Word 221 Reserved + public ushort ReservedWord221; + + /// + /// Word 222 Transport major revision number Bits 15 to 12 indicate transport type. 0 parallel, 1 serial, 0xE + /// PCIe. Bits 11 to 0 indicate revision + /// + public ushort TransportMajorVersion; + /// Word 223 Transport minor revision number + public ushort TransportMinorVersion; + + /// Words 224 to 229 Reserved for CE-ATA + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] + public ushort[] ReservedCEATA224; + + /// Words 230 to 233 48-bit LBA if Word 69 bit 3 is set + public ulong ExtendedUserSectors; + + /// Word 234 Minimum number of 512 byte units per DOWNLOAD MICROCODE mode 3 + public ushort MinDownloadMicroMode3; + /// Word 235 Maximum number of 512 byte units per DOWNLOAD MICROCODE mode 3 + public ushort MaxDownloadMicroMode3; + + /// Words 236 to 254 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)] + public ushort[] ReservedWords; + + /// Word 255 bits 7 to 0 Should be 0xA5 + public byte Signature; + /// Word 255 bits 15 to 8 Checksum + public byte Checksum; + } + +#endregion +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/Devices/SCSI/Enums.cs b/Aaru.CommonTypes/Structs/Devices/SCSI/Enums.cs new file mode 100644 index 000000000..5ed7356a5 --- /dev/null +++ b/Aaru.CommonTypes/Structs/Devices/SCSI/Enums.cs @@ -0,0 +1,245 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Enums.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures for SCSI devices. +// +// --[ Description ] ---------------------------------------------------------- +// +// Contains various SCSI enumerations. +// +// --[ 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2023 Natalia Portillo +// ****************************************************************************/ + +using System.Diagnostics.CodeAnalysis; + +namespace Aaru.CommonTypes.Structs.Devices.SCSI; + +/// List of known SCSI peripheral qualifiers +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public enum PeripheralQualifiers : byte +{ + /// Peripheral qualifier: Device is connected and supported + Supported = 0x00, + /// Peripheral qualifier: Device is supported but not connected + Unconnected = 0x01, + /// Peripheral qualifier: Reserved value + Reserved = 0x02, + /// Peripheral qualifier: Device is connected but unsupported + Unsupported = 0x03, + /// Peripheral qualifier: Vendor values: 0x04, 0x05, 0x06 and 0x07 + VendorMask = 0x04 +} + +/// List of known peripheral device types +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum PeripheralDeviceTypes : byte +{ + /// Direct-access device + DirectAccess = 0x00, + /// Sequential-access device + SequentialAccess = 0x01, + /// Printer device + PrinterDevice = 0x02, + /// Processor device + ProcessorDevice = 0x03, + /// Write-once device + WriteOnceDevice = 0x04, + /// CD-ROM/DVD/etc device + MultiMediaDevice = 0x05, + /// Scanner device + ScannerDevice = 0x06, + /// Optical memory device + OpticalDevice = 0x07, + /// Medium change device + MediumChangerDevice = 0x08, + /// Communications device + CommsDevice = 0x09, + /// Graphics arts pre-press device (defined in ASC IT8) + PrePressDevice1 = 0x0A, + /// Graphics arts pre-press device (defined in ASC IT8) + PrePressDevice2 = 0x0B, + /// Array controller device + ArrayControllerDevice = 0x0C, + /// Enclosure services device + EnclosureServiceDevice = 0x0D, + /// Simplified direct-access device + SimplifiedDevice = 0x0E, + /// Optical card reader/writer device + OCRWDevice = 0x0F, + /// Bridging Expanders + BridgingExpander = 0x10, + /// Object-based Storage Device + ObjectDevice = 0x11, + /// Automation/Drive Interface + ADCDevice = 0x12, + /// Security Manager Device + SCSISecurityManagerDevice = 0x13, + /// Host managed zoned block device + SCSIZonedBlockDevice = 0x14, + /// Well known logical unit + WellKnownDevice = 0x1E, + /// Unknown or no device type + UnknownDevice = 0x1F +} + +/// List of known ANSI SCSI standards +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum ANSIVersions : byte +{ + /// Device does not claim conformance to any ANSI version + ANSINoVersion = 0x00, + /// Device complies with ANSI X3.131:1986 + ANSI1986Version = 0x01, + /// Device complies with ANSI X3.131:1994 + ANSI1994Version = 0x02, + /// Device complies with ANSI X3.301:1997 + ANSI1997Version = 0x03, + /// Device complies with ANSI X3.351:2001 + ANSI2001Version = 0x04, + /// Device complies with ANSI X3.408:2005. + ANSI2005Version = 0x05, + /// Device complies with SPC-4 + ANSI2008Version = 0x06 +} + +/// List of known ECMA SCSI standards +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum ECMAVersions : byte +{ + /// Device does not claim conformance to any ECMA version + ECMANoVersion = 0x00, + /// Device complies with a ECMA-111 standard + ECMA111 = 0x01 +} + +/// List of known ISO SCSI standards +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum ISOVersions : byte +{ + /// Device does not claim conformance to any ISO/IEC version + ISONoVersion = 0x00, + /// Device complies with ISO/IEC 9316:1995 + ISO1995Version = 0x02 +} + +/// List of known SCSI Parallel Interface clocking types +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum SPIClocking : byte +{ + /// Supports only ST + ST = 0x00, + /// Supports only DT + DT = 0x01, + /// Reserved value + Reserved = 0x02, + /// Supports ST and DT + STandDT = 0x03 +} + +/// List of known TGPS values +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum TGPSValues : byte +{ + /// Asymmetrical access not supported + NotSupported = 0x00, + /// Only implicit asymmetrical access is supported + OnlyImplicit = 0x01, + /// Only explicit asymmetrical access is supported + OnlyExplicit = 0x02, + /// Both implicit and explicit asymmetrical access are supported + Both = 0x03 +} + +/// List of known SCSI protocols +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum ProtocolIdentifiers : byte +{ + /// Fibre Channel + FibreChannel = 0, + /// Parallel SCSI + SCSI = 1, + /// SSA + SSA = 2, + /// IEEE-1394 + Firewire = 3, + /// SCSI Remote Direct Memory Access Protocol + RDMAP = 4, + /// Internet SCSI + iSCSI = 5, + /// Serial SCSI + SAS = 6, + /// Automation/Drive Interface Transport Protocol + ADT = 7, + /// AT Attachment Interface (ATA/ATAPI) + ATA = 8, + /// USB Attached SCSI + UAS = 9, + /// SCSI over PCI Express + SCSIe = 10, + /// PCI Express + PCIe = 11, + /// No specific protocol + NoProtocol = 15 +} + +/// List of known SCSI definitions +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum ScsiDefinitions : byte +{ + /// Unknown + Current = 0, + /// SCSI-1 + SCSI1 = 1, + /// Unknown + CCS = 2, + /// SCSI-2 + SCSI2 = 3, + /// SCSI-3 + SCSI3 = 4 +} + +/// List of known SCSI physical interfaces +[SuppressMessage("ReSharper", "InconsistentNaming")] +public enum PhysicalInterfaces : uint +{ + /// Unspecified physical interface + Unspecified = 0, + /// SCSI + SCSI = 1, + /// ATAPI + ATAPI = 2, + /// IEEE-1394/1995 + IEEE1394 = 3, + /// IEEE-1394A + IEEE1394A = 4, + /// Fibre Channel + FC = 5, + /// IEEE-1394B + IEEE1394B = 6, + /// Serial ATAPI + SerialATAPI = 7, + /// USB + USB = 8, + /// Vendor unique + Vendor = 0xFFFF +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/Devices/SCSI/Inquiry.cs b/Aaru.CommonTypes/Structs/Devices/SCSI/Inquiry.cs new file mode 100644 index 000000000..9a9ee87e3 --- /dev/null +++ b/Aaru.CommonTypes/Structs/Devices/SCSI/Inquiry.cs @@ -0,0 +1,792 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Inquiry.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures for SCSI devices. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines a high level interpretation of the SCSI INQUIRY response. +// +// --[ 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.Linq; +using Aaru.Console; + +namespace Aaru.CommonTypes.Structs.Devices.SCSI; + +/// +/// Information from the following standards: T9/375-D revision 10l T10/995-D revision 10 T10/1236-D revision 20 +/// T10/1416-D revision 23 T10/1731-D revision 16 T10/502 revision 05 RFC 7144 ECMA-111 +/// +[SuppressMessage("ReSharper", "InconsistentNaming")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public struct Inquiry +{ + const string MODULE_NAME = "SCSI INQUIRY decoder"; + /// Peripheral qualifier Byte 0, bits 7 to 5 + public byte PeripheralQualifier; + /// Peripheral device type Byte 0, bits 4 to 0 + public byte PeripheralDeviceType; + /// Removable device Byte 1, bit 7 + public bool RMB; + /// SCSI-1 vendor-specific qualification codes Byte 1, bits 6 to 0 + public byte DeviceTypeModifier; + /// ISO/IEC SCSI Standard Version Byte 2, bits 7 to 6, mask = 0xC0, >> 6 + public byte ISOVersion; + /// ECMA SCSI Standard Version Byte 2, bits 5 to 3, mask = 0x38, >> 3 + public byte ECMAVersion; + /// ANSI SCSI Standard Version Byte 2, bits 2 to 0, mask = 0x07 + public byte ANSIVersion; + /// Asynchronous Event Reporting Capability supported Byte 3, bit 7 + public bool AERC; + /// Device supports TERMINATE TASK command Byte 3, bit 6 + public bool TrmTsk; + /// Supports setting Normal ACA Byte 3, bit 5 + public bool NormACA; + /// Supports LUN hierarchical addressing Byte 3, bit 4 + public bool HiSup; + /// Responde data format Byte 3, bit 3 to 0 + public byte ResponseDataFormat; + /// Lenght of total INQUIRY response minus 4 Byte 4 + public byte AdditionalLength; + /// Device contains an embedded storage array controller Byte 5, bit 7 + public bool SCCS; + /// Device contains an Access Control Coordinator Byte 5, bit 6 + public bool ACC; + /// Supports asymetrical logical unit access Byte 5, bits 5 to 4 + public byte TPGS; + /// Supports third-party copy commands Byte 5, bit 3 + public bool ThreePC; + /// Reserved Byte 5, bits 2 to 1 + public byte Reserved2; + /// Supports protection information Byte 5, bit 0 + public bool Protect; + /// Supports basic queueing Byte 6, bit 7 + public bool BQue; + /// Device contains an embedded enclosure services component Byte 6, bit 6 + public bool EncServ; + /// Vendor-specific Byte 6, bit 5 + public bool VS1; + /// Multi-port device Byte 6, bit 4 + public bool MultiP; + /// Device contains or is attached to a medium changer Byte 6, bit 3 + public bool MChngr; + /// Device supports request and acknowledge handshakes Byte 6, bit 2 + public bool ACKREQQ; + /// Supports 32-bit wide SCSI addresses Byte 6, bit 1 + public bool Addr32; + /// Supports 16-bit wide SCSI addresses Byte 6, bit 0 + public bool Addr16; + /// Device supports relative addressing Byte 7, bit 7 + public bool RelAddr; + /// Supports 32-bit wide data transfers Byte 7, bit 6 + public bool WBus32; + /// Supports 16-bit wide data transfers Byte 7, bit 5 + public bool WBus16; + /// Supports synchronous data transfer Byte 7, bit 4 + public bool Sync; + /// Supports linked commands Byte 7, bit 3 + public bool Linked; + /// Supports CONTINUE TASK and TARGET TRANSFER DISABLE commands Byte 7, bit 2 + public bool TranDis; + /// Supports TCQ queue Byte 7, bit 1 + public bool CmdQue; + /// Indicates that the devices responds to RESET with soft reset Byte 7, bit 0 + public bool SftRe; + /// Vendor identification Bytes 8 to 15 + public byte[] VendorIdentification; + /// Product identification Bytes 16 to 31 + public byte[] ProductIdentification; + /// Product revision level Bytes 32 to 35 + public byte[] ProductRevisionLevel; + /// Vendor-specific data Bytes 36 to 55 + public byte[] VendorSpecific; + /// Byte 56, bits 7 to 4 + public byte Reserved3; + /// Supported SPI clocking Byte 56, bits 3 to 2 + public byte Clocking; + /// Device supports Quick Arbitration and Selection Byte 56, bit 1 + public bool QAS; + /// Supports information unit transfers Byte 56, bit 0 + public bool IUS; + /// Reserved Byte 57 + public byte Reserved4; + /// Array of version descriptors Bytes 58 to 73 + public ushort[] VersionDescriptors; + /// Reserved Bytes 74 to 95 + public byte[] Reserved5; + /// Reserved Bytes 96 to end + public byte[] VendorSpecific2; + + // Per DLT4000/DLT4500/DLT4700 Cartridge Tape Subsystem Product Manual + +#region Quantum vendor unique inquiry data structure + + /// Means that the INQUIRY response contains 56 bytes or more, so this data has been filled + public bool QuantumPresent; + /// The product family. Byte 36, bits 7 to 5 + public byte Qt_ProductFamily; + /// The released firmware. Byte 36, bits 4 to 0 + public byte Qt_ReleasedFirmware; + /// The firmware major version. Byte 37 + public byte Qt_FirmwareMajorVersion; + /// The firmware minor version. Byte 38 + public byte Qt_FirmwareMinorVersion; + /// The EEPROM format major version. Byte 39 + public byte Qt_EEPROMFormatMajorVersion; + /// The EEPROM format minor version. Byte 40 + public byte Qt_EEPROMFormatMinorVersion; + /// The firmware personality. Byte 41 + public byte Qt_FirmwarePersonality; + /// The firmware sub personality. Byte 42 + public byte Qt_FirmwareSubPersonality; + /// The tape directory format version. Byte 43 + public byte Qt_TapeDirectoryFormatVersion; + /// The controller hardware version. Byte 44 + public byte Qt_ControllerHardwareVersion; + /// The drive EEPROM version. Byte 45 + public byte Qt_DriveEEPROMVersion; + /// The drive hardware version. Byte 46 + public byte Qt_DriveHardwareVersion; + /// The media loader firmware version. Byte 47 + public byte Qt_MediaLoaderFirmwareVersion; + /// The media loader hardware version. Byte 48 + public byte Qt_MediaLoaderHardwareVersion; + /// The media loader mechanical version. Byte 49 + public byte Qt_MediaLoaderMechanicalVersion; + /// Is a media loader present? Byte 50 + public bool Qt_MediaLoaderPresent; + /// Is a library present? Byte 51 + public bool Qt_LibraryPresent; + /// The module revision. Bytes 52 to 55 + public byte[] Qt_ModuleRevision; + +#endregion Quantum vendor unique inquiry data structure + +#region IBM vendor unique inquiry data structure + + /// Means that the INQUIRY response contains 56 bytes or more, so this data has been filled + public bool IBMPresent; + /// Drive is not capable of automation Byte 36 bit 0 + public bool IBM_AutDis; + /// If not zero, limit in MB/s = Max * (this / 256) Byte 37 + public byte IBM_PerformanceLimit; + /// Byte 41 + public byte IBM_OEMSpecific; + +#endregion IBM vendor unique inquiry data structure + +#region HP vendor unique inquiry data structure + + /// Means that the INQUIRY response contains 49 bytes or more, so this data has been filled + public bool HPPresent; + /// WORM version Byte 40 bits 7 to 1 + public byte HP_WORMVersion; + /// WORM supported Byte 40 bit 0 + public bool HP_WORM; + /// Bytes 43 to 48 + public byte[] HP_OBDR; + +#endregion HP vendor unique inquiry data structure + +#region Seagate vendor unique inquiry data structure + + /// Means that bytes 36 to 43 are filled + public bool SeagatePresent; + /// Drive Serial Number Bytes 36 to 43 + public byte[] Seagate_DriveSerialNumber; + /// Means that bytes 96 to 143 are filled + public bool Seagate2Present; + /// Contains Seagate copyright notice Bytes 96 to 143 + public byte[] Seagate_Copyright; + /// Means that bytes 144 to 147 are filled + public bool Seagate3Present; + /// Reserved Seagate field Bytes 144 to 147 + public byte[] Seagate_ServoPROMPartNo; + +#endregion Seagate vendor unique inquiry data structure + +#region Kreon vendor unique inquiry data structure + + /// Means that firmware is Kreon + public bool KreonPresent; + /// Kreon identifier Bytes 36 to 40 + public byte[] KreonIdentifier; + /// Kreon just a 0x20 Bytes 41 + public byte KreonSpace; + /// Kreon version string Bytes 42 to 46 + public byte[] KreonVersion; + +#endregion Kreon vendor unique inquiry data structure + +#region Sony Hi-MD data + + /// Set if Hi-MD signature is present + public bool IsHiMD; + /// Hi-MD signature, bytes 36 to 44 + public byte[] HiMDSignature; + /// Unknown data, bytes 44 to 55 + public byte[] HiMDSpecific; + +#endregion Sony Hi-MD data + + static readonly byte[] HiMDSignatureContents = "Hi-MD "u8.ToArray(); + + /// Decodes a SCSI INQUIRY response + /// INQUIRY raw response data + /// Decoded SCSI INQUIRY + +#region Public methods + + public static Inquiry? Decode(byte[] SCSIInquiryResponse) + { + if(SCSIInquiryResponse == null) + return null; + + if(SCSIInquiryResponse.Length < 36 && SCSIInquiryResponse.Length != 5) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization.INQUIRY_response_is_0_bytes_less_than_minimum_of_36_bytes, + SCSIInquiryResponse.Length); + + return null; + } + + if(SCSIInquiryResponse.Length < SCSIInquiryResponse[4] + 4 && + SCSIInquiryResponse.Length != SCSIInquiryResponse[4]) + { + AaruConsole.DebugWriteLine(MODULE_NAME, + Localization. + INQUIRY_response_length_0_bytes_is_different_than_specified_in_length_field, + SCSIInquiryResponse.Length, SCSIInquiryResponse[4] + 4); + + return null; + } + + var decoded = new Inquiry(); + + if(SCSIInquiryResponse.Length >= 1) + { + decoded.PeripheralQualifier = (byte)((SCSIInquiryResponse[0] & 0xE0) >> 5); + decoded.PeripheralDeviceType = (byte)(SCSIInquiryResponse[0] & 0x1F); + } + + if(SCSIInquiryResponse.Length >= 2) + { + decoded.RMB = Convert.ToBoolean(SCSIInquiryResponse[1] & 0x80); + decoded.DeviceTypeModifier = (byte)(SCSIInquiryResponse[1] & 0x7F); + } + + if(SCSIInquiryResponse.Length >= 3) + { + decoded.ISOVersion = (byte)((SCSIInquiryResponse[2] & 0xC0) >> 6); + decoded.ECMAVersion = (byte)((SCSIInquiryResponse[2] & 0x38) >> 3); + decoded.ANSIVersion = (byte)(SCSIInquiryResponse[2] & 0x07); + } + + if(SCSIInquiryResponse.Length >= 4) + { + decoded.AERC = Convert.ToBoolean(SCSIInquiryResponse[3] & 0x80); + decoded.TrmTsk = Convert.ToBoolean(SCSIInquiryResponse[3] & 0x40); + decoded.NormACA = Convert.ToBoolean(SCSIInquiryResponse[3] & 0x20); + decoded.HiSup = Convert.ToBoolean(SCSIInquiryResponse[3] & 0x10); + decoded.ResponseDataFormat = (byte)(SCSIInquiryResponse[3] & 0x07); + } + + if(SCSIInquiryResponse.Length >= 5) + decoded.AdditionalLength = SCSIInquiryResponse[4]; + + if(SCSIInquiryResponse.Length >= 6) + { + decoded.SCCS = Convert.ToBoolean(SCSIInquiryResponse[5] & 0x80); + decoded.ACC = Convert.ToBoolean(SCSIInquiryResponse[5] & 0x40); + decoded.TPGS = (byte)((SCSIInquiryResponse[5] & 0x30) >> 4); + decoded.ThreePC = Convert.ToBoolean(SCSIInquiryResponse[5] & 0x08); + decoded.Reserved2 = (byte)((SCSIInquiryResponse[5] & 0x06) >> 1); + decoded.Protect = Convert.ToBoolean(SCSIInquiryResponse[5] & 0x01); + } + + if(SCSIInquiryResponse.Length >= 7) + { + decoded.BQue = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x80); + decoded.EncServ = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x40); + decoded.VS1 = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x20); + decoded.MultiP = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x10); + decoded.MChngr = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x08); + decoded.ACKREQQ = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x04); + decoded.Addr32 = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x02); + decoded.Addr16 = Convert.ToBoolean(SCSIInquiryResponse[6] & 0x01); + } + + if(SCSIInquiryResponse.Length >= 8) + { + decoded.RelAddr = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x80); + decoded.WBus32 = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x40); + decoded.WBus16 = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x20); + decoded.Sync = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x10); + decoded.Linked = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x08); + decoded.TranDis = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x04); + decoded.CmdQue = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x02); + decoded.SftRe = Convert.ToBoolean(SCSIInquiryResponse[7] & 0x01); + } + + if(SCSIInquiryResponse.Length >= 16) + { + decoded.VendorIdentification = new byte[8]; + Array.Copy(SCSIInquiryResponse, 8, decoded.VendorIdentification, 0, 8); + } + + if(SCSIInquiryResponse.Length >= 32) + { + decoded.ProductIdentification = new byte[16]; + Array.Copy(SCSIInquiryResponse, 16, decoded.ProductIdentification, 0, 16); + } + + if(SCSIInquiryResponse.Length >= 36) + { + decoded.ProductRevisionLevel = new byte[4]; + Array.Copy(SCSIInquiryResponse, 32, decoded.ProductRevisionLevel, 0, 4); + } + + if(SCSIInquiryResponse.Length >= 44) + { + // Seagate 1 + decoded.SeagatePresent = true; + decoded.Seagate_DriveSerialNumber = new byte[8]; + Array.Copy(SCSIInquiryResponse, 36, decoded.Seagate_DriveSerialNumber, 0, 8); + + // Hi-MD + decoded.HiMDSignature = new byte[8]; + Array.Copy(SCSIInquiryResponse, 36, decoded.HiMDSignature, 0, 8); + decoded.IsHiMD = HiMDSignatureContents.SequenceEqual(decoded.HiMDSignature); + } + + if(SCSIInquiryResponse.Length >= 46) + { + // Kreon + decoded.KreonIdentifier = new byte[5]; + Array.Copy(SCSIInquiryResponse, 36, decoded.KreonIdentifier, 0, 5); + decoded.KreonSpace = SCSIInquiryResponse[41]; + decoded.KreonVersion = new byte[5]; + Array.Copy(SCSIInquiryResponse, 42, decoded.KreonVersion, 0, 5); + + if(decoded.KreonSpace == 0x20 && decoded.KreonIdentifier.SequenceEqual("KREON"u8.ToArray())) + decoded.KreonPresent = true; + } + + if(SCSIInquiryResponse.Length >= 49) + { + // HP + decoded.HPPresent = true; + decoded.HP_WORM |= (SCSIInquiryResponse[40] & 0x01) == 0x01; + decoded.HP_WORMVersion = (byte)((SCSIInquiryResponse[40] & 0x7F) >> 1); + decoded.HP_OBDR = new byte[6]; + Array.Copy(SCSIInquiryResponse, 43, decoded.HP_OBDR, 0, 6); + } + + if(SCSIInquiryResponse.Length >= 56) + { + if(decoded.IsHiMD) + { + decoded.HiMDSpecific = new byte[12]; + Array.Copy(SCSIInquiryResponse, 44, decoded.HiMDSpecific, 0, 12); + } + else + { + decoded.VendorSpecific = new byte[20]; + Array.Copy(SCSIInquiryResponse, 36, decoded.VendorSpecific, 0, 20); + } + + // Quantum + decoded.QuantumPresent = true; + decoded.Qt_ProductFamily = (byte)((SCSIInquiryResponse[36] & 0xF0) >> 4); + decoded.Qt_ReleasedFirmware = (byte)(SCSIInquiryResponse[36] & 0x0F); + decoded.Qt_FirmwareMajorVersion = SCSIInquiryResponse[37]; + decoded.Qt_FirmwareMinorVersion = SCSIInquiryResponse[38]; + decoded.Qt_EEPROMFormatMajorVersion = SCSIInquiryResponse[39]; + decoded.Qt_EEPROMFormatMinorVersion = SCSIInquiryResponse[40]; + decoded.Qt_FirmwarePersonality = SCSIInquiryResponse[41]; + decoded.Qt_FirmwareSubPersonality = SCSIInquiryResponse[42]; + decoded.Qt_TapeDirectoryFormatVersion = SCSIInquiryResponse[43]; + decoded.Qt_ControllerHardwareVersion = SCSIInquiryResponse[44]; + decoded.Qt_DriveEEPROMVersion = SCSIInquiryResponse[45]; + decoded.Qt_DriveHardwareVersion = SCSIInquiryResponse[46]; + decoded.Qt_MediaLoaderFirmwareVersion = SCSIInquiryResponse[47]; + decoded.Qt_MediaLoaderHardwareVersion = SCSIInquiryResponse[48]; + decoded.Qt_MediaLoaderMechanicalVersion = SCSIInquiryResponse[49]; + decoded.Qt_MediaLoaderPresent = SCSIInquiryResponse[50] > 0; + decoded.Qt_LibraryPresent = SCSIInquiryResponse[51] > 0; + decoded.Qt_ModuleRevision = new byte[4]; + Array.Copy(SCSIInquiryResponse, 52, decoded.Qt_ModuleRevision, 0, 4); + + // IBM + decoded.IBMPresent = true; + decoded.IBM_AutDis |= (SCSIInquiryResponse[36] & 0x01) == 0x01; + decoded.IBM_PerformanceLimit = SCSIInquiryResponse[37]; + decoded.IBM_OEMSpecific = SCSIInquiryResponse[41]; + } + + if(SCSIInquiryResponse.Length >= 57) + { + decoded.Reserved3 = (byte)((SCSIInquiryResponse[56] & 0xF0) >> 4); + decoded.Clocking = (byte)((SCSIInquiryResponse[56] & 0x0C) >> 2); + decoded.QAS = Convert.ToBoolean(SCSIInquiryResponse[56] & 0x02); + decoded.IUS = Convert.ToBoolean(SCSIInquiryResponse[56] & 0x01); + } + + if(SCSIInquiryResponse.Length >= 58) + decoded.Reserved4 = SCSIInquiryResponse[57]; + + if(SCSIInquiryResponse.Length >= 60) + { + int descriptorsNo; + + if(SCSIInquiryResponse.Length >= 74) + descriptorsNo = 8; + else + descriptorsNo = (SCSIInquiryResponse.Length - 58) / 2; + + decoded.VersionDescriptors = new ushort[descriptorsNo]; + + for(var i = 0; i < descriptorsNo; i++) + decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + i * 2); + } + + switch(SCSIInquiryResponse.Length) + { + case >= 75 and < 96: + decoded.Reserved5 = new byte[SCSIInquiryResponse.Length - 74]; + Array.Copy(SCSIInquiryResponse, 74, decoded.Reserved5, 0, SCSIInquiryResponse.Length - 74); + + break; + case >= 96: + decoded.Reserved5 = new byte[22]; + Array.Copy(SCSIInquiryResponse, 74, decoded.Reserved5, 0, 22); + + break; + } + + if(SCSIInquiryResponse.Length > 96) + { + decoded.VendorSpecific2 = new byte[SCSIInquiryResponse.Length - 96]; + Array.Copy(SCSIInquiryResponse, 96, decoded.VendorSpecific2, 0, SCSIInquiryResponse.Length - 96); + } + + if(SCSIInquiryResponse.Length >= 144) + { + // Seagate 2 + decoded.Seagate2Present = true; + decoded.Seagate_Copyright = new byte[48]; + Array.Copy(SCSIInquiryResponse, 96, decoded.Seagate_Copyright, 0, 48); + } + + if(SCSIInquiryResponse.Length < 148) + return decoded; + + // Seagate 2 + decoded.Seagate3Present = true; + decoded.Seagate_ServoPROMPartNo = new byte[4]; + Array.Copy(SCSIInquiryResponse, 144, decoded.Seagate_ServoPROMPartNo, 0, 4); + + return decoded; + } + + /// Encodes a SCSI INQUIRY response + /// Decoded SCSI INQUIRY + /// Raw SCSI INQUIRY response + public static byte[] Encode(Inquiry? inq) + { + if(inq is null) + return null; + + Inquiry decoded = inq.Value; + + var buffer = new byte[512]; + byte length = 0; + + buffer[0] = (byte)(decoded.PeripheralQualifier << 5); + buffer[0] += decoded.PeripheralDeviceType; + + if(decoded.RMB) + buffer[1] = 0x80; + + buffer[1] += decoded.DeviceTypeModifier; + + buffer[2] = (byte)(decoded.ISOVersion << 6); + buffer[2] += (byte)(decoded.ECMAVersion << 3); + buffer[2] += decoded.ANSIVersion; + + if(decoded.AERC) + buffer[3] = 0x80; + + if(decoded.TrmTsk) + buffer[3] += 0x40; + + if(decoded.NormACA) + buffer[3] += 0x20; + + if(decoded.HiSup) + buffer[3] += 0x10; + + buffer[3] += decoded.ResponseDataFormat; + + if(decoded.AdditionalLength > 0) + { + length = 5; + buffer[4] = decoded.AdditionalLength; + } + + if(decoded.SCCS || + decoded.ACC || + decoded.TPGS > 0 || + decoded.ThreePC || + decoded.Reserved2 > 0 || + decoded.Protect) + { + length = 6; + + if(decoded.SCCS) + buffer[5] = 0x80; + + if(decoded.ACC) + buffer[5] += 0x40; + + buffer[5] += (byte)(decoded.TPGS << 4); + + if(decoded.ThreePC) + buffer[5] += 0x08; + + buffer[5] += (byte)(decoded.Reserved2 << 1); + + if(decoded.Protect) + buffer[5] += 0x01; + } + + if(decoded.BQue || + decoded.EncServ || + decoded.VS1 || + decoded.MultiP || + decoded.MChngr || + decoded.ACKREQQ || + decoded.Addr32 || + decoded.Addr16) + { + length = 7; + + if(decoded.BQue) + buffer[6] = 0x80; + + if(decoded.EncServ) + buffer[6] += 0x40; + + if(decoded.VS1) + buffer[6] += 0x20; + + if(decoded.MultiP) + buffer[6] += 0x10; + + if(decoded.MChngr) + buffer[6] += 0x08; + + if(decoded.ACKREQQ) + buffer[6] += 0x04; + + if(decoded.Addr32) + buffer[6] += 0x02; + + if(decoded.Addr16) + buffer[6] += 0x01; + } + + if(decoded.RelAddr || + decoded.WBus32 || + decoded.WBus16 || + decoded.Sync || + decoded.Linked || + decoded.TranDis || + decoded.CmdQue || + decoded.SftRe) + + { + length = 8; + + if(decoded.RelAddr) + buffer[7] = 0x80; + + if(decoded.WBus32) + buffer[7] += 0x40; + + if(decoded.WBus16) + buffer[7] += 0x20; + + if(decoded.Sync) + buffer[7] += 0x10; + + if(decoded.Linked) + buffer[7] += 0x08; + + if(decoded.TranDis) + buffer[7] += 0x04; + + if(decoded.CmdQue) + buffer[7] += 0x02; + + if(decoded.SftRe) + buffer[7] += 0x01; + } + + if(decoded.VendorIdentification != null) + { + length = 16; + + Array.Copy(decoded.VendorIdentification, 0, buffer, 8, + decoded.VendorIdentification.Length >= 8 ? 8 : decoded.VendorIdentification.Length); + } + + if(decoded.ProductIdentification != null) + { + length = 32; + + Array.Copy(decoded.ProductIdentification, 0, buffer, 16, + decoded.ProductIdentification.Length >= 16 ? 16 : decoded.ProductIdentification.Length); + } + + if(decoded.ProductRevisionLevel != null) + { + length = 36; + + Array.Copy(decoded.ProductRevisionLevel, 0, buffer, 32, + decoded.ProductRevisionLevel.Length >= 4 ? 4 : decoded.ProductRevisionLevel.Length); + } + + if(decoded.Seagate_DriveSerialNumber != null) + { + length = 44; + Array.Copy(decoded.Seagate_DriveSerialNumber, 0, buffer, 36, 8); + } + + if(decoded is { KreonIdentifier: not null, KreonVersion: not null }) + { + length = 46; + Array.Copy(decoded.KreonIdentifier, 0, buffer, 36, 5); + buffer[41] = decoded.KreonSpace; + Array.Copy(decoded.KreonVersion, 0, buffer, 42, 5); + } + + if(decoded.HP_WORM || decoded.HP_WORMVersion > 0 || decoded.HP_OBDR != null) + { + length = 49; + + if(decoded.HP_WORM) + buffer[40] = 0x01; + + buffer[40] += (byte)(decoded.HP_WORMVersion << 1); + Array.Copy(decoded.HP_OBDR, 0, buffer, 43, 6); + } + + if(decoded.IsHiMD) + { + length = 56; + Array.Copy(HiMDSignatureContents, 0, buffer, 36, 8); + + if(decoded.HiMDSpecific != null) + Array.Copy(decoded.HiMDSpecific, 0, buffer, 44, 12); + } + + if(decoded is { VendorSpecific: not null, IsHiMD: false }) + { + length = 56; + Array.Copy(decoded.VendorSpecific, 0, buffer, 36, 20); + } + + if(decoded.Reserved3 > 0 || decoded.Clocking > 0 || decoded.QAS || decoded.IUS) + { + length = 57; + buffer[56] = (byte)(decoded.Reserved3 << 4); + buffer[56] += (byte)(decoded.Clocking << 2); + + if(decoded.QAS) + buffer[56] += 0x02; + + if(decoded.IUS) + buffer[56] += 0x01; + } + + if(decoded.Reserved4 != 0) + { + length = 58; + buffer[57] = decoded.Reserved4; + } + + if(decoded.VersionDescriptors != null) + { + length = (byte)(58 + decoded.VersionDescriptors.Length * 2); + + for(var i = 0; i < decoded.VersionDescriptors.Length; i++) + Array.Copy(BitConverter.GetBytes(decoded.VersionDescriptors[i]), 0, buffer, 56 + i * 2, 2); + } + + if(decoded.Reserved5 != null) + { + length = (byte)(74 + decoded.Reserved5.Length); + Array.Copy(decoded.Reserved5, 0, buffer, 74, decoded.Reserved5.Length); + } + + if(decoded.VendorSpecific2 != null) + { + length = (byte)(96 + decoded.VendorSpecific2.Length); + Array.Copy(decoded.VendorSpecific2, 0, buffer, 96, decoded.VendorSpecific2.Length); + } + + if(decoded.Seagate_Copyright != null) + { + length = 144; + Array.Copy(decoded.Seagate_Copyright, 0, buffer, 96, 48); + } + + if(decoded.Seagate_ServoPROMPartNo != null) + { + length = 148; + Array.Copy(decoded.Seagate_ServoPROMPartNo, 0, buffer, 144, 4); + } + + buffer[4] = length; + var dest = new byte[length]; + Array.Copy(buffer, 0, dest, 0, length); + + return dest; + } + +#endregion Public methods +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/Devices/SCSI/Modes/2A.cs b/Aaru.CommonTypes/Structs/Devices/SCSI/Modes/2A.cs new file mode 100644 index 000000000..0e4e30c13 --- /dev/null +++ b/Aaru.CommonTypes/Structs/Devices/SCSI/Modes/2A.cs @@ -0,0 +1,566 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : 2A.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures for SCSI devices. +// +// --[ Description ] ---------------------------------------------------------- +// +// Decodes SCSI MODE PAGE 2Ah: CD-ROM capabilities page. +// +// --[ 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 . +// +// ---------------------------------------------------------------------------- +// Copyright © 2011-2023 Natalia Portillo +// ****************************************************************************/ + +using System; +using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; +using System.Text.Json.Serialization; + +namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes; + +#region Mode Page 0x2A: CD-ROM capabilities page + +/// +/// CD-ROM capabilities page Page code 0x2A 16 bytes in OB-U0077C 20 bytes in SFF-8020i 22 bytes in MMC-1 26 bytes +/// in MMC-2 Variable bytes in MMC-3 +/// +[SuppressMessage("ReSharper", "InconsistentNaming")] +[SuppressMessage("ReSharper", "MemberCanBeInternal")] +[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] +[SuppressMessage("ReSharper", "NotAccessedField.Global")] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public class ModePage_2A +{ + /// Write speed performance descriptors + public ModePage_2A_WriteDescriptor[] WriteSpeedPerformanceDescriptors; + + /// Parameters can be saved + public bool PS { get; set; } + + /// Drive supports multi-session and/or Photo-CD + public bool MultiSession { get; set; } + + /// Drive is capable of reading sectors in Mode 2 Form 2 format + public bool Mode2Form2 { get; set; } + + /// Drive is capable of reading sectors in Mode 2 Form 1 format + public bool Mode2Form1 { get; set; } + + /// Drive is capable of playing audio + public bool AudioPlay { get; set; } + + /// Drive can return the ISRC + public bool ISRC { get; set; } + + /// Drive can return the media catalogue number + public bool UPC { get; set; } + + /// Drive can return C2 pointers + public bool C2Pointer { get; set; } + + /// Drive can read, deinterlave and correct R-W subchannels + public bool DeinterlaveSubchannel { get; set; } + + /// Drive can read interleaved and uncorrected R-W subchannels + public bool Subchannel { get; set; } + + /// Drive can continue from a loss of streaming on audio reading + public bool AccurateCDDA { get; set; } + + /// Audio can be read as digital data + public bool CDDACommand { get; set; } + + /// Loading Mechanism Type + public byte LoadingMechanism { get; set; } + + /// Drive can eject discs + public bool Eject { get; set; } + + /// Drive's optional prevent jumper status + public bool PreventJumper { get; set; } + + /// Current lock status + public bool LockState { get; set; } + + /// Drive can lock media + public bool Lock { get; set; } + + /// Each channel can be muted independently + public bool SeparateChannelMute { get; set; } + + /// Each channel's volume can be controlled independently + public bool SeparateChannelVolume { get; set; } + + /// Maximum drive speed in Kbytes/second + public ushort MaximumSpeed { get; set; } + + /// Supported volume levels + public ushort SupportedVolumeLevels { get; set; } + + /// Buffer size in Kbytes + public ushort BufferSize { get; set; } + + /// Current drive speed in Kbytes/second + public ushort CurrentSpeed { get; set; } + + /// Can read packet media + public bool Method2 { get; set; } + + /// Can read CD-RW + public bool ReadCDRW { get; set; } + + /// Can read CD-R + public bool ReadCDR { get; set; } + + /// Can write CD-RW + public bool WriteCDRW { get; set; } + + /// Can write CD-R + public bool WriteCDR { get; set; } + + /// Supports IEC-958 digital output on port 2 + public bool DigitalPort2 { get; set; } + + /// Supports IEC-958 digital output on port 1 + public bool DigitalPort1 { get; set; } + + /// Can deliver a composite audio and video data stream + public bool Composite { get; set; } + + /// This bit controls the behavior of the LOAD/UNLOAD command when trying to load a Slot with no Disc present + public bool SSS { get; set; } + + /// Contains a changer that can report the exact contents of the slots + public bool SDP { get; set; } + + /// Page length + public byte Length { get; set; } + + /// Set if LSB comes first + public bool LSBF { get; set; } + + /// Set if HIGH on LRCK indicates left channel. Clear if HIGH on LRCK indicates right channel. + public bool RCK { get; set; } + + /// + /// Set if data valid on the falling edge of the BCK signal. Clear if data valid on the rising edge of the BCK + /// signal + /// + public bool BCK { get; set; } + + /// Can do a test write + public bool TestWrite { get; set; } + + /// Maximum write speed + public ushort MaxWriteSpeed { get; set; } + + /// Current write speed + public ushort CurrentWriteSpeed { get; set; } + + /// Can read disc's barcode + public bool ReadBarcode { get; set; } + + /// Can read DVD-RAM + public bool ReadDVDRAM { get; set; } + + /// Can read DVD-R + public bool ReadDVDR { get; set; } + + /// Can read DVD-ROM + public bool ReadDVDROM { get; set; } + + /// Can write DVD-RAM + public bool WriteDVDRAM { get; set; } + + /// Can write DVD-R + public bool WriteDVDR { get; set; } + + /// Can read raw R-W subchannel from the Lead-In + public bool LeadInPW { get; set; } + + /// Can read both sides of a disc + public bool SCC { get; set; } + + /// Support copyright management + public ushort CMRSupported { get; set; } + + /// Supports buffer under-run free recording + public bool BUF { get; set; } + + /// Selected rotational control + public byte RotationControlSelected { get; set; } + + /// Current write speed selected + public ushort CurrentWriteSpeedSelected { get; set; } + + /// Database ID + [JsonIgnore] + [Key] + // ReSharper disable once UnusedMember.Global + public int Id { get; set; } + + /// Decodes the page 2Ah of a MODE SENSE response + /// Raw page 2Ah + /// Decoded page 2Ah + public static ModePage_2A Decode(byte[] pageResponse) + { + if((pageResponse?[0] & 0x40) == 0x40) + return null; + + if((pageResponse?[0] & 0x3F) != 0x2A) + return null; + + if(pageResponse[1] + 2 != pageResponse.Length) + return null; + + if(pageResponse.Length < 16) + return null; + + var decoded = new ModePage_2A(); + + decoded.PS |= (pageResponse[0] & 0x80) == 0x80; + + decoded.AudioPlay |= (pageResponse[4] & 0x01) == 0x01; + decoded.Mode2Form1 |= (pageResponse[4] & 0x10) == 0x10; + decoded.Mode2Form2 |= (pageResponse[4] & 0x20) == 0x20; + decoded.MultiSession |= (pageResponse[4] & 0x40) == 0x40; + + decoded.CDDACommand |= (pageResponse[5] & 0x01) == 0x01; + decoded.AccurateCDDA |= (pageResponse[5] & 0x02) == 0x02; + decoded.Subchannel |= (pageResponse[5] & 0x04) == 0x04; + decoded.DeinterlaveSubchannel |= (pageResponse[5] & 0x08) == 0x08; + decoded.C2Pointer |= (pageResponse[5] & 0x10) == 0x10; + decoded.UPC |= (pageResponse[5] & 0x20) == 0x20; + decoded.ISRC |= (pageResponse[5] & 0x40) == 0x40; + + decoded.LoadingMechanism = (byte)((pageResponse[6] & 0xE0) >> 5); + decoded.Lock |= (pageResponse[6] & 0x01) == 0x01; + decoded.LockState |= (pageResponse[6] & 0x02) == 0x02; + decoded.PreventJumper |= (pageResponse[6] & 0x04) == 0x04; + decoded.Eject |= (pageResponse[6] & 0x08) == 0x08; + + decoded.SeparateChannelVolume |= (pageResponse[7] & 0x01) == 0x01; + decoded.SeparateChannelMute |= (pageResponse[7] & 0x02) == 0x02; + + decoded.MaximumSpeed = (ushort)((pageResponse[8] << 8) + pageResponse[9]); + decoded.SupportedVolumeLevels = (ushort)((pageResponse[10] << 8) + pageResponse[11]); + decoded.BufferSize = (ushort)((pageResponse[12] << 8) + pageResponse[13]); + decoded.CurrentSpeed = (ushort)((pageResponse[14] << 8) + pageResponse[15]); + + if(pageResponse.Length < 20) + return decoded; + + decoded.Method2 |= (pageResponse[2] & 0x04) == 0x04; + decoded.ReadCDRW |= (pageResponse[2] & 0x02) == 0x02; + decoded.ReadCDR |= (pageResponse[2] & 0x01) == 0x01; + + decoded.WriteCDRW |= (pageResponse[3] & 0x02) == 0x02; + decoded.WriteCDR |= (pageResponse[3] & 0x01) == 0x01; + + decoded.Composite |= (pageResponse[4] & 0x02) == 0x02; + decoded.DigitalPort1 |= (pageResponse[4] & 0x04) == 0x04; + decoded.DigitalPort2 |= (pageResponse[4] & 0x08) == 0x08; + + decoded.SDP |= (pageResponse[7] & 0x04) == 0x04; + decoded.SSS |= (pageResponse[7] & 0x08) == 0x08; + + decoded.Length = (byte)((pageResponse[17] & 0x30) >> 4); + decoded.LSBF |= (pageResponse[17] & 0x08) == 0x08; + decoded.RCK |= (pageResponse[17] & 0x04) == 0x04; + decoded.BCK |= (pageResponse[17] & 0x02) == 0x02; + + if(pageResponse.Length < 22) + return decoded; + + decoded.TestWrite |= (pageResponse[3] & 0x04) == 0x04; + decoded.MaxWriteSpeed = (ushort)((pageResponse[18] << 8) + pageResponse[19]); + decoded.CurrentWriteSpeed = (ushort)((pageResponse[20] << 8) + pageResponse[21]); + + decoded.ReadBarcode |= (pageResponse[5] & 0x80) == 0x80; + + if(pageResponse.Length < 26) + return decoded; + + decoded.ReadDVDRAM |= (pageResponse[2] & 0x20) == 0x20; + decoded.ReadDVDR |= (pageResponse[2] & 0x10) == 0x10; + decoded.ReadDVDROM |= (pageResponse[2] & 0x08) == 0x08; + + decoded.WriteDVDRAM |= (pageResponse[3] & 0x20) == 0x20; + decoded.WriteDVDR |= (pageResponse[3] & 0x10) == 0x10; + + decoded.LeadInPW |= (pageResponse[3] & 0x20) == 0x20; + decoded.SCC |= (pageResponse[3] & 0x10) == 0x10; + + decoded.CMRSupported = (ushort)((pageResponse[22] << 8) + pageResponse[23]); + + if(pageResponse.Length < 32) + return decoded; + + decoded.BUF |= (pageResponse[4] & 0x80) == 0x80; + decoded.RotationControlSelected = (byte)(pageResponse[27] & 0x03); + decoded.CurrentWriteSpeedSelected = (ushort)((pageResponse[28] << 8) + pageResponse[29]); + + var descriptors = (ushort)((pageResponse.Length - 32) / 4); + decoded.WriteSpeedPerformanceDescriptors = new ModePage_2A_WriteDescriptor[descriptors]; + + for(var i = 0; i < descriptors; i++) + { + decoded.WriteSpeedPerformanceDescriptors[i] = new ModePage_2A_WriteDescriptor + { + RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07), + WriteSpeed = (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4]) + }; + } + + return decoded; + } + + /// Encodes a page 2Ah of a MODE SENSE response + /// Decoded page 2Ah + /// Raw page 2Ah + public static byte[] Encode(ModePage_2A decoded) + { + var pageResponse = new byte[512]; + byte length = 16; + + pageResponse[0] = 0x2A; + + if(decoded.PS) + pageResponse[0] += 0x80; + + if(decoded.AudioPlay) + pageResponse[4] += 0x01; + + if(decoded.Mode2Form1) + pageResponse[4] += 0x10; + + if(decoded.Mode2Form2) + pageResponse[4] += 0x20; + + if(decoded.MultiSession) + pageResponse[4] += 0x40; + + if(decoded.CDDACommand) + pageResponse[5] += 0x01; + + if(decoded.AccurateCDDA) + pageResponse[5] += 0x02; + + if(decoded.Subchannel) + pageResponse[5] += 0x04; + + if(decoded.DeinterlaveSubchannel) + pageResponse[5] += 0x08; + + if(decoded.C2Pointer) + pageResponse[5] += 0x10; + + if(decoded.UPC) + pageResponse[5] += 0x20; + + if(decoded.ISRC) + pageResponse[5] += 0x40; + + decoded.LoadingMechanism = (byte)((pageResponse[6] & 0xE0) >> 5); + + if(decoded.Lock) + pageResponse[6] += 0x01; + + if(decoded.LockState) + pageResponse[6] += 0x02; + + if(decoded.PreventJumper) + pageResponse[6] += 0x04; + + if(decoded.Eject) + pageResponse[6] += 0x08; + + if(decoded.SeparateChannelVolume) + pageResponse[7] += 0x01; + + if(decoded.SeparateChannelMute) + pageResponse[7] += 0x02; + + decoded.MaximumSpeed = (ushort)((pageResponse[8] << 8) + pageResponse[9]); + decoded.SupportedVolumeLevels = (ushort)((pageResponse[10] << 8) + pageResponse[11]); + decoded.BufferSize = (ushort)((pageResponse[12] << 8) + pageResponse[13]); + decoded.CurrentSpeed = (ushort)((pageResponse[14] << 8) + pageResponse[15]); + + if(decoded.Method2 || + decoded.ReadCDRW || + decoded.ReadCDR || + decoded.WriteCDRW || + decoded.WriteCDR || + decoded.Composite || + decoded.DigitalPort1 || + decoded.DigitalPort2 || + decoded.SDP || + decoded.SSS || + decoded.Length > 0 || + decoded.LSBF || + decoded.RCK || + decoded.BCK) + { + length = 20; + + if(decoded.Method2) + pageResponse[2] += 0x04; + + if(decoded.ReadCDRW) + pageResponse[2] += 0x02; + + if(decoded.ReadCDR) + pageResponse[2] += 0x01; + + if(decoded.WriteCDRW) + pageResponse[3] += 0x02; + + if(decoded.WriteCDR) + pageResponse[3] += 0x01; + + if(decoded.Composite) + pageResponse[4] += 0x02; + + if(decoded.DigitalPort1) + pageResponse[4] += 0x04; + + if(decoded.DigitalPort2) + pageResponse[4] += 0x08; + + if(decoded.SDP) + pageResponse[7] += 0x04; + + if(decoded.SSS) + pageResponse[7] += 0x08; + + pageResponse[17] = (byte)(decoded.Length << 4); + + if(decoded.LSBF) + pageResponse[17] += 0x08; + + if(decoded.RCK) + pageResponse[17] += 0x04; + + if(decoded.BCK) + pageResponse[17] += 0x02; + } + + if(decoded.TestWrite || decoded.MaxWriteSpeed > 0 || decoded.CurrentWriteSpeed > 0 || decoded.ReadBarcode) + { + length = 22; + + if(decoded.TestWrite) + pageResponse[3] += 0x04; + + pageResponse[18] = (byte)((decoded.MaxWriteSpeed & 0xFF00) >> 8); + pageResponse[19] = (byte)(decoded.MaxWriteSpeed & 0xFF); + pageResponse[20] = (byte)((decoded.CurrentWriteSpeed & 0xFF00) >> 8); + pageResponse[21] = (byte)(decoded.CurrentWriteSpeed & 0xFF); + + if(decoded.ReadBarcode) + pageResponse[5] += 0x80; + } + + if(decoded.ReadDVDRAM || + decoded.ReadDVDR || + decoded.ReadDVDROM || + decoded.WriteDVDRAM || + decoded.WriteDVDR || + decoded.LeadInPW || + decoded.SCC || + decoded.CMRSupported > 0) + + { + length = 26; + + if(decoded.ReadDVDRAM) + pageResponse[2] += 0x20; + + if(decoded.ReadDVDR) + pageResponse[2] += 0x10; + + if(decoded.ReadDVDROM) + pageResponse[2] += 0x08; + + if(decoded.WriteDVDRAM) + pageResponse[3] += 0x20; + + if(decoded.WriteDVDR) + pageResponse[3] += 0x10; + + if(decoded.LeadInPW) + pageResponse[3] += 0x20; + + if(decoded.SCC) + pageResponse[3] += 0x10; + + pageResponse[22] = (byte)((decoded.CMRSupported & 0xFF00) >> 8); + pageResponse[23] = (byte)(decoded.CMRSupported & 0xFF); + } + + if(decoded.BUF || decoded.RotationControlSelected > 0 || decoded.CurrentWriteSpeedSelected > 0) + { + length = 32; + + if(decoded.BUF) + pageResponse[4] += 0x80; + + pageResponse[27] += decoded.RotationControlSelected; + pageResponse[28] = (byte)((decoded.CurrentWriteSpeedSelected & 0xFF00) >> 8); + pageResponse[29] = (byte)(decoded.CurrentWriteSpeedSelected & 0xFF); + } + + if(decoded.WriteSpeedPerformanceDescriptors != null) + { + length = 32; + + for(var i = 0; i < decoded.WriteSpeedPerformanceDescriptors.Length; i++) + { + length += 4; + pageResponse[1 + 32 + i * 4] = decoded.WriteSpeedPerformanceDescriptors[i].RotationControl; + + pageResponse[2 + 32 + i * 4] = + (byte)((decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF00) >> 8); + + pageResponse[3 + 32 + i * 4] = (byte)(decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF); + } + } + + pageResponse[1] = (byte)(length - 2); + var buf = new byte[length]; + Array.Copy(pageResponse, 0, buf, 0, length); + + return buf; + } +} + +/// Page 2Ah write descriptor +[SuppressMessage("ReSharper", "InconsistentNaming")] +public struct ModePage_2A_WriteDescriptor +{ + /// Rotational control + public byte RotationControl; + /// Write speed + public ushort WriteSpeed; +} + +#endregion Mode Page 0x2A: CD-ROM capabilities page \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/Filesystems.cs b/Aaru.CommonTypes/Structs/Filesystems.cs new file mode 100644 index 000000000..6c8290302 --- /dev/null +++ b/Aaru.CommonTypes/Structs/Filesystems.cs @@ -0,0 +1,297 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : Structs.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures. +// +// --[ Description ] ---------------------------------------------------------- +// +// Contains enumerations and structures of common usage by 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.Diagnostics.CodeAnalysis; +using System.Runtime.InteropServices; +using System.Text.Json.Serialization; + +namespace Aaru.CommonTypes.Structs; + +/// File attributes. +[Flags] +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public enum FileAttributes : ulong +{ + /// File has no attributes + None = 0, + /// File is an alias (Mac OS) + Alias = 0x01, + /// Indicates that the file can only be writable appended + AppendOnly = 0x02, + /// File is candidate for archival/backup + Archive = 0x04, + /// File is a block device + BlockDevice = 0x08, + /// File is stored on filesystem block units instead of device sectors + BlockUnits = 0x10, + /// Directory is a bundle or file contains a BNDL resource + Bundle = 0x20, + /// File is a char device + CharDevice = 0x40, + /// File is compressed + Compressed = 0x80, + /// File is compressed and should not be uncompressed on read + CompressedRaw = 0x100, + /// File has compression errors + CompressionError = 0x200, + /// Compressed file is dirty + CompressionDirty = 0x400, + /// File is a device + Device = 0x800, + /// File is a directory + Directory = 0x1000, + /// File is encrypted + Encrypted = 0x2000, + /// File is stored on disk using extents + Extents = 0x4000, + /// File is a FIFO + FIFO = 0x8000, + /// File is a normal file + File = 0x10000, + /// File is a Mac OS file containing desktop databases that has already been added to the desktop database + HasBeenInited = 0x20000, + /// File contains an icon resource / EA + HasCustomIcon = 0x40000, + /// File is a Mac OS extension or control panel lacking INIT resources + HasNoINITs = 0x80000, + /// File is hidden/invisible + Hidden = 0x100000, + /// File cannot be written, deleted, modified or linked to + Immutable = 0x200000, + /// Directory is indexed using hashed trees + IndexedDirectory = 0x400000, + /// File contents are stored alongside its inode (or equivalent) + Inline = 0x800000, + /// File contains integrity checks + IntegrityStream = 0x1000000, + /// File is on desktop + IsOnDesk = 0x2000000, + /// File changes are written to filesystem journal before being written to file itself + Journaled = 0x4000000, + /// Access time will not be modified + NoAccessTime = 0x8000000, + /// File will not be subject to copy-on-write + NoCopyOnWrite = 0x10000000, + /// File will not be backed up + NoDump = 0x20000000, + /// File contents should not be scrubbed + NoScrub = 0x40000000, + /// File contents should not be indexed + NotIndexed = 0x80000000, + /// File is offline + Offline = 0x100000000, + /// File is password protected, but contents are not encrypted on disk + Password = 0x200000000, + /// File is read-only + ReadOnly = 0x400000000, + /// File is a reparse point + ReparsePoint = 0x800000000, + /// When file is removed its content will be overwritten with zeroes + Secured = 0x1000000000, + /// File contents are sparse + Sparse = 0x2000000000, + /// File is a shadow (OS/2) + Shadow = 0x4000000000, + /// File is shared + Shared = 0x8000000000, + /// File is a stationery + Stationery = 0x10000000000, + /// File is a symbolic link + Symlink = 0x20000000000, + /// File writes are synchronously written to disk + Sync = 0x40000000000, + /// File belongs to the operating system + System = 0x80000000000, + /// If file end is a partial block its content will be merged with other files + TailMerged = 0x100000000000, + /// File is temporary + Temporary = 0x200000000000, + /// Subdirectories inside of this directory are not related and should be allocated elsewhere + TopDirectory = 0x400000000000, + /// If file is deleted, contents should be stored, for a possible future undeletion + Undeletable = 0x800000000000, + /// File is a pipe + Pipe = 0x1000000000000, + /// File is a socket + Socket = 0x2000000000000 +} + +/// Information about a file entry +public class FileEntryInfo +{ + /// File attributes + public FileAttributes Attributes { get; set; } + + /// File length in blocks + public long Blocks { get; set; } + + /// File block size in bytes + public long BlockSize { get; set; } + + /// If file points to a device, device number. Null if the underlying filesystem does not support them. + public ulong? DeviceNo { get; set; } + + /// POSIX group ID. Null if the underlying filesystem does not support them. + public ulong? GID { get; set; } + + /// inode number for this file (or other unique identifier for the volume) + public ulong Inode { get; set; } + + /// File length in bytes + public long Length { get; set; } + + /// Number of hard links pointing to this file (. and .. entries count as hard links) + public ulong Links { get; set; } + + /// POSIX permissions/mode for this file. Null if the underlying filesystem does not support them. + public uint? Mode { get; set; } + + /// POSIX owner ID. Null if the underlying filesystem does not support them. + public ulong? UID { get; set; } + + /// File creation date in UTC. Null if the underlying filesystem does not support them. + public DateTime? CreationTimeUtc { get; set; } + + /// File last access date in UTC. Null if the underlying filesystem does not support them. + public DateTime? AccessTimeUtc { get; set; } + + /// File attributes change date in UTC. Null if the underlying filesystem does not support them. + public DateTime? StatusChangeTimeUtc { get; set; } + + /// File last backup date in UTC. Null if the underlying filesystem does not support them. + public DateTime? BackupTimeUtc { get; set; } + + /// File last modification date in UTC. Null if the underlying filesystem does not support them. + public DateTime? LastWriteTimeUtc { get; set; } + + /// File creation date. Null if the underlying filesystem does not support them. + [JsonIgnore] + public DateTime? CreationTime + { + get => CreationTimeUtc?.ToLocalTime(); + set => CreationTimeUtc = value?.ToUniversalTime(); + } + + /// File last access date. Null if the underlying filesystem does not support them. + [JsonIgnore] + public DateTime? AccessTime + { + get => AccessTimeUtc?.ToLocalTime(); + set => AccessTimeUtc = value?.ToUniversalTime(); + } + + /// File attributes change date. Null if the underlying filesystem does not support them. + [JsonIgnore] + public DateTime? StatusChangeTime + { + get => StatusChangeTimeUtc?.ToLocalTime(); + set => StatusChangeTimeUtc = value?.ToUniversalTime(); + } + + /// File last backup date. Null if the underlying filesystem does not support them. + [JsonIgnore] + public DateTime? BackupTime + { + get => BackupTimeUtc?.ToLocalTime(); + set => BackupTimeUtc = value?.ToUniversalTime(); + } + + /// File last modification date. Null if the underlying filesystem does not support them. + [JsonIgnore] + public DateTime? LastWriteTime + { + get => LastWriteTimeUtc?.ToLocalTime(); + set => LastWriteTimeUtc = value?.ToUniversalTime(); + } +} + +/// Information about a volume +[SuppressMessage("ReSharper", "NotAccessedField.Global")] +public class FileSystemInfo +{ + /// Blocks for this filesystem + public ulong Blocks; + /// Maximum length of filenames on this filesystem + public ushort FilenameLength; + /// Files on this filesystem + public ulong Files; + /// Blocks free on this filesystem + public ulong FreeBlocks; + /// Free inodes on this filesystem + public ulong FreeFiles; + /// Filesystem ID + public FileSystemId Id; + /// ID of plugin for this file + public Guid PluginId; + /// Filesystem type + public string Type; + + /// Initializes an empty instance of this structure + public FileSystemInfo() => Id = new FileSystemId(); + + /// Gets a clone of this structure + /// Clone of this structure + public FileSystemInfo ShallowCopy() => (FileSystemInfo)MemberwiseClone(); +} + +/// Stores a filesystem volume unique identifier or serial number +[StructLayout(LayoutKind.Explicit)] +public struct FileSystemId +{ + /// Set to true if the identifier is a 32-bit integer + [FieldOffset(0)] + public bool IsInt; + /// Set to true if the identifier is a 64-bit integer + [FieldOffset(1)] + public bool IsLong; + /// Set to true if the identifier is a GUID + [FieldOffset(2)] + public bool IsGuid; + + /// Identifier as a 32-bit integer + [FieldOffset(3)] + public uint Serial32; + /// Identifier as a 64-bit integer + [FieldOffset(3)] + public ulong Serial64; + /// Identifier as a GUID + [FieldOffset(3)] + public Guid uuid; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/Images.cs b/Aaru.CommonTypes/Structs/Images.cs new file mode 100644 index 000000000..b380dd441 --- /dev/null +++ b/Aaru.CommonTypes/Structs/Images.cs @@ -0,0 +1,256 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : IMediaImage.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines structures to be used by media 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 System.Diagnostics.CodeAnalysis; +using Aaru.CommonTypes.Enums; +using Aaru.CommonTypes.Interfaces; + +namespace Aaru.CommonTypes.Structs; + +/// Contains information about a dump image and its contents +public struct ImageInfo +{ + /// Image contains partitions (or tracks for optical media) + public bool HasPartitions; + /// Image contains sessions (optical media only) + public bool HasSessions; + /// Size of the image without headers + public ulong ImageSize; + /// Sectors contained in the image + public ulong Sectors; + /// Size of sectors contained in the image + public uint SectorSize; + /// Media tags contained by the image + public List ReadableMediaTags; + /// Sector tags contained by the image + public List ReadableSectorTags; + /// Image version + public string Version; + /// Application that created the image + public string Application; + /// Version of the application that created the image + public string ApplicationVersion; + /// Who (person) created the image? + public string Creator; + /// Image creation time + public DateTime CreationTime; + /// Image last modification time + public DateTime LastModificationTime; + /// Title of the media represented by the image + public string MediaTitle; + /// Image comments + public string Comments; + /// Manufacturer of the media represented by the image + public string MediaManufacturer; + /// Model of the media represented by the image + public string MediaModel; + /// Serial number of the media represented by the image + public string MediaSerialNumber; + /// Barcode of the media represented by the image + public string MediaBarcode; + /// Part number of the media represented by the image + public string MediaPartNumber; + /// Media type represented by the image + public MediaType MediaType; + /// Number in sequence for the media represented by the image + public int MediaSequence; + /// Last media of the sequence the media represented by the image corresponds to + public int LastMediaSequence; + /// Manufacturer of the drive used to read the media represented by the image + public string DriveManufacturer; + /// Model of the drive used to read the media represented by the image + public string DriveModel; + /// Serial number of the drive used to read the media represented by the image + public string DriveSerialNumber; + /// Firmware revision of the drive used to read the media represented by the image + public string DriveFirmwareRevision; + /// Type of the media represented by the image to use in XML sidecars + public MetadataMediaType MetadataMediaType; + + // CHS geometry... + /// Cylinders of the media represented by the image + public uint Cylinders; + /// Heads of the media represented by the image + public uint Heads; + /// Sectors per track of the media represented by the image (for variable image, the smallest) + public uint SectorsPerTrack; +} + +/// Session defining structure. +public struct Session +{ + /// Session number, 1-started + public ushort Sequence; + /// First track present on this session + public uint StartTrack; + /// Last track present on this session + public uint EndTrack; + /// First sector present on this session + public ulong StartSector; + /// Last sector present on this session + public ulong EndSector; +} + +/// Track defining structure. +public class Track +{ + /// How many main channel / user data bytes are per sector in this track + public int BytesPerSector; + /// Information that does not find space in this struct + public string Description; + /// Track ending sector + public ulong EndSector; + /// Which file stores this track + public string File; + /// Starting at which byte is this track stored + public ulong FileOffset; + /// What kind of file is storing this track + public string FileType; + /// Which filter stores this track + public IFilter Filter; + /// Indexes, 00 to 99 and sector offset + public Dictionary Indexes; + /// Track pre-gap + public ulong Pregap; + /// How many main channel bytes per sector are in the file with this track + public int RawBytesPerSector; + /// Track number, 1-started + public uint Sequence; + /// Session this track belongs to + public ushort Session; + /// Track starting sector + public ulong StartSector; + /// Which file stores this track's subchannel + public string SubchannelFile; + /// Which filter stores this track's subchannel + public IFilter SubchannelFilter; + /// Starting at which byte are this track's subchannel stored + public ulong SubchannelOffset; + /// Type of subchannel stored for this track + public TrackSubchannelType SubchannelType; + /// Partition type + public TrackType Type; + + /// Initializes an empty instance of this structure + public Track() => Indexes = new Dictionary(); +} + +/// Floppy physical characteristics structure. +[SuppressMessage("ReSharper", "UnusedMember.Global")] +public struct FloppyInfo +{ + /// Physical floppy type. + public FloppyTypes Type; + /// Bitrate in bits per second used to write the floppy, 0 if unknown or track-variable. + public uint Bitrate; + /// Physical magnetic density (coercivity) of floppy medium. + public FloppyDensities Coercivity; + /// How many physical tracks are actually written in the floppy image. + public ushort Tracks; + /// How many physical heads are actually written in the floppy image. + public byte Heads; + /// How many tracks per inch are actually written in the floppy image. + public ushort TrackDensity; +} + +/// Provides a map for linear memory structure +public struct LinearMemoryMap +{ + /// List of devices that are mapped to linear memory + [NotNull] + public LinearMemoryDevice[] Devices { get; set; } +} + +/// Provides information about a linear memory device +public struct LinearMemoryDevice +{ + /// Device manufacturer + public string Manufacturer { get; set; } + + /// Device model + public string Model { get; set; } + + /// Device package, e.g. DIP28 + public string Package { get; set; } + + /// Device location marking in PCB, e.g. U28 + public string Location { get; set; } + + /// Device functional type + public LinearMemoryType Type { get; set; } + + /// Arbitrary device information + public string Description { get; set; } + + /// + /// Physical addressing is the address considering all devices in the linear memory media, starting at the lowest + /// marking in PCB and going up incrementally. This is the view of the memory inside Aaru. + /// + public LinearMemoryAddressing PhysicalAddress { get; set; } + + /// + /// Virtual addressing is the address as seen by the hardware directly accessing the linear memory media. This + /// allows devices to be overlapped or banked. + /// + public LinearMemoryAddressing VirtualAddress { get; set; } +} + +/// Maps the addressing of a linear memory device +public class LinearMemoryAddressing +{ + /// Start in memory where the device is mapped + public ulong Start { get; set; } + + /// Length in bytes of the device, not including interleaving + public ulong Length { get; set; } + + /// Interleaving information + public LinearMemoryInterleave Interleave { get; set; } +} + +/// Provides information about a device interleaving +public class LinearMemoryInterleave +{ + /// How many bytes to skip from start of map before device first byte starts + public uint Offset { get; set; } + + /// How many bytes in memory to skip every device byte + public uint Value { get; set; } +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/TapeFile.cs b/Aaru.CommonTypes/Structs/TapeFile.cs new file mode 100644 index 000000000..e9745a516 --- /dev/null +++ b/Aaru.CommonTypes/Structs/TapeFile.cs @@ -0,0 +1,52 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : TapeFile.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines a structure to hold information about a tape file object. +// +// --[ 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.Structs; + +/// Describes a tape file +public struct TapeFile +{ + /// File number + public uint File; + /// Partition number + public byte Partition; + /// First block, inclusive, of the file + public ulong FirstBlock; + /// Last block, inclusive, of the file + public ulong LastBlock; +} \ No newline at end of file diff --git a/Aaru.CommonTypes/Structs/TapePartition.cs b/Aaru.CommonTypes/Structs/TapePartition.cs new file mode 100644 index 000000000..c0108d604 --- /dev/null +++ b/Aaru.CommonTypes/Structs/TapePartition.cs @@ -0,0 +1,50 @@ +// /*************************************************************************** +// Aaru Data Preservation Suite +// ---------------------------------------------------------------------------- +// +// Filename : TapeFile.cs +// Author(s) : Natalia Portillo +// +// Component : Common structures. +// +// --[ Description ] ---------------------------------------------------------- +// +// Defines a structure to hold information about a tape partition. +// +// --[ 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.Structs; + +/// Describes a tape partition +public struct TapePartition +{ + /// Partition number + public byte Number; + /// First block, inclusive, of the partition + public ulong FirstBlock; + /// Last block, inclusive, of the partition + public ulong LastBlock; +} \ No newline at end of file