# HG changeset patch # User John W. Eaton # Date 1491498729 14400 # Node ID 08db4e9dd14995fd40ae7d08706bd11a3090500e # Parent 1a2941fb8ffd8ba1583519b533a0a906b15eb7b5 * Cell.h, Cell.cc (Cell::string_vector_value): New function. diff -r 1a2941fb8ffd -r 08db4e9dd149 libinterp/corefcn/Cell.cc --- a/libinterp/corefcn/Cell.cc Wed Apr 05 16:54:21 2017 -0700 +++ b/libinterp/corefcn/Cell.cc Thu Apr 06 13:12:09 2017 -0400 @@ -151,6 +151,19 @@ return retval; } +string_vector +Cell::string_vector_value (void) const +{ + octave_idx_type n = numel (); + + string_vector retval (n); + + for (octave_idx_type i = 0; i < n; i++) + retval.xelem (i) = elem (i).string_value (); + + return retval; +} + Cell Cell::index (const octave_value_list& idx_arg, bool resize_ok) const { diff -r 1a2941fb8ffd -r 08db4e9dd149 libinterp/corefcn/Cell.h --- a/libinterp/corefcn/Cell.h Wed Apr 05 16:54:21 2017 -0700 +++ b/libinterp/corefcn/Cell.h Thu Apr 06 13:12:09 2017 -0400 @@ -76,6 +76,8 @@ Array cellstr_value (void) const; + string_vector string_vector_value (void) const; + using Array::index; Cell index (const octave_value_list& idx, bool resize_ok = false) const;