KMPageEditSettingBaseModel.swift 984 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // KMPageEditSettingBaseModel.swift
  3. // PDF Master
  4. //
  5. // Created by tangchao on 2023/1/12.
  6. //
  7. import Cocoa
  8. class KMPageEditSettingBaseModel: NSObject {
  9. var documentURL: URL!
  10. var password: String = ""
  11. var fileName: String!
  12. var pathExtension: String!
  13. var outputFileNameDeletePathExtension: String!
  14. var outputFileName: String {
  15. get {
  16. if (fileName == nil || fileName.isEmpty) {
  17. return ""
  18. }
  19. var result: String = ""
  20. let pathExtension = fileName.components(separatedBy: ".").last
  21. let files = fileName.split(separator: ".")
  22. for i in 0 ..< files.count-1 {
  23. let file: String = String(files[i])
  24. result.append(file)
  25. if (i == files.count-2) {
  26. result.append(".")
  27. }
  28. }
  29. return fileName
  30. }
  31. }
  32. var pageCount: Int = 0
  33. }