cdbfapi.framework for iOS, OSX, Swift

class cdbfapi : NSObject {
    
    func initLibrary(_ magicNumber: Int, email: String)
    
    func openDBFfile(_ filename: String) -> Bool
    func closeDBFfile()

    func recCount() -> Int
    func fieldCount() -> Int

    func getRecord(_ recno: Int) -> Bool
    func readRecord(_ recno: Int) -> Bool
    func writeRecord(_ recno: Int) -> Bool

    func readField(_ recno: Int, fieldno: Int) -> Bool
    func writeField(_ recno: Int, fieldno: Int) -> Bool

    func indexOfField(_ fieldname: String) -> Int

    func getString(_ fieldno: Int) -> String?
    func getValue(_ fieldno: Int) -> Double

    func getDateTime(_ fieldno: Int) -> Date?
    func getTicks(_ fieldno: Int) -> Int64
    func getMemoBuf(_ fieldno: Int) -> Data?

    func isMemoField(_ fieldno: Int) -> Bool
    func isNumericField(_ fieldno: Int) -> Bool
    func isDateField(_ fieldno: Int) -> Bool
    
    func isDeleted() -> Bool
    func isDeleted(_ recno: Int) -> Bool

    func clearRecord()
    func clearField(_ fieldno: Int)
    
    func setField(_ fieldno: Int, asString string: String?)
    func setField(_ fieldno: Int, asDouble value: Double)
    func setField(_ fieldno: Int, asString string: String?, asDouble value: Double)
    
    func setMemoBuf(_ fieldno: Int, data: Data)
    
    func markAsDeleted(_ recno: Int) -> Bool
    func recallDeleted(_ recno: Int) -> Bool

    func deleteRecord(_ recno: Int) -> Bool
    func appendRecord(_ blank: Bool) -> Bool
    func insertRecord(_ recno: Int, blank: Bool) -> Bool
    
    func setOrder(_ fieldlist: String)
    func setOrderA(_ array: [String])
    func unsetOrder()
    func descendingMode(_ descending: Bool)
    
    func setFilter(_ expression: String)
    func unsetFilter()
    func caseSensitiveMode(_ sensitive: Bool)
    
    func pack() -> Bool
    func truncate(_ recno: Int) -> Bool
    func zap() -> Bool
    
    func fileType() -> Int
    func filetypeAsText() -> String?
    
    func recordLength() -> Int
    func lastUpdated() -> String
    func headerSize() -> Int
     
    func filename() -> String?
    func filenameMemo() -> String?
    func driverName() -> String?
    
    func resetLastRecord()
    
    func fieldName(_ fieldno: Int) -> String?
    func fieldType(_ fieldno: Int) -> Int8
    func fieldLength(_ fieldno: Int) -> Int
    func fieldDecimal(_ fieldno: Int) -> Int

    class func typeAsText(_ c: Int8) -> String?
    
    func setEncoding(_ encoding: Int)
    func setDateFormat(_ format: String)
    func setDateDelimiter(_ c: Int8)
    
    func setReadOnly(_ value: Bool)
    func isReadOnly() -> Bool
    
    func prepareNewTable(_ fileType: Int) -> Bool
    func prepareNewTable(_ fileType: Int, memoSize: Int, driver: String?) -> Bool
    
    func addField(_ fieldname: String, fieldType c: Int8, length: Int)
    func addField(_ fieldname: String, fieldType c: Int8, length: Int, decimal: Int)
    
    func createTable(_ filename: String) -> Bool
    func createAndOpenTable(_ filename: String) -> Bool
    
    func setByte(_ offset: Int, byte: UInt8)
    func getByte(_ offset: Int) -> UInt8
    
   
}