mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General cleanup and refactor.
This commit is contained in:
816
.editorconfig
816
.editorconfig
@@ -1,632 +1,216 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
next_line = crlf
|
||||
end_of_line = lf
|
||||
trim_trailing_whitespace = false
|
||||
insert_final_newline = false
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
|
||||
# Generic non-language specific ones for Resharper and friends
|
||||
brace_style = next_line
|
||||
int_align = true
|
||||
keep_existing_arrangement = false
|
||||
place_simple_blocks_on_single_line = true
|
||||
place_simple_declaration_blocks_on_single_line = true
|
||||
place_attribute_on_same_line = false
|
||||
space_after_unary_operator = false
|
||||
space_after_comma = true
|
||||
space_around_ternary_operator = true
|
||||
space_around_binary_operator = true
|
||||
space_around_member_access_operator = false
|
||||
space_before_open_square_brackets = false
|
||||
space_after_keywords_in_control_flow_statements = true
|
||||
space_before_comma = false
|
||||
space_between_method_call_name_and_opening_parenthesis = false
|
||||
space_between_method_declaration_name_and_open_parenthesis = false
|
||||
space_between_square_brackets = false
|
||||
space_between_parentheses_of_control_flow_statements = false
|
||||
accessor_owner_declaration_braces = next_line
|
||||
accessor_declaration_braces = next_line
|
||||
case_block_braces = next_line
|
||||
initializer_braces = next_line
|
||||
other_braces = next_line
|
||||
allow_comment_after_lbrace = false
|
||||
empty_block_style = together_same_line
|
||||
braces_for_ifelse = not_required
|
||||
braces_for_for = not_required
|
||||
braces_for_foreach = not_required
|
||||
braces_for_while = not_required
|
||||
braces_for_dowhile = not_required
|
||||
braces_for_using = not_required
|
||||
braces_for_lock = not_required
|
||||
braces_for_fixed = not_required
|
||||
method_or_operator_body = expression_body
|
||||
local_function_body = expression_body
|
||||
constructor_or_destructor_body = expression_body
|
||||
accessor_owner_body = expression_body
|
||||
force_attribute_style = join
|
||||
function_braces = next_line
|
||||
force_control_statements_braces = always_remove
|
||||
space_in_singleline_accessorholder = true
|
||||
type_declaration_braces = next_line
|
||||
invocable_declaration_braces = next_line
|
||||
anonymous_method_declaration_braces = next_line
|
||||
space_between_accessors_in_singleline_property = true
|
||||
indent_nested_usings_stmt = true
|
||||
space_within_empty_braces = false
|
||||
indent_nested_fixed_stmt = true
|
||||
indent_nested_lock_stmt = true
|
||||
indent_nested_for_stmt = true
|
||||
indent_nested_foreach_stmt = true
|
||||
indent_nested_while_stmt = true
|
||||
use_continuous_indent_inside_parens = true
|
||||
indent_method_decl_pars = inside
|
||||
indent_invocation_pars = inside
|
||||
indent_statement_pars = inside
|
||||
indent_typeparam_angles = inside
|
||||
indent_typearg_angles = inside
|
||||
indent_pars = inside
|
||||
indent_preprocessor_if = outdent
|
||||
indent_preprocessor_region = usual_indent
|
||||
indent_preprocessor_other = usual_indent
|
||||
indent_switch_labels = true
|
||||
indent_type_constraints = true
|
||||
stick_comment = false
|
||||
alignment_tab_fill_style = use_spaces
|
||||
align_multiline_parameter = true
|
||||
align_multiline_extends_list = true
|
||||
align_linq_query = true
|
||||
align_multiline_binary_expressions_chain = true
|
||||
outdent_binary_ops = true
|
||||
align_multiline_calls_chain = true
|
||||
outdent_dots = true
|
||||
align_multiline_array_and_object_initializer = false
|
||||
indent_anonymous_method_block = false
|
||||
align_first_arg_by_paren = true
|
||||
align_multiline_argument = true
|
||||
align_tuple_components = true
|
||||
align_multiline_expression = true
|
||||
align_multiline_for_stmt = true
|
||||
align_multiple_declaration = true
|
||||
align_multline_type_parameter_list = true
|
||||
align_multline_type_parameter_constrains = true
|
||||
int_align_fields = true
|
||||
int_align_properties = true
|
||||
int_align_methods = true
|
||||
int_align_parameters = false
|
||||
int_align_variables = true
|
||||
int_align_assignments = true
|
||||
int_align_nested_ternary = true
|
||||
int_align_invocations = false
|
||||
int_align_binary_expressions = true
|
||||
int_align_comments = true
|
||||
int_align_switch_sections = true
|
||||
keep_user_linebreaks = false
|
||||
keep_existing_arrangement = false
|
||||
keep_existing_linebreaks = false
|
||||
max_line_length = 120
|
||||
wrap_before_comma = false
|
||||
special_else_if_treatment = true
|
||||
place_type_attribute_on_same_line = never
|
||||
place_method_attribute_on_same_line = never
|
||||
place_accessorholder_attribute_on_same_line = never
|
||||
place_attribute_on_same_line = never
|
||||
place_accessor_attribute_on_same_line = never
|
||||
place_attribute_on_same_line = never
|
||||
place_field_attribute_on_same_line = never
|
||||
place_attribute_on_same_line = never
|
||||
wrap_parameters_style = wrap_if_long
|
||||
keep_existing_declaration_parens_arrangement = false
|
||||
wrap_before_declaration_lpar = false
|
||||
wrap_after_declaration_lpar = false
|
||||
wrap_before_declaration_rpar = false
|
||||
place_constructor_initializer_on_same_line = true
|
||||
keep_existing_expr_member_arrangement = false
|
||||
place_expr_method_on_single_line = true
|
||||
place_expr_property_on_single_line = true
|
||||
place_expr_accessor_on_single_line = true
|
||||
wrap_before_arrow_with_expressions = false
|
||||
place_type_constraints_on_same_line = true
|
||||
wrap_before_first_type_parameter_constraint = true
|
||||
wrap_multiple_type_parameter_constraints_style = wrap_if_long
|
||||
wrap_before_type_parameter_langle = true
|
||||
wrap_before_extends_colon = false
|
||||
wrap_extends_list_style = wrap_if_long
|
||||
keep_existing_declaration_block_arrangement = false
|
||||
place_abstract_accessorholder_on_single_line = true
|
||||
place_simple_accessorholder_on_single_line = false
|
||||
place_accessor_with_attrs_holder_on_single_line = false
|
||||
place_simple_accessor_on_single_line = true
|
||||
place_simple_method_on_single_line = false
|
||||
keep_existing_enum_arrangement = false
|
||||
place_simple_enum_on_single_line = false
|
||||
wrap_enum_declaration = wrap_if_long
|
||||
new_line_before_else = true
|
||||
new_line_before_while = false
|
||||
wrap_for_stmt_header_style = wrap_if_long
|
||||
wrap_multiple_declaration_style = wrap_if_long
|
||||
keep_existing_embedded_arrangement = false
|
||||
place_simple_embedded_statement_on_same_line = false
|
||||
place_simple_case_statement_on_same_line = true
|
||||
keep_existing_embedded_block_arrangement = false
|
||||
place_simple_embedded_block_on_same_line = false
|
||||
place_simple_anonymousmethod_on_single_line = false
|
||||
keep_existing_initializer_arrangement = false
|
||||
place_simple_initializer_on_single_line = false
|
||||
wrap_object_and_collection_initializer_style = chop_always
|
||||
wrap_array_initializer_style = wrap_if_long
|
||||
wrap_arguments_style = wrap_if_long
|
||||
keep_existing_invocation_parens_arrangement = false
|
||||
wrap_after_invocation_lpar = false
|
||||
wrap_before_invocation_rpar = false
|
||||
wrap_after_dot_in_method_calls = true
|
||||
wrap_chained_method_calls = wrap_if_long
|
||||
wrap_before_binary_opsign = false
|
||||
wrap_chained_binary_expressions = wrap_if_long
|
||||
force_chop_compound_if_expression = true
|
||||
force_chop_compound_while_expression = true
|
||||
force_chop_compound_do_expression = true
|
||||
wrap_before_ternary_opsigns = true
|
||||
wrap_ternary_expr_style = wrap_if_long
|
||||
nested_ternary_style = expanded
|
||||
wrap_linq_expressions = wrap_if_long
|
||||
wrap_before_linq_expression = false
|
||||
place_linq_into_on_new_line = false
|
||||
wrap_verbatim_interpolated_strings = wrap_if_long
|
||||
extra_spaces = remove_all
|
||||
space_after_keywords_in_control_flow_statements = false
|
||||
space_between_method_call_name_and_opening_parenthesis = false
|
||||
space_between_method_declaration_name_and_open_parenthesis = false
|
||||
space_before_typeof_parentheses = false
|
||||
space_before_checked_parentheses = false
|
||||
space_before_sizeof_parentheses = false
|
||||
space_before_nameof_parentheses = false
|
||||
space_between_keyword_and_expression = true
|
||||
space_between_keyword_and_type = true
|
||||
space_around_assignment_op = true
|
||||
space_around_logical_op = true
|
||||
space_around_binary_operator = true
|
||||
space_around_equality_op = true
|
||||
space_around_relational_op = true
|
||||
space_around_bitwise_op = true
|
||||
space_around_additive_op = true
|
||||
space_around_multiplicative_op = true
|
||||
space_around_shift_op = true
|
||||
space_around_nullcoalescing_op = true
|
||||
space_around_arrow_op = false
|
||||
space_after_logical_not_op = false
|
||||
space_after_unary_operator = false
|
||||
space_after_cast = false
|
||||
space_around_dot = false
|
||||
space_around_lambda_arrow = true
|
||||
space_before_pointer_asterik_declaration = false
|
||||
space_before_nullable_mark = false
|
||||
blank_lines_around_class_definition = 1
|
||||
namespace_indentation = all
|
||||
space_within_template_argument = false
|
||||
align_union_type_usage = true
|
||||
space_in_singleline_method = true
|
||||
space_in_singleline_anonymous_method = true
|
||||
space_within_single_line_array_initializer_braces = true
|
||||
space_around_arrow_op = false
|
||||
|
||||
# These are for markup languages (HTML, XML, etc)
|
||||
spaces_around_eq_in_pi_attribute = false
|
||||
space_after_last_pi_attribute = true
|
||||
pi_attributes_indent = align_by_first_attribute
|
||||
blank_line_after_pi = true
|
||||
spaces_around_eq_in_attribute = false
|
||||
space_after_last_attribute = false
|
||||
space_before_self_closing = true
|
||||
attribute_style = on_single_line
|
||||
attribute_indent = align_by_first_attribute
|
||||
sort_attributes = true
|
||||
sort_class_selectors = true
|
||||
max_blank_lines_between_tags = 0
|
||||
linebreak_before_all_elements = true
|
||||
linebreak_before_multiline_elements = true
|
||||
quote_style = doublequoted
|
||||
delete_quotes_from_solid_values = false
|
||||
normalize_tag_names = true
|
||||
|
||||
|
||||
[{.babelrc,.stylelintrc,jest.config,.eslintrc,.prettierrc,*.json,*.jsb3,*.jsb2,*.bowerrc}]
|
||||
indent_size = 2
|
||||
|
||||
[*.js.map]
|
||||
indent_size = 2
|
||||
|
||||
[*.{css,scss}]
|
||||
indent_size = 2
|
||||
declarations_style = separate_lines_for_nonsingle
|
||||
media_query_style = separate_lines
|
||||
selector_style = same_line
|
||||
properties_style = separate_lines_for_nonsingle
|
||||
brace_style = next_line
|
||||
|
||||
[{.analysis_options,*.yml,*.yaml}]
|
||||
indent_size = 2
|
||||
|
||||
# Xml project files
|
||||
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
|
||||
indent_size = 2
|
||||
|
||||
# Xml files
|
||||
[*.{xml,stylecop,resx,ruleset}]
|
||||
indent_size = 2
|
||||
|
||||
# Xml config files
|
||||
[*.{props,targets,config,nuspec}]
|
||||
indent_size = 2
|
||||
|
||||
# .net files
|
||||
[*.{cs,vb}]
|
||||
# These set the this. / Me.
|
||||
dotnet_style_qualification_for_field = false:warning
|
||||
dotnet_style_qualification_for_property = false:warning
|
||||
dotnet_style_qualification_for_method = false:warning
|
||||
dotnet_style_qualification_for_event = false:warning
|
||||
|
||||
# These make it suggest Int32 instead of int, etc.
|
||||
# Microsoft .NET properties
|
||||
csharp_new_line_between_query_expression_clauses = false
|
||||
csharp_preferred_modifier_order = public, private, protected, internal, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async:suggestion
|
||||
csharp_prefer_braces = false:warning
|
||||
csharp_space_after_keywords_in_control_flow_statements = false
|
||||
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 = inside_namespace:silent
|
||||
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_rule.unity_serialized_field_rule_1.import_to_resharper = True
|
||||
dotnet_naming_rule.unity_serialized_field_rule_1.resharper_description = Unity serialized field
|
||||
dotnet_naming_rule.unity_serialized_field_rule_1.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
|
||||
dotnet_naming_rule.unity_serialized_field_rule_1.severity = warning
|
||||
dotnet_naming_rule.unity_serialized_field_rule_1.style = lower_camel_case_style
|
||||
dotnet_naming_rule.unity_serialized_field_rule_1.symbols = unity_serialized_field_symbols_1
|
||||
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
|
||||
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_naming_symbols.unity_serialized_field_symbols_1.applicable_accessibilities = *
|
||||
dotnet_naming_symbols.unity_serialized_field_symbols_1.applicable_kinds =
|
||||
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_applicable_kinds = unity_serialised_field
|
||||
dotnet_naming_symbols.unity_serialized_field_symbols_1.resharper_required_modifiers = instance
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:warning
|
||||
dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary: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
|
||||
|
||||
# This controls implicit access modifiers
|
||||
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
|
||||
|
||||
# Prefer non modified fields to be marked readonly
|
||||
dotnet_style_readonly_field = true:warning
|
||||
# ReSharper properties
|
||||
resharper_align_first_arg_by_paren = true
|
||||
resharper_align_linq_query = true
|
||||
resharper_align_multiline_argument = true
|
||||
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_extends_list = true
|
||||
resharper_align_multiline_for_stmt = 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_tuple_components = true
|
||||
resharper_attribute_indent = align_by_first_attribute
|
||||
resharper_attribute_style = on_single_line
|
||||
resharper_autodetect_indent_settings = true
|
||||
resharper_constructor_or_destructor_body = expression_body
|
||||
resharper_cpp_brace_style = next_line
|
||||
resharper_csharp_outdent_commas = true
|
||||
resharper_default_value_when_type_not_evident = default_expression
|
||||
resharper_empty_block_style = together_same_line
|
||||
resharper_force_attribute_style = join
|
||||
resharper_force_chop_compound_do_expression = true
|
||||
resharper_force_chop_compound_if_expression = true
|
||||
resharper_force_chop_compound_while_expression = true
|
||||
resharper_for_built_in_types = use_var_when_evident
|
||||
resharper_fsharp_type_declaration_braces = next_line
|
||||
resharper_indent_nested_fixed_stmt = true
|
||||
resharper_indent_nested_foreach_stmt = true
|
||||
resharper_indent_nested_for_stmt = true
|
||||
resharper_indent_nested_lock_stmt = true
|
||||
resharper_indent_nested_usings_stmt = true
|
||||
resharper_indent_nested_while_stmt = true
|
||||
resharper_indent_preprocessor_if = outdent
|
||||
resharper_indent_preprocessor_other = usual_indent
|
||||
resharper_indent_switch_labels = true
|
||||
resharper_int_align_assignments = true
|
||||
resharper_int_align_binary_expressions = true
|
||||
resharper_int_align_comments = true
|
||||
resharper_int_align_fields = true
|
||||
resharper_int_align_methods = true
|
||||
resharper_int_align_nested_ternary = true
|
||||
resharper_int_align_properties = true
|
||||
resharper_int_align_property_patterns = true
|
||||
resharper_int_align_switch_expressions = true
|
||||
resharper_int_align_switch_sections = true
|
||||
resharper_int_align_variables = true
|
||||
resharper_keep_existing_arrangement = false
|
||||
resharper_keep_user_linebreaks = false
|
||||
resharper_linebreak_before_all_elements = true
|
||||
resharper_local_function_body = expression_body
|
||||
resharper_max_blank_lines_between_tags = 0
|
||||
resharper_max_enum_members_on_line = 1
|
||||
resharper_method_or_operator_body = expression_body
|
||||
resharper_nested_ternary_style = expanded
|
||||
resharper_new_line_before_while = false
|
||||
resharper_normalize_tag_names = true
|
||||
resharper_outdent_binary_ops = true
|
||||
resharper_outdent_binary_pattern_ops = true
|
||||
resharper_outdent_dots = true
|
||||
resharper_outdent_statement_labels = true
|
||||
resharper_place_attribute_on_same_line = false
|
||||
resharper_place_expr_accessor_on_single_line = true
|
||||
resharper_place_expr_method_on_single_line = true
|
||||
resharper_place_expr_property_on_single_line = true
|
||||
resharper_place_linq_into_on_new_line = false
|
||||
resharper_place_simple_anonymousmethod_on_single_line = false
|
||||
resharper_place_simple_case_statement_on_same_line = true
|
||||
resharper_place_simple_embedded_statement_on_same_line = false
|
||||
resharper_place_simple_initializer_on_single_line = false
|
||||
resharper_place_simple_switch_expression_on_single_line = true
|
||||
resharper_prefer_explicit_discard_declaration = true
|
||||
resharper_qualified_using_at_nested_scope = true
|
||||
resharper_show_autodetect_configure_formatting_tip = false
|
||||
resharper_sort_attributes = true
|
||||
resharper_sort_class_selectors = true
|
||||
resharper_space_after_keywords_in_control_flow_statements = false
|
||||
resharper_space_after_last_pi_attribute = true
|
||||
resharper_space_after_unary_operator = false
|
||||
resharper_space_around_binary_operator = true
|
||||
resharper_space_before_self_closing = true
|
||||
resharper_space_within_empty_braces = false
|
||||
resharper_stick_comment = false
|
||||
resharper_use_indent_from_vs = false
|
||||
resharper_wrap_after_dot_in_method_calls = true
|
||||
resharper_wrap_before_first_type_parameter_constraint = true
|
||||
resharper_wrap_before_type_parameter_langle = true
|
||||
resharper_wrap_enum_declaration = wrap_if_long
|
||||
resharper_wrap_for_stmt_header_style = wrap_if_long
|
||||
resharper_wrap_lines = true
|
||||
resharper_wrap_multiple_declaration_style = wrap_if_long
|
||||
resharper_wrap_multiple_type_parameter_constraints_style = wrap_if_long
|
||||
resharper_wrap_object_and_collection_initializer_style = chop_always
|
||||
resharper_wrap_ternary_expr_style = wrap_if_long
|
||||
resharper_wrap_verbatim_interpolated_strings = wrap_if_long
|
||||
|
||||
# Parenthesis settings
|
||||
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:warning
|
||||
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:warning
|
||||
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:warning
|
||||
dotnet_style_parentheses_in_other_operators = always_for_clarity:warning
|
||||
# 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_arrange_attributes_highlighting = hint
|
||||
resharper_arrange_constructor_or_destructor_body_highlighting = warning
|
||||
resharper_arrange_default_value_when_type_evident_highlighting = warning
|
||||
resharper_arrange_default_value_when_type_not_evident_highlighting = warning
|
||||
resharper_arrange_local_function_body_highlighting = warning
|
||||
resharper_arrange_method_or_operator_body_highlighting = warning
|
||||
resharper_arrange_object_creation_when_type_evident_highlighting = warning
|
||||
resharper_arrange_object_creation_when_type_not_evident_highlighting = warning
|
||||
resharper_arrange_redundant_parentheses_highlighting = hint
|
||||
resharper_arrange_this_qualifier_highlighting = hint
|
||||
resharper_arrange_type_member_modifiers_highlighting = hint
|
||||
resharper_arrange_type_modifiers_highlighting = hint
|
||||
resharper_async_void_method_highlighting = warning
|
||||
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
|
||||
resharper_built_in_type_reference_style_highlighting = hint
|
||||
resharper_compare_non_constrained_generic_with_null_highlighting = warning
|
||||
resharper_heap_view_boxing_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_inheritdoc_consider_usage_highlighting = warning
|
||||
resharper_local_function_can_be_made_static_highlighting = warning
|
||||
resharper_loop_can_be_partly_converted_to_query_highlighting = warning
|
||||
resharper_member_can_be_internal_highlighting = warning
|
||||
resharper_nullable_warning_suppression_is_used_highlighting = warning
|
||||
resharper_redundant_base_qualifier_highlighting = warning
|
||||
resharper_remove_constructor_invocation_highlighting = warning
|
||||
resharper_separate_control_transfer_statement_highlighting = warning
|
||||
resharper_string_ends_with_is_culture_specific_highlighting = warning
|
||||
resharper_string_starts_with_is_culture_specific_highlighting = warning
|
||||
resharper_struct_member_can_be_made_read_only_highlighting = warning
|
||||
resharper_suggest_var_or_type_built_in_types_highlighting = hint
|
||||
resharper_suggest_var_or_type_elsewhere_highlighting = hint
|
||||
resharper_suggest_var_or_type_simple_types_highlighting = hint
|
||||
resharper_tabs_are_disallowed_highlighting = warning
|
||||
resharper_unnecessary_whitespace_highlighting = warning
|
||||
resharper_use_nameof_expression_for_part_of_the_string_highlighting = warning
|
||||
resharper_use_positional_deconstruction_pattern_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
|
||||
|
||||
dotnet_style_object_initializer = true:suggestion
|
||||
dotnet_style_collection_initializer = true:suggestion
|
||||
dotnet_style_explicit_tuple_names = true:error
|
||||
dotnet_style_prefer_inferred_tuple_names = true:warning
|
||||
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:warning
|
||||
dotnet_style_coalesce_expression = true:warning
|
||||
dotnet_style_null_propagation = true:error
|
||||
[{*.har,*.inputactions,*.jsb2,*.jsb3,*.json,.babelrc,.eslintrc,.stylelintrc,bowerrc,jest.config}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
dotnet_sort_system_directives_first = true
|
||||
[{*.yaml,*.yml,.analysis_options}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
# Constants in C style, all-caps
|
||||
dotnet_naming_rule.constant_fields_caps.symbols = constant_fields
|
||||
dotnet_naming_rule.constant_fields_caps.severity = warning
|
||||
dotnet_naming_rule.constant_fields_caps.style = caps_style
|
||||
dotnet_naming_symbols.constant_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.constant_fields.required_modifiers = const
|
||||
dotnet_naming_style.caps_style.capitalization = all_upper
|
||||
[*.csv]
|
||||
indent_style = tab
|
||||
tab_width = 1
|
||||
|
||||
# interfaces should be prefixed with I
|
||||
dotnet_naming_rule.pascal_case_for_interface.severity = error
|
||||
dotnet_naming_rule.pascal_case_for_interface.symbols = interfaces_fields
|
||||
dotnet_naming_rule.pascal_case_for_interface.style = pascal_case_interface_style
|
||||
dotnet_naming_symbols.interfaces_fields.applicable_kinds = interface
|
||||
dotnet_naming_style.pascal_case_interface_style.required_prefix = I
|
||||
dotnet_naming_style.pascal_case_interface_style.capitalization = pascal_case
|
||||
[{*.bash,*.sh,*.tool,*.zsh}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
## internal and private fields should be _camelCase
|
||||
dotnet_naming_rule.camel_case_for_private_internal_fields.severity = warning
|
||||
dotnet_naming_rule.camel_case_for_private_internal_fields.symbols = private_internal_fields
|
||||
dotnet_naming_rule.camel_case_for_private_internal_fields.style = camel_case_underscore_style
|
||||
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
|
||||
dotnet_naming_style.camel_case_underscore_style.required_prefix = _
|
||||
dotnet_naming_style.camel_case_underscore_style.capitalization = camel_case
|
||||
|
||||
# 2018-12-07 NP: This is not yet working in VS2017
|
||||
# local variables should be camelCase
|
||||
#dotnet_naming_rule.camel_case_for_locals.severity = suggestion
|
||||
#dotnet_naming_rule.camel_case_for_locals.symbols = local_fields
|
||||
#dotnet_naming_rule.camel_case_for_locals.style = camel_case_style
|
||||
#dotnet_naming_symbols.local_fields.applicable_kinds = local
|
||||
#dotnet_naming_style.camel_case_style.capitalization = camel_case
|
||||
|
||||
[*.cs]
|
||||
# var var var
|
||||
csharp_style_var_for_built_in_types = false:warning
|
||||
csharp_style_var_when_type_is_apparent = true:suggestion
|
||||
csharp_style_var_elsewhere = false:warning
|
||||
|
||||
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
|
||||
csharp_style_expression_bodied_constructors = when_on_single_line:suggestion
|
||||
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
|
||||
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
|
||||
csharp_style_expression_bodied_indexers = when_on_single_line:suggestion
|
||||
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
|
||||
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||
csharp_style_pattern_matching_over_as_with_null_check = when_on_single_line:warning
|
||||
|
||||
csharp_style_inlined_variable_declaration = true:warning
|
||||
|
||||
csharp_prefer_simple_default_expression = true:warning
|
||||
csharp_style_deconstructed_variable_declaration = false:warning
|
||||
|
||||
csharp_style_throw_expression = true:warning
|
||||
csharp_style_conditional_delegate_call = true:warning
|
||||
|
||||
csharp_prefer_braces = false
|
||||
|
||||
csharp_new_line_before_open_brace = all
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_catch = true
|
||||
csharp_new_line_before_finally = true
|
||||
csharp_new_line_before_members_in_object_initializers = true
|
||||
csharp_new_line_before_members_in_anonymous_types = true
|
||||
csharp_new_line_between_query_expression_clauses = true
|
||||
|
||||
csharp_indent_case_contents = true
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_labels = flush_left
|
||||
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_after_keywords_in_control_flow_statements = false
|
||||
csharp_space_between_method_declaration_parameter_list_parentheses = false
|
||||
csharp_space_between_parentheses = none
|
||||
csharp_space_before_colon_in_inheritance_clause = true
|
||||
csharp_space_after_colon_in_inheritance_clause = true
|
||||
csharp_space_around_binary_operators = before_and_after
|
||||
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_call_empty_parameter_list_parentheses = false
|
||||
|
||||
csharp_preserve_single_line_statements = false
|
||||
csharp_preserve_single_line_blocks = true
|
||||
|
||||
csharp_blank_lines_around_region = 0
|
||||
csharp_blank_lines_inside_region = 0
|
||||
csharp_blank_lines_before_single_line_comment = 1
|
||||
csharp_keep_blank_lines_in_declarations = 1
|
||||
csharp_remove_blank_lines_near_braces_in_declarations = true
|
||||
csharp_blank_lines_after_start_comment = false
|
||||
csharp_blank_lines_between_using_groups = 0
|
||||
csharp_blank_lines_after_using_list = 1
|
||||
csharp_blank_lines_around_namespace = 1
|
||||
csharp_blank_lines_inside_namespace = 0
|
||||
csharp_blank_lines_around_type = 1
|
||||
csharp_blank_lines_inside_type = 0
|
||||
csharp_blank_lines_around_field = 0
|
||||
csharp_blank_lines_around_single_line_field = 0
|
||||
csharp_blank_lines_around_property = 1
|
||||
csharp_blank_lines_around_single_line_property = 0
|
||||
csharp_blank_lines_around_auto_property = 0
|
||||
csharp_blank_lines_around_single_line_auto_property = 0
|
||||
csharp_blank_lines_around_invocable = 1
|
||||
csharp_blank_lines_around_single_line_invocable = 1
|
||||
csharp_keep_blank_lines_in_code = 1
|
||||
csharp_remove_blank_lines_near_braces_in_code = true
|
||||
csharp_blank_lines_around_local_method = 1
|
||||
csharp_blank_lines_around_single_line_local_method = 1
|
||||
csharp_blank_lines_before_control_transfer_statements = 1
|
||||
csharp_blank_lines_after_control_transfer_statements = 1
|
||||
csharp_blank_lines_before_block_statements = 1
|
||||
csharp_blank_lines_after_block_statements = 1
|
||||
csharp_blank_lines_before_multiline_statements = 1
|
||||
csharp_blank_lines_after_multiline_statements = 1
|
||||
|
||||
csharp_type_declaration_braces = next_line
|
||||
csharp_brace_style = next_line
|
||||
csharp_indent_inside_namespace = true
|
||||
csharp_invocable_declaration_braces = next_line
|
||||
csharp_anonymous_method_declaration_braces = next_line
|
||||
csharp_accessor_owner_declaration_braces = next_line
|
||||
csharp_accessor_declaration_braces = next_line
|
||||
csharp_case_block_braces = next_line
|
||||
csharp_initializer_braces = next_line
|
||||
csharp_other_braces = next_line
|
||||
csharp_allow_comment_after_lbrace = false
|
||||
csharp_empty_block_style = together_same_line
|
||||
|
||||
csharp_for_built_in_types = use_explicit_type
|
||||
csharp_for_simple_types = use_var_when_evident
|
||||
csharp_for_other_types = use_explicit_type
|
||||
csharp_prefer_separate_deconstructed_variables_declaration = true
|
||||
csharp_prefer_explicit_discard_declaration = false
|
||||
|
||||
csharp_instance_members_qualify_members = none
|
||||
csharp_builtin_type_reference_style = use_keyword
|
||||
csharp_prefer_qualified_reference = false
|
||||
csharp_add_imports_to_deepest_scope = false
|
||||
csharp_allow_alias = true
|
||||
csharp_default_private_modifier = implicit
|
||||
csharp_default_internal_modifier = explicit
|
||||
csharp_arguments_literal = positional
|
||||
csharp_arguments_string_literal = positional
|
||||
csharp_arguments_named = positional
|
||||
csharp_arguments_anonymous_function = positional
|
||||
csharp_arguments_other = positional
|
||||
csharp_braces_for_ifelse = not_required
|
||||
csharp_braces_for_for = not_required
|
||||
csharp_braces_for_foreach = not_required
|
||||
csharp_braces_for_while = not_required
|
||||
csharp_braces_for_dowhile = not_required
|
||||
csharp_braces_for_using = not_required
|
||||
csharp_braces_for_lock = not_required
|
||||
csharp_braces_for_fixed = not_required
|
||||
csharp_method_or_operator_body = expression_body
|
||||
csharp_local_function_body = expression_body
|
||||
csharp_constructor_or_destructor_body = expression_body
|
||||
csharp_accessor_owner_body = expression_body
|
||||
csharp_force_attribute_style = join
|
||||
csharp_indent_nested_usings_stmt = true
|
||||
|
||||
csharp_builtin_type_reference_for_member_access_style = use_keyword
|
||||
csharp_indent_nested_fixed_stmt = true
|
||||
csharp_indent_nested_lock_stmt = true
|
||||
csharp_indent_nested_for_stmt = true
|
||||
csharp_indent_nested_foreach_stmt = true
|
||||
csharp_indent_nested_while_stmt = true
|
||||
csharp_use_continuous_indent_inside_parens = true
|
||||
csharp_indent_method_decl_pars = inside
|
||||
csharp_indent_invocation_pars = inside
|
||||
csharp_indent_statement_pars = inside
|
||||
csharp_indent_typeparam_angles = inside
|
||||
csharp_indent_typearg_angles = inside
|
||||
csharp_indent_pars = inside
|
||||
csharp_indent_preprocessor_if = outdent
|
||||
csharp_indent_preprocessor_region = usual_indent
|
||||
csharp_indent_preprocessor_other = usual_indent
|
||||
csharp_indent_switch_labels = true
|
||||
csharp_indent_type_constraints = true
|
||||
csharp_stick_comment = false
|
||||
csharp_alignment_tab_fill_style = use_spaces
|
||||
csharp_align_multiline_parameter = true
|
||||
csharp_align_multiline_extends_list = true
|
||||
csharp_align_linq_query = true
|
||||
csharp_align_multiline_binary_expressions_chain = true
|
||||
csharp_outdent_binary_ops = true
|
||||
csharp_align_multiline_calls_chain = true
|
||||
csharp_outdent_dots = true
|
||||
csharp_align_multiline_array_and_object_initializer = false
|
||||
csharp_indent_anonymous_method_block = false
|
||||
csharp_align_first_arg_by_paren = true
|
||||
csharp_align_multiline_argument = true
|
||||
csharp_align_tuple_components = true
|
||||
csharp_align_multiline_expression = true
|
||||
csharp_align_multiline_for_stmt = true
|
||||
csharp_align_multiple_declaration = true
|
||||
csharp_align_multline_type_parameter_list = true
|
||||
csharp_align_multline_type_parameter_constrains = true
|
||||
csharp_int_align_fields = true
|
||||
csharp_int_align_properties = true
|
||||
csharp_int_align_methods = true
|
||||
csharp_int_align_parameters = false
|
||||
csharp_int_align_variables = true
|
||||
csharp_int_align_assignments = true
|
||||
csharp_int_align_nested_ternary = true
|
||||
csharp_int_align_invocations = false
|
||||
csharp_int_align_binary_expressions = true
|
||||
csharp_int_align_comments = true
|
||||
csharp_int_align_switch_sections = true
|
||||
csharp_int_align = true
|
||||
csharp_keep_user_linebreaks = false
|
||||
csharp_keep_existing_arrangement = false
|
||||
csharp_keep_existing_linebreaks = false
|
||||
csharp_max_line_length = 120
|
||||
csharp_wrap_before_comma = false
|
||||
csharp_special_else_if_treatment = true
|
||||
csharp_insert_final_newline = false
|
||||
csharp_place_type_attribute_on_same_line = never
|
||||
csharp_place_method_attribute_on_same_line = never
|
||||
csharp_place_accessorholder_attribute_on_same_line = never
|
||||
csharp_place_attribute_on_same_line = never
|
||||
csharp_place_accessor_attribute_on_same_line = never
|
||||
csharp_place_attribute_on_same_line = never
|
||||
csharp_place_field_attribute_on_same_line = never
|
||||
csharp_place_attribute_on_same_line = never
|
||||
csharp_wrap_parameters_style = wrap_if_long
|
||||
csharp_keep_existing_declaration_parens_arrangement = false
|
||||
csharp_wrap_before_declaration_lpar = false
|
||||
csharp_wrap_after_declaration_lpar = false
|
||||
csharp_wrap_before_declaration_rpar = false
|
||||
csharp_place_constructor_initializer_on_same_line = true
|
||||
csharp_keep_existing_expr_member_arrangement = false
|
||||
csharp_place_expr_method_on_single_line = true
|
||||
csharp_place_expr_property_on_single_line = true
|
||||
csharp_place_expr_accessor_on_single_line = true
|
||||
csharp_wrap_before_arrow_with_expressions = false
|
||||
csharp_place_type_constraints_on_same_line = true
|
||||
csharp_wrap_before_first_type_parameter_constraint = true
|
||||
csharp_wrap_multiple_type_parameter_constraints_style = wrap_if_long
|
||||
csharp_wrap_before_type_parameter_langle = true
|
||||
csharp_wrap_before_extends_colon = false
|
||||
csharp_wrap_extends_list_style = wrap_if_long
|
||||
csharp_keep_existing_declaration_block_arrangement = false
|
||||
csharp_place_abstract_accessorholder_on_single_line = true
|
||||
csharp_place_simple_accessorholder_on_single_line = false
|
||||
csharp_place_accessor_with_attrs_holder_on_single_line = false
|
||||
csharp_place_simple_accessor_on_single_line = true
|
||||
csharp_place_simple_method_on_single_line = false
|
||||
csharp_keep_existing_enum_arrangement = false
|
||||
csharp_place_simple_enum_on_single_line = false
|
||||
csharp_wrap_enum_declaration = wrap_if_long
|
||||
csharp_new_line_before_else = true
|
||||
csharp_new_line_before_while = false
|
||||
csharp_wrap_for_stmt_header_style = wrap_if_long
|
||||
csharp_wrap_multiple_declaration_style = wrap_if_long
|
||||
csharp_keep_existing_embedded_arrangement = false
|
||||
csharp_place_simple_embedded_statement_on_same_line = false
|
||||
csharp_place_simple_case_statement_on_same_line = true
|
||||
csharp_keep_existing_embedded_block_arrangement = false
|
||||
csharp_place_simple_embedded_block_on_same_line = false
|
||||
csharp_place_simple_anonymousmethod_on_single_line = false
|
||||
csharp_keep_existing_initializer_arrangement = false
|
||||
csharp_place_simple_initializer_on_single_line = false
|
||||
csharp_wrap_object_and_collection_initializer_style = chop_always
|
||||
csharp_wrap_array_initializer_style = wrap_if_long
|
||||
csharp_wrap_arguments_style = wrap_if_long
|
||||
csharp_keep_existing_invocation_parens_arrangement = false
|
||||
csharp_wrap_after_invocation_lpar = false
|
||||
csharp_wrap_before_invocation_rpar = false
|
||||
csharp_wrap_after_dot_in_method_calls = true
|
||||
csharp_wrap_chained_method_calls = wrap_if_long
|
||||
csharp_wrap_before_binary_opsign = false
|
||||
csharp_wrap_chained_binary_expressions = wrap_if_long
|
||||
csharp_force_chop_compound_if_expression = true
|
||||
csharp_force_chop_compound_while_expression = true
|
||||
csharp_force_chop_compound_do_expression = true
|
||||
csharp_wrap_before_ternary_opsigns = true
|
||||
csharp_wrap_ternary_expr_style = wrap_if_long
|
||||
csharp_nested_ternary_style = expanded
|
||||
csharp_wrap_linq_expressions = wrap_if_long
|
||||
csharp_wrap_before_linq_expression = false
|
||||
csharp_place_linq_into_on_new_line = false
|
||||
csharp_wrap_verbatim_interpolated_strings = wrap_if_long
|
||||
csharp_extra_spaces = remove_all
|
||||
csharp_space_after_keywords_in_control_flow_statements = false
|
||||
csharp_space_between_method_call_name_and_opening_parenthesis = false
|
||||
csharp_space_between_method_declaration_name_and_open_parenthesis = false
|
||||
csharp_space_before_typeof_parentheses = false
|
||||
csharp_space_before_checked_parentheses = false
|
||||
csharp_space_before_sizeof_parentheses = false
|
||||
csharp_space_before_nameof_parentheses = false
|
||||
csharp_space_between_keyword_and_expression = true
|
||||
csharp_space_between_keyword_and_type = true
|
||||
csharp_space_around_assignment_op = true
|
||||
csharp_space_around_logical_op = true
|
||||
csharp_space_around_binary_operator = true
|
||||
csharp_space_around_equality_op = true
|
||||
csharp_space_around_relational_op = true
|
||||
csharp_space_around_bitwise_op = true
|
||||
csharp_space_around_additive_op = true
|
||||
csharp_space_around_multiplicative_op = true
|
||||
csharp_space_around_shift_op = true
|
||||
csharp_space_around_nullcoalescing_op = true
|
||||
csharp_space_around_arrow_op = false
|
||||
csharp_space_after_logical_not_op = false
|
||||
csharp_space_after_unary_operator = false
|
||||
csharp_space_after_cast = false
|
||||
csharp_space_around_dot = false
|
||||
csharp_space_around_lambda_arrow = true
|
||||
csharp_space_before_pointer_asterik_declaration = false
|
||||
csharp_space_before_nullable_mark = false
|
||||
|
||||
[*.cshtml]
|
||||
linebreaks_around_razor_statements = true
|
||||
blank_lines_around_razor_functions = true
|
||||
blank_lines_around_razor_helpers = true
|
||||
blank_lines_around_razor_sections = true
|
||||
|
||||
# C++
|
||||
[*.{cc,cpp,cxx,h,hpp,hxx}]
|
||||
cpp_indent_access_specifiers_from_class = true
|
||||
cpp_indent_wrapped_function_names = false
|
||||
cpp_align_multiline_type_argument = true
|
||||
|
||||
# C, C++ and ObjectiveC
|
||||
[*.{c,h,cc,cpp,cxx,m,hpp,hxx}]
|
||||
indent_preprocessor_directives = normal
|
||||
indent_type_constraints = true
|
||||
|
||||
# Javascript and Typescript
|
||||
[*.{js,js.map,ts}]
|
||||
quote_style = doublequoted
|
||||
termination_style = ensure_semicolon
|
||||
[*.{appxmanifest,asax,ascx,aspx,axaml,build,cg,cginc,compute,cs,cshtml,dtd,fs,fsi,fsscript,fsx,hlsl,hlsli,hlslinc,master,ml,mli,nuspec,paml,razor,resw,resx,shader,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
tab_width = 4
|
||||
|
||||
@@ -43,15 +43,22 @@ public enum ErrorNumber
|
||||
{
|
||||
NotPermitted = -1,
|
||||
/// <summary>No such file or directory</summary>
|
||||
NoSuchFile = -2, NoSuchProcess = -3, InterruptedSyscall = -4,
|
||||
NoSuchFile = -2, NoSuchProcess = -3,
|
||||
InterruptedSyscall = -4,
|
||||
/// <summary>I/O error</summary>
|
||||
InOutError = -5, NoSuchDeviceOrAddress = -6, ArgumentListTooLong = -7, ExecutableFormatError = -8,
|
||||
BadFileNumber = -9, NoChildProcess = -10, TryAgain = -11,
|
||||
InOutError = -5, NoSuchDeviceOrAddress = -6,
|
||||
ArgumentListTooLong = -7,
|
||||
ExecutableFormatError = -8,
|
||||
BadFileNumber = -9,
|
||||
NoChildProcess = -10,
|
||||
TryAgain = -11,
|
||||
OutOfMemory = -12,
|
||||
/// <summary>Access denied</summary>
|
||||
AccessDenied = -13, BadAddress = -14, NotABlockDevice = -15,
|
||||
AccessDenied = -13, BadAddress = -14,
|
||||
NotABlockDevice = -15,
|
||||
/// <summary>Busy, cannot complete</summary>
|
||||
Busy = -16, FileExists = -17, CrossDeviceLink = -18,
|
||||
Busy = -16, FileExists = -17,
|
||||
CrossDeviceLink = -18,
|
||||
/// <summary>No such device</summary>
|
||||
NoSuchDevice = -19,
|
||||
/// <summary>Is not a directory (e.g.: trying to ReadDir() a file)</summary>
|
||||
@@ -59,12 +66,19 @@ public enum ErrorNumber
|
||||
/// <summary>Is a directory (e.g.: trying to Read() a dir)</summary>
|
||||
IsDirectory = -21,
|
||||
/// <summary>Invalid argument</summary>
|
||||
InvalidArgument = -22, FileTableOverflow = -23, TooManyOpenFiles = -24, NotTypewriter = -25,
|
||||
InvalidArgument = -22, FileTableOverflow = -23,
|
||||
TooManyOpenFiles = -24,
|
||||
NotTypewriter = -25,
|
||||
TextFileBusy = -26,
|
||||
/// <summary>File is too large</summary>
|
||||
FileTooLarge = -27, NoSpaceLeft = -28, IllegalSeek = -29, ReadOnly = -30,
|
||||
TooManyLinks = -31, BrokenPipe = -32, OutOfDomain = -33,
|
||||
OutOfRange = -34, DeadlockWouldOccur = -35,
|
||||
FileTooLarge = -27, NoSpaceLeft = -28,
|
||||
IllegalSeek = -29,
|
||||
ReadOnly = -30,
|
||||
TooManyLinks = -31,
|
||||
BrokenPipe = -32,
|
||||
OutOfDomain = -33,
|
||||
OutOfRange = -34,
|
||||
DeadlockWouldOccur = -35,
|
||||
/// <summary>Name is too long</summary>
|
||||
NameTooLong = -36, NoLocksAvailable = -37,
|
||||
/// <summary>Not implemented</summary>
|
||||
@@ -78,15 +92,22 @@ public enum ErrorNumber
|
||||
/// <summary>Not supported</summary>
|
||||
NotSupported = -252, EPERM = NotPermitted,
|
||||
/// <summary>No such file or directory</summary>
|
||||
ENOENT = NoSuchFile, ESRCH = NoSuchProcess, EINTR = InterruptedSyscall,
|
||||
ENOENT = NoSuchFile, ESRCH = NoSuchProcess,
|
||||
EINTR = InterruptedSyscall,
|
||||
/// <summary>I/O error</summary>
|
||||
EIO = InOutError, ENXIO = NoSuchDeviceOrAddress, E2BIG = ArgumentListTooLong, ENOEXEC = ExecutableFormatError,
|
||||
EBADF = BadFileNumber, ECHILD = NoChildProcess, EAGAIN = TryAgain,
|
||||
EIO = InOutError, ENXIO = NoSuchDeviceOrAddress,
|
||||
E2BIG = ArgumentListTooLong,
|
||||
ENOEXEC = ExecutableFormatError,
|
||||
EBADF = BadFileNumber,
|
||||
ECHILD = NoChildProcess,
|
||||
EAGAIN = TryAgain,
|
||||
ENOMEM = OutOfMemory,
|
||||
/// <summary>Access denied</summary>
|
||||
EACCES = AccessDenied, EFAULT = BadAddress, ENOTBLK = NotABlockDevice,
|
||||
EACCES = AccessDenied, EFAULT = BadAddress,
|
||||
ENOTBLK = NotABlockDevice,
|
||||
/// <summary>Busy, cannot complete</summary>
|
||||
EBUSY = Busy, EEXIST = FileExists, EXDEV = CrossDeviceLink,
|
||||
EBUSY = Busy, EEXIST = FileExists,
|
||||
EXDEV = CrossDeviceLink,
|
||||
/// <summary>No such device</summary>
|
||||
ENODEV = NoSuchDevice,
|
||||
/// <summary>Is not a directory (e.g.: trying to ReadDir() a file)</summary>
|
||||
@@ -94,12 +115,19 @@ public enum ErrorNumber
|
||||
/// <summary>Is a directory (e.g.: trying to Read() a dir)</summary>
|
||||
EISDIR = IsDirectory,
|
||||
/// <summary>Invalid argument</summary>
|
||||
EINVAL = InvalidArgument, ENFILE = FileTableOverflow, EMFILE = TooManyOpenFiles, ENOTTY = NotTypewriter,
|
||||
EINVAL = InvalidArgument, ENFILE = FileTableOverflow,
|
||||
EMFILE = TooManyOpenFiles,
|
||||
ENOTTY = NotTypewriter,
|
||||
ETXTBSY = TextFileBusy,
|
||||
/// <summary>File is too large</summary>
|
||||
EFBIG = FileTooLarge, ENOSPC = NoSpaceLeft, ESPIPE = IllegalSeek, EROFS = ReadOnly,
|
||||
EMLINK = TooManyLinks, EPIPE = BrokenPipe, EDOM = OutOfDomain,
|
||||
ERANGE = OutOfRange, EDEADLK = DeadlockWouldOccur,
|
||||
EFBIG = FileTooLarge, ENOSPC = NoSpaceLeft,
|
||||
ESPIPE = IllegalSeek,
|
||||
EROFS = ReadOnly,
|
||||
EMLINK = TooManyLinks,
|
||||
EPIPE = BrokenPipe,
|
||||
EDOM = OutOfDomain,
|
||||
ERANGE = OutOfRange,
|
||||
EDEADLK = DeadlockWouldOccur,
|
||||
/// <summary>Name is too long</summary>
|
||||
ENAMETOOLONG = NameTooLong, ENOLCK = NoLocksAvailable,
|
||||
/// <summary>Not implemented</summary>
|
||||
@@ -107,7 +135,9 @@ public enum ErrorNumber
|
||||
/// <summary>Link is severed</summary>
|
||||
ENOLINK = SeveredLink,
|
||||
/// <summary>Not supported</summary>
|
||||
ENOTSUP = NotSupported, DirectoryNotEmpty = -39, TooManySymbolicLinks = -40, ENOTEMPTY = DirectoryNotEmpty,
|
||||
ENOTSUP = NotSupported, DirectoryNotEmpty = -39,
|
||||
TooManySymbolicLinks = -40,
|
||||
ENOTEMPTY = DirectoryNotEmpty,
|
||||
ELOOP = TooManySymbolicLinks,
|
||||
/// <summary>There is no such attribute</summary>
|
||||
ENOATTR = NoSuchExtendedAttribute,
|
||||
@@ -170,5 +200,6 @@ public enum ErrorNumber
|
||||
/// <summary>Cannot open device</summary>
|
||||
CannotOpenDevice = 27,
|
||||
/// <summary>Cannot remove the existing database</summary>
|
||||
CannotRemoveDatabase = 28, SectorNotFound = 29, NotOpened = 30
|
||||
CannotRemoveDatabase = 28, SectorNotFound = 29,
|
||||
NotOpened = 30
|
||||
}
|
||||
@@ -37,13 +37,15 @@
|
||||
// Copyright © 2020-2022 Rebecca Wallander
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Aaru.CommonTypes.Enums;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>Track (as partitioning element) types.</summary>
|
||||
public enum TrackType : byte
|
||||
{
|
||||
|
||||
119
Enums/Nes.cs
119
Enums/Nes.cs
@@ -2,58 +2,117 @@ namespace Aaru.CommonTypes.Enums;
|
||||
|
||||
public enum NesConsoleType : byte
|
||||
{
|
||||
Nes = 0, Vs = 1, Playchoice = 2,
|
||||
Nes = 0,
|
||||
Vs = 1,
|
||||
Playchoice = 2,
|
||||
Extended = 3
|
||||
}
|
||||
|
||||
public enum NesTimingMode : byte
|
||||
{
|
||||
RP2C02 = 0, RP2C07 = 1, Multiple = 2,
|
||||
RP2C02 = 0,
|
||||
RP2C07 = 1,
|
||||
Multiple = 2,
|
||||
UMC6527P = 3
|
||||
}
|
||||
|
||||
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,
|
||||
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
|
||||
}
|
||||
|
||||
public enum NesVsHardwareType : byte
|
||||
{
|
||||
Normal = 0, RBI = 1, TKO = 2,
|
||||
SuperXevious = 3, IceClimber = 4, Dual = 5,
|
||||
Normal = 0,
|
||||
RBI = 1,
|
||||
TKO = 2,
|
||||
SuperXevious = 3,
|
||||
IceClimber = 4,
|
||||
Dual = 5,
|
||||
RaidOnBungeling = 6
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
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
|
||||
}
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="byte" /></summary>
|
||||
public class ExtentsByte
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsByte
|
||||
Tuple<byte, byte> removeTwo = null;
|
||||
Tuple<byte, byte> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
|
||||
@@ -36,13 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Converts extents</summary>
|
||||
public static class ExtentsConverter
|
||||
{
|
||||
@@ -55,7 +54,7 @@ public static class ExtentsConverter
|
||||
return null;
|
||||
|
||||
Tuple<ulong, ulong>[] tuples = extents.ToArray();
|
||||
ExtentType[] array = new ExtentType[tuples.Length];
|
||||
var array = new ExtentType[tuples.Length];
|
||||
|
||||
for(ulong i = 0; i < (ulong)array.LongLength; i++)
|
||||
array[i] = new ExtentType
|
||||
@@ -75,8 +74,7 @@ public static class ExtentsConverter
|
||||
if(extents == null)
|
||||
return null;
|
||||
|
||||
List<Tuple<ulong, ulong>> tuples =
|
||||
extents.Select(extent => new Tuple<ulong, ulong>(extent.Start, extent.End)).ToList();
|
||||
var tuples = extents.Select(extent => new Tuple<ulong, ulong>(extent.Start, extent.End)).ToList();
|
||||
|
||||
return new ExtentsULong(tuples);
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="int" /></summary>
|
||||
public class ExtentsInt
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsInt
|
||||
Tuple<int, int> removeTwo = null;
|
||||
Tuple<int, int> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="long" /></summary>
|
||||
public class ExtentsLong
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsLong
|
||||
Tuple<long, long> removeTwo = null;
|
||||
Tuple<long, long> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="sbyte" /></summary>
|
||||
public class ExtentsSByte
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsSByte
|
||||
Tuple<sbyte, sbyte> removeTwo = null;
|
||||
Tuple<sbyte, sbyte> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
@@ -241,8 +241,7 @@ public class ExtentsSByte
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<sbyte, sbyte> extent in
|
||||
_backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
foreach(Tuple<sbyte, sbyte> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="short" /></summary>
|
||||
public class ExtentsShort
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsShort
|
||||
Tuple<short, short> removeTwo = null;
|
||||
Tuple<short, short> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
@@ -241,8 +241,7 @@ public class ExtentsShort
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<short, short> extent in
|
||||
_backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
foreach(Tuple<short, short> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="uint" /></summary>
|
||||
public class ExtentsUInt
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsUInt
|
||||
Tuple<uint, uint> removeTwo = null;
|
||||
Tuple<uint, uint> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="ulong" /></summary>
|
||||
public class ExtentsULong
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsULong
|
||||
Tuple<ulong, ulong> removeTwo = null;
|
||||
Tuple<ulong, ulong> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
@@ -241,8 +241,7 @@ public class ExtentsULong
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<ulong, ulong> extent in
|
||||
_backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
foreach(Tuple<ulong, ulong> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes.Extents;
|
||||
|
||||
/// <summary>Implements extents for <see cref="ushort" /></summary>
|
||||
public class ExtentsUShort
|
||||
{
|
||||
@@ -72,7 +72,7 @@ public class ExtentsUShort
|
||||
Tuple<ushort, ushort> removeTwo = null;
|
||||
Tuple<ushort, ushort> itemToAdd = null;
|
||||
|
||||
for(int i = 0; i < _backend.Count; i++)
|
||||
for(var i = 0; i < _backend.Count; i++)
|
||||
{
|
||||
// Already contained in an extent
|
||||
if(item >= _backend[i].Item1 &&
|
||||
@@ -241,8 +241,7 @@ public class ExtentsUShort
|
||||
{
|
||||
start = 0;
|
||||
|
||||
foreach(Tuple<ushort, ushort> extent in _backend.Where(extent => item >= extent.Item1 &&
|
||||
item <= extent.Item2))
|
||||
foreach(Tuple<ushort, ushort> extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2))
|
||||
{
|
||||
start = extent.Item1;
|
||||
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -45,8 +47,6 @@ using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
/// <summary>Manages the known filters</summary>
|
||||
public sealed class FiltersList
|
||||
{
|
||||
@@ -83,7 +83,6 @@ public sealed class FiltersList
|
||||
IFilter noFilter = null;
|
||||
|
||||
foreach(IFilter filter in Filters.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(filter.Id != new Guid("12345678-AAAA-BBBB-CCCC-123456789000"))
|
||||
@@ -104,7 +103,6 @@ public sealed class FiltersList
|
||||
{
|
||||
// Ignore and continue
|
||||
}
|
||||
}
|
||||
|
||||
if(!noFilter?.Identify(path) == true)
|
||||
return null;
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System.Linq;
|
||||
|
||||
/// <summary>Handles CHS geometries</summary>
|
||||
public static class Geometry
|
||||
{
|
||||
@@ -138,7 +138,7 @@ public static class Geometry
|
||||
/// <summary>Gets the geometry for a given media type</summary>
|
||||
/// <param name="mediaType">Media type</param>
|
||||
/// <returns>Geometry</returns>
|
||||
public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding
|
||||
, bool variableSectorsPerTrack, MediaType type) GetGeometry(MediaType mediaType) =>
|
||||
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();
|
||||
}
|
||||
@@ -31,15 +31,17 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
/// <summary>Supported archive features</summary>
|
||||
[Flags]
|
||||
public enum ArchiveSupportedFeature : uint
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Base interface for all images</summary>
|
||||
public interface IBaseImage
|
||||
{
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Base interface for all writable images</summary>
|
||||
public interface IBaseWritableImage : IBaseImage
|
||||
{
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Interface defining linear media (chips, game carts, etc) images</summary>
|
||||
public interface IByteAddressableImage : IBaseWritableImage
|
||||
{
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Interface to implement filesystem plugins.</summary>
|
||||
public interface IFilesystem
|
||||
{
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Defines a filter, that is, a transformation of the data from a file, like, for example, a compressor (e.g.
|
||||
/// GZIP), or a container (e.g. AppleDouble)
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is
|
||||
@@ -68,8 +68,7 @@ public interface IFloppyImage : IMediaImage
|
||||
/// <param name="head">Physical head (0-based).</param>
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
/// <param name="status">Status of request.</param>
|
||||
ErrorNumber ReadSector(ushort track, byte head, ushort sector, out FloppySectorStatus status,
|
||||
out byte[] buffer);
|
||||
ErrorNumber ReadSector(ushort track, byte head, ushort sector, out FloppySectorStatus status, out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a sector's tag.</summary>
|
||||
/// <returns>
|
||||
@@ -84,8 +83,8 @@ public interface IFloppyImage : IMediaImage
|
||||
/// <param name="sector">Logical sector ID.</param>
|
||||
/// <param name="status">Status of request.</param>
|
||||
/// <param name="tag">Sector tag</param>
|
||||
ErrorNumber ReadSectorTag(ushort track, byte head, ushort sector, out FloppySectorStatus status,
|
||||
SectorTagType tag, out byte[] buffer);
|
||||
ErrorNumber ReadSectorTag(ushort track, byte head, ushort sector, out FloppySectorStatus status, SectorTagType tag,
|
||||
out byte[] buffer);
|
||||
|
||||
/// <summary>Reads a whole track. It includes all gaps, address marks, sectors data, etc.</summary>
|
||||
/// <returns>The track data.</returns>
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
/// <summary>Abstract class to implement disk image reading plugins.</summary>
|
||||
public interface IMediaImage : IBaseImage
|
||||
{
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="IMediaImage" />
|
||||
/// <summary>Abstract class to implement disk image reading plugins.</summary>
|
||||
public interface IOpticalMediaImage : IMediaImage, IPartitionableMediaImage, IVerifiableSectorsImage
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Abstract class to implement partitioning schemes interpreting plugins.</summary>
|
||||
public interface IPartition
|
||||
{
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>Defines an image that can contain partitions</summary>
|
||||
public interface IPartitionableMediaImage
|
||||
{
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines a register of all known plugins</summary>
|
||||
public interface IPluginRegister
|
||||
{
|
||||
|
||||
@@ -37,14 +37,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Defines the interface to implement reading the contents of a filesystem</summary>
|
||||
public interface IReadOnlyFilesystem : IFilesystem
|
||||
|
||||
@@ -37,11 +37,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Defines an image that can store the information from streaming, digital, tapes</summary>
|
||||
public interface ITapeImage : IMediaImage
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>Defines an image that can verify the integrity of the sectors it contains</summary>
|
||||
public interface IVerifiableSectorsImage
|
||||
{
|
||||
|
||||
@@ -36,11 +36,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <inheritdoc cref="IWritableImage" />
|
||||
/// <summary>
|
||||
/// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using Aaru.CommonTypes.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Abstract class to implement disk image writing plugins. TODO: This interface is subject to change until
|
||||
/// notice.
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
/// <summary>Defines an image that is writable and can store an optical disc (CD, DVD, etc)</summary>
|
||||
public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage
|
||||
{
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
namespace Aaru.CommonTypes.Interfaces;
|
||||
|
||||
using Aaru.CommonTypes.Structs;
|
||||
|
||||
/// <summary>Defines an image that is writable and can store information about a streaming, digital, tape</summary>
|
||||
public interface IWritableTapeImage : ITapeImage, IWritableImage
|
||||
{
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Principal;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
/// <summary>Detects the underlying execution framework and operating system</summary>
|
||||
public static class DetectOS
|
||||
{
|
||||
@@ -218,7 +218,7 @@ public static class DetectOS
|
||||
/// <returns>Current operating system version</returns>
|
||||
public static string GetVersion()
|
||||
{
|
||||
string environ = Environment.OSVersion.Version.ToString();
|
||||
var environ = Environment.OSVersion.Version.ToString();
|
||||
|
||||
switch(GetRealPlatformID())
|
||||
{
|
||||
@@ -235,7 +235,7 @@ public static class DetectOS
|
||||
goto default;
|
||||
case PlatformID.Win32NT:
|
||||
// From Windows 8.1 the reported version is simply falsified...
|
||||
if((Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major >= 2) ||
|
||||
if(Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major >= 2 ||
|
||||
Environment.OSVersion.Version.Major > 6)
|
||||
return FileVersionInfo.
|
||||
GetVersionInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System),
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>Contains an arbitrary list of OSes, even if .NET does not run on them</summary>
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public enum PlatformID
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Runtime;
|
||||
|
||||
namespace Aaru.CommonTypes.Interop;
|
||||
|
||||
/// <summary>Gets our own, or the runtime's version</summary>
|
||||
public static class Version
|
||||
{
|
||||
|
||||
310
MediaType.cs
310
MediaType.cs
@@ -39,8 +39,6 @@
|
||||
// ReSharper disable InconsistentNaming
|
||||
// TODO: Rename contents
|
||||
|
||||
using System;
|
||||
|
||||
#pragma warning disable 1591
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
@@ -48,10 +46,16 @@ using System;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
|
||||
public enum MediaEncoding
|
||||
{
|
||||
Unknown, FM, MFM,
|
||||
M2FM, AppleGCR, CommodoreGCR
|
||||
Unknown,
|
||||
FM,
|
||||
MFM,
|
||||
M2FM,
|
||||
AppleGCR,
|
||||
CommodoreGCR
|
||||
}
|
||||
|
||||
/// <summary>Contains an enumeration of all known types of media.</summary>
|
||||
@@ -210,7 +214,9 @@ public enum MediaType : uint
|
||||
/// <summary>Pioneer LaserDisc</summary>
|
||||
LD = 80,
|
||||
/// <summary>Pioneer LaserDisc data</summary>
|
||||
LDROM = 81, LDROM2 = 82, LVROM = 83, MegaLD = 84,
|
||||
LDROM = 81, LDROM2 = 82,
|
||||
LVROM = 83,
|
||||
MegaLD = 84,
|
||||
/// <summary>Writable LaserDisc with support for component video</summary>
|
||||
CRVdisc = 85,
|
||||
#endregion LaserDisc based, types 80 to 89
|
||||
@@ -242,7 +248,8 @@ public enum MediaType : uint
|
||||
#endregion Plasmon UDO, types 100 to 109
|
||||
|
||||
#region Sony game media, types 110 to 129
|
||||
PlayStationMemoryCard = 110, PlayStationMemoryCard2 = 111,
|
||||
PlayStationMemoryCard = 110,
|
||||
PlayStationMemoryCard2 = 111,
|
||||
/// <summary>Sony PlayStation game CD</summary>
|
||||
PS1CD = 112,
|
||||
/// <summary>Sony PlayStation 2 game CD</summary>
|
||||
@@ -280,9 +287,14 @@ public enum MediaType : uint
|
||||
/// <summary>Sega/Yamaha Gigabyte Disc</summary>
|
||||
GDROM = 152,
|
||||
/// <summary>Sega/Yamaha recordable Gigabyte Disc</summary>
|
||||
GDR = 153, SegaCard = 154, MilCD = 155, MegaDriveCartridge = 156,
|
||||
_32XCartridge = 157, SegaPicoCartridge = 158, MasterSystemCartridge = 159,
|
||||
GameGearCartridge = 160, SegaSaturnCartridge = 161,
|
||||
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
|
||||
@@ -555,15 +567,25 @@ public enum MediaType : uint
|
||||
#endregion Apricot ACT standard floppy formats, type 309
|
||||
|
||||
#region OnStream ADR, types 310 to 319
|
||||
ADR2120 = 310, ADR260 = 311, ADR30 = 312,
|
||||
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,
|
||||
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
|
||||
@@ -572,10 +594,17 @@ public enum MediaType : uint
|
||||
Bernoulli = 340,
|
||||
/// <summary>Obsolete type for 5⅓" Bernoulli Box II disks</summary>
|
||||
[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,
|
||||
Bernoulli2 = 341, Ditto = 342,
|
||||
DittoMax = 343,
|
||||
Jaz = 344,
|
||||
Jaz2 = 345,
|
||||
PocketZip = 346,
|
||||
REV120 = 347,
|
||||
REV35 = 348,
|
||||
REV70 = 349,
|
||||
ZIP100 = 350,
|
||||
ZIP250 = 351,
|
||||
ZIP750 = 352,
|
||||
/// <summary>5⅓" Bernoulli Box II disk with 35Mb capacity</summary>
|
||||
Bernoulli35 = 353,
|
||||
/// <summary>5⅓" Bernoulli Box II disk with 44Mb capacity</summary>
|
||||
@@ -593,7 +622,9 @@ public enum MediaType : uint
|
||||
#endregion Iomega, types 340 to 359
|
||||
|
||||
#region Audio or video media, types 360 to 369
|
||||
CompactCassette = 360, Data8 = 361, MiniDV = 362,
|
||||
CompactCassette = 360,
|
||||
Data8 = 361,
|
||||
MiniDV = 362,
|
||||
/// <summary>D/CAS-25: Digital data on Compact Cassette form factor, special magnetic media, 9-track</summary>
|
||||
Dcas25 = 363,
|
||||
/// <summary>D/CAS-85: Digital data on Compact Cassette form factor, special magnetic media, 17-track</summary>
|
||||
@@ -603,34 +634,62 @@ public enum MediaType : uint
|
||||
#endregion Audio media, types 360 to 369
|
||||
|
||||
#region CompactFlash Association, types 370 to 379
|
||||
CFast = 370, CompactFlash = 371, CompactFlashType2 = 372,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
@@ -666,11 +725,19 @@ public enum MediaType : uint
|
||||
#endregion SyQuest, types 430 to 449
|
||||
|
||||
#region Nintendo, types 450 to 469
|
||||
FamicomGamePak = 450, GameBoyAdvanceGamePak = 451, GameBoyGamePak = 452,
|
||||
FamicomGamePak = 450,
|
||||
GameBoyAdvanceGamePak = 451,
|
||||
GameBoyGamePak = 452,
|
||||
/// <summary>Nintendo GameCube Optical Disc</summary>
|
||||
GOD = 453, N64DD = 454, N64GamePak = 455, NESGamePak = 456,
|
||||
Nintendo3DSGameCard = 457, NintendoDiskCard = 458, NintendoDSGameCard = 459,
|
||||
NintendoDSiGameCard = 460, SNESGamePak = 461, SNESGamePakUS = 462,
|
||||
GOD = 453, N64DD = 454,
|
||||
N64GamePak = 455,
|
||||
NESGamePak = 456,
|
||||
Nintendo3DSGameCard = 457,
|
||||
NintendoDiskCard = 458,
|
||||
NintendoDSGameCard = 459,
|
||||
NintendoDSiGameCard = 460,
|
||||
SNESGamePak = 461,
|
||||
SNESGamePakUS = 462,
|
||||
/// <summary>Nintendo Wii Optical Disc</summary>
|
||||
WOD = 463,
|
||||
/// <summary>Nintendo Wii U Optical Disc</summary>
|
||||
@@ -678,66 +745,121 @@ public enum MediaType : uint
|
||||
#endregion Nintendo, types 450 to 469
|
||||
|
||||
#region IBM Tapes, types 470 to 479
|
||||
IBM3470 = 470, IBM3480 = 471, IBM3490 = 472,
|
||||
IBM3490E = 473, IBM3592 = 474,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
VXA1 = 620,
|
||||
VXA2 = 621,
|
||||
VXA3 = 622,
|
||||
#endregion VXA, types 620 to 629
|
||||
|
||||
#region Magneto-optical, types 630 to 659
|
||||
@@ -804,27 +926,47 @@ public enum MediaType : uint
|
||||
#endregion Magneto-optical, types 630 to 659
|
||||
|
||||
#region Other floppy standards, types 660 to 689
|
||||
CompactFloppy = 660, DemiDiskette = 661,
|
||||
CompactFloppy = 660,
|
||||
DemiDiskette = 661,
|
||||
/// <summary>3.5", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169</summary>
|
||||
Floptical = 662, HiFD = 663, QuickDisk = 664, UHD144 = 665,
|
||||
VideoFloppy = 666, Wafer = 667, ZXMicrodrive = 668,
|
||||
Floptical = 662, HiFD = 663,
|
||||
QuickDisk = 664,
|
||||
UHD144 = 665,
|
||||
VideoFloppy = 666,
|
||||
Wafer = 667,
|
||||
ZXMicrodrive = 668,
|
||||
/// <summary>5.25", SS, DD, 77 tracks, 16 spt, 256 bytes/sector, MFM, 100 tpi, 300rpm</summary>
|
||||
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,
|
||||
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,
|
||||
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
|
||||
@@ -966,14 +1108,18 @@ public enum MediaType : uint
|
||||
#endregion DEC hard disks, types 700 to 729
|
||||
|
||||
#region Imation, types 730 to 739
|
||||
LS120 = 730, LS240 = 731, FD32MB = 732,
|
||||
LS120 = 730,
|
||||
LS240 = 731,
|
||||
FD32MB = 732,
|
||||
RDX = 733,
|
||||
/// <summary>Imation 320Gb RDX</summary>
|
||||
RDX320 = 734,
|
||||
#endregion Imation, types 730 to 739
|
||||
|
||||
#region VideoNow, types 740 to 749
|
||||
VideoNow = 740, VideoNowColor = 741, VideoNowXp = 742,
|
||||
VideoNow = 740,
|
||||
VideoNowColor = 741,
|
||||
VideoNowXp = 742,
|
||||
#endregion
|
||||
|
||||
#region Iomega, types 750 to 759
|
||||
@@ -986,7 +1132,9 @@ public enum MediaType : uint
|
||||
#endregion Iomega, types 750 to 759
|
||||
|
||||
#region Kodak, types 760 to 769
|
||||
KodakVerbatim3 = 760, KodakVerbatim6 = 761, KodakVerbatim12 = 762,
|
||||
KodakVerbatim3 = 760,
|
||||
KodakVerbatim6 = 761,
|
||||
KodakVerbatim12 = 762,
|
||||
#endregion Kodak, types 760 to 769
|
||||
|
||||
#region Sony and Panasonic Blu-ray derived, types 770 to 799
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using Aaru.Console;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the media type from an ATA (not ATAPI) device</summary>
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
/// <summary>Gets the media type from a real device</summary>
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
@@ -83,8 +83,7 @@ public static partial class MediaTypeFromDevice
|
||||
case 0x01:
|
||||
case 0x05:
|
||||
AaruConsole.DebugWriteLine("Media detection",
|
||||
"SCSI medium type is {0:X2}h, setting media type to CD-ROM.",
|
||||
mediumType);
|
||||
"SCSI medium type is {0:X2}h, setting media type to CD-ROM.", mediumType);
|
||||
|
||||
return MediaType.CDROM;
|
||||
case 0x02:
|
||||
@@ -96,14 +95,13 @@ public static partial class MediaTypeFromDevice
|
||||
return MediaType.CDDA;
|
||||
case 0x03:
|
||||
case 0x07:
|
||||
AaruConsole.DebugWriteLine("Media detection",
|
||||
"SCSI medium type is {0:X2}h, setting media type to CD+.", mediumType);
|
||||
AaruConsole.DebugWriteLine("Media detection", "SCSI medium type is {0:X2}h, setting media type to CD+.",
|
||||
mediumType);
|
||||
|
||||
return MediaType.CDPLUS;
|
||||
case 0x04:
|
||||
AaruConsole.DebugWriteLine("Media detection",
|
||||
"SCSI medium type is {0:X2}h, setting media type to Photo CD.",
|
||||
mediumType);
|
||||
"SCSI medium type is {0:X2}h, setting media type to Photo CD.", mediumType);
|
||||
|
||||
return MediaType.PCD;
|
||||
case 0x10:
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using Aaru.Console;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the device type from a SCSI Optical Device</summary>
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the media type from a SCSI Block Commands compliant device</summary>
|
||||
@@ -650,8 +650,7 @@ public static partial class MediaTypeFromDevice
|
||||
mediumType, blocks, blockSize);
|
||||
|
||||
return MediaType.PD650;
|
||||
case 1470500
|
||||
when model.ToLowerInvariant().StartsWith("zip", StringComparison.OrdinalIgnoreCase):
|
||||
case 1470500 when model.ToLowerInvariant().StartsWith("zip", StringComparison.OrdinalIgnoreCase):
|
||||
AaruConsole.DebugWriteLine("Media detection",
|
||||
"Drive manufacturer is IOMEGA, drive model is ZIP, media has 489532 blocks of 512 bytes, setting media type to 250Mb ZIP.");
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Tries to guess, from SCSI information, the media type of a device and/or its inserted media</summary>
|
||||
@@ -51,8 +51,7 @@ public static partial class MediaTypeFromDevice
|
||||
/// <param name="opticalDisc">Is media an optical disc?</param>
|
||||
/// <returns>The media type</returns>
|
||||
public static MediaType GetFromScsi(byte scsiPeripheralType, string vendor, string model, byte mediumType,
|
||||
byte densityCode, ulong blocks, uint blockSize, bool isUsb,
|
||||
bool opticalDisc)
|
||||
byte densityCode, ulong blocks, uint blockSize, bool isUsb, bool opticalDisc)
|
||||
{
|
||||
switch(scsiPeripheralType)
|
||||
{
|
||||
@@ -68,8 +67,7 @@ public static partial class MediaTypeFromDevice
|
||||
return GetFromSbc(vendor, model, mediumType, blocks, blockSize);
|
||||
|
||||
// Sequential access device
|
||||
case 0x01:
|
||||
return GetFromSsc(scsiPeripheralType, vendor, model, mediumType, densityCode, blocks, blockSize);
|
||||
case 0x01: return GetFromSsc(scsiPeripheralType, vendor, model, mediumType, densityCode, blocks, blockSize);
|
||||
|
||||
// Write-once device
|
||||
case 0x04:
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
public static partial class MediaTypeFromDevice
|
||||
{
|
||||
/// <summary>Gets the media type from an SCSI Streaming Commands compliant device</summary>
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
/// <summary>Describes CD reading offset</summary>
|
||||
public class CdOffset
|
||||
{
|
||||
|
||||
@@ -36,13 +36,7 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Xml.Serialization;
|
||||
using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
// This is obsolete
|
||||
#pragma warning disable 1591
|
||||
@@ -52,6 +46,14 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Xml.Serialization;
|
||||
using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
[Serializable, XmlRoot("DicDeviceReport", Namespace = "", IsNullable = false)]
|
||||
public class DeviceReport
|
||||
{
|
||||
|
||||
@@ -36,17 +36,7 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
// TODO: Re-enable CS1591 in this file
|
||||
#pragma warning disable 1591
|
||||
@@ -59,6 +49,18 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class DeviceReportV2
|
||||
{
|
||||
public DeviceReportV2() {}
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using Schemas;
|
||||
|
||||
#pragma warning disable 612
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
using Schemas;
|
||||
|
||||
/// <summary>Physical dimensions for media types</summary>
|
||||
public static class Dimensions
|
||||
{
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
/// <summary>Information that allows to resume a dump</summary>
|
||||
[Serializable, XmlRoot("DicResume", Namespace = "", IsNullable = false)]
|
||||
public class Resume
|
||||
|
||||
@@ -36,15 +36,17 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
|
||||
// ReSharper disable ClassNeverInstantiated.Global
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
/// <summary>Statistics</summary>
|
||||
[XmlRoot("DicStats", Namespace = "", IsNullable = false)]
|
||||
public class Stats
|
||||
|
||||
@@ -36,17 +36,17 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
using Aaru.CommonTypes.Interop;
|
||||
using Schemas;
|
||||
|
||||
namespace Aaru.CommonTypes.Metadata;
|
||||
|
||||
/// <summary>Manages Aaru's version for metadata</summary>
|
||||
public static class Version
|
||||
{
|
||||
/// <summary>Gets XML software type for the running version</summary>
|
||||
/// <returns>XML software type</returns>
|
||||
public static SoftwareType GetSoftwareType() => new SoftwareType
|
||||
public static SoftwareType GetSoftwareType() => new()
|
||||
{
|
||||
Name = "Aaru",
|
||||
OperatingSystem = DetectOS.GetRealPlatformID().ToString(),
|
||||
|
||||
@@ -36,10 +36,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
|
||||
/// <summary>Partition structure.</summary>
|
||||
public struct Partition : IEquatable<Partition>, IComparable<Partition>
|
||||
{
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.CommonTypes;
|
||||
|
||||
/// <summary>Contain all plugins (filesystem, partition and image)</summary>
|
||||
public class PluginBase
|
||||
{
|
||||
|
||||
@@ -36,6 +36,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -45,10 +51,6 @@ using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
// ReSharper disable UnusedMember.Global
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.ATA;
|
||||
|
||||
/// <summary>
|
||||
/// 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)
|
||||
@@ -108,10 +110,18 @@ public static class Identify
|
||||
/// <summary>MUST be set</summary>
|
||||
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,
|
||||
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
|
||||
/// <summary>Indicates a device specific minimum standby timer value</summary>
|
||||
@@ -264,7 +274,9 @@ public static class Identify
|
||||
/// <summary>MUST be set</summary>
|
||||
MustBeSet = 0x4000,
|
||||
#pragma warning disable 1591
|
||||
Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800,
|
||||
Reserved13 = 0x2000,
|
||||
Reserved12 = 0x1000,
|
||||
Reserved11 = 0x0800,
|
||||
Reserved10 = 0x0400,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>DSN feature set is supported</summary>
|
||||
@@ -332,11 +344,21 @@ public static class Identify
|
||||
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,
|
||||
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
|
||||
/// <summary>TRIM is supported</summary>
|
||||
Trim = 0x0001
|
||||
@@ -426,7 +448,9 @@ public static class Identify
|
||||
public enum MajorVersionBit : ushort
|
||||
{
|
||||
#pragma warning disable 1591
|
||||
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
|
||||
Reserved15 = 0x8000,
|
||||
Reserved14 = 0x4000,
|
||||
Reserved13 = 0x2000,
|
||||
Reserved12 = 0x1000,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>ACS-4</summary>
|
||||
@@ -477,7 +501,9 @@ public static class Identify
|
||||
/// <summary>Supports NCQ</summary>
|
||||
NCQ = 0x0100,
|
||||
#pragma warning disable 1591
|
||||
Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020,
|
||||
Reserved07 = 0x0080,
|
||||
Reserved06 = 0x0040,
|
||||
Reserved05 = 0x0020,
|
||||
Reserved04 = 0x0010,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>Supports SATA Gen. 3 Signaling Speed (6.0Gb/s)</summary>
|
||||
@@ -495,9 +521,15 @@ public static class Identify
|
||||
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,
|
||||
Reserved15 = 0x8000,
|
||||
Reserved14 = 0x4000,
|
||||
Reserved13 = 0x2000,
|
||||
Reserved12 = 0x1000,
|
||||
Reserved11 = 0x0800,
|
||||
Reserved10 = 0x0400,
|
||||
Reserved09 = 0x0200,
|
||||
Reserved08 = 0x0100,
|
||||
Reserved07 = 0x0080,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>Supports RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED</summary>
|
||||
FPDMAQ = 0x0040,
|
||||
@@ -524,9 +556,14 @@ public static class Identify
|
||||
public enum SATAFeaturesBit : ushort
|
||||
{
|
||||
#pragma warning disable 1591
|
||||
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
|
||||
Reserved12 = 0x1000, Reserved11 = 0x0800, Reserved10 = 0x0400,
|
||||
Reserved09 = 0x0200, Reserved08 = 0x0100,
|
||||
Reserved15 = 0x8000,
|
||||
Reserved14 = 0x4000,
|
||||
Reserved13 = 0x2000,
|
||||
Reserved12 = 0x1000,
|
||||
Reserved11 = 0x0800,
|
||||
Reserved10 = 0x0400,
|
||||
Reserved09 = 0x0200,
|
||||
Reserved08 = 0x0100,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>Supports NCQ autosense</summary>
|
||||
NCQAutoSense = 0x0080,
|
||||
@@ -555,9 +592,15 @@ public static class Identify
|
||||
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,
|
||||
Vendor15 = 0x8000,
|
||||
Vendor14 = 0x4000,
|
||||
Vendor13 = 0x2000,
|
||||
Vendor12 = 0x1000,
|
||||
Reserved11 = 0x0800,
|
||||
Reserved10 = 0x0400,
|
||||
Reserved09 = 0x0200,
|
||||
Reserved08 = 0x0100,
|
||||
Reserved07 = 0x0080,
|
||||
Reserved06 = 0x0040,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>SCT Command Transport Data Tables supported</summary>
|
||||
@@ -579,14 +622,19 @@ public static class Identify
|
||||
public enum SecurityStatusBit : ushort
|
||||
{
|
||||
#pragma warning disable 1591
|
||||
Reserved15 = 0x8000, Reserved14 = 0x4000, Reserved13 = 0x2000,
|
||||
Reserved12 = 0x1000, Reserved11 = 0x0800, Reserved10 = 0x0400,
|
||||
Reserved15 = 0x8000,
|
||||
Reserved14 = 0x4000,
|
||||
Reserved13 = 0x2000,
|
||||
Reserved12 = 0x1000,
|
||||
Reserved11 = 0x0800,
|
||||
Reserved10 = 0x0400,
|
||||
Reserved09 = 0x0200,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>Maximum security level</summary>
|
||||
Maximum = 0x0100,
|
||||
#pragma warning disable 1591
|
||||
Reserved07 = 0x0080, Reserved06 = 0x0040,
|
||||
Reserved07 = 0x0080,
|
||||
Reserved06 = 0x0040,
|
||||
#pragma warning restore 1591
|
||||
/// <summary>Supports enhanced security erase</summary>
|
||||
Enhanced = 0x0020,
|
||||
@@ -620,9 +668,14 @@ public static class Identify
|
||||
public enum TransferMode : byte
|
||||
{
|
||||
#pragma warning disable 1591
|
||||
Mode7 = 0x80, Mode6 = 0x40, Mode5 = 0x20,
|
||||
Mode4 = 0x10, Mode3 = 0x08, Mode2 = 0x04,
|
||||
Mode1 = 0x02, Mode0 = 0x01
|
||||
Mode7 = 0x80,
|
||||
Mode6 = 0x40,
|
||||
Mode5 = 0x20,
|
||||
Mode4 = 0x10,
|
||||
Mode3 = 0x08,
|
||||
Mode2 = 0x04,
|
||||
Mode1 = 0x02,
|
||||
Mode0 = 0x01
|
||||
#pragma warning restore 1591
|
||||
}
|
||||
|
||||
@@ -635,10 +688,18 @@ public static class Identify
|
||||
/// <summary>MUST be set</summary>
|
||||
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,
|
||||
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
|
||||
/// <summary>Trusted Computing feature set is supported</summary>
|
||||
@@ -1041,7 +1102,7 @@ public static class Identify
|
||||
ataId.WWN = DescrambleWWN(ataId.WWN);
|
||||
ataId.WWNExtension = DescrambleWWN(ataId.WWNExtension);
|
||||
|
||||
byte[] buf = new byte[512];
|
||||
var buf = new byte[512];
|
||||
IntPtr ptr = System.Runtime.InteropServices.Marshal.AllocHGlobal(512);
|
||||
System.Runtime.InteropServices.Marshal.StructureToPtr(ataId, ptr, false);
|
||||
System.Runtime.InteropServices.Marshal.Copy(ptr, buf, 0, 512);
|
||||
@@ -1066,7 +1127,7 @@ public static class Identify
|
||||
static ulong DescrambleWWN(ulong WWN)
|
||||
{
|
||||
byte[] qwb = BitConverter.GetBytes(WWN);
|
||||
byte[] qword = new byte[8];
|
||||
var qword = new byte[8];
|
||||
|
||||
qword[7] = qwb[1];
|
||||
qword[6] = qwb[0];
|
||||
@@ -1084,7 +1145,7 @@ public static class Identify
|
||||
{
|
||||
byte[] outbuf = buffer[offset + length - 1] != 0x00 ? new byte[length + 1] : new byte[length];
|
||||
|
||||
for(int i = 0; i < length; i += 2)
|
||||
for(var i = 0; i < length; i += 2)
|
||||
{
|
||||
outbuf[i] = buffer[offset + i + 1];
|
||||
outbuf[i + 1] = buffer[offset + i];
|
||||
@@ -1097,9 +1158,9 @@ public static class Identify
|
||||
|
||||
static byte[] ScrambleATAString(string str, int length)
|
||||
{
|
||||
byte[] buf = new byte[length];
|
||||
var buf = new byte[length];
|
||||
|
||||
for(int i = 0; i < length; i++)
|
||||
for(var i = 0; i < length; i++)
|
||||
buf[i] = 0x20;
|
||||
|
||||
if(str is null)
|
||||
@@ -1109,13 +1170,13 @@ public static class Identify
|
||||
|
||||
if(bytes.Length % 2 != 0)
|
||||
{
|
||||
byte[] tmp = new byte[bytes.Length + 1];
|
||||
var tmp = new byte[bytes.Length + 1];
|
||||
tmp[^1] = 0x20;
|
||||
Array.Copy(bytes, 0, tmp, 0, bytes.Length);
|
||||
bytes = tmp;
|
||||
}
|
||||
|
||||
for(int i = 0; i < bytes.Length; i += 2)
|
||||
for(var i = 0; i < bytes.Length; i += 2)
|
||||
{
|
||||
buf[i] = bytes[i + 1];
|
||||
buf[i + 1] = bytes[i];
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
/// <summary>List of known SCSI peripheral qualifiers</summary>
|
||||
public enum PeripheralQualifiers : byte
|
||||
{
|
||||
|
||||
@@ -36,13 +36,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Aaru.Console;
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
@@ -469,8 +469,8 @@ public struct Inquiry
|
||||
|
||||
decoded.VersionDescriptors = new ushort[descriptorsNo];
|
||||
|
||||
for(int i = 0; i < descriptorsNo; i++)
|
||||
decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + (i * 2));
|
||||
for(var i = 0; i < descriptorsNo; i++)
|
||||
decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + i * 2);
|
||||
}
|
||||
|
||||
if(SCSIInquiryResponse.Length >= 75 &&
|
||||
@@ -521,7 +521,7 @@ public struct Inquiry
|
||||
|
||||
Inquiry decoded = inq.Value;
|
||||
|
||||
byte[] buffer = new byte[512];
|
||||
var buffer = new byte[512];
|
||||
byte length = 0;
|
||||
|
||||
buffer[0] = (byte)(decoded.PeripheralQualifier << 5);
|
||||
@@ -747,10 +747,10 @@ public struct Inquiry
|
||||
|
||||
if(decoded.VersionDescriptors != null)
|
||||
{
|
||||
length = (byte)(58 + (decoded.VersionDescriptors.Length * 2));
|
||||
length = (byte)(58 + decoded.VersionDescriptors.Length * 2);
|
||||
|
||||
for(int i = 0; i < decoded.VersionDescriptors.Length; i++)
|
||||
Array.Copy(BitConverter.GetBytes(decoded.VersionDescriptors[i]), 0, buffer, 56 + (i * 2), 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)
|
||||
@@ -778,7 +778,7 @@ public struct Inquiry
|
||||
}
|
||||
|
||||
buffer[4] = length;
|
||||
byte[] dest = new byte[length];
|
||||
var dest = new byte[length];
|
||||
Array.Copy(buffer, 0, dest, 0, length);
|
||||
|
||||
return dest;
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||
|
||||
#region Mode Page 0x2A: CD-ROM capabilities page
|
||||
/// <summary>
|
||||
/// CD-ROM capabilities page Page code 0x2A 16 bytes in OB-U0077C 20 bytes in SFF-8020i 22 bytes in MMC-1 26 bytes
|
||||
@@ -263,14 +263,14 @@ public class ModePage_2A
|
||||
decoded.RotationControlSelected = (byte)(pageResponse[27] & 0x03);
|
||||
decoded.CurrentWriteSpeedSelected = (ushort)((pageResponse[28] << 8) + pageResponse[29]);
|
||||
|
||||
ushort descriptors = (ushort)((pageResponse.Length - 32) / 4);
|
||||
var descriptors = (ushort)((pageResponse.Length - 32) / 4);
|
||||
decoded.WriteSpeedPerformanceDescriptors = new ModePage_2A_WriteDescriptor[descriptors];
|
||||
|
||||
for(int i = 0; i < descriptors; i++)
|
||||
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)])
|
||||
RotationControl = (byte)(pageResponse[1 + 32 + i * 4] & 0x07),
|
||||
WriteSpeed = (ushort)((pageResponse[2 + 32 + i * 4] << 8) + pageResponse[3 + 32 + i * 4])
|
||||
};
|
||||
|
||||
return decoded;
|
||||
@@ -281,7 +281,7 @@ public class ModePage_2A
|
||||
/// <returns>Raw page 2Ah</returns>
|
||||
public static byte[] Encode(ModePage_2A decoded)
|
||||
{
|
||||
byte[] pageResponse = new byte[512];
|
||||
var pageResponse = new byte[512];
|
||||
byte length = 16;
|
||||
|
||||
pageResponse[0] = 0x2A;
|
||||
@@ -480,21 +480,20 @@ public class ModePage_2A
|
||||
{
|
||||
length = 32;
|
||||
|
||||
for(int i = 0; i < decoded.WriteSpeedPerformanceDescriptors.Length; i++)
|
||||
for(var i = 0; i < decoded.WriteSpeedPerformanceDescriptors.Length; i++)
|
||||
{
|
||||
length += 4;
|
||||
pageResponse[1 + 32 + (i * 4)] = decoded.WriteSpeedPerformanceDescriptors[i].RotationControl;
|
||||
pageResponse[1 + 32 + i * 4] = decoded.WriteSpeedPerformanceDescriptors[i].RotationControl;
|
||||
|
||||
pageResponse[2 + 32 + (i * 4)] =
|
||||
pageResponse[2 + 32 + i * 4] =
|
||||
(byte)((decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF00) >> 8);
|
||||
|
||||
pageResponse[3 + 32 + (i * 4)] =
|
||||
(byte)(decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF);
|
||||
pageResponse[3 + 32 + i * 4] = (byte)(decoded.WriteSpeedPerformanceDescriptors[i].WriteSpeed & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
pageResponse[1] = (byte)(length - 2);
|
||||
byte[] buf = new byte[length];
|
||||
var buf = new byte[length];
|
||||
Array.Copy(pageResponse, 0, buf, 0, length);
|
||||
|
||||
return buf;
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Structs;
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Aaru.CommonTypes.Structs;
|
||||
|
||||
/// <summary>File attributes.</summary>
|
||||
[Flags]
|
||||
public enum FileAttributes : ulong
|
||||
|
||||
@@ -36,14 +36,14 @@
|
||||
// Copyright © 2011-2022 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
namespace Aaru.CommonTypes.Structs;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
|
||||
namespace Aaru.CommonTypes.Structs;
|
||||
|
||||
/// <summary>Contains information about a dump image and its contents</summary>
|
||||
public struct ImageInfo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user