Skip to content

Commit

Permalink
Merge pull request #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
  • Loading branch information
kjessup authored Aug 2, 2016
2 parents 4b32a5b + 4b27983 commit c1251a6
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 c1251a6

Please sign in to comment.