diff src/ov-struct.cc @ 4791:62f2fb593455

[project @ 2004-02-20 18:02:59 by jwe]
author jwe
date Fri, 20 Feb 2004 18:02:59 +0000
parents 5eb5b8aaed8a
children d2038299c683
line wrap: on
line diff
--- a/src/ov-struct.cc	Thu Feb 19 20:15:18 2004 +0000
+++ b/src/ov-struct.cc	Fri Feb 20 18:02:59 2004 +0000
@@ -353,6 +353,25 @@
   return retval;
 }
 
+size_t
+octave_struct::byte_size (void) const
+{
+  // Neglect the size of the fieldnames.
+
+  size_t retval = 0;
+
+  for (Octave_map::const_iterator p = map.begin (); p != map.end (); p++)
+    {
+      std::string key = map.key (p);
+
+      octave_value val = octave_value (map.contents (p));
+
+      retval += val.byte_size ();
+    }
+
+  return retval;
+}
+
 void
 octave_struct::print (std::ostream& os, bool) const
 {