Update to latest props/targets

This commit is contained in:
James Jackson-South 2021-02-20 19:11:00 +00:00
Родитель 7569610db9
Коммит c907cb9474
50 изменённых файлов: 651 добавлений и 772 удалений

Просмотреть файл

@ -1,373 +1,436 @@
###############################################################################
# EditorConfig is awesome: http://EditorConfig.org
###############################################################################
# Version: 1.6.2 (Using https://semver.org/)
# Updated: 2020-11-02
# See https://github.com/RehanSaeed/EditorConfig/releases for release notes.
# See https://github.com/RehanSaeed/EditorConfig for updates to this file.
# See http://EditorConfig.org for more information about .editorconfig files.
###############################################################################
# Top-most EditorConfig file
###############################################################################
##########################################
# Common Settings
##########################################
# This file is the top-most EditorConfig file
root = true
###############################################################################
# Set default behavior to:
# a UTF-8 encoding,
# Unix-style line endings,
# a newline ending the file,
# 4 space indentation, and
# trimming of trailing whitespace
###############################################################################
# All Files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
###############################################################################
# Set file behavior to:
# 2 space indentation
###############################################################################
[*.{cmd,config,csproj,json,props,ps1,resx,sh,targets}]
indent_size = 2
##########################################
# File Extension Settings
##########################################
###############################################################################
# Set file behavior to:
# Windows-style line endings, and
# tabular indentation
###############################################################################
# Visual Studio Solution Files
[*.sln]
end_of_line = crlf
indent_style = tab
###############################################################################
# Set dotnet naming rules to:
# suggest async members be pascal case suffixed with Async
# suggest const declarations be pascal case
# suggest interfaces be pascal case prefixed with I
# suggest parameters be camel case
# suggest private and internal static fields be camel case
# suggest private and internal fields be camel case
# suggest public and protected declarations be pascal case
# suggest static readonly declarations be pascal case
# suggest type parameters be prefixed with T
###############################################################################
[*.cs]
dotnet_naming_rule.async_members_should_be_pascal_case_suffixed_with_async.severity = suggestion
dotnet_naming_rule.async_members_should_be_pascal_case_suffixed_with_async.style = pascal_case_suffixed_with_async
dotnet_naming_rule.async_members_should_be_pascal_case_suffixed_with_async.symbols = async_members
# Visual Studio XML Project Files
[*.{csproj,vbproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
dotnet_naming_rule.const_declarations_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.const_declarations_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.const_declarations_should_be_pascal_case.symbols = const_declarations
# T4 Templates Files
[*.{tt,ttinclude}]
end_of_line = crlf
dotnet_naming_rule.interfaces_should_be_pascal_case_prefixed_with_i.severity = suggestion
dotnet_naming_rule.interfaces_should_be_pascal_case_prefixed_with_i.style = pascal_case_prefixed_with_i
dotnet_naming_rule.interfaces_should_be_pascal_case_prefixed_with_i.symbols = interfaces
# XML Configuration Files
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
indent_size = 2
dotnet_naming_rule.parameters_should_be_camel_case.severity = suggestion
dotnet_naming_rule.parameters_should_be_camel_case.style = camel_case
dotnet_naming_rule.parameters_should_be_camel_case.symbols = parameters
# JSON Files
[*.{json,json5,webmanifest}]
indent_size = 2
dotnet_naming_rule.private_and_internal_static_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.private_and_internal_static_fields_should_be_camel_case.style = camel_case
dotnet_naming_rule.private_and_internal_static_fields_should_be_camel_case.symbols = private_and_internal_static_fields
# YAML Files
[*.{yml,yaml}]
indent_size = 2
dotnet_naming_rule.private_and_internal_fields_should_be_camel_case.severity = suggestion
dotnet_naming_rule.private_and_internal_fields_should_be_camel_case.style = camel_case
dotnet_naming_rule.private_and_internal_fields_should_be_camel_case.symbols = private_and_internal_fields
# Markdown Files
[*.md]
trim_trailing_whitespace = false
dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.public_and_protected_declarations_should_be_pascal_case.symbols = public_and_protected_declarations
dotnet_naming_symbols.public_and_protected_declarations.applicable_kinds = method, field, event, property
# Web Files
[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,svg,vue}]
indent_size = 2
dotnet_naming_rule.static_readonly_declarations_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.static_readonly_declarations_should_be_pascal_case.style = pascal_case
dotnet_naming_rule.static_readonly_declarations_should_be_pascal_case.symbols = static_readonly_declarations
# Batch Files
[*.{cmd,bat}]
end_of_line = crlf
dotnet_naming_rule.type_parameters_should_be_pascal_case_prefixed_with_t.severity = suggestion
dotnet_naming_rule.type_parameters_should_be_pascal_case_prefixed_with_t.style = pascal_case_prefixed_with_t
dotnet_naming_rule.type_parameters_should_be_pascal_case_prefixed_with_t.symbols = type_parameters
# Makefiles
[Makefile]
indent_style = tab
###############################################################################
# Set dotnet naming styles to define:
# camel case
# pascal case
# pascal case suffixed with Async
# pascal case prefixed with I
# pascal case prefixed with T
###############################################################################
[*.cs]
dotnet_naming_style.camel_case.capitalization = camel_case
##########################################
# File Header (Uncomment to support file headers)
# https://docs.microsoft.com/visualstudio/ide/reference/add-file-header
##########################################
dotnet_naming_style.pascal_case.capitalization = pascal_case
# [*.{cs,csx,cake,vb,vbx,tt,ttinclude}]
file_header_template = Copyright (c) Six Labors.\nLicensed under the Apache License, Version 2.0.
dotnet_naming_style.pascal_case_suffixed_with_async.capitalization = pascal_case
dotnet_naming_style.pascal_case_suffixed_with_async.required_suffix = Async
# SA1636: File header copyright text should match
# Justification: .editorconfig supports file headers. If this is changed to a value other than "none", a stylecop.json file will need to added to the project.
# dotnet_diagnostic.SA1636.severity = none
dotnet_naming_style.pascal_case_prefixed_with_i.capitalization = pascal_case
dotnet_naming_style.pascal_case_prefixed_with_i.required_prefix = I
##########################################
# .NET Language Conventions
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions
##########################################
dotnet_naming_style.pascal_case_prefixed_with_t.capitalization = pascal_case
dotnet_naming_style.pascal_case_prefixed_with_t.required_prefix = T
###############################################################################
# Set dotnet naming symbols to:
# async members
# const declarations
# interfaces
# private and internal fields
# private and internal static fields
# public and protected declarations
# static readonly declarations
# type parameters
###############################################################################
[*.cs]
dotnet_naming_symbols.async_members.required_modifiers = async
dotnet_naming_symbols.const_declarations.required_modifiers = const
dotnet_naming_symbols.interfaces.applicable_kinds = interface
dotnet_naming_symbols.parameters.applicable_kinds = parameter
dotnet_naming_symbols.private_and_internal_fields.applicable_accessibilities = private, internal
dotnet_naming_symbols.private_and_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_and_internal_static_fields.applicable_accessibilities = private, internal
dotnet_naming_symbols.private_and_internal_static_fields.applicable_kinds = field
dotnet_naming_symbols.private_and_internal_static_fields.required_modifiers = static
dotnet_naming_symbols.public_and_protected_declarations.applicable_accessibilities = public, protected
dotnet_naming_symbols.static_readonly_declarations.required_modifiers = static, readonly
dotnet_naming_symbols.type_parameters.applicable_kinds = type_parameter
###############################################################################
# Set dotnet sort options to:
# do not separate import directives into groups, and
# sort system directives first
###############################################################################
[*.cs]
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true
###############################################################################
# Set dotnet style options to:
# suggest null-coalescing expressions,
# suggest collection-initializers,
# suggest explicit tuple names,
# suggest null-propogation
# suggest object-initializers,
# generate parentheses in arithmetic binary operators for clarity,
# generate parentheses in other binary operators for clarity,
# don't generate parentheses in other operators if unnecessary,
# generate parentheses in relational binary operators for clarity,
# warn when not using predefined-types for locals, parameters, and members,
# generate predefined-types of type names for member access,
# generate auto properties,
# suggest compound assignment,
# generate conditional expression over assignment,
# generate conditional expression over return,
# suggest inferred anonymous types,
# suggest inferred tuple names,
# suggest 'is null' checks over '== null',
# don't generate 'this.' and 'Me.' for events,
# warn when not using 'this.' and 'Me.' for fields,
# warn when not using 'this.' and 'Me.' for methods,
# warn when not using 'this.' and 'Me.' for properties,
# suggest readonly fields, and
# generate accessibility modifiers for non interface members
###############################################################################
[*.cs]
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:silent
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_qualification_for_event = false:silent
# .NET Code Style Settings
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#net-code-style-settings
[*.{cs,csx,cake,vb,vbx}]
# "this." and "Me." qualifiers
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#this-and-me
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_property = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_event = true:warning
# Language keywords instead of framework type names for type references
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#language-keywords
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
# Modifier preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#normalize-modifiers
dotnet_style_require_accessibility_modifiers = always:warning
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:warning
dotnet_style_readonly_field = true:warning
# Parentheses preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parentheses-preferences
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 = never_if_unnecessary:suggestion
# Expression-level preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
dotnet_style_object_initializer = true:warning
dotnet_style_collection_initializer = true:warning
dotnet_style_explicit_tuple_names = true:warning
dotnet_style_prefer_inferred_tuple_names = true:warning
dotnet_style_prefer_inferred_anonymous_type_member_names = true:warning
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = false:suggestion
dotnet_style_prefer_conditional_expression_over_return = false:suggestion
dotnet_style_prefer_compound_assignment = true:warning
# Null-checking preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#null-checking-preferences
dotnet_style_coalesce_expression = true:warning
dotnet_style_null_propagation = true:warning
# Parameter preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#parameter-preferences
dotnet_code_quality_unused_parameters = all:warning
# More style options (Undocumented)
# https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641
dotnet_style_operator_placement_when_wrapping = end_of_line
# https://github.com/dotnet/roslyn/pull/40070
dotnet_style_prefer_simplified_interpolation = true:warning
dotnet_style_readonly_field = true:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
###############################################################################
# Set dotnet style options to:
# suggest removing all unused parameters
###############################################################################
[*.cs]
dotnet_code_quality_unused_parameters = all:suggestion
###############################################################################
# Set csharp indent options to:
# indent block contents,
# not indent braces,
# indent case contents,
# not indent case contents when block,
# indent labels one less than the current, and
# indent switch labels
###############################################################################
[*.cs]
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true
###############################################################################
# Set csharp new-line options to:
# insert a new-line before "catch",
# insert a new-line before "else",
# insert a new-line before "finally",
# insert a new-line before members in anonymous-types,
# insert a new-line before members in object-initializers, and
# insert a new-line before all open braces
###############################################################################
[*.cs]
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
###############################################################################
# Set csharp preserve options to:
# preserve single-line blocks, and
# preserve single-line statements
###############################################################################
[*.cs]
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true
###############################################################################
# Set csharp space options to:
# remove any space after a cast,
# add a space after the colon in an inheritance clause,
# add a space after a comma,
# remove any space after a dot,
# add a space after keywords in control flow statements,
# add a space after a semicolon in a "for" statement,
# add a space before and after binary operators,
# remove space around declaration statements,
# add a space before the colon in an inheritance clause,
# remove any space before a comma,
# remove any space before a dot,
# remove any space before an open square-bracket,
# remove any space before a semicolon in a "for" statement,
# remove any space between empty square-brackets,
# remove any space between a method call's empty parameter list parenthesis,
# remove any space between a method call's name and its opening parenthesis,
# remove any space between a method call's parameter list parenthesis,
# remove any space between a method declaration's empty parameter list parenthesis,
# remove any space between a method declaration's name and its openening parenthesis,
# remove any space between a method declaration's parameter list parenthesis,
# remove any space between parentheses, and
# remove any space between square brackets
###############################################################################
[*.cs]
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
###############################################################################
# Set csharp style options to:
# generate braces,
# suggest simple default expressions,
# generate a preferred modifier order,
# suggest conditional delegate calls,
# suggest deconstructed variable declarations,
# generate expression-bodied accessors,
# generate expression-bodied constructors,
# generate expression-bodied indexers,
# generate expression-bodied lambdas,
# generate expression-bodied methods,
# generate expression-bodied operators,
# generate expression-bodied properties,
# suggest inlined variable declarations,
# suggest local over anonymous functions,
# suggest pattern-matching over "as" with "null" check,
# suggest pattern-matching over "is" with "cast" check,
# suggest throw expressions,
# generate a discard variable for unused value expression statements,
# suggest a discard variable for unused assignments,
# warn when using var for built-in types,
# warn when using var when the type is not apparent, and
# warn when not using var when the type is apparent
# warn when using simplified "using" declaration
###############################################################################
[*.cs]
csharp_prefer_braces = true:silent
csharp_prefer_simple_default_expression = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:silent
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_constructors = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_methods = true:silent
csharp_style_expression_bodied_operators = true:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
# C# Code Style Settings
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-code-style-settings
[*.{cs,csx,cake}]
# Implicit and explicit types
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#implicit-and-explicit-types
csharp_style_var_for_built_in_types = never
csharp_style_var_when_type_is_apparent = true:warning
csharp_style_var_elsewhere = false:warning
# Expression-bodied members
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-bodied-members
csharp_style_expression_bodied_methods = true:warning
csharp_style_expression_bodied_constructors = true:warning
csharp_style_expression_bodied_operators = true:warning
csharp_style_expression_bodied_properties = true:warning
csharp_style_expression_bodied_indexers = true:warning
csharp_style_expression_bodied_accessors = true:warning
csharp_style_expression_bodied_lambdas = true:warning
csharp_style_expression_bodied_local_functions = true:warning
# Pattern matching
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#pattern-matching
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
csharp_style_pattern_matching_over_as_with_null_check = true:warning
# Inlined variable declarations
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#inlined-variable-declarations
csharp_style_inlined_variable_declaration = true:warning
# Expression-level preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#expression-level-preferences
csharp_prefer_simple_default_expression = true:warning
# "Null" checking preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#c-null-checking-preferences
csharp_style_throw_expression = true:warning
csharp_style_conditional_delegate_call = true:warning
# Code block preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#code-block-preferences
csharp_prefer_braces = true:warning
# Unused value preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#unused-value-preferences
csharp_style_unused_value_expression_statement_preference = discard_variable:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
# Index and range preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#index-and-range-preferences
csharp_style_prefer_index_operator = true:warning
csharp_style_prefer_range_operator = true:warning
# Miscellaneous preferences
# https://docs.microsoft.com/visualstudio/ide/editorconfig-language-conventions#miscellaneous-preferences
csharp_style_deconstructed_variable_declaration = true:warning
csharp_style_pattern_local_over_anonymous_function = true:warning
csharp_using_directive_placement = outside_namespace:warning
csharp_prefer_static_local_function = true:warning
csharp_prefer_simple_using_statement = true:suggestion
##########################################
# .NET Formatting Conventions
# https://docs.microsoft.com/visualstudio/ide/editorconfig-code-style-settings-reference#formatting-conventions
##########################################
# Organize usings
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#organize-using-directives
dotnet_sort_system_directives_first = true
# Newline options
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#new-line-options
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
# Indentation options
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#indentation-options
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = no_change
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents_when_block = false
# Spacing options
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#spacing-options
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_parentheses = false
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_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_after_comma = true
csharp_space_before_comma = false
csharp_space_after_dot = false
csharp_space_before_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_semicolon_in_for_statement = false
csharp_space_around_declaration_statements = false
csharp_space_before_open_square_brackets = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false
# Wrapping options
# https://docs.microsoft.com/visualstudio/ide/editorconfig-formatting-conventions#wrap-options
csharp_preserve_single_line_statements = false
csharp_preserve_single_line_blocks = true
##########################################
# .NET Naming Conventions
# https://docs.microsoft.com/visualstudio/ide/editorconfig-naming-conventions
##########################################
[*.{cs,csx,cake,vb,vbx}]
##########################################
# Styles
##########################################
# camel_case_style - Define the camelCase style
dotnet_naming_style.camel_case_style.capitalization = camel_case
# pascal_case_style - Define the PascalCase style
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
# first_upper_style - The first character must start with an upper-case character
dotnet_naming_style.first_upper_style.capitalization = first_word_upper
# prefix_interface_with_i_style - Interfaces must be PascalCase and the first character of an interface must be an 'I'
dotnet_naming_style.prefix_interface_with_i_style.capitalization = pascal_case
dotnet_naming_style.prefix_interface_with_i_style.required_prefix = I
# prefix_type_parameters_with_t_style - Generic Type Parameters must be PascalCase and the first character must be a 'T'
dotnet_naming_style.prefix_type_parameters_with_t_style.capitalization = pascal_case
dotnet_naming_style.prefix_type_parameters_with_t_style.required_prefix = T
# disallowed_style - Anything that has this style applied is marked as disallowed
dotnet_naming_style.disallowed_style.capitalization = pascal_case
dotnet_naming_style.disallowed_style.required_prefix = ____RULE_VIOLATION____
dotnet_naming_style.disallowed_style.required_suffix = ____RULE_VIOLATION____
# internal_error_style - This style should never occur... if it does, it indicates a bug in file or in the parser using the file
dotnet_naming_style.internal_error_style.capitalization = pascal_case
dotnet_naming_style.internal_error_style.required_prefix = ____INTERNAL_ERROR____
dotnet_naming_style.internal_error_style.required_suffix = ____INTERNAL_ERROR____
##########################################
# .NET Design Guideline Field Naming Rules
# Naming rules for fields follow the .NET Framework design guidelines
# https://docs.microsoft.com/dotnet/standard/design-guidelines/index
##########################################
# All public/protected/protected_internal constant fields must be PascalCase
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
dotnet_naming_symbols.public_protected_constant_fields_group.applicable_accessibilities = public, protected, protected_internal
dotnet_naming_symbols.public_protected_constant_fields_group.required_modifiers = const
dotnet_naming_symbols.public_protected_constant_fields_group.applicable_kinds = field
dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.symbols = public_protected_constant_fields_group
dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.public_protected_constant_fields_must_be_pascal_case_rule.severity = warning
# All public/protected/protected_internal static readonly fields must be PascalCase
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_accessibilities = public, protected, protected_internal
dotnet_naming_symbols.public_protected_static_readonly_fields_group.required_modifiers = static, readonly
dotnet_naming_symbols.public_protected_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.symbols = public_protected_static_readonly_fields_group
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.public_protected_static_readonly_fields_must_be_pascal_case_rule.severity = warning
# No other public/protected/protected_internal fields are allowed
# https://docs.microsoft.com/dotnet/standard/design-guidelines/field
dotnet_naming_symbols.other_public_protected_fields_group.applicable_accessibilities = public, protected, protected_internal
dotnet_naming_symbols.other_public_protected_fields_group.applicable_kinds = field
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.symbols = other_public_protected_fields_group
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.style = disallowed_style
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.severity = error
##########################################
# StyleCop Field Naming Rules
# Naming rules for fields follow the StyleCop analyzers
# This does not override any rules using disallowed_style above
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
##########################################
# All constant fields must be PascalCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity = warning
# All static readonly fields must be PascalCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = warning
# No non-private instance fields are allowed
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.severity = error
# Private fields must be camelCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1306.md
dotnet_naming_symbols.stylecop_private_fields_group.applicable_accessibilities = private
dotnet_naming_symbols.stylecop_private_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.symbols = stylecop_private_fields_group
dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.style = camel_case_style
dotnet_naming_rule.stylecop_private_fields_must_be_camel_case_rule.severity = warning
# Local variables must be camelCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md
dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local
dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.severity = silent
# This rule should never fire. However, it's included for at least two purposes:
# First, it helps to understand, reason about, and root-case certain types of issues, such as bugs in .editorconfig parsers.
# Second, it helps to raise immediate awareness if a new field type is added (as occurred recently in C#).
dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_accessibilities = *
dotnet_naming_symbols.sanity_check_uncovered_field_case_group.applicable_kinds = field
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_check_uncovered_field_case_group
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error
##########################################
# Other Naming Rules
##########################################
# All of the following must be PascalCase:
# - Namespaces
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-namespaces
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md
# - Classes and Enumerations
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1300.md
# - Delegates
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces#names-of-common-types
# - Constructors, Properties, Events, Methods
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-type-members
dotnet_naming_symbols.element_group.applicable_kinds = namespace, class, enum, struct, delegate, event, method, property
dotnet_naming_rule.element_rule.symbols = element_group
dotnet_naming_rule.element_rule.style = pascal_case_style
dotnet_naming_rule.element_rule.severity = warning
# Interfaces use PascalCase and are prefixed with uppercase 'I'
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
dotnet_naming_symbols.interface_group.applicable_kinds = interface
dotnet_naming_rule.interface_rule.symbols = interface_group
dotnet_naming_rule.interface_rule.style = prefix_interface_with_i_style
dotnet_naming_rule.interface_rule.severity = warning
# Generics Type Parameters use PascalCase and are prefixed with uppercase 'T'
# https://docs.microsoft.com/dotnet/standard/design-guidelines/names-of-classes-structs-and-interfaces
dotnet_naming_symbols.type_parameter_group.applicable_kinds = type_parameter
dotnet_naming_rule.type_parameter_rule.symbols = type_parameter_group
dotnet_naming_rule.type_parameter_rule.style = prefix_type_parameters_with_t_style
dotnet_naming_rule.type_parameter_rule.severity = warning
# Function parameters use camelCase
# https://docs.microsoft.com/dotnet/standard/design-guidelines/naming-parameters
dotnet_naming_symbols.parameters_group.applicable_kinds = parameter
dotnet_naming_rule.parameters_rule.symbols = parameters_group
dotnet_naming_rule.parameters_rule.style = camel_case_style
dotnet_naming_rule.parameters_rule.severity = warning
##########################################
# License
##########################################
# The following applies as to the .editorconfig file ONLY, and is
# included below for reference, per the requirements of the license
# corresponding to this .editorconfig file.
# See: https://github.com/RehanSaeed/EditorConfig
#
# MIT License
#
# Copyright (c) 2017-2019 Muhammad Rehan Saeed
# Copyright (c) 2019 Henry Gabryjelski
#
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject
# to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
##########################################

27
.gitattributes поставляемый
Просмотреть файл

@ -4,7 +4,6 @@
# normalize to Unix-style line endings
###############################################################################
* text eol=lf
###############################################################################
# Set explicit file behavior to:
# treat as text and
@ -54,7 +53,6 @@
*.txt text eol=lf
*.vb text eol=lf
*.yml text eol=lf
###############################################################################
# Set explicit file behavior to:
# treat as text
@ -62,7 +60,6 @@
# diff as csharp
###############################################################################
*.cs text eol=lf diff=csharp
###############################################################################
# Set explicit file behavior to:
# treat as text
@ -74,7 +71,6 @@
*.fsproj text eol=lf merge=union
*.ncrunchproject text eol=lf merge=union
*.vbproj text eol=lf merge=union
###############################################################################
# Set explicit file behavior to:
# treat as text
@ -82,37 +78,29 @@
# use a union merge when resoling conflicts
###############################################################################
*.sln text eol=crlf merge=union
###############################################################################
# Set explicit file behavior to:
# treat as binary
###############################################################################
*.basis binary
*.bmp binary
*.dds binary
*.dll binary
*.eot binary
*.exe binary
*.gif binary
*.jpg binary
*.ktx binary
*.otf binary
*.pbm binary
*.pdf binary
*.png binary
*.ppt binary
*.pptx binary
*.pvr binary
*.snk binary
*.tga binary
*.ttc binary
*.ttf binary
*.webp binary
*.wbmp binary
*.woff binary
*.woff2 binary
*.xls binary
*.xlsx binary
###############################################################################
# Set explicit file behavior to:
# diff as plain text
@ -124,3 +112,16 @@
*.pptx diff=astextplain
*.rtf diff=astextplain
*.svg diff=astextplain
###############################################################################
# Handle image files by git lfs
###############################################################################
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.bmp filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.tif filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
*.tga filter=lfs diff=lfs merge=lfs -text
*.webp filter=lfs diff=lfs merge=lfs -text
*.dds filter=lfs diff=lfs merge=lfs -text

Просмотреть файл

@ -10,132 +10,52 @@
that is done by the file that imports us.
-->
<!-- Default settings that are used by other settings -->
<PropertyGroup>
<BaseArtifactsPath>$(MSBuildThisFileDirectory)artifacts/</BaseArtifactsPath>
<BaseArtifactsPathSuffix>$(ImageSharpProjectCategory)/$(MSBuildProjectName)</BaseArtifactsPathSuffix>
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/SixLabors/ZlibStream/</RepositoryUrl>
<!-- This MUST be defined before importing props. -->
<SixLaborsSolutionDirectory>$(MSBuildThisFileDirectory)</SixLaborsSolutionDirectory>
</PropertyGroup>
<!-- Default settings that explicitly differ from the Sdk.props defaults -->
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseIntermediateOutputPath>$(BaseArtifactsPath)obj/$(BaseArtifactsPathSuffix)/</BaseIntermediateOutputPath>
<DebugType>portable</DebugType>
<DebugType Condition="'$(codecov)' != ''">full</DebugType>
<NullableContextOptions>disable</NullableContextOptions>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
</PropertyGroup>
<!-- Import the shared global .props file -->
<Import Project="$(MSBuildThisFileDirectory)shared-infrastructure\msbuild\props\SixLabors.Global.props" />
<!--
https://apisof.net/
+===================+=======+==========+=====================+=============+=================+====================+==============+=========+===============+==========+
| SUPPORTS | MATHF | HASHCODE | EXTENDED_INTRINSICS | SPAN_STREAM | ENCODING_STRING | RUNTIME_INTRINSICS | CODECOVERAGE | HOTPATH | SERIALIZATION | CORE_CLR |
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|===============+==========|
| netcoreapp3.1 | Y | Y | Y | Y | Y | Y | Y | Y | Y | Y |
| netcoreapp2.1 | Y | Y | Y | Y | Y | N | Y | N | Y | Y |
| netcoreapp2.0 | Y | N | N | N | N | N | Y | N | Y | Y |
| netstandard2.1 | Y | Y | N | Y | Y | N | Y | N | Y | N |
| netstandard2.0 | N | N | N | N | N | N | Y | N | Y | N |
| netstandard1.3 | N | N | N | N | N | N | N | N | N | N |
| net472 | N | N | Y | N | N | N | Y | N | Y | N |
+===================+=======+==========+=====================+=============+=================+====================+==============+=========|===============+==========+
+===================+===============+==========+
| SUPPORTS | SERIALIZATION | CORE_CLR |
+===================+===============+==========|
| netcoreapp3.1 | Y | Y |
| netcoreapp2.1 | Y | Y |
| netcoreapp2.0 | Y | Y |
| netstandard2.1 | Y | N |
| netstandard2.0 | Y | N |
| netstandard1.3 | N | N |
| net472 | Y | N |
+===================+===============+==========+
-->
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE;</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_RUNTIME_INTRINSICS</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HOTPATH</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CORE_CLR</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE;</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CORE_CLR</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netcoreapp2.0'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CORE_CLR</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<DefineConstants>$(DefineConstants);SUPPORTS_MATHF;</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_HASHCODE;</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SPAN_STREAM</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_ENCODING_STRING</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net472'">
<DefineConstants>$(DefineConstants);SUPPORTS_EXTENDED_INTRINSICS</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CODECOVERAGE</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
</PropertyGroup>
<!-- Default settings that explicitly differ from the Sdk.targets defaults-->
<PropertyGroup>
<Authors>Six Labors and contributors</Authors>
<BaseOutputPath>$(BaseArtifactsPath)bin/$(BaseArtifactsPathSuffix)/</BaseOutputPath>
<Company>Six Labors</Company>
<PackageOutputPath>$(BaseArtifactsPath)pkg/$(BaseArtifactsPathSuffix)/$(Configuration)/</PackageOutputPath>
<Product>SixLabors.ZlibStream</Product>
<VersionPrefix>0.0.1</VersionPrefix>
<VersionPrefix Condition="'$(packageversion)' != ''">$(PackageVersion)</VersionPrefix>
<VersionSuffix></VersionSuffix>
</PropertyGroup>
<!-- Default settings that are otherwise undefined -->
<PropertyGroup>
<Copyright>Copyright © Six Labors and Contributors</Copyright>
<Features>strict;IOperation</Features>
<HighEntropyVA>true</HighEntropyVA>
<LangVersion>8.0</LangVersion>
<NeutralLanguage>en</NeutralLanguage>
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
<PackageIcon>sixlabors.128.png</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
<RepositoryType>git</RepositoryType>
<RestoreSources>
https://api.nuget.org/v3/index.json;
</RestoreSources>
<UseSharedCompilation>true</UseSharedCompilation>
<SignAssembly>true</SignAssembly>
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)shared-infrastructure/SixLabors.snk</AssemblyOriginatorKeyFile>
<SixLaborsPublicKey>00240000048000009400000006020000002400005253413100040000010001000147e6fe6766715eec6cfed61f1e7dcdbf69748a3e355c67e9d8dfd953acab1d5e012ba34b23308166fdc61ee1d0390d5f36d814a6091dd4b5ed9eda5a26afced924c683b4bfb4b3d64b0586a57eff9f02b1f84e3cb0ddd518bd1697f2c84dcbb97eb8bb5c7801be12112ed0ec86db934b0e9a5171e6bb1384b6d2f7d54dfa97</SixLaborsPublicKey>
</PropertyGroup>
<!-- Package references and additional files which are consumed by all projects -->
<ItemGroup>
<PackageReference Include="Microsoft.Net.Compilers.Toolset" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" IsImplicitlyDefined="true" />
<PackageReference Include="StyleCop.Analyzers" IsImplicitlyDefined="true" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" />
<!--NuGet package icon source-->
<None Include="$(MSBuildThisFileDirectory)shared-infrastructure\branding\icons\org\sixlabors.128.png"
Pack="true"
PackagePath="" />
<None Include="$(MSBuildThisFileDirectory)LICENSE" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)' == 'net472' OR '$(TargetFramework)' == 'net48'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
</PropertyGroup>
</When>
<When Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
</PropertyGroup>
</When>
<When Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
</PropertyGroup>
</When>
<When Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)','netcoreapp2.0'))">
<!--NETCORE 3.1. NET5.0, and future versions will fallback to this as the closest target.-->
<PropertyGroup>
<DefineConstants>$(DefineConstants);SUPPORTS_SERIALIZATION</DefineConstants>
<DefineConstants>$(DefineConstants);SUPPORTS_CORE_CLR</DefineConstants>
</PropertyGroup>
</When>
</Choose>
</Project>

