Skip to content

Commit

Permalink
Prepare 4.9.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
jehugaleahsa committed Sep 26, 2020
1 parent 318dbff commit 6f5dcd1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 4.9.0 (2020-09-26)
**Summary** - Make OnParsing, OnParsed, OnFormatting, OnFormatted events available to type mappings.

When I introduced the `OnParsing`, `OnParsed`, `OnFormatting` and `OnFormatted` delegates, I marked `Preprocessing` as deprecated but then did not mark it deprecated on the `ColumnDefinition` class or in the column property mapping classes. Furthermore, I did not add methods to the property mapping classes to allow you to utilize the new delegates. While working on this, I also realized that whenever the `NullFormatter` or `DefaultValue` classes were being used, I was not executing the `OnParsed` and `OnFormatted` delegates with the output of these classes. So, now, I have marked all references to `Preprocessing` as deprecated, added methods to register the delegates on property mappings and now call `OnParsed` and `OnFormatted` regardless of whether the value being parsed/formatted is considered `null`.

One of the primary motivations of these changes was to allow inspecting the values found in ignored columns. For example, you might want to ignore a block of text within a file, but also perform some sanity checks to ensure that the ignored value corresponds to your expectations. For example, you might be working on a fixed-width file and you want to ignore pipe (`|`) characters appearing between values; as a sanity check, you additionally want to ensure the extracted string is in fact a pipe. If you saw something else, you could then assume something was wrong with the input text, such as instead of truncating a string to fit within the fixed-width column, the record got shifted over and the values no longer fit within the expected windows. I updated the `Parse` and `Format` methods to call the `OnParsing`, `OnParsed`, `OnFormatting` and `OnFormatted` delegates just like the other column types and updated the property mappings as well.

An interesting side-effect of these changes is that for `IgnoredColumn`s, spitting out a placeholder value can be achieved either via a `NullFormatter` or using the `OnFormatted` delegate. This is different than the other column types because they are not equipped to handle `null`s.

## 4.8.0 (2020-09-17)
**Summary** - Avoid memory leaks by creating new dynamic assemblies each time.

Expand Down
15 changes: 10 additions & 5 deletions FlatFiles/FlatFiles.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,19 @@
<RepositoryUrl>https://github.com/jehugaleahsa/FlatFiles.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>csv;comma;tab;separated;value;delimited;flat;file;fixed;width;fixed-width;length;fixed-length;parser;parsing;parse</PackageTags>
<PackageReleaseNotes>Avoid memory leaks by creating new dynamic assemblies each time.</PackageReleaseNotes>
<PackageReleaseNotes>Allowing configuring OnParsing, OnParsed, OnFormatting, OnFormatted events with type mappings. Raise events when processing ignored columns.</PackageReleaseNotes>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>FlatFiles.snk</AssemblyOriginatorKeyFile>
<Version>4.8.0</Version>
<Version>4.9.0</Version>
</PropertyGroup>

<PropertyGroup>
<LangVersion>8.0</LangVersion>
<PackageIconUrl>https://raw.githubusercontent.com/jehugaleahsa/FlatFiles/master/icon.png</PackageIconUrl>
<AssemblyVersion>4.8.0.0</AssemblyVersion>
<FileVersion>4.8.0.0</FileVersion>
<PackageIconUrl></PackageIconUrl>
<AssemblyVersion>4.9.0.0</AssemblyVersion>
<FileVersion>4.9.0.0</FileVersion>
<PackageLicenseFile>UNLICENSE.txt</PackageLicenseFile>
<PackageIcon>icon.png</PackageIcon>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.6|AnyCPU'">
Expand Down Expand Up @@ -91,6 +92,10 @@
</ItemGroup>

<ItemGroup>
<None Include="..\icon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="..\UNLICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
Expand Down

0 comments on commit 6f5dcd1

Please sign in to comment.