Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hughbe/emfplusreader
Swift definitions for structures, enumerations and functions defined in [MS-EMFPLUS]
https://github.com/hughbe/emfplusreader
Last synced: 2 days ago
JSON representation
Swift definitions for structures, enumerations and functions defined in [MS-EMFPLUS]
- Host: GitHub
- URL: https://github.com/hughbe/emfplusreader
- Owner: hughbe
- Created: 2020-12-23T12:39:25.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-01-05T15:49:14.000Z (about 4 years ago)
- Last Synced: 2024-11-10T12:47:31.324Z (about 2 months ago)
- Language: Swift
- Size: 14.9 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# EmfPlusReader
Swift definitions for structures, enumerations and functions defined in [MS-EMFPLUS](https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-emfplus/)
## Example Usage
Add the following line to your project's SwiftPM dependencies:
```swift
.package(url: "https://github.com/hughbe/EmfPlusReader", from: "1.0.0"),
``````swift
import EmfReader
import EmfPlusReaderlet data = Data(contentsOfFile: ".emf")!
let file = try EmfFile(data: data)
var emfPlusData = Data()
try file.enumerateRecords { record in
guard case let .comment(comment) = record,
case let .commentEmfPlus(emfPlusComment) = comment else {
return .continue
}emfPlusData += emfPlusComment.emfPlusRecords
return .continue
}let emfPlusFile = try EmfPlusFile(data: emfPlusData)
try emfPlusFile.enumerateRecords { record in
if case let .object(object) = record {
if case .continues = object.objectData {
return .continue
}
}print(record)
return .continue
}
```