23 #if defined (HAVE_CONFIG_H) 128 unsigned char tmp = 0;
130 int32_t name_len = 0;
138 is.read (reinterpret_cast<char *> (&name_len), 4);
146 name[name_len] =
'\0';
147 if (!
is.read (reinterpret_cast<char *> (
name), name_len))
148 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
152 is.read (reinterpret_cast<char *> (&doc_len), 4);
154 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
160 tdoc[doc_len] =
'\0';
161 if (!
is.read (reinterpret_cast<char *> (tdoc), doc_len))
162 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
166 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
167 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
168 global = (
tmp ? 1 : 0);
171 if (!
is.read (reinterpret_cast<char *> (&
tmp), 1))
172 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
202 if (!
is.read (reinterpret_cast<char *> (&len), 4))
203 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
207 if (!
is.read (reinterpret_cast<char *> (
s), len))
208 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
229 if (!
is.read (reinterpret_cast<char *> (&len), 4))
230 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
234 if (!
is.read (
s, len))
235 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
242 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
247 error (
"load: trouble reading binary file '%s'",
filename.c_str ());
261 int32_t name_len =
name.length ();
263 os.
write (reinterpret_cast<char *> (&name_len), 4);
266 int32_t doc_len = doc.length ();
268 os.
write (reinterpret_cast<char *> (&doc_len), 4);
274 os.
write (reinterpret_cast<char *> (&
tmp), 1);
278 os.
write (reinterpret_cast<char *> (&
tmp), 1);
282 int32_t len = typ.length ();
283 os.
write (reinterpret_cast<char *> (&len), 4);
284 const char *btmp = typ.data ();
293 return (
os && success);
octave_idx_type write(const octave_value &data, octave_idx_type block_size, oct_data_conv::data_type output_type, octave_idx_type skip, mach_info::float_format flt_fmt)
octave_value lookup_type(const std::string &nm)
identity matrix If supplied two scalar respectively For allows like xample val
void error(const char *fmt,...)
nd deftypefn *std::string name
void swap_bytes< 4 >(void *ptr)
type_info & __get_type_info__(const std::string &who)
std::string read_binary_data(std::istream &is, bool swap, octave::mach_info::float_format fmt, const std::string &filename, bool &global, octave_value &tc, std::string &doc)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
write the output to stdout if nargout is
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
std::string type_name(void) const
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
bool save_binary_data(std::ostream &os, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_global, bool save_as_floats)