23 #if defined (HAVE_CONFIG_H)
141 unsigned char tmp = 0;
143 int32_t name_len = 0;
151 is.read (reinterpret_cast<char *> (&name_len), 4);
159 name[name_len] =
'\0';
160 if (! is.read (reinterpret_cast<char *> (
name), name_len))
161 error (
"load: trouble reading binary file '%s'", filename.c_str ());
165 is.read (reinterpret_cast<char *> (&doc_len), 4);
167 error (
"load: trouble reading binary file '%s'", filename.c_str ());
173 tdoc[doc_len] =
'\0';
174 if (! is.read (reinterpret_cast<char *> (tdoc), doc_len))
175 error (
"load: trouble reading binary file '%s'", filename.c_str ());
179 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
180 error (
"load: trouble reading binary file '%s'", filename.c_str ());
181 global = tmp ? 1 : 0;
184 if (! is.read (reinterpret_cast<char *> (&tmp), 1))
185 error (
"load: trouble reading binary file '%s'", filename.c_str ());
212 if (! is.read (reinterpret_cast<char *> (&len), 4))
213 error (
"load: trouble reading binary file '%s'", filename.c_str ());
217 if (! is.read (reinterpret_cast<char *> (
s), len))
218 error (
"load: trouble reading binary file '%s'", filename.c_str ());
239 if (! is.read (reinterpret_cast<char *> (&len), 4))
240 error (
"load: trouble reading binary file '%s'", filename.c_str ());
244 if (! is.read (
s, len))
245 error (
"load: trouble reading binary file '%s'", filename.c_str ());
252 error (
"load: trouble reading binary file '%s'", filename.c_str ());
257 error (
"load: trouble reading binary file '%s'", filename.c_str ());
271 int32_t name_len = name.length ();
273 os.write (reinterpret_cast<char *> (&name_len), 4);
276 int32_t doc_len = doc.
length ();
278 os.write (reinterpret_cast<char *> (&doc_len), 4);
283 tmp = mark_as_global;
284 os.write (reinterpret_cast<char *> (&tmp), 1);
288 os.write (reinterpret_cast<char *> (&tmp), 1);
292 int32_t len = typ.length ();
293 os.write (reinterpret_cast<char *> (&len), 4);
294 const char *btmp = typ.data ();
295 os.write (btmp, len);
301 bool success = val.
save_binary (os, save_as_floats);
303 return (os && success);
identity matrix If supplied two scalar respectively For allows like xample val
octave_idx_type length(void) const
void error(const char *fmt,...)
static octave_value lookup_type(const std::string &nm)
void swap_bytes< 4 >(void *ptr)
bool save_binary(std::ostream &os, bool &save_as_floats)
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)
std::string type_name(void) const
bool save_binary_data(std::ostream &os, const octave_value &tc, const std::string &name, const std::string &doc, bool mark_as_global, bool save_as_floats)
#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)
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