diff liboctave/str-vec.cc @ 4392:dd108fa566fa

[project @ 2003-04-26 17:00:24 by jwe]
author jwe
date Sat, 26 Apr 2003 17:00:24 +0000
parents c20a1e67cef6
children f682f9258271
line wrap: on
line diff
--- a/liboctave/str-vec.cc
+++ b/liboctave/str-vec.cc
@@ -97,6 +97,33 @@
   return *this;
 }
 
+string_vector&
+string_vector::append (const std::string& s)
+{
+  int len = length ();
+
+  resize (len + 1);
+
+  elem(len) = s;
+
+  return *this;
+}
+
+string_vector&
+string_vector::append (const string_vector& sv)
+{
+  int len = length ();
+
+  int new_len = len + sv.length ();
+
+  resize (new_len);
+
+  for (int i = 0; i < new_len; i++)
+    elem(len + i) = sv[i];
+
+  return *this;
+}
+
 char **
 string_vector::c_str_vec (void) const
 {