Просмотреть файл

@ -5,27 +5,12 @@
Directory.Build.targets is automatically picked up and imported by
Microsoft.Common.targets. This file needs to exist, even if empty so that
files in the parent directory tree, with the same name, are not imported
instead. The import fairly late and most other props/targets will have been
instead. They import fairly late and most other props/targets will have been
imported beforehand. We also don't need to add ourselves to
MSBuildAllProjects, as that is done by the file that imports us.
-->
<!-- Settings that append the existing setting value -->
<PropertyGroup>
<DefineConstants>$(DefineConstants);$(OS)</DefineConstants>
</PropertyGroup>
<!-- Package versions for package references across all projects -->
<ItemGroup>
<!--Global Dependencies-->
<PackageReference Update="Microsoft.Net.Compilers.Toolset" PrivateAssets="All" Version="3.7.0" />
<PackageReference Update="Microsoft.NETFramework.ReferenceAssemblies" PrivateAssets="All" Version="1.0.0" />
<PackageReference Update="StyleCop.Analyzers" PrivateAssets="All" Version="1.1.118" />
<!--Src Dependencies-->
<PackageReference Update="System.Buffers" Version="4.5.1" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="System.Runtime.CompilerServices.Unsafe" Version="5.0" />
</ItemGroup>
<!-- Import the shared global .props file -->
<Import Project="$(MSBuildThisFileDirectory)shared-infrastructure\msbuild\targets\SixLabors.Global.targets"/>
</Project>

