Skip to content

Commit

Permalink
Merge pull request PerfectlySoft#214 from rymcol/JSON-Int32-Int64
Browse files Browse the repository at this point in the history
Added Int32 & Int64 Extensions (Plus Unsigned)

Former-commit-id: e4329b4
Former-commit-id: 8dca59154841e6ca481d84c6cc1e662488300a71
Former-commit-id: 1da692dcad6e36da68a04834626fe5b7cc0a6a0e
Former-commit-id: 0547a6492e15a041f265e96f1db89dea5aaed374
  • Loading branch information
kjessup authored Aug 2, 2016
2 parents bce90ee + 9fb7987 commit ae4724a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Sources/PerfectLib/JSONConvertible.swift
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,34 @@ extension UInt: JSONConvertible {
}
}

extension Int32: JSONConvertible {
/// Convert an Int into JSON text.
public func jsonEncodedString() throws -> String {
return String(self)
}
}

extension Int64: JSONConvertible {
/// Convert an Int into JSON text.
public func jsonEncodedString() throws -> String {
return String(self)
}
}

extension UInt32: JSONConvertible {
/// Convert an Int into JSON text.
public func jsonEncodedString() throws -> String {
return String(self)
}
}

extension UInt64: JSONConvertible {
/// Convert an Int into JSON text.
public func jsonEncodedString() throws -> String {
return String(self)
}
}

extension Double: JSONConvertible {
/// Convert a Double into JSON text.
public func jsonEncodedString() throws -> String {
Expand Down

0 comments on commit ae4724a

Please sign in to comment.