//
//  SHRecordModel.swift
//  ShorthandMaster
//
//  Created by 明津李 on 2020/8/11.
//  Copyright © 2020 明津李. All rights reserved.
//

import UIKit

class SHRecordModel: NSObject{
    
    @objc var createDate: Date = Date()
    @objc var modifyDate: Date = Date()
    @objc var deleteDate: Date = Date()
    
    @objc var during: NSInteger = 0
    @objc var address: String = ""
    @objc var rename: String = ""
    @objc var pathFile: String = ""
    @objc var pcmPathFile: String = ""
    @objc var txt: String = ""
    
    @objc var delete: Bool = false
    @objc var top: Bool = false

    @objc var fileData: Data = Data()
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
    }
    
//    //构造方法
//    required init(createDate:Date=Date(), modifyDate:Date=Date(), deleteDate:Date=Date(), during:NSInteger=0, address:String="", rename:String="", pathFile:String="", pcmPathFile:String="", txt:String="", delete:Bool=false, top:Bool=false, fileData:Data=Data()) {
//        self.createDate = createDate
//        self.modifyDate = modifyDate
//        self.deleteDate = deleteDate
//        
//        self.during = during
//        self.address = address
//        self.pathFile = pathFile
//        self.pcmPathFile = pcmPathFile
//        self.txt = txt
//        
//        self.delete = delete
//        self.top = top
//        
//        self.fileData = fileData
//        self.rename = rename
//    }
//
//    //从object解析回来
//    required init(coder decoder: NSCoder) {
//        self.createDate = (decoder.decodeObject(forKey: "createDate") as? Date)!
//        self.modifyDate = (decoder.decodeObject(forKey: "modifyDate") as? Date)!
//        self.deleteDate = (decoder.decodeObject(forKey: "deleteDate") as? Date)!
//        self.during = (decoder.decodeObject(forKey: "during") as? NSInteger)!
//        self.address = decoder.decodeObject(forKey: "address") as? String ?? ""
//        self.pathFile = decoder.decodeObject(forKey: "pathFile") as? String ?? ""
//        self.pcmPathFile = decoder.decodeObject(forKey: "pcmPathFile") as? String ?? ""
//        self.txt = decoder.decodeObject(forKey: "txt") as? String ?? ""
//        self.delete = decoder.decodeObject(forKey: "delete") as? Bool ?? false
//        self.top = decoder.decodeObject(forKey: "top") as? Bool ?? false
//        self.fileData = (decoder.decodeObject(forKey: "fileData") as? Data)!
//        self.rename = decoder.decodeObject(forKey: "rename") as? String ?? ""
//    }
//
//   //编码成object
//    func encode(with coder: NSCoder) {
//        coder.encode(createDate, forKey:"createDate")
//        coder.encode(modifyDate, forKey:"modifyDate")
//        coder.encode(deleteDate, forKey:"deleteDate")
//        coder.encode(during, forKey:"during")
//        coder.encode(address, forKey:"address")
//        coder.encode(pathFile, forKey:"pathFile")
//        coder.encode(pcmPathFile, forKey:"pcmPathFile")
//        coder.encode(txt, forKey:"txt")
//        coder.encode(delete, forKey:"delete")
//        coder.encode(top, forKey:"top")
//        coder.encode(fileData, forKey:"fileData")
//        coder.encode(rename, forKey:"rename")
//   }
}
