Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dduan/TOMLDeserializer

Replaced by https://github.com/dduan/TOMLDecoder
https://github.com/dduan/TOMLDeserializer

toml toml-parser

Last synced: about 2 months ago
JSON representation

Replaced by https://github.com/dduan/TOMLDecoder

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`.