FileInfo.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // FileInfo.swift
  3. // KdanAuto
  4. //
  5. // Created by 朱东勇 on 2023/2/5.
  6. //
  7. import Foundation
  8. extension NSMutableDictionary {
  9. class func fileInfoWith(_ fileName:String, refFilePath:String?, resultPath:String, comparePath:String, objc:AutoTest) -> NSMutableDictionary {
  10. let dic = NSMutableDictionary.init()
  11. dic.setValue(fileName, forKey: "fileName");
  12. dic.setValue(resultPath, forKey: "resultPath");
  13. dic.setValue(comparePath, forKey: "comparePath");
  14. if nil != refFilePath {
  15. dic.setValue(refFilePath, forKey: "refFilePath")
  16. }
  17. dic.setValue(objc, forKey: "objc");
  18. return dic
  19. }
  20. func fileName() -> String {
  21. return self.value(forKey: "fileName") as! String
  22. }
  23. func resultPath() -> String {
  24. return self.value(forKey: "resultPath") as! String
  25. }
  26. func comparePath() -> String {
  27. return self.value(forKey: "comparePath") as! String
  28. }
  29. func refFilePath() -> String? {
  30. if nil == self.value(forKey: "refFilePath") {
  31. return nil
  32. }
  33. return self.value(forKey: "refFilePath") as? String
  34. }
  35. func objc() -> AutoTest {
  36. return self.value(forKey: "objc") as! AutoTest
  37. }
  38. }