Mercurial > hg > octave-nkf
diff src/ls-hdf5.h @ 5255:3c4237738c3e
[project @ 2005-03-29 18:35:32 by jwe]
author | jwe |
---|---|
date | Tue, 29 Mar 2005 18:35:32 +0000 |
parents | b0d6da24caeb |
children | 4c8a2e4e0717 |
line wrap: on
line diff
--- a/src/ls-hdf5.h +++ b/src/ls-hdf5.h @@ -45,9 +45,9 @@ hdf5_fstreambase (const char *name, int mode, int /* prot */ = 0) { - if (mode == std::ios::in) + if (mode & std::ios::in) file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT); - else if (mode == std::ios::out) + else if (mode & std::ios::out) file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (file_id < 0) @@ -70,9 +70,9 @@ { clear (); - if (mode == std::ios::in) + if (mode & std::ios::in) file_id = H5Fopen (name, H5F_ACC_RDONLY, H5P_DEFAULT); - else if (mode == std::ios::out) + else if (mode & std::ios::out) file_id = H5Fcreate (name, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (file_id < 0) @@ -91,10 +91,12 @@ hdf5_ifstream () : hdf5_fstreambase (), std::istream (0) { } - hdf5_ifstream (const char *name, int mode = std::ios::in, int prot = 0) + hdf5_ifstream (const char *name, int mode = std::ios::in|std::ios::binary, + int prot = 0) : hdf5_fstreambase (name, mode, prot), std::istream (0) { } - void open (const char *name, int mode = std::ios::in, int prot = 0) + void open (const char *name, int mode = std::ios::in|std::ios::binary, + int prot = 0) { hdf5_fstreambase::open (name, mode, prot); } }; @@ -104,10 +106,12 @@ hdf5_ofstream () : hdf5_fstreambase (), std::ostream (0) { } - hdf5_ofstream (const char *name, int mode = std::ios::out, int prot = 0) + hdf5_ofstream (const char *name, int mode = std::ios::out|std::ios::binary, + int prot = 0) : hdf5_fstreambase (name, mode, prot), std::ostream (0) { } - void open (const char *name, int mode = std::ios::out, int prot = 0) + void open (const char *name, int mode = std::ios::out|std::ios::binary, + int prot = 0) { hdf5_fstreambase::open (name, mode, prot); } };