Import dotnetDBF for error handling.

This commit is contained in:
Patrick Fic
2022-02-11 15:06:05 -08:00
parent 991ad38839
commit f32c149bae
75 changed files with 5585 additions and 7 deletions

44
dotnetdbf/DBFBase.cs Normal file
View File

@@ -0,0 +1,44 @@
/*
Serves as the base class of DBFReader adn DBFWriter.
This file is part of DotNetDBF packege.
original author (javadbf): anil@linuxense.com 2004/03/31
license: LGPL (http://www.gnu.org/copyleft/lesser.html)
Support for choosing implemented character Sets as
suggested by Nick Voznesensky <darkers@mail.ru>
ported to C# (DotNetDBF): Jay Tuley <jay+dotnetdbf@tuley.name> 6/28/2007
*/
/**
Base class for DBFReader and DBFWriter.
*/
using System;
using System.Text;
namespace DotNetDBF
{
public abstract class DBFBase
{
public Encoding CharEncoding { get; set; } = Encoding.GetEncoding("utf-8");
public int BlockSize { get; set; } = 512;
private string _nullSymbol;
public string NullSymbol
{
get => _nullSymbol ?? DBFFieldType.Unknown;
set
{
if (value != null && value.Length != 1)
throw new ArgumentException(nameof(NullSymbol));
_nullSymbol = value;
}
}
}
}