@@ -11,10 +11,11 @@ immutable SAVE end
11
11
split_predicates (list) = filter (x-> x <: OS , list), filter (x-> ! (x <: OS ), list)
12
12
applies_to_os (os:: Vector ) = isempty (os) || any (applies_to_os, os)
13
13
applies_to_os {O <: OS} (os:: Type{O} ) = false
14
- @unix_only applies_to_os {U <: Unix} (os:: Type{U} ) = true
15
- @windows_only applies_to_os (os:: Type{Windows} ) = true
16
- @linux_only applies_to_os (os:: Type{OSX} ) = false
17
- @osx_only applies_to_os (os:: Type{Linux} ) = false
14
+
15
+ applies_to_os {U <: Unix} (os:: Type{U} ) = is_unix ()
16
+ applies_to_os (os:: Type{Windows} ) = is_windows ()
17
+ applies_to_os (os:: Type{OSX} ) = is_apple ()
18
+ applies_to_os (os:: Type{Linux} ) = is_linux ()
18
19
19
20
function add_loadsave (format, predicates)
20
21
library = shift! (predicates)
@@ -240,7 +241,7 @@ immutable Stream{F<:DataFormat,IOtype<:IO} <: Formatted{F}
240
241
end
241
242
242
243
Stream {F<:DataFormat} (:: Type{F} , io:: IO ) = Stream {F,typeof(io)} (io, Nullable {Compat.UTF8String} ())
243
- Stream {F<:DataFormat} (:: Type{F} , io:: IO , filename:: AbstractString ) = Stream {F,typeof(io)} (io,utf8 (filename))
244
+ Stream {F<:DataFormat} (:: Type{F} , io:: IO , filename:: AbstractString ) = Stream {F,typeof(io)} (io,Compat . String (filename))
244
245
Stream {F<:DataFormat} (:: Type{F} , io:: IO , filename) = Stream {F,typeof(io)} (io,filename)
245
246
Stream {F} (file:: File{F} , io:: IO ) = Stream {F,typeof(io)} (io,filename (file))
246
247
@@ -383,7 +384,7 @@ hasfunction(s::Tuple) = false #has magic
383
384
@doc """
384
385
`query(io, [filename])` returns a `Stream` object with information about the
385
386
format inferred from the magic bytes.""" ->
386
- query (io:: IO , filename) = query (io, Nullable (utf8 (filename)))
387
+ query (io:: IO , filename) = query (io, Nullable (Compat . String (filename)))
387
388
388
389
function query (io:: IO , filename:: Nullable{Compat.UTF8String} = Nullable {Compat.UTF8String} ())
389
390
magic = Array (UInt8, 0 )
0 commit comments