cdbfapiPlus C# for Windows

namespace cdbfapi
{
    class CDBFapi
    {
        bool libraryLoaded();

        void initLibrary(int magicNumber, string email);

        bool openDBFfile(string filename);
        void closeDBFfile();

        int recCount();
        int fieldCount();

        bool getRecord(int recno);
        bool readRecord(int recno);
        bool writeRecord(int recno);

        bool readField(int recno, int fieldno);
        bool writeField(int recno, int fieldno);

        int indexOfField(string fieldname);
        int indexOfField(string fieldname, EncodingInfo e);

        string getString(int fieldno);
        string getString(int fieldno, EncodingInfo e);

        double   getValue(int fieldno);
        DateTime getDateTime(int fieldno);
        Int64 	getTicks(int fieldno);

        byte[] 	getMemo(int fieldno, out int len);

        bool isMemoField(int fieldno);
        bool isNumericField(int fieldno);
        bool isDateField(int fieldno);

        bool isDeleted();
        bool isDeleted(int recno);

        void clearRecord();
        void clearField(int fieldno);

        void setField(int fieldno, string s, EncodingInfo e);
        void setField(int fieldno, byte[] s);
        void setField(int fieldno, double value);
        void setField(int fieldno, string s, double value, EncodingInfo e);
        void setField(int fieldno, byte[] s, double value);

        void setMemoBuf(int field, byte[] src, int len);

        bool markAsDeleted(int fieldno);
        bool recallDeleted(int fieldno);

        bool deleteRecord(int recno);
        bool appendRecord(bool blankrecord);
        bool insertRecord(int recno, bool blankrecord);

        void setOrder(string fieldlist, EncodingInfo e);
        void setOrder(byte[] fieldlist);
        void setOrderA(string[] fields);
        void unsetOrder();
        void descendingMode(bool descending);

        void setFilter(string expression, EncodingInfo e);
        void setFilter(byte[] expression);
        void unsetFilter();
        void caseSensitiveMode(bool sensitive);

        bool pack();
        bool truncate(int recno);
        bool zap();

        int    fileType();
        string filetypeAsText();

        int    recordLength();
        string lastUpdated();
        int    headerSize();

        string filename();
        string filenameMemo();
        string driverName();

        void resetLastRecord();

        string fieldName(int fieldno);
        string fieldName(int fieldno, EncodingInfo e);
        char   fieldType(int fieldno);
        int    fieldLength(int fieldno);
        int    fieldDecimal(int fieldno);

        static string fieldtypeAsText(char c);

        void setEncoding(Encoding e);
        void setDateFormat(string format);
        void setDateDelimiter(char delimiter);

        void setReadOnly(bool value);
        bool isReadOnly();

        bool prepareNewTable(int fileType);
        bool prepareNewTable(int fileType, int memoSize, string driver);

        void addField(string fieldname, char fieldType, int length);
        void addField(string fieldname, char fieldType, int length, int dec);

        bool createTable(string filename);
        bool createAndOpenTable(string filename);

        void setByte(int offset, byte b);
        byte getByte(int offset);

    }
}