Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dduan/TOMLDeserializer
Replaced by https://github.com/dduan/TOMLDecoder
https://github.com/dduan/TOMLDeserializer
toml toml-parser
Last synced: 3 months ago
JSON representation
Replaced by https://github.com/dduan/TOMLDecoder
- Host: GitHub
- URL: https://github.com/dduan/TOMLDeserializer
- Owner: dduan
- License: mit
- Archived: true
- Created: 2019-02-20T19:13:41.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2022-03-31T20:06:33.000Z (almost 3 years ago)
- Last Synced: 2024-11-12T00:40:34.325Z (3 months ago)
- Topics: toml, toml-parser
- Language: Swift
- Homepage:
- Size: 119 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
*This project has been merged with [TOMLDecoder][]*, and will not receive further updates.*
# TOMLDeserializer
Turn TOML data into Swift objects.
```swift
try TOMLDeserializer.tomlTable(with: data) // [String: Any]
```Compatible with [TOML v0.5.0][]
Unless you have a good reason not to, [TOMLDecoder][] is probably a better choice for your TOML needs.
[TOML v0.5.0]: https://github.com/toml-lang/toml/blob/master/versions/en/toml-v0.5.0.md
[TOMLDecoder]: https://github.com/dduan/TOMLDecoder## Installation
#### With [CocoaPods](http://cocoapods.org/)
```ruby
use_frameworks!pod "TOMLDeserializer"
```#### With [SwiftPM](https://swift.org/package-manager)
```swift
.package(url: "https://github.com/dduan/TOMLDeserializer", from: "0.2.5")
```#### With [Carthage](https://github.com/Carthage/Carthage)
```
github "dduan/TOMLDeserializer"
```## Types
In addition to Swift types from the standard library, date and time are
represeted with types from the [NetTime][] library. The following is a mapping
from types defined in the TOML spec to Swift types.| TOML | Swift |
| - | - |
| String | `Swift.String` |
| Integer | `Swift.Int64` |
| Float | `Swift.Double` |
| Boolean | `Swift.Bool` |
| Local Time | `NetTime.LocalTime` |
| Local Date | `NetTime.LocalDate` |
| Local Date-Time | `NetTime.LocalDateTime` |
| Offset Date-Time | `NetTime.DateTime` |
| Array | `Swift.[Any]` |
| Table | `Swift.[String: Any]` |[NetTime]: https://github.com/dduan/NetTime
## License
MIT. See `LICENSE.md`.