Releases: cdervis/SharpConfig
Releases · cdervis/SharpConfig
v4.1
SharpConfig 4.1
- Added
StringComparisonoverload support toGetSectionsNamed()andGetSettingsNamed(), while keeping the default behavior asStringComparison.OrdinalIgnoreCase. - Clarified the public documentation around create-or-get indexers and name matching behavior (see README).
- Fixed stream ownership inconsistencies:
LoadFromStream()now leaves caller-provided streams open.LoadFromBinaryStream()now leaves caller-providedBinaryReaderinstances and streams open.SaveToBinaryStream()now leaves caller-providedBinaryWriterinstances open.- Stream-based load/save APIs now consistently leave caller-owned streams usable after the operation.
- Binary/text stream internals now use explicit
leaveOpenhandling instead of relying on disposal side effects.
- Reduced allocations in textual stream save by writing through
StreamWriterinstead of building and encoding an intermediate byte buffer. - Cached reflection metadata used for object mapping to avoid repeated member scans without changing observable behavior.
- Removed the deprecated
Configuration.StringRepresentationproperty.
v4.0
SharpConfig 4.0
This major update modernizes the library for the latest .NET ecosystem, improves performance, and introduces native support for multiline values.
Please note that this is a major release with breaking changes!
New Features & Enhancements
- .NET 10 Support: Full support for .NET 10 while maintaining .NET Standard 2.0 compatibility.
- Multiline Values: Native support for parsing and saving multiline strings using the
[[ ... ]]syntax. - MultilineAttribute: New attribute to automatically handle multiline strings during object mapping (
ToObjectandFromObject). - Nullable Reference Types: The entire library now uses nullable reference types for improved type safety and fewer null-reference exceptions.
- Performance Optimizations: Significant performance improvements in parsing, string handling, and setting lookups.
- New API Methods:
Configuration.SaveToString(): A modern replacement for theStringRepresentationproperty.Configuration.ResetOptions(): Resets all global configuration options to their default states.Configuration.FindTypeStringConverter(): Publicly accessible converter lookups.
Breaking Changes & Deprecations
- Nullable API: Method signatures have been updated to reflect nullability.
- Obsolete:
Configuration.StringRepresentationis now obsolete; useSaveToString()instead. - Removed:
Setting.StringValueTrimmedhas been removed (useStringValue). - Modernized: Legacy target frameworks (older than .NET Standard 2.0) are no longer officially supported.
Fixes
- Optimized comment character lookups using
HashSet. - Improved null safety in
Section.Remove()andSection.ToObject(). - Fixed edge cases when handling inline comments within section headers.
- Refined array element separator handling across different culture settings.