Skip to content

Commit 5f89602

Browse files
committed
Convert Readme to asciidoc
1 parent aebe1c3 commit 5f89602

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1-
# BSONSerialization
1+
= BSONSerialization
22
BSON Serialization in native Swift
33

4-
## Installation & Compatibility
4+
== Installation & Compatibility
55
The recommended (and only tested) way to install and use BSONSerialization is
6-
via `SwiftPM`, using at least Swift 4.
6+
via `SwiftPM`, using at least Swift 5.1.
77

88
The content of your `Package.swift` should be something resembling:
9-
```swift
9+
[source,swift]
10+
----
1011
import PackageDescription
1112
1213
let package = Package(
1314
name: "MyAwesomePackage",
1415
dependencies: [.package(url: "https://github.com/Frizlab/BSONSerialization.git", from: "2.0.0")]
1516
)
16-
```
17+
----
1718

18-
## Usage
19+
== Usage
1920
`BSONSerialization` has the same basic interface than `JSONSerialization`.
2021

2122
Example of use:
22-
```swift
23+
[source,swift]
24+
----
2325
let myFirstBSONDoc = ["key": "value"]
2426
let serializedBSONDoc = try BSONSerialization.data(withBSONObject: myFirstBSONDoc, options: [])
2527
let unserializedBSONDoc = try BSONSerialization.bsonObject(with: serializedBSONDoc, options: [])
2628
try areBSONDocEqual(myFirstBSONDoc, unserializedBSONDoc) /* Returns true */
27-
```
29+
----
2830

2931
Serializing/deserializing to/from a stream is also supported. (Note: Due to the
3032
specifications of the BSON format, serializing to a Data object is faster than
@@ -33,7 +35,7 @@ serializing to a stream.)
3335
Finally, a method lets you know if a given dictionary can be serialized as a
3436
BSON document.
3537

36-
## Alternatives
38+
== Alternatives
3739
First, a word about the philosophy of this project. Most BSON frameworks create
3840
a whole new type to represent the BSON document. This is useful to add new
3941
elements to the documents and have the document serialization ready at all times.
@@ -47,21 +49,21 @@ If you prefer having an actual BSON object to which you can add elements
4749
instead of standard Foundation object which are serialized later, I would
4850
recommend this project: https://github.com/OpenKitten/BSON
4951

50-
## Reference
52+
== Reference
5153
I used the BSON specification version 1.1 from http://bsonspec.org/spec.html
5254

5355
All types in this specification, including deprecated ones are supported.
5456

55-
## To Do
56-
- [ ] Allow direct serialization of `Data` object instead of having to use the
57+
== To Do
58+
* [ ] Allow direct serialization of `Data` object instead of having to use the
5759
`MongoBinary` type
58-
- [ ] Allow serializing Int64 or Int32 to Int directly, depending on the platform
59-
- [ ] Xcode target for an iOS Framework
60+
* [ ] Allow serializing Int64 or Int32 to Int directly, depending on the platform
61+
* [ ] Xcode target for an iOS Framework
6062

6163
I’ll work seriously on the project if it gains enough attention. Feel free to
6264
open issues, I’ll do my best to answer.
6365

6466
Pull requests are welcome 😉
6567

66-
## License
68+
== License
6769
MIT (see License.txt file)

0 commit comments

Comments
 (0)