diff --git a/.editorconfig b/.editorconfig index 9181fe5..25aaa32 100644 --- a/.editorconfig +++ b/.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 \ No newline at end of file +[*.{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 diff --git a/Aaru.CommonTypes.csproj b/Aaru.CommonTypes.csproj index 7924b9b..ea9b864 100644 --- a/Aaru.CommonTypes.csproj +++ b/Aaru.CommonTypes.csproj @@ -1,175 +1,175 @@  - - Debug - AnyCPU - 2.0 - {F2B84194-26EB-4227-B1C5-6602517E85AE} - Library - Aaru.CommonTypes - Aaru.CommonTypes - $(Version) - false - true - 6.0.0-alpha8 - Claunia.com - Copyright © 2011-2022 Natalia Portillo - Aaru Data Preservation Suite - Aaru.CommonTypes - $(Version) - net6 - 10 - Contains common types defined by the Aaru Data Preservation Suite. - https://github.com/aaru-dps/ - MIT - https://github.com/aaru-dps/Aaru.CommonTypes - true - en-US - true - true - snupkg - Natalia Portillo <claunia@claunia.com> - true - - - $(Version)+{chash:8} - true - true - - - true - full - false - bin\Debug\net6 - DEBUG; - prompt - 4 - false - - - full - true - bin\Release\net6 - prompt - 4 - false - - - - Metadata/cicm.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LICENSE.MIT - - - - - - - - - - - - - - - - - - - - - - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono - /usr/lib/mono - /usr/local/lib/mono - - $(BaseFrameworkPathOverrideForMono)/4.0-api - $(BaseFrameworkPathOverrideForMono)/4.5-api - $(BaseFrameworkPathOverrideForMono)/4.5.1-api - $(BaseFrameworkPathOverrideForMono)/4.5.2-api - $(BaseFrameworkPathOverrideForMono)/4.6-api - $(BaseFrameworkPathOverrideForMono)/4.6.1-api - $(BaseFrameworkPathOverrideForMono)/4.6.2-api - $(BaseFrameworkPathOverrideForMono)/4.7-api - $(BaseFrameworkPathOverrideForMono)/4.7.1-api - true - - $(FrameworkPathOverride)/Facades;$(AssemblySearchPaths) - + + Debug + AnyCPU + 2.0 + {F2B84194-26EB-4227-B1C5-6602517E85AE} + Library + Aaru.CommonTypes + Aaru.CommonTypes + $(Version) + false + true + 6.0.0-alpha8 + Claunia.com + Copyright © 2011-2022 Natalia Portillo + Aaru Data Preservation Suite + Aaru.CommonTypes + $(Version) + net6 + 10 + Contains common types defined by the Aaru Data Preservation Suite. + https://github.com/aaru-dps/ + MIT + https://github.com/aaru-dps/Aaru.CommonTypes + true + en-US + true + true + snupkg + Natalia Portillo <claunia@claunia.com> + true + + + $(Version)+{chash:8} + true + true + + + true + full + false + bin\Debug\net6 + DEBUG; + prompt + 4 + false + + + full + true + bin\Release\net6 + prompt + 4 + false + + + + Metadata/cicm.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LICENSE.MIT + + + + + + + + + + + + + + + + + + + + + + /Library/Frameworks/Mono.framework/Versions/Current/lib/mono + /usr/lib/mono + /usr/local/lib/mono + + $(BaseFrameworkPathOverrideForMono)/4.0-api + $(BaseFrameworkPathOverrideForMono)/4.5-api + $(BaseFrameworkPathOverrideForMono)/4.5.1-api + $(BaseFrameworkPathOverrideForMono)/4.5.2-api + $(BaseFrameworkPathOverrideForMono)/4.6-api + $(BaseFrameworkPathOverrideForMono)/4.6.1-api + $(BaseFrameworkPathOverrideForMono)/4.6.2-api + $(BaseFrameworkPathOverrideForMono)/4.7-api + $(BaseFrameworkPathOverrideForMono)/4.7.1-api + true + + $(FrameworkPathOverride)/Facades;$(AssemblySearchPaths) + diff --git a/Enums/ErrorNumber.cs b/Enums/ErrorNumber.cs index a1a1f75..22335ac 100644 --- a/Enums/ErrorNumber.cs +++ b/Enums/ErrorNumber.cs @@ -43,15 +43,22 @@ public enum ErrorNumber { NotPermitted = -1, /// No such file or directory - NoSuchFile = -2, NoSuchProcess = -3, InterruptedSyscall = -4, + NoSuchFile = -2, NoSuchProcess = -3, + InterruptedSyscall = -4, /// I/O error - 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, /// Access denied - AccessDenied = -13, BadAddress = -14, NotABlockDevice = -15, + AccessDenied = -13, BadAddress = -14, + NotABlockDevice = -15, /// Busy, cannot complete - Busy = -16, FileExists = -17, CrossDeviceLink = -18, + Busy = -16, FileExists = -17, + CrossDeviceLink = -18, /// No such device NoSuchDevice = -19, /// Is not a directory (e.g.: trying to ReadDir() a file) @@ -59,12 +66,19 @@ public enum ErrorNumber /// Is a directory (e.g.: trying to Read() a dir) IsDirectory = -21, /// Invalid argument - InvalidArgument = -22, FileTableOverflow = -23, TooManyOpenFiles = -24, NotTypewriter = -25, + InvalidArgument = -22, FileTableOverflow = -23, + TooManyOpenFiles = -24, + NotTypewriter = -25, TextFileBusy = -26, /// File is too large - 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, /// Name is too long NameTooLong = -36, NoLocksAvailable = -37, /// Not implemented @@ -78,15 +92,22 @@ public enum ErrorNumber /// Not supported NotSupported = -252, EPERM = NotPermitted, /// No such file or directory - ENOENT = NoSuchFile, ESRCH = NoSuchProcess, EINTR = InterruptedSyscall, + ENOENT = NoSuchFile, ESRCH = NoSuchProcess, + EINTR = InterruptedSyscall, /// I/O error - 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, /// Access denied - EACCES = AccessDenied, EFAULT = BadAddress, ENOTBLK = NotABlockDevice, + EACCES = AccessDenied, EFAULT = BadAddress, + ENOTBLK = NotABlockDevice, /// Busy, cannot complete - EBUSY = Busy, EEXIST = FileExists, EXDEV = CrossDeviceLink, + EBUSY = Busy, EEXIST = FileExists, + EXDEV = CrossDeviceLink, /// No such device ENODEV = NoSuchDevice, /// Is not a directory (e.g.: trying to ReadDir() a file) @@ -94,12 +115,19 @@ public enum ErrorNumber /// Is a directory (e.g.: trying to Read() a dir) EISDIR = IsDirectory, /// Invalid argument - EINVAL = InvalidArgument, ENFILE = FileTableOverflow, EMFILE = TooManyOpenFiles, ENOTTY = NotTypewriter, + EINVAL = InvalidArgument, ENFILE = FileTableOverflow, + EMFILE = TooManyOpenFiles, + ENOTTY = NotTypewriter, ETXTBSY = TextFileBusy, /// File is too large - 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, /// Name is too long ENAMETOOLONG = NameTooLong, ENOLCK = NoLocksAvailable, /// Not implemented @@ -107,7 +135,9 @@ public enum ErrorNumber /// Link is severed ENOLINK = SeveredLink, /// Not supported - ENOTSUP = NotSupported, DirectoryNotEmpty = -39, TooManySymbolicLinks = -40, ENOTEMPTY = DirectoryNotEmpty, + ENOTSUP = NotSupported, DirectoryNotEmpty = -39, + TooManySymbolicLinks = -40, + ENOTEMPTY = DirectoryNotEmpty, ELOOP = TooManySymbolicLinks, /// There is no such attribute ENOATTR = NoSuchExtendedAttribute, @@ -170,5 +200,6 @@ public enum ErrorNumber /// Cannot open device CannotOpenDevice = 27, /// Cannot remove the existing database - CannotRemoveDatabase = 28, SectorNotFound = 29, NotOpened = 30 + CannotRemoveDatabase = 28, SectorNotFound = 29, + NotOpened = 30 } \ No newline at end of file diff --git a/Enums/Images.cs b/Enums/Images.cs index 0fdbd4d..24294e4 100644 --- a/Enums/Images.cs +++ b/Enums/Images.cs @@ -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; + /// Track (as partitioning element) types. public enum TrackType : byte { @@ -421,5 +423,5 @@ public enum LinearMemoryType /// Read-write volatile memory for character CharacterRAM = 12, /// Trainer, or hack - Trainer = 13 + Trainer = 13 } \ No newline at end of file diff --git a/Enums/Nes.cs b/Enums/Nes.cs index 5d5022c..e96c3c0 100644 --- a/Enums/Nes.cs +++ b/Enums/Nes.cs @@ -2,58 +2,117 @@ namespace Aaru.CommonTypes.Enums; public enum NesConsoleType : byte { - Nes = 0, Vs = 1, Playchoice = 2, - Extended = 3 + 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 } \ No newline at end of file diff --git a/Extents/ExtentsByte.cs b/Extents/ExtentsByte.cs index cb388b9..dba965a 100644 --- a/Extents/ExtentsByte.cs +++ b/Extents/ExtentsByte.cs @@ -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; - /// Implements extents for public class ExtentsByte { @@ -72,7 +72,7 @@ public class ExtentsByte Tuple removeTwo = null; Tuple 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 && diff --git a/Extents/ExtentsConverter.cs b/Extents/ExtentsConverter.cs index f3a3ad7..0c2be46 100644 --- a/Extents/ExtentsConverter.cs +++ b/Extents/ExtentsConverter.cs @@ -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; - /// Converts extents public static class ExtentsConverter { @@ -55,7 +54,7 @@ public static class ExtentsConverter return null; Tuple[] 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> tuples = - extents.Select(extent => new Tuple(extent.Start, extent.End)).ToList(); + var tuples = extents.Select(extent => new Tuple(extent.Start, extent.End)).ToList(); return new ExtentsULong(tuples); } diff --git a/Extents/ExtentsInt.cs b/Extents/ExtentsInt.cs index 0b5ed01..9b4ef21 100644 --- a/Extents/ExtentsInt.cs +++ b/Extents/ExtentsInt.cs @@ -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; - /// Implements extents for public class ExtentsInt { @@ -72,7 +72,7 @@ public class ExtentsInt Tuple removeTwo = null; Tuple 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 && diff --git a/Extents/ExtentsLong.cs b/Extents/ExtentsLong.cs index 0b8be72..219a6d0 100644 --- a/Extents/ExtentsLong.cs +++ b/Extents/ExtentsLong.cs @@ -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; - /// Implements extents for public class ExtentsLong { @@ -72,7 +72,7 @@ public class ExtentsLong Tuple removeTwo = null; Tuple 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 && diff --git a/Extents/ExtentsSByte.cs b/Extents/ExtentsSByte.cs index 9bf246e..75fb71a 100644 --- a/Extents/ExtentsSByte.cs +++ b/Extents/ExtentsSByte.cs @@ -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; - /// Implements extents for public class ExtentsSByte { @@ -72,7 +72,7 @@ public class ExtentsSByte Tuple removeTwo = null; Tuple 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 extent in - _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) { start = extent.Item1; diff --git a/Extents/ExtentsShort.cs b/Extents/ExtentsShort.cs index 086d7e4..a77b150 100644 --- a/Extents/ExtentsShort.cs +++ b/Extents/ExtentsShort.cs @@ -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; - /// Implements extents for public class ExtentsShort { @@ -72,7 +72,7 @@ public class ExtentsShort Tuple removeTwo = null; Tuple 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 extent in - _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) { start = extent.Item1; diff --git a/Extents/ExtentsUInt.cs b/Extents/ExtentsUInt.cs index 0f8c800..3f9649d 100644 --- a/Extents/ExtentsUInt.cs +++ b/Extents/ExtentsUInt.cs @@ -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; - /// Implements extents for public class ExtentsUInt { @@ -72,7 +72,7 @@ public class ExtentsUInt Tuple removeTwo = null; Tuple 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 && diff --git a/Extents/ExtentsULong.cs b/Extents/ExtentsULong.cs index 1d0e12c..d7cbc35 100644 --- a/Extents/ExtentsULong.cs +++ b/Extents/ExtentsULong.cs @@ -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; - /// Implements extents for public class ExtentsULong { @@ -72,7 +72,7 @@ public class ExtentsULong Tuple removeTwo = null; Tuple 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 extent in - _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) { start = extent.Item1; diff --git a/Extents/ExtentsUShort.cs b/Extents/ExtentsUShort.cs index f944d57..298f23f 100644 --- a/Extents/ExtentsUShort.cs +++ b/Extents/ExtentsUShort.cs @@ -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; - /// Implements extents for public class ExtentsUShort { @@ -72,7 +72,7 @@ public class ExtentsUShort Tuple removeTwo = null; Tuple 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 extent in _backend.Where(extent => item >= extent.Item1 && - item <= extent.Item2)) + foreach(Tuple extent in _backend.Where(extent => item >= extent.Item1 && item <= extent.Item2)) { start = extent.Item1; diff --git a/Filters.cs b/Filters.cs index ca7bd1c..43c91c6 100644 --- a/Filters.cs +++ b/Filters.cs @@ -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; - /// Manages the known filters 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; diff --git a/Geometry.cs b/Geometry.cs index eb43827..4ad0df3 100644 --- a/Geometry.cs +++ b/Geometry.cs @@ -36,10 +36,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using System.Linq; - namespace Aaru.CommonTypes; +using System.Linq; + /// Handles CHS geometries public static class Geometry { @@ -138,7 +138,7 @@ public static class Geometry /// Gets the geometry for a given media type /// Media type /// Geometry - public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding - , bool variableSectorsPerTrack, MediaType type) GetGeometry(MediaType mediaType) => + public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding, + bool variableSectorsPerTrack, MediaType type) GetGeometry(MediaType mediaType) => (from geom in KnownGeometries where geom.type == mediaType select geom).FirstOrDefault(); } \ No newline at end of file diff --git a/Interfaces/IArchive.cs b/Interfaces/IArchive.cs index 79c2c53..6aff725 100644 --- a/Interfaces/IArchive.cs +++ b/Interfaces/IArchive.cs @@ -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; + /// Supported archive features [Flags] public enum ArchiveSupportedFeature : uint diff --git a/Interfaces/IBaseImage.cs b/Interfaces/IBaseImage.cs index 7f0d12c..d647c21 100644 --- a/Interfaces/IBaseImage.cs +++ b/Interfaces/IBaseImage.cs @@ -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; - /// Base interface for all images public interface IBaseImage { diff --git a/Interfaces/IBaseWritableImage.cs b/Interfaces/IBaseWritableImage.cs index 5554f8c..3f7ffcb 100644 --- a/Interfaces/IBaseWritableImage.cs +++ b/Interfaces/IBaseWritableImage.cs @@ -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; - /// Base interface for all writable images public interface IBaseWritableImage : IBaseImage { diff --git a/Interfaces/IByteAddressableImage.cs b/Interfaces/IByteAddressableImage.cs index 464cedd..ab91562 100644 --- a/Interfaces/IByteAddressableImage.cs +++ b/Interfaces/IByteAddressableImage.cs @@ -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; - /// Interface defining linear media (chips, game carts, etc) images public interface IByteAddressableImage : IBaseWritableImage { diff --git a/Interfaces/IFilesystem.cs b/Interfaces/IFilesystem.cs index 5bcd46d..0536a0b 100644 --- a/Interfaces/IFilesystem.cs +++ b/Interfaces/IFilesystem.cs @@ -36,12 +36,12 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ +namespace Aaru.CommonTypes.Interfaces; + using System; using System.Text; using Schemas; -namespace Aaru.CommonTypes.Interfaces; - /// Interface to implement filesystem plugins. public interface IFilesystem { diff --git a/Interfaces/IFilter.cs b/Interfaces/IFilter.cs index fc3bbfb..8006aae 100644 --- a/Interfaces/IFilter.cs +++ b/Interfaces/IFilter.cs @@ -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; - /// /// 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) diff --git a/Interfaces/IFloppyImage.cs b/Interfaces/IFloppyImage.cs index 164c7d9..f3627b7 100644 --- a/Interfaces/IFloppyImage.cs +++ b/Interfaces/IFloppyImage.cs @@ -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; - /// /// /// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is @@ -68,8 +68,7 @@ public interface IFloppyImage : IMediaImage /// Physical head (0-based). /// Logical sector ID. /// Status of request. - 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); /// Reads a sector's tag. /// @@ -84,8 +83,8 @@ public interface IFloppyImage : IMediaImage /// Logical sector ID. /// Status of request. /// Sector tag - 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); /// Reads a whole track. It includes all gaps, address marks, sectors data, etc. /// The track data. diff --git a/Interfaces/IMediaImage.cs b/Interfaces/IMediaImage.cs index c03a0fd..45d7cd5 100644 --- a/Interfaces/IMediaImage.cs +++ b/Interfaces/IMediaImage.cs @@ -37,10 +37,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using Aaru.CommonTypes.Enums; - namespace Aaru.CommonTypes.Interfaces; +using Aaru.CommonTypes.Enums; + /// Abstract class to implement disk image reading plugins. public interface IMediaImage : IBaseImage { diff --git a/Interfaces/IOpticalMediaImage.cs b/Interfaces/IOpticalMediaImage.cs index 617045f..9a567f1 100644 --- a/Interfaces/IOpticalMediaImage.cs +++ b/Interfaces/IOpticalMediaImage.cs @@ -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; - /// /// Abstract class to implement disk image reading plugins. public interface IOpticalMediaImage : IMediaImage, IPartitionableMediaImage, IVerifiableSectorsImage diff --git a/Interfaces/IPartition.cs b/Interfaces/IPartition.cs index c1eb4fa..c4916e3 100644 --- a/Interfaces/IPartition.cs +++ b/Interfaces/IPartition.cs @@ -37,11 +37,11 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ +namespace Aaru.CommonTypes.Interfaces; + using System; using System.Collections.Generic; -namespace Aaru.CommonTypes.Interfaces; - /// Abstract class to implement partitioning schemes interpreting plugins. public interface IPartition { diff --git a/Interfaces/IPartitionableMediaImage.cs b/Interfaces/IPartitionableMediaImage.cs index f4529bf..5be9986 100644 --- a/Interfaces/IPartitionableMediaImage.cs +++ b/Interfaces/IPartitionableMediaImage.cs @@ -37,10 +37,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using System.Collections.Generic; - namespace Aaru.CommonTypes.Interfaces; +using System.Collections.Generic; + /// Defines an image that can contain partitions public interface IPartitionableMediaImage { diff --git a/Interfaces/IPluginRegister.cs b/Interfaces/IPluginRegister.cs index d27ab29..c3ec271 100644 --- a/Interfaces/IPluginRegister.cs +++ b/Interfaces/IPluginRegister.cs @@ -36,11 +36,11 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ +namespace Aaru.CommonTypes.Interfaces; + using System; using System.Collections.Generic; -namespace Aaru.CommonTypes.Interfaces; - /// Defines a register of all known plugins public interface IPluginRegister { diff --git a/Interfaces/IReadOnlyFilesystem.cs b/Interfaces/IReadOnlyFilesystem.cs index c8c526a..0c776e4 100644 --- a/Interfaces/IReadOnlyFilesystem.cs +++ b/Interfaces/IReadOnlyFilesystem.cs @@ -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; - /// /// Defines the interface to implement reading the contents of a filesystem public interface IReadOnlyFilesystem : IFilesystem diff --git a/Interfaces/ITapeImage.cs b/Interfaces/ITapeImage.cs index 028cc64..ed1138e 100644 --- a/Interfaces/ITapeImage.cs +++ b/Interfaces/ITapeImage.cs @@ -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; - /// /// Defines an image that can store the information from streaming, digital, tapes public interface ITapeImage : IMediaImage diff --git a/Interfaces/IVerifiableSectorsImage.cs b/Interfaces/IVerifiableSectorsImage.cs index 0b46701..2f83470 100644 --- a/Interfaces/IVerifiableSectorsImage.cs +++ b/Interfaces/IVerifiableSectorsImage.cs @@ -37,10 +37,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using System.Collections.Generic; - namespace Aaru.CommonTypes.Interfaces; +using System.Collections.Generic; + /// Defines an image that can verify the integrity of the sectors it contains public interface IVerifiableSectorsImage { diff --git a/Interfaces/IWritableFloppyImage.cs b/Interfaces/IWritableFloppyImage.cs index ca8b270..0c16c63 100644 --- a/Interfaces/IWritableFloppyImage.cs +++ b/Interfaces/IWritableFloppyImage.cs @@ -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; - /// /// /// Abstract class to implement disk image reading plugins that can contain floppy images. This interface is diff --git a/Interfaces/IWritableImage.cs b/Interfaces/IWritableImage.cs index b632790..b55bf7c 100644 --- a/Interfaces/IWritableImage.cs +++ b/Interfaces/IWritableImage.cs @@ -36,10 +36,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using Aaru.CommonTypes.Enums; - namespace Aaru.CommonTypes.Interfaces; +using Aaru.CommonTypes.Enums; + /// /// Abstract class to implement disk image writing plugins. TODO: This interface is subject to change until /// notice. diff --git a/Interfaces/IWritableOpticalImage.cs b/Interfaces/IWritableOpticalImage.cs index d22f30a..81d1d98 100644 --- a/Interfaces/IWritableOpticalImage.cs +++ b/Interfaces/IWritableOpticalImage.cs @@ -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; - /// Defines an image that is writable and can store an optical disc (CD, DVD, etc) public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage { diff --git a/Interfaces/IWritableTapeImage.cs b/Interfaces/IWritableTapeImage.cs index d3f0b5a..fe0d328 100644 --- a/Interfaces/IWritableTapeImage.cs +++ b/Interfaces/IWritableTapeImage.cs @@ -37,10 +37,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using Aaru.CommonTypes.Structs; - namespace Aaru.CommonTypes.Interfaces; +using Aaru.CommonTypes.Structs; + /// Defines an image that is writable and can store information about a streaming, digital, tape public interface IWritableTapeImage : ITapeImage, IWritableImage { diff --git a/Interop/DetectOS.cs b/Interop/DetectOS.cs index efc2475..a0f28a5 100644 --- a/Interop/DetectOS.cs +++ b/Interop/DetectOS.cs @@ -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; - /// Detects the underlying execution framework and operating system public static class DetectOS { @@ -218,7 +218,7 @@ public static class DetectOS /// Current operating system version 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), diff --git a/Interop/PlatformID.cs b/Interop/PlatformID.cs index f9e4e2f..f5d1f13 100644 --- a/Interop/PlatformID.cs +++ b/Interop/PlatformID.cs @@ -36,10 +36,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using System.Diagnostics.CodeAnalysis; - namespace Aaru.CommonTypes.Interop; +using System.Diagnostics.CodeAnalysis; + /// Contains an arbitrary list of OSes, even if .NET does not run on them [SuppressMessage("ReSharper", "InconsistentNaming")] public enum PlatformID diff --git a/Interop/Version.cs b/Interop/Version.cs index 4ef6b54..ad4441b 100644 --- a/Interop/Version.cs +++ b/Interop/Version.cs @@ -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; - /// Gets our own, or the runtime's version public static class Version { diff --git a/MediaType.cs b/MediaType.cs index 7c5d5c6..788b30b 100644 --- a/MediaType.cs +++ b/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 } /// Contains an enumeration of all known types of media. @@ -210,7 +214,9 @@ public enum MediaType : uint /// Pioneer LaserDisc LD = 80, /// Pioneer LaserDisc data - LDROM = 81, LDROM2 = 82, LVROM = 83, MegaLD = 84, + LDROM = 81, LDROM2 = 82, + LVROM = 83, + MegaLD = 84, /// Writable LaserDisc with support for component video 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, /// Sony PlayStation game CD PS1CD = 112, /// Sony PlayStation 2 game CD @@ -280,9 +287,14 @@ public enum MediaType : uint /// Sega/Yamaha Gigabyte Disc GDROM = 152, /// Sega/Yamaha recordable Gigabyte Disc - GDR = 153, SegaCard = 154, MilCD = 155, MegaDriveCartridge = 156, - _32XCartridge = 157, SegaPicoCartridge = 158, MasterSystemCartridge = 159, - GameGearCartridge = 160, SegaSaturnCartridge = 161, + 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, /// Obsolete type for 5⅓" Bernoulli Box II disks [Obsolete] - Bernoulli2 = 341, Ditto = 342, DittoMax = 343, Jaz = 344, - Jaz2 = 345, PocketZip = 346, REV120 = 347, - REV35 = 348, REV70 = 349, ZIP100 = 350, - ZIP250 = 351, ZIP750 = 352, + Bernoulli2 = 341, Ditto = 342, + DittoMax = 343, + Jaz = 344, + Jaz2 = 345, + PocketZip = 346, + REV120 = 347, + REV35 = 348, + REV70 = 349, + ZIP100 = 350, + ZIP250 = 351, + ZIP750 = 352, /// 5⅓" Bernoulli Box II disk with 35Mb capacity Bernoulli35 = 353, /// 5⅓" Bernoulli Box II disk with 44Mb capacity @@ -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, /// D/CAS-25: Digital data on Compact Cassette form factor, special magnetic media, 9-track Dcas25 = 363, /// D/CAS-85: Digital data on Compact Cassette form factor, special magnetic media, 17-track @@ -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, - VStapeI = 399, + CompactTapeI = 390, + CompactTapeII = 391, + DECtapeII = 392, + DLTtapeIII = 393, + DLTtapeIIIxt = 394, + DLTtapeIV = 395, + DLTtapeS4 = 396, + SDLT1 = 397, + SDLT2 = 398, + VStapeI = 399, #endregion DEC, types 390 to 399 #region Exatape, types 400 to 419 - Exatape15m = 400, Exatape22m = 401, Exatape22mAME = 402, - Exatape28m = 403, Exatape40m = 404, Exatape45m = 405, - Exatape54m = 406, Exatape75m = 407, Exatape76m = 408, - Exatape80m = 409, Exatape106m = 410, Exatape160mXL = 411, - Exatape112m = 412, Exatape125m = 413, Exatape150m = 414, - Exatape170m = 415, Exatape225m = 416, + 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, /// Nintendo GameCube Optical Disc - 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, /// Nintendo Wii Optical Disc WOD = 463, /// Nintendo Wii U Optical Disc @@ -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, /// 3.5", 652 tracks, 2 sides, 512 bytes/sector, Floptical, ECMA-207, ISO 14169 - Floptical = 662, HiFD = 663, QuickDisk = 664, UHD144 = 665, - VideoFloppy = 666, Wafer = 667, ZXMicrodrive = 668, + Floptical = 662, HiFD = 663, + QuickDisk = 664, + UHD144 = 665, + VideoFloppy = 666, + Wafer = 667, + ZXMicrodrive = 668, /// 5.25", SS, DD, 77 tracks, 16 spt, 256 bytes/sector, MFM, 100 tpi, 300rpm MetaFloppy_Mod_II = 669, #endregion Other floppy standards, types 660 to 669 #region Miscellaneous, types 670 to 689 - BeeCard = 670, Borsu = 671, DataStore = 672, - DIR = 673, DST = 674, DTF = 675, - DTF2 = 676, Flextra3020 = 677, Flextra3225 = 678, - HiTC1 = 679, HiTC2 = 680, LT1 = 681, - MiniCard = 872, Orb = 683, Orb5 = 684, - SmartMedia = 685, xD = 686, XQD = 687, - DataPlay = 688, + 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, - RDX = 733, + LS120 = 730, + LS240 = 731, + FD32MB = 732, + RDX = 733, /// Imation 320Gb RDX RDX320 = 734, #endregion Imation, types 730 to 739 #region VideoNow, types 740 to 749 - VideoNow = 740, VideoNowColor = 741, VideoNowXp = 742, + 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 @@ -1044,6 +1192,6 @@ public enum MediaType : uint MetaFloppy_Mod_I = 820, #endregion - AtariLynxCard = 821, + AtariLynxCard = 821, AtariJaguarCartridge = 822 } \ No newline at end of file diff --git a/MediaTypeFromDevice/FromAta.cs b/MediaTypeFromDevice/FromAta.cs index 564ca3e..aa067e2 100644 --- a/MediaTypeFromDevice/FromAta.cs +++ b/MediaTypeFromDevice/FromAta.cs @@ -32,10 +32,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using Aaru.Console; - namespace Aaru.CommonTypes; +using Aaru.Console; + public static partial class MediaTypeFromDevice { /// Gets the media type from an ATA (not ATAPI) device diff --git a/MediaTypeFromDevice/FromMmc.cs b/MediaTypeFromDevice/FromMmc.cs index 33f0cf7..dab547b 100644 --- a/MediaTypeFromDevice/FromMmc.cs +++ b/MediaTypeFromDevice/FromMmc.cs @@ -32,11 +32,11 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ +namespace Aaru.CommonTypes; + using System; using Aaru.Console; -namespace Aaru.CommonTypes; - /// Gets the media type from a real device 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: diff --git a/MediaTypeFromDevice/FromOdc.cs b/MediaTypeFromDevice/FromOdc.cs index 80be560..c1f07bf 100644 --- a/MediaTypeFromDevice/FromOdc.cs +++ b/MediaTypeFromDevice/FromOdc.cs @@ -32,10 +32,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using Aaru.Console; - namespace Aaru.CommonTypes; +using Aaru.Console; + public static partial class MediaTypeFromDevice { /// Gets the device type from a SCSI Optical Device diff --git a/MediaTypeFromDevice/FromSbc.cs b/MediaTypeFromDevice/FromSbc.cs index aa01a57..9d2c89d 100644 --- a/MediaTypeFromDevice/FromSbc.cs +++ b/MediaTypeFromDevice/FromSbc.cs @@ -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 { /// Gets the media type from a SCSI Block Commands compliant device @@ -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."); diff --git a/MediaTypeFromDevice/FromScsi.cs b/MediaTypeFromDevice/FromScsi.cs index ff44187..b865b22 100644 --- a/MediaTypeFromDevice/FromScsi.cs +++ b/MediaTypeFromDevice/FromScsi.cs @@ -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 { /// Tries to guess, from SCSI information, the media type of a device and/or its inserted media @@ -51,8 +51,7 @@ public static partial class MediaTypeFromDevice /// Is media an optical disc? /// The media type public static MediaType GetFromScsi(byte scsiPeripheralType, string vendor, string model, byte mediumType, - byte densityCode, ulong blocks, uint blockSize, bool isUsb, - bool opticalDisc) + 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: diff --git a/MediaTypeFromDevice/FromSsc.cs b/MediaTypeFromDevice/FromSsc.cs index fd1838f..c36a8f8 100644 --- a/MediaTypeFromDevice/FromSsc.cs +++ b/MediaTypeFromDevice/FromSsc.cs @@ -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 { /// Gets the media type from an SCSI Streaming Commands compliant device diff --git a/Metadata/CdOffset.cs b/Metadata/CdOffset.cs index 53887c9..6f73773 100644 --- a/Metadata/CdOffset.cs +++ b/Metadata/CdOffset.cs @@ -36,10 +36,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using System.ComponentModel.DataAnnotations; - namespace Aaru.CommonTypes.Metadata; +using System.ComponentModel.DataAnnotations; + /// Describes CD reading offset public class CdOffset { diff --git a/Metadata/DeviceReport.cs b/Metadata/DeviceReport.cs index 3d24303..7b4448a 100644 --- a/Metadata/DeviceReport.cs +++ b/Metadata/DeviceReport.cs @@ -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 { diff --git a/Metadata/DeviceReportV2.cs b/Metadata/DeviceReportV2.cs index e7868ab..8f04e9b 100644 --- a/Metadata/DeviceReportV2.cs +++ b/Metadata/DeviceReportV2.cs @@ -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() {} diff --git a/Metadata/Dimensions.cs b/Metadata/Dimensions.cs index b3423bf..e9cd3f3 100644 --- a/Metadata/Dimensions.cs +++ b/Metadata/Dimensions.cs @@ -36,12 +36,12 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using Schemas; - #pragma warning disable 612 namespace Aaru.CommonTypes.Metadata; +using Schemas; + /// Physical dimensions for media types public static class Dimensions { diff --git a/Metadata/Resume.cs b/Metadata/Resume.cs index 382b65b..20ef7c9 100644 --- a/Metadata/Resume.cs +++ b/Metadata/Resume.cs @@ -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; - /// Information that allows to resume a dump [Serializable, XmlRoot("DicResume", Namespace = "", IsNullable = false)] public class Resume diff --git a/Metadata/Statistics.cs b/Metadata/Statistics.cs index 011b070..5eed493 100644 --- a/Metadata/Statistics.cs +++ b/Metadata/Statistics.cs @@ -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; + /// Statistics [XmlRoot("DicStats", Namespace = "", IsNullable = false)] public class Stats diff --git a/Metadata/Version.cs b/Metadata/Version.cs index 1266f5f..1786c31 100644 --- a/Metadata/Version.cs +++ b/Metadata/Version.cs @@ -36,17 +36,17 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ +namespace Aaru.CommonTypes.Metadata; + using Aaru.CommonTypes.Interop; using Schemas; -namespace Aaru.CommonTypes.Metadata; - /// Manages Aaru's version for metadata public static class Version { /// Gets XML software type for the running version /// XML software type - public static SoftwareType GetSoftwareType() => new SoftwareType + public static SoftwareType GetSoftwareType() => new() { Name = "Aaru", OperatingSystem = DetectOS.GetRealPlatformID().ToString(), diff --git a/Partition.cs b/Partition.cs index 83ffdf7..be88f99 100644 --- a/Partition.cs +++ b/Partition.cs @@ -36,10 +36,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using System; - namespace Aaru.CommonTypes; +using System; + /// Partition structure. public struct Partition : IEquatable, IComparable { diff --git a/PluginBase.cs b/PluginBase.cs index 7250155..cbe2c22 100644 --- a/PluginBase.cs +++ b/PluginBase.cs @@ -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; - /// Contain all plugins (filesystem, partition and image) public class PluginBase { diff --git a/Structs/Devices/ATA/Identify.cs b/Structs/Devices/ATA/Identify.cs index 94dbb18..18cb25c 100644 --- a/Structs/Devices/ATA/Identify.cs +++ b/Structs/Devices/ATA/Identify.cs @@ -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; - /// /// 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 /// MUST be set MustBeSet = 0x4000, #pragma warning disable 1591 - Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800, - Reserved10 = 0x0400, Reserved09 = 0x0200, Reserved08 = 0x0100, - Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020, - Reserved04 = 0x0010, Reserved03 = 0x0008, Reserved02 = 0x0004, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + Reserved07 = 0x0080, + Reserved06 = 0x0040, + Reserved05 = 0x0020, + Reserved04 = 0x0010, + Reserved03 = 0x0008, + Reserved02 = 0x0004, Reserved01 = 0x0002, #pragma warning restore 1591 /// Indicates a device specific minimum standby timer value @@ -264,7 +274,9 @@ public static class Identify /// MUST be set MustBeSet = 0x4000, #pragma warning disable 1591 - Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, Reserved10 = 0x0400, #pragma warning restore 1591 /// DSN feature set is supported @@ -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 /// TRIM is supported 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 /// ACS-4 @@ -477,7 +501,9 @@ public static class Identify /// Supports NCQ NCQ = 0x0100, #pragma warning disable 1591 - Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020, + Reserved07 = 0x0080, + Reserved06 = 0x0040, + Reserved05 = 0x0020, Reserved04 = 0x0010, #pragma warning restore 1591 /// Supports SATA Gen. 3 Signaling Speed (6.0Gb/s) @@ -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 /// Supports RECEIVE FPDMA QUEUED and SEND FPDMA QUEUED 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 /// Supports NCQ autosense 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 /// SCT Command Transport Data Tables supported @@ -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 /// Maximum security level Maximum = 0x0100, #pragma warning disable 1591 - Reserved07 = 0x0080, Reserved06 = 0x0040, + Reserved07 = 0x0080, + Reserved06 = 0x0040, #pragma warning restore 1591 /// Supports enhanced security erase 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 /// MUST be set Set = 0x4000, #pragma warning disable 1591 - Reserved13 = 0x2000, Reserved12 = 0x1000, Reserved11 = 0x0800, - Reserved10 = 0x0400, Reserved09 = 0x0200, Reserved08 = 0x0100, - Reserved07 = 0x0080, Reserved06 = 0x0040, Reserved05 = 0x0020, - Reserved04 = 0x0010, Reserved03 = 0x0008, Reserved02 = 0x0004, + Reserved13 = 0x2000, + Reserved12 = 0x1000, + Reserved11 = 0x0800, + Reserved10 = 0x0400, + Reserved09 = 0x0200, + Reserved08 = 0x0100, + Reserved07 = 0x0080, + Reserved06 = 0x0040, + Reserved05 = 0x0020, + Reserved04 = 0x0010, + Reserved03 = 0x0008, + Reserved02 = 0x0004, Reserved01 = 0x0002, #pragma warning restore 1591 /// Trusted Computing feature set is supported @@ -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]; diff --git a/Structs/Devices/SCSI/Enums.cs b/Structs/Devices/SCSI/Enums.cs index 55ab2e1..01dbf7d 100644 --- a/Structs/Devices/SCSI/Enums.cs +++ b/Structs/Devices/SCSI/Enums.cs @@ -30,10 +30,10 @@ // Copyright © 2011-2022 Natalia Portillo // ****************************************************************************/ -using System.Diagnostics.CodeAnalysis; - namespace Aaru.CommonTypes.Structs.Devices.SCSI; +using System.Diagnostics.CodeAnalysis; + /// List of known SCSI peripheral qualifiers public enum PeripheralQualifiers : byte { diff --git a/Structs/Devices/SCSI/Inquiry.cs b/Structs/Devices/SCSI/Inquiry.cs index 2d6199c..273675b 100644 --- a/Structs/Devices/SCSI/Inquiry.cs +++ b/Structs/Devices/SCSI/Inquiry.cs @@ -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; - /// /// 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,8 +521,8 @@ public struct Inquiry Inquiry decoded = inq.Value; - byte[] buffer = new byte[512]; - byte length = 0; + var buffer = new byte[512]; + byte length = 0; buffer[0] = (byte)(decoded.PeripheralQualifier << 5); buffer[0] += decoded.PeripheralDeviceType; @@ -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; diff --git a/Structs/Devices/SCSI/Modes/2A.cs b/Structs/Devices/SCSI/Modes/2A.cs index 6d5d2fe..711db91 100644 --- a/Structs/Devices/SCSI/Modes/2A.cs +++ b/Structs/Devices/SCSI/Modes/2A.cs @@ -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 /// /// 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,8 +281,8 @@ public class ModePage_2A /// Raw page 2Ah public static byte[] Encode(ModePage_2A decoded) { - byte[] pageResponse = new byte[512]; - byte length = 16; + 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; + length += 4; + 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; diff --git a/Structs/Filesystems.cs b/Structs/Filesystems.cs index ac4273c..869a842 100644 --- a/Structs/Filesystems.cs +++ b/Structs/Filesystems.cs @@ -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; - /// File attributes. [Flags] public enum FileAttributes : ulong diff --git a/Structs/Images.cs b/Structs/Images.cs index d30a370..6547fab 100644 --- a/Structs/Images.cs +++ b/Structs/Images.cs @@ -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; - /// Contains information about a dump image and its contents public struct ImageInfo {