Skip to content

Commit

Permalink
Issue #56: Adds Records/src/common.jl to package
Browse files Browse the repository at this point in the history
- Adds the Records/src/common.jl file that contains IO functions for Records objects.
  • Loading branch information
exoticDFT committed Mar 10, 2020
1 parent 6a7fb0c commit f28d6fe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/records/common.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Base.write(io::IO, ::MIME"text/plain", ::Nothing) = nothing
function Base.read(io::IO, ::MIME"text/plain", ::Nothing)
readline(io)
return nothing
end

Base.write(io::IO, ::MIME"text/plain", i::Integer) = print(io, i)
Base.read(io::IO, ::MIME"text/plain", ::Type{I}) where {I<:Integer} = parse(I, readline(io))

Base.write(io::IO, ::MIME"text/plain", r::Float64) = print(io, r)
Base.read(io::IO, ::MIME"text/plain", ::Type{F}) where {F<:AbstractFloat} = parse(F, readline(io))

0 comments on commit f28d6fe

Please sign in to comment.