Skip to content

Commit

Permalink
Cifs can also be constructed from an IOStream
Browse files Browse the repository at this point in the history
  • Loading branch information
James.Hester committed Oct 10, 2024
1 parent ba9af4d commit 3fcfa27
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/cif_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -724,8 +724,13 @@ Cif(somepath; verbose=false, native=true, version=0) = begin
if Sys.iswindows() && !native
@debug "Did not use cif_api on Windows"
end
full_contents = read(full, String)
cif_from_string(full_contents, verbose=verbose, version=version, source=full)
Cif(open(full), verbose = verbose, version = version, source = full)
end

Cif(io::IO; verbose = false, version = 0, source = nothing) = begin
full_contents = read(io, String)
if isnothing(source) source = "$io" end
cif_from_string(full_contents, verbose = verbose, version = version, source = source)
end

"""
Expand Down

0 comments on commit 3fcfa27

Please sign in to comment.