@ -1 +1 @@
Subproject commit b0d4cd98647996265a668e852574d901b27f22d6
Subproject commit 06a733983486638b9e38197c7c6eb197ecac43e6

Просмотреть файл

@ -31,6 +31,4 @@
<InternalsVisibleTo Include="ZlibStream.Tests" Key="$(SixLaborsPublicKey)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -5,63 +5,15 @@
Directory.Build.targets is automatically picked up and imported by
Microsoft.Common.targets. This file needs to exist, even if empty so that
files in the parent directory tree, with the same name, are not imported
instead. The import fairly late and most other props/targets will have
instead. They import fairly late and most other props/targets will have
been imported beforehand. We also don't need to add ourselves to
MSBuildAllProjects, as that is done by the file that imports us.
-->
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets</MSBuildAllProjects>
</PropertyGroup>
<!-- Import the shared src .targets file -->
<Import Project="$(MSBuildThisFileDirectory)..\shared-infrastructure\msbuild\targets\SixLabors.Src.targets" />
<!-- Import the solution .targets file. -->
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />
<PropertyGroup>
<GeneratedInternalsVisibleToFile Condition="'$(GeneratedInternalsVisibleToFile)' == ''">$(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedInternalsVisibleToFile>
</PropertyGroup>
<ItemDefinitionGroup>
<InternalsVisibleTo>
<Visible>false</Visible>
</InternalsVisibleTo>
</ItemDefinitionGroup>
<Target Name="GenerateInternalsVisibleTo"
BeforeTargets="CoreCompile"
DependsOnTargets="PrepareForBuild;CoreGenerateInternalsVisibleTo"
Condition="'@(InternalsVisibleTo)' != ''" />
<Target Name="CoreGenerateInternalsVisibleTo"
Condition="'$(Language)' == 'VB' or '$(Language)' == 'C#'"
Inputs="$(MSBuildAllProjects)"
Outputs="$(GeneratedInternalsVisibleToFile)">
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute" AdditionalMetadata="_Parameter1=%(InternalsVisibleTo.Identity)" Condition="'%(InternalsVisibleTo.Key)' == ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<CreateItem Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute" AdditionalMetadata="_Parameter1=%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key)" Condition="'%(InternalsVisibleTo.Key)' != ''">
<Output TaskParameter="Include" ItemName="InternalsVisibleToAttribute" />
</CreateItem>
<WriteCodeFragment AssemblyAttributes="@(InternalsVisibleToAttribute)" Language="$(Language)" OutputFile="$(GeneratedInternalsVisibleToFile)">
<Output TaskParameter="OutputFile" ItemName="Compile" />
<Output TaskParameter="OutputFile" ItemName="FileWrites" />
</WriteCodeFragment>
</Target>
<!-- Empty target so that `dotnet test` will work on the solution -->
<!-- https://github.com/Microsoft/vstest/issues/411 -->
<Target Name="VSTest" Condition="'$(IsTestProject)' == 'true'"/>
<ItemGroup>
<!--Shared config files that have to exist at root level.-->
<ConfigFilesToCopy Include="..\..\shared-infrastructure\.editorconfig;..\..\shared-infrastructure\.gitattributes" />
</ItemGroup>
<!--Ensures our config files are up to date.-->
<Target Name="CopyFiles" BeforeTargets="Build">
<Copy SourceFiles="@(ConfigFilesToCopy)"
SkipUnchangedFiles = "true"
DestinationFolder="..\..\" />
</Target>
</Project>

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Buffers;
@ -14,7 +14,7 @@ namespace SixLabors.ZlibStream
/// <summary>
/// Contains buffers whose lengths are defined by compile time constants.
/// </summary>
public class ConstantBuffers : IDisposable
public class FixedLengthBuffers : IDisposable
{
private bool isDisposed;
@ -31,9 +31,9 @@ namespace SixLabors.ZlibStream
private MemoryHandle depthHandle;
/// <summary>
/// Initializes a new instance of the <see cref="ConstantBuffers"/> class.
/// Initializes a new instance of the <see cref="FixedLengthBuffers"/> class.
/// </summary>
public ConstantBuffers()
public FixedLengthBuffers()
{
this.blCountBuffer = ArrayPool<ushort>.Shared.Rent(MAXBITS + 1);
this.blCountHandle = new Memory<ushort>(this.blCountBuffer).Pin();
@ -93,7 +93,7 @@ namespace SixLabors.ZlibStream
/// Contains buffers whose lengths are defined by parameters passed
/// to the containing <see cref="Deflate"/> instance.
/// </summary>
public class DynamicBuffers : IDisposable
public class DynamicLengthBuffers : IDisposable
{
private MemoryHandle windowHandle;
@ -112,12 +112,12 @@ namespace SixLabors.ZlibStream
private bool isDisposed;
/// <summary>
/// Initializes a new instance of the <see cref="DynamicBuffers"/> class.
/// Initializes a new instance of the <see cref="DynamicLengthBuffers"/> class.
/// </summary>
/// <param name="wSize">The size of the sliding window.</param>
/// <param name="hashSize">The size of the hash chain.</param>
/// <param name="pendingSize">The size of the pending buffer.</param>
public DynamicBuffers(int wSize, int hashSize, int pendingSize)
public DynamicLengthBuffers(int wSize, int hashSize, int pendingSize)
{
this.WindowBuffer = ArrayPool<byte>.Shared.Rent(wSize * 2);
this.windowHandle = new Memory<byte>(this.WindowBuffer).Pin();

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{
@ -22,9 +22,9 @@ namespace SixLabors.ZlibStream
int hash_head; // head of the hash chain
bool bflush; // set if current block must be flushed
byte* window = this.DynBuffers.WindowPointer;
ushort* head = this.DynBuffers.HeadPointer;
ushort* prev = this.DynBuffers.PrevPointer;
byte* window = this.DynamicBuffers.WindowPointer;
ushort* head = this.DynamicBuffers.HeadPointer;
ushort* prev = this.DynamicBuffers.PrevPointer;
while (true)
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Numerics;
using System.Runtime.CompilerServices;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Runtime.CompilerServices;
@ -23,9 +23,9 @@ namespace SixLabors.ZlibStream
int matchLen;
bool last;
byte* window = this.DynBuffers.WindowPointer;
ushort* head = this.DynBuffers.HeadPointer;
ushort* prev = this.DynBuffers.PrevPointer;
byte* window = this.DynamicBuffers.WindowPointer;
ushort* head = this.DynamicBuffers.HeadPointer;
ushort* prev = this.DynamicBuffers.PrevPointer;
fixed (Trees.CodeData* ltree = &Trees.StaticLTreeDesc.GetCodeDataReference())
fixed (Trees.CodeData* dtree = &Trees.StaticDTreeDesc.GetCodeDataReference())
@ -38,7 +38,7 @@ namespace SixLabors.ZlibStream
this.QuickStartBlock(last);
}
int pendingBufferSize = this.DynBuffers.PendingSize;
int pendingBufferSize = this.DynamicBuffers.PendingSize;
do
{
if (this.Pending + 12 >= pendingBufferSize)

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{
@ -21,7 +21,7 @@ namespace SixLabors.ZlibStream
int prev; // byte at distance one to match
byte* scan; // scan goes up to strend for length of run
byte* strend;
byte* window = this.DynBuffers.WindowPointer;
byte* window = this.DynamicBuffers.WindowPointer;
while (true)
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{
@ -20,9 +20,9 @@ namespace SixLabors.ZlibStream
int hash_head = 0; // head of hash chain
bool bflush; // set if current block must be flushed
byte* window = this.DynBuffers.WindowPointer;
ushort* head = this.DynBuffers.HeadPointer;
ushort* prev = this.DynBuffers.PrevPointer;
byte* window = this.DynamicBuffers.WindowPointer;
ushort* head = this.DynamicBuffers.HeadPointer;
ushort* prev = this.DynamicBuffers.PrevPointer;
// Process the input block.
while (true)

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
@ -26,7 +26,7 @@ namespace SixLabors.ZlibStream
// Smallest worthy block size when not flushing or finishing. By default
// this is 32K.This can be as small as 507 bytes for memLevel == 1., pending_buf is limited
// to pending_buf_size, and each stored block has a 5 byte header:
int max_block_size = Math.Min(this.DynBuffers.PendingSize - 5, this.wSize);
int max_block_size = Math.Min(this.DynamicBuffers.PendingSize - 5, this.wSize);
int max_start;
// Copy as much as possible from input to output:

Просмотреть файл

@ -1,6 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
// Uncomment to use DeflateQuick
// TODO: Make an option.
// #define USE_QUICK
@ -218,7 +217,7 @@ namespace SixLabors.ZlibStream
/// <summary>
/// Initializes a new instance of the <see cref="Deflate"/> class.
/// </summary>
internal Deflate() => this.ConstBuffers = new ConstantBuffers();
internal Deflate() => this.FixedBuffers = new FixedLengthBuffers();
internal int Pending { get; set; } // nb of bytes in the pending buffer
@ -227,9 +226,9 @@ namespace SixLabors.ZlibStream
/// <summary>
/// Gets buffers whose lengths are defined by compile time constants.
/// </summary>
public ConstantBuffers ConstBuffers { get; private set; }
public FixedLengthBuffers FixedBuffers { get; private set; }
public DynamicBuffers DynBuffers { get; private set; }
public DynamicLengthBuffers DynamicBuffers { get; private set; }
internal int HeapLen { get; set; } // number of elements in the heap
@ -332,7 +331,7 @@ namespace SixLabors.ZlibStream
this.strategy = strategy;
this.method = (byte)method;
this.DynBuffers = new DynamicBuffers(this.wSize, this.hashSize, this.litBufsize * 4);
this.DynamicBuffers = new DynamicLengthBuffers(this.wSize, this.hashSize, this.litBufsize * 4);
return this.DeflateReset(strm);
}
@ -344,15 +343,11 @@ namespace SixLabors.ZlibStream
return CompressionState.ZSTREAMERROR;
}
this.DynBuffers.Dispose();
this.DynBuffers = null;
this.DynamicBuffers.Dispose();
this.DynLTree.Dispose();
this.DynDTree.Dispose();
this.DynBLTree.Dispose();
this.ConstBuffers.Dispose();
this.ConstBuffers = null;
this.FixedBuffers.Dispose();
// free
// dstate=null;
@ -423,16 +418,16 @@ namespace SixLabors.ZlibStream
index = dictLength - length; // use the tail of the dictionary
}
Buffer.BlockCopy(dictionary, index, this.DynBuffers.WindowBuffer, 0, length);
Buffer.BlockCopy(dictionary, index, this.DynamicBuffers.WindowBuffer, 0, length);
this.strStart = length;
this.blockStart = length;
// Insert all strings in the hash table (except for the last two bytes).
// s->lookahead stays null, so s->ins_h will be recomputed at the next
// call of fill_window.
byte* window = this.DynBuffers.WindowPointer;
ushort* head = this.DynBuffers.HeadPointer;
ushort* prev = this.DynBuffers.PrevPointer;
byte* window = this.DynamicBuffers.WindowPointer;
ushort* head = this.DynamicBuffers.HeadPointer;
ushort* prev = this.DynamicBuffers.PrevPointer;
this.InsertString(prev, head, window, 1);
@ -607,7 +602,7 @@ namespace SixLabors.ZlibStream
if (flush == FlushStrategy.FullFlush)
{
// state.head[s.hash_size-1]=0;
ushort* head = this.DynBuffers.HeadPointer;
ushort* head = this.DynamicBuffers.HeadPointer;
for (int i = 0; i < this.hashSize; i++)
{
// forget history
@ -695,13 +690,13 @@ namespace SixLabors.ZlibStream
this.PutShort((ushort)~len);
}
this.PutByte(this.DynBuffers.WindowBuffer, buf, len);
this.PutByte(this.DynamicBuffers.WindowBuffer, buf, len);
}
private void Lm_init()
{
this.windowSize = 2 * this.wSize;
ushort* head = this.DynBuffers.HeadPointer;
ushort* head = this.DynamicBuffers.HeadPointer;
head[this.hashSize - 1] = 0;
for (int i = 0; i < this.hashSize - 1; i++)
@ -727,17 +722,17 @@ namespace SixLabors.ZlibStream
[MethodImpl(InliningOptions.ShortMethod)]
private void PutByte(byte[] p, int start, int len)
{
Buffer.BlockCopy(p, start, this.DynBuffers.PendingBuffer, this.Pending, len);
Buffer.BlockCopy(p, start, this.DynamicBuffers.PendingBuffer, this.Pending, len);
this.Pending += len;
}
[MethodImpl(InliningOptions.ShortMethod)]
private void PutByte(byte c) => this.DynBuffers.PendingPointer[this.Pending++] = c;
private void PutByte(byte c) => this.DynamicBuffers.PendingPointer[this.Pending++] = c;
[MethodImpl(InliningOptions.ShortMethod)]
private void PutShort(int w)
{
*(ushort*)&this.DynBuffers.PendingPointer[this.Pending] = (ushort)w;
*(ushort*)&this.DynamicBuffers.PendingPointer[this.Pending] = (ushort)w;
this.Pending += 2;
}
@ -789,7 +784,7 @@ namespace SixLabors.ZlibStream
return;
}
Buffer.BlockCopy(this.DynBuffers.PendingBuffer, this.PendingOut, strm.INextOut, strm.NextOutIndex, len);
Buffer.BlockCopy(this.DynamicBuffers.PendingBuffer, this.PendingOut, strm.INextOut, strm.NextOutIndex, len);
strm.NextOutIndex += len;
this.PendingOut += len;
@ -859,7 +854,7 @@ namespace SixLabors.ZlibStream
[MethodImpl(InliningOptions.ShortMethod)]
private bool Tr_tally_dist(int dist, int len)
{
byte* pending = this.DynBuffers.PendingPointer;
byte* pending = this.DynamicBuffers.PendingPointer;
int dbuffindex = this.dBuf + (this.lastLit * 2);
pending[dbuffindex++] = (byte)(dist >> 8);
@ -884,7 +879,7 @@ namespace SixLabors.ZlibStream
[MethodImpl(InliningOptions.ShortMethod)]
private bool Tr_tally_lit(byte c)
{
byte* pending = this.DynBuffers.PendingPointer;
byte* pending = this.DynamicBuffers.PendingPointer;
int dbuffindex = this.dBuf + (this.lastLit * 2);
pending[dbuffindex++] = 0;
@ -919,9 +914,9 @@ namespace SixLabors.ZlibStream
int n;
int more; // Amount of free space at the end of the window.
byte* window = this.DynBuffers.WindowPointer;
ushort* head = this.DynBuffers.HeadPointer;
ushort* prev = this.DynBuffers.PrevPointer;
byte* window = this.DynamicBuffers.WindowPointer;
ushort* head = this.DynamicBuffers.HeadPointer;
ushort* prev = this.DynamicBuffers.PrevPointer;
do
{
@ -929,7 +924,7 @@ namespace SixLabors.ZlibStream
if (this.strStart >= this.wSize + this.wSize - MINLOOKAHEAD)
{
Buffer.BlockCopy(this.DynBuffers.WindowBuffer, this.wSize, this.DynBuffers.WindowBuffer, 0, this.wSize);
Buffer.BlockCopy(this.DynamicBuffers.WindowBuffer, this.wSize, this.DynamicBuffers.WindowBuffer, 0, this.wSize);
this.matchStart -= this.wSize;
this.strStart -= this.wSize; // we now have strstart >= MAX_DIST
this.blockStart -= this.wSize;
@ -953,7 +948,7 @@ namespace SixLabors.ZlibStream
// strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD.
// Otherwise, window_size == 2*WSIZE so more >= 2.
// If there was sliding, more >= WSIZE. So in all cases, more >= 2.
n = this.strm.Read_buf(this.DynBuffers.WindowBuffer, this.strStart + this.lookahead, more);
n = this.strm.Read_buf(this.DynamicBuffers.WindowBuffer, this.strStart + this.lookahead, more);
this.lookahead += n;
// Initialize the hash value now that we have some input:
@ -971,7 +966,7 @@ namespace SixLabors.ZlibStream
[MethodImpl(InliningOptions.ShortMethod)]
private int Longest_match(int cur_match)
{
byte* window = this.DynBuffers.WindowPointer;
byte* window = this.DynamicBuffers.WindowPointer;
int chain_length = this.maxChainLength; // max hash chain length
byte* scan = &window[this.strStart]; // current string
@ -1010,7 +1005,7 @@ namespace SixLabors.ZlibStream
nice_match = this.lookahead;
}
ushort* prev = this.DynBuffers.PrevPointer;
ushort* prev = this.DynamicBuffers.PrevPointer;
do
{
@ -1049,20 +1044,20 @@ namespace SixLabors.ZlibStream
return Math.Min(best_len, this.lookahead);
}
private struct Config
private readonly struct Config
{
// reduce lazy search above this match length
public int GoodLength;
public int GoodLength { get; }
// do not perform lazy search above this match length
public int MaxLazy;
public int MaxLazy { get; }
// quit search above this match length
public int NiceLength;
public int NiceLength { get; }
public int MaxChain;
public int MaxChain { get; }
public int Func;
public int Func { get; }
public Config(int good_length, int max_lazy, int nice_length, int max_chain, int func)
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Runtime.CompilerServices;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Diagnostics;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Buffers;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Runtime.CompilerServices;
@ -407,9 +407,9 @@ namespace SixLabors.ZlibStream
int n, m; // iterate over heap elements
var max_code = -1; // largest code with non zero frequency
int node; // new node being created
ushort* blCount = s.ConstBuffers.BlCountPointer;
int* heap = s.ConstBuffers.HeapPointer;
byte* depth = s.ConstBuffers.DepthPointer;
ushort* blCount = s.FixedBuffers.BlCountPointer;
int* heap = s.FixedBuffers.HeapPointer;
byte* depth = s.FixedBuffers.DepthPointer;
// Construct the initial heap, with least frequent element in
// heap[1]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
@ -512,8 +512,8 @@ namespace SixLabors.ZlibStream
[MethodImpl(InliningOptions.ShortMethod)]
public static void Pqdownheap(Deflate s, DynamicTreeDesc tree, int k)
{
int* heap = s.ConstBuffers.HeapPointer;
byte* depth = s.ConstBuffers.DepthPointer;
int* heap = s.FixedBuffers.HeapPointer;
byte* depth = s.FixedBuffers.DepthPointer;
int v = heap[k];
int heapLen = s.HeapLen;
@ -948,7 +948,7 @@ namespace SixLabors.ZlibStream
if (s.lastLit != 0)
{
byte* pending = s.DynBuffers.PendingPointer;
byte* pending = s.DynamicBuffers.PendingPointer;
do
{
@ -994,8 +994,8 @@ namespace SixLabors.ZlibStream
int xbits; // extra bits
ushort f; // frequency
int overflow = 0; // number of elements with bit length too large
ushort* blCount = s.ConstBuffers.BlCountPointer;
int* heap = s.ConstBuffers.HeapPointer;
ushort* blCount = s.FixedBuffers.BlCountPointer;
int* heap = s.FixedBuffers.HeapPointer;
for (bits = 0; bits <= MAXBITS; bits++)
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Buffers;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.Buffers;

Просмотреть файл

@ -3,28 +3,40 @@
<PropertyGroup>
<AssemblyName>SixLabors.ZlibStream</AssemblyName>
<AssemblyTitle>SixLabors.ZlibStream</AssemblyTitle>
<RootNamespace>SixLabors.ZlibStream</RootNamespace>
<PackageId>SixLabors.ZlibStream</PackageId>
<PackageIcon>sixlabors.128.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<RepositoryUrl Condition="'$(RepositoryUrl)' == ''">https://github.com/SixLabors/ZlibStream/</RepositoryUrl>
<PackageProjectUrl>$(RepositoryUrl)</PackageProjectUrl>
<Description>A cross platform, managed, implementation of Zlib.</Description>
<NeutralLanguage>en</NeutralLanguage>
<VersionPrefix Condition="$(packageversion) != ''">$(packageversion)</VersionPrefix>
<VersionPrefix Condition="$(packageversion) == ''">0.0.1</VersionPrefix>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.3;net472</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageId>SixLabors.ZlibStream</PackageId>
<PackageTags>Zlib Compression</PackageTags>
<RootNamespace>SixLabors.ZlibStream</RootNamespace>
</PropertyGroup>
<Choose>
<When Condition="'$(SIXLABORS_TESTING)' == 'true'">
<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.3;net472</TargetFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;netstandard2.1;netstandard2.0;netstandard1.3;net472</TargetFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="5.0" />
</ItemGroup>
<ItemGroup Condition=" $(TargetFramework.StartsWith('netstandard')) OR '$(TargetFramework)' == 'net472'">
<PackageReference Include="System.Buffers" />
<PackageReference Include="System.Memory" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup>
<ItemGroup>
<None Include="..\..\shared-infrastructure\branding\icons\org\sixlabors.128.png" Pack="true" PackagePath="" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace SixLabors.ZlibStream
{

Просмотреть файл

@ -5,35 +5,17 @@
Directory.Build.props is automatically picked up and imported by
Microsoft.Common.props. This file needs to exist, even if empty so that
files in the parent directory tree, with the same name, are not imported
instead. The import fairly early and only Sdk.props will have been
instead. They import fairly early and only Sdk.props will have been
imported beforehand. We also don't need to add ourselves to
MSBuildAllProjects, as that is done by the file that imports us.
-->
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props</MSBuildAllProjects>
<ImageSharpProjectCategory>tests</ImageSharpProjectCategory>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\shared-infrastructure\SixLabors.Tests.ruleset</CodeAnalysisRuleSet>
<!--TODO: We should remove all obsolete code from the solution-->
<NoWarn>$(NoWarn);CS0618</NoWarn>
</PropertyGroup>
<!-- Import the shared tests .props file -->
<Import Project="$(MSBuildThisFileDirectory)..\shared-infrastructure\msbuild\props\SixLabors.Tests.props" />
<!-- Import the solution .props file. -->
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="Microsoft.NET.Test.Sdk" IsImplicitlyDefined="true" />
<PackageReference Include="xunit" IsImplicitlyDefined="true" />
<PackageReference Include="xunit.runner.visualstudio" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup Condition="'$(codecov)' == 'true' AND '$(IsTestProject)' == 'true'">
<PackageReference Include="coverlet.collector" IsImplicitlyDefined="true" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(MSBuildThisFileDirectory)..\src\ZlibStream\ZlibStream.csproj" />
</ItemGroup>

Просмотреть файл

@ -5,35 +5,20 @@
Directory.Build.targets is automatically picked up and imported by
Microsoft.Common.targets. This file needs to exist, even if empty so that
files in the parent directory tree, with the same name, are not imported
instead. The import fairly late and most other props/targets will have
instead. They import fairly late and most other props/targets will have
been imported beforehand. We also don't need to add ourselves to
MSBuildAllProjects, as that is done by the file that imports us.
-->
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets</MSBuildAllProjects>
</PropertyGroup>
<!-- Import the shared tests .targets file -->
<Import Project="$(MSBuildThisFileDirectory)..\shared-infrastructure\msbuild\targets\SixLabors.Tests.targets" />
<!-- Import the solution .targets file. -->
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />
<!-- Tool versions for tool references across all projects -->
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<!--dotnet tools does not have an x86 runner. You have to use separate SDKs-->
<!--https://github.com/actions/setup-dotnet/issues/72-->
<DotNetCliToolReference Update="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
<ItemGroup>
<!--Test Dependencies-->
<PackageReference Update="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Update="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" Condition="'$(OS)' == 'Windows_NT'" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Update="xunit" Version="2.4.1" />
<PackageReference Update="xunit.runner.visualstudio" Version="2.4.1"/>
<PackageReference Update="coverlet.collector" Version="1.2.1" PrivateAssets="All"/>
<PackageReference Update="SharpZipLib" Version="1.2.0" />
<!-- Test Dependencies -->
<PackageReference Update="SharpZipLib" Version="1.3.0" />
<PackageReference Update="zlib.managed" Version="1.1.5-preview-99682104" />
</ItemGroup>

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using BenchmarkDotNet.Attributes;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Buffers.Binary;
using BenchmarkDotNet.Attributes;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
#if Windows_NT
using System.Security.Principal;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Collections.Generic;
using System.IO;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.IO;
using BenchmarkDotNet.Attributes;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.IO;
@ -125,28 +125,16 @@ namespace ZlibStream.Benchmarks
}
/// <inheritdoc/>
public override void Flush()
{
this.deflateStream.Flush();
}
public override void Flush() => this.deflateStream.Flush();
/// <inheritdoc/>
public override int Read(byte[] buffer, int offset, int count)
{
throw new NotSupportedException();
}
public override int Read(byte[] buffer, int offset, int count) => throw new NotSupportedException();
/// <inheritdoc/>
public override long Seek(long offset, SeekOrigin origin)
{
throw new NotSupportedException();
}
public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException();
/// <inheritdoc/>
public override void SetLength(long value)
{
throw new NotSupportedException();
}
public override void SetLength(long value) => throw new NotSupportedException();
/// <inheritdoc/>
public override void Write(byte[] buffer, int offset, int count)
@ -260,10 +248,7 @@ namespace ZlibStream.Benchmarks
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Reset()
{
this.checksum = 1;
}
public void Reset() => this.checksum = 1;
/// <summary>
/// Updates the checksum with a byte value.

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System.Reflection;
using BenchmarkDotNet.Running;

Просмотреть файл

@ -1,18 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>ZlibStream.Benchmarks</AssemblyName>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
<IsPackable>false</IsPackable>
<!--Used to hide test project from dotnet test-->
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Condition="'$(OS)' == 'Windows_NT'" />
<PackageReference Include="SharpZipLib" />
<PackageReference Include="zlib.managed" />
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" Condition="'$(IsWindows)'=='true'" />
<PackageReference Include="SharpZipLib" />
<PackageReference Include="zlib.managed" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using SixLabors.ZlibStream;

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
namespace ZlibStream.Tests.TestUtilities
{

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.IO;

Просмотреть файл

@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net5.0;netcoreapp3.1;netcoreapp2.1;net472</TargetFrameworks>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DebugSymbols>True</DebugSymbols>
<IsTestProject>True</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SharpZipLib" />
<PackageReference Include="zlib.managed" />
<PackageReference Include="SharpZipLib" />
<PackageReference Include="zlib.managed" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,5 +1,5 @@
// Copyright (c) Six Labors and contributors.
// See LICENSE for more details.
// Copyright (c) Six Labors.
// Licensed under the Apache License, Version 2.0.
using System;
using System.IO;