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)
  • Loading branch information
kjessup authored Aug 2, 2016
2 parents 914beed + 9a46b92 commit e4329b4
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 e4329b4

Please sign in to comment.