Skip to content

Commit

Permalink
Moved up NullSymbol/Upd impromptu-interface
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtule committed Jan 4, 2018
1 parent 57deed1 commit 2b2c4e4
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 34 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ obj
*.suo

*.user
.idea/*
8 changes: 3 additions & 5 deletions DotNetDBF.Enumerable/DotNetDBF.Enumerable.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net40</TargetFramework>
<TargetFrameworks>net40;netstandard2.0</TargetFrameworks>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<PackageId>dotnetdbf.enumerable</PackageId>
Expand All @@ -15,17 +15,15 @@
<RepositoryType>gits</RepositoryType>
<PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>4.3.11.0</Version>
<AssemblyVersion>4.3.11.0</AssemblyVersion>
<FileVersion>4.3.11.0</FileVersion>
<Version>5.0.4</Version>
<IncludeSymbols>True</IncludeSymbols>
<IncludeSource>True</IncludeSource>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ImpromptuInterface" Version="6.2.2" />
<PackageReference Include="ImpromptuInterface" Version="7.0.1-*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DotNetDBF\DotNetDBF.csproj" />
Expand Down
8 changes: 4 additions & 4 deletions DotNetDBF.Enumerable/Enumerable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
using ImpromptuInterface;
using ImpromptuInterface.Dynamic;
using Dynamitey;

namespace DotNetDBF.Enumerable
{
Expand Down Expand Up @@ -37,7 +37,7 @@ public DBFIntercepter(object[] wrappedObj, string[] fieldNames) : base(wrappedOb
/// <summary>
/// DBF Dynamic Wrapper
/// </summary>
public abstract class BaseDBFIntercepter : ImpromptuObject, IDBFIntercepter
public abstract class BaseDBFIntercepter : Dynamitey.DynamicObjects.BaseObject, IDBFIntercepter
{
private readonly string[] _fieldNames;
private readonly object[] _wrappedArray;
Expand Down Expand Up @@ -75,7 +75,7 @@ public override bool TryGetMember(GetMemberBinder binder, out object result)
Type outType;
if (TryTypeForName(tLookup, out outType))
{
result = Impromptu.CoerceConvert(result, outType);
result = Dynamic.CoerceConvert(result, outType);
}

return true;
Expand All @@ -93,7 +93,7 @@ public override bool TrySetMember(SetMemberBinder binder, object value)
Type outType;
if (TryTypeForName(tLookup, out outType))
{
value = Impromptu.CoerceConvert(value, outType);
value = Dynamic.CoerceConvert(value, outType);
}

_wrappedArray[tIndex] = value;
Expand Down
14 changes: 14 additions & 0 deletions DotNetDBF/DBFBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ suggested by Nick Voznesensky <[email protected]>
Base class for DBFReader and DBFWriter.
*/

using System;
using System.Text;

namespace DotNetDBF
Expand All @@ -24,6 +25,7 @@ public abstract class DBFBase
{
protected Encoding _charEncoding = Encoding.GetEncoding("utf-8");
protected int _blockSize = 512;
private string _nullSymbol;

public Encoding CharEncoding
{
Expand All @@ -38,5 +40,17 @@ public int BlockSize

get { return _blockSize; }
}

public string NullSymbol
{
get { return _nullSymbol ?? DBFFieldType.Unknown; }
set
{
if (value != null && value.Length != 1)
throw new ArgumentException(nameof(NullSymbol));
_nullSymbol = value;
}
}

}
}
14 changes: 2 additions & 12 deletions DotNetDBF/DBFReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class DBFReader : DBFBase, IDisposable
private int[] _orderedSelectFields = new int[] {};
/* Class specific variables */
private bool _isClosed = true;
private string _nullSymbol;


/**
Initializes a DBFReader object.
Expand Down Expand Up @@ -162,17 +162,7 @@ public string DataMemoLoc
}
#endif

public string NullSymbol
{
get { return _nullSymbol ?? DBFFieldType.Unknown; }
set
{
if (value != null && value.Length != 1)
throw new ArgumentException(nameof(NullSymbol));
_nullSymbol = value;
}
}


public delegate Stream LazyStream();

private Stream _loadedStream;
Expand Down
10 changes: 0 additions & 10 deletions DotNetDBF/DBFWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,6 @@ public byte LanguageDriver
}
}

public string NullSymbol
{
get { return _nullSymbol ?? DBFFieldType.Unknown; }
set
{
if (value != null && value.Length != 1)
throw new ArgumentException(nameof(NullSymbol));
_nullSymbol = value;
}
}

public DBFField[] Fields
{
Expand Down
4 changes: 1 addition & 3 deletions DotNetDBF/DotNetDBF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
<TargetFrameworks>net35;netstandard1.3</TargetFrameworks>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>sn.snk</AssemblyOriginatorKeyFile>
<Version>5.0.3.0</Version>
<AssemblyVersion>5.0.3.0</AssemblyVersion>
<FileVersion>5.0.3.0</FileVersion>
<Version>5.0.4.0</Version>
<Company>Ekon Benefits</Company>
<Copyright>Copyright 2009-2017</Copyright>
<Description>This is a basic file parser for reading and writing xBase DBF files particularlly Clipper. Code originally derived from javadbf.</Description>
Expand Down

0 comments on commit 2b2c4e4

Please sign in to comment.