# HG changeset patch # User Rik # Date 1451185185 28800 # Node ID fc9cca99b2de6754ed46800618ff59b6103b1794 # Parent 98e75f952a36125a5a8e583e7d6ccb1eefff1ce2 Deprecate all_strings, replace with string_vector_value. * daspk.cc, dasrt.cc, dassl.cc, dirfns.cc, gl-render.cc, gl2ps-renderer.cc, graphics.cc, graphics.in.h, lsode.cc, str2double.cc, strfns.cc, syscalls.cc, sysdep.cc, utils.cc, ov-base.cc, ov-base.h, ov-cell.cc, ov-cell.h, ov-class.cc, ov-class.h, ov-str-mat.cc, ov-str-mat.h, ov.cc, ovl.cc: Replace [x]all_strings with [x]string_vector_value. * ov.h(all_strings): Add GCC_ATTR_DEPRECATED warning to function prototype. Change it to call string_vector_value. * ov.h(string_vector_value): New prototype to call rep's string_vector_value function. diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/daspk.cc --- a/libinterp/corefcn/daspk.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/daspk.cc Sat Dec 26 18:59:45 2015 -0800 @@ -350,7 +350,7 @@ case 2: { - string_vector tmp = f_arg.all_strings (); + string_vector tmp = f_arg.string_vector_value (); fcn_name = unique_symbol_name ("__daspk_fcn__"); fname = "function y = "; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/dasrt.cc --- a/libinterp/corefcn/dasrt.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/dasrt.cc Sat Dec 26 18:59:45 2015 -0800 @@ -432,7 +432,7 @@ case 2: { - string_vector tmp = args(0).all_strings (); + string_vector tmp = args(0).string_vector_value (); fcn_name = unique_symbol_name ("__dasrt_fcn__"); fname = "function y = "; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/dassl.cc --- a/libinterp/corefcn/dassl.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/dassl.cc Sat Dec 26 18:59:45 2015 -0800 @@ -351,7 +351,7 @@ case 2: { - string_vector tmp = f_arg.all_strings (); + string_vector tmp = f_arg.string_vector_value (); fcn_name = unique_symbol_name ("__dassl_fcn__"); fname = "function y = "; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/dirfns.cc --- a/libinterp/corefcn/dirfns.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/dirfns.cc Sat Dec 26 18:59:45 2015 -0800 @@ -479,7 +479,7 @@ if (args.length () != 1) print_usage (); - string_vector pat = args(0).xall_strings ("glob: PATTERN must be a string"); + string_vector pat = args(0).xstring_vector_value ("glob: PATTERN must be a string"); glob_match pattern (file_ops::tilde_expand (pat)); @@ -540,8 +540,8 @@ if (args.length () != 2) print_usage (); - string_vector pat = args(0).all_strings (); - string_vector str = args(1).all_strings (); + string_vector pat = args(0).string_vector_value (); + string_vector str = args(1).string_vector_value (); glob_match pattern (file_ops::tilde_expand (pat)); diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/gl-render.cc --- a/libinterp/corefcn/gl-render.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/gl-render.cc Sat Dec 26 18:59:45 2015 -0800 @@ -1052,7 +1052,7 @@ bool do_xminortick = props.is_xminortick (); Matrix xticks = xform.xscale (props.get_xtick ().matrix_value ()); Matrix xmticks = xform.xscale (props.get_xmtick ().matrix_value ()); - string_vector xticklabels = props.get_xticklabel ().all_strings (); + string_vector xticklabels = props.get_xticklabel ().string_vector_value (); int wmax = 0; int hmax = 0; bool tick_along_z = nearhoriz || xisinf (fy); @@ -1162,7 +1162,7 @@ bool do_yminortick = props.is_yminortick (); Matrix yticks = xform.yscale (props.get_ytick ().matrix_value ()); Matrix ymticks = xform.yscale (props.get_ymtick ().matrix_value ()); - string_vector yticklabels = props.get_yticklabel ().all_strings (); + string_vector yticklabels = props.get_yticklabel ().string_vector_value (); int wmax = 0; int hmax = 0; bool tick_along_z = nearhoriz || xisinf (fx); @@ -1263,7 +1263,7 @@ bool do_zminortick = props.is_zminortick (); Matrix zticks = xform.zscale (props.get_ztick ().matrix_value ()); Matrix zmticks = xform.zscale (props.get_zmtick ().matrix_value ()); - string_vector zticklabels = props.get_zticklabel ().all_strings (); + string_vector zticklabels = props.get_zticklabel ().string_vector_value (); int wmax = 0; int hmax = 0; bool mirror = props.is_box () && zstate != AXE_ANY_DIR; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/gl2ps-renderer.cc --- a/libinterp/corefcn/gl2ps-renderer.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/gl2ps-renderer.cc Sat Dec 26 18:59:45 2015 -0800 @@ -607,7 +607,7 @@ Matrix bbox; const Matrix pos = get_transform ().scale (props.get_data_position ()); - std::string str = props.get_string ().all_strings ().join ("\n"); + std::string str = props.get_string ().string_vector_value ().join ("\n"); render_text (str, pos(0), pos(1), pos.numel () > 2 ? pos(2) : 0.0, halign, valign, props.get_rotation ()); diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/graphics.cc --- a/libinterp/corefcn/graphics.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/graphics.cc Sat Dec 26 18:59:45 2015 -0800 @@ -5662,7 +5662,7 @@ Matrix ext (1, 2, 0.0); ext = get_ticklabel_extents (get_xtick ().matrix_value (), - get_xticklabel ().all_strings (), + get_xticklabel ().string_vector_value (), get_xlim ().matrix_value ()); double wmax = ext(0); @@ -5772,7 +5772,7 @@ // ALWAYS use an even number for padding or horizontal alignment // will be off. ext = get_ticklabel_extents (get_ytick ().matrix_value (), - get_yticklabel ().all_strings (), + get_yticklabel ().string_vector_value (), get_ylim ().matrix_value ()); double wmax = ext(0)+4; @@ -5875,7 +5875,7 @@ Matrix ext (1, 2, 0.0); ext = get_ticklabel_extents (get_ztick ().matrix_value (), - get_zticklabel ().all_strings (), + get_zticklabel ().string_vector_value (), get_zlim ().matrix_value ()); double wmax = ext(0); @@ -5985,7 +5985,7 @@ { Matrix ext (1, 2, 0.0); ext = get_ticklabel_extents (get_xtick ().matrix_value (), - get_xticklabel ().all_strings (), + get_xticklabel ().string_vector_value (), get_xlim ().matrix_value ()); p(1) -= ext(1); } @@ -7983,7 +7983,7 @@ octave_value string_prop = get_string (); - string_vector sv = string_prop.all_strings (); + string_vector sv = string_prop.string_vector_value (); renderer.text_to_pixels (sv.join ("\n"), pixels, bbox, halign, valign, get_rotation (), diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/graphics.in.h --- a/libinterp/corefcn/graphics.in.h Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/graphics.in.h Sat Dec 26 18:59:45 2015 -0800 @@ -757,7 +757,7 @@ { if (val.is_string ()) { - value = val.all_strings (); + value = val.string_vector_value (); stored_type = char_t; } diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/lsode.cc --- a/libinterp/corefcn/lsode.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/lsode.cc Sat Dec 26 18:59:45 2015 -0800 @@ -351,7 +351,7 @@ case 2: { - string_vector tmp = f_arg.all_strings (); + string_vector tmp = f_arg.string_vector_value (); fcn_name = unique_symbol_name ("__lsode_fcn__"); fname = "function y = "; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/str2double.cc --- a/libinterp/corefcn/str2double.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/str2double.cc Sat Dec 26 18:59:45 2015 -0800 @@ -354,7 +354,7 @@ retval = str2double1 (args(0).string_value ()); else { - const string_vector sv = args(0).all_strings (); + const string_vector sv = args(0).string_vector_value (); retval = sv.map (str2double1); } diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/strfns.cc --- a/libinterp/corefcn/strfns.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/strfns.cc Sat Dec 26 18:59:45 2015 -0800 @@ -95,7 +95,7 @@ for (int i = 0; i < nargin; i++) { - string_vector s = args(i).xall_strings ("char: unable to convert some args to strings"); + string_vector s = args(i).xstring_vector_value ("char: unable to convert some args to strings"); if (s.numel () > 0) n_elts += s.numel (); @@ -210,7 +210,7 @@ for (int i = 0; i < nargin; i++) { - string_vector s = args(i).xall_strings ("strvcat: unable to convert some args to strings"); + string_vector s = args(i).xstring_vector_value ("strvcat: unable to convert some args to strings"); size_t n = s.numel (); @@ -346,7 +346,7 @@ } const Cell cell = cell_val.cell_value (); - const string_vector str = str_val.all_strings (); + const string_vector str = str_val.string_vector_value (); octave_idx_type r = str.numel (); if (r == 0 || r == 1) @@ -847,7 +847,7 @@ if (nargin < 1 || nargin > 3) print_usage (); - string_vector s = args(0).xall_strings ("list_in_columns: ARG must be a cellstr or char array"); + string_vector s = args(0).xstring_vector_value ("list_in_columns: ARG must be a cellstr or char array"); int width = -1; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/syscalls.cc --- a/libinterp/corefcn/syscalls.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/syscalls.cc Sat Dec 26 18:59:45 2015 -0800 @@ -162,7 +162,7 @@ if (nargin == 2) { - string_vector tmp = args(1).xall_strings ("exec: all arguments must be strings"); + string_vector tmp = args(1).xstring_vector_value ("exec: all arguments must be strings"); int len = tmp.numel (); @@ -250,7 +250,7 @@ if (nargin >= 2) { - string_vector tmp = args(1).xall_strings ("popen2: all arguments must be strings"); + string_vector tmp = args(1).xstring_vector_value ("popen2: all arguments must be strings"); int len = tmp.numel (); diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/sysdep.cc --- a/libinterp/corefcn/sysdep.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/sysdep.cc Sat Dec 26 18:59:45 2015 -0800 @@ -887,7 +887,7 @@ octave_value arg = args(0); - string_vector sv = arg.xall_strings ("tilde_expand: argument must be char or cellstr object"); + string_vector sv = arg.xstring_vector_value ("tilde_expand: argument must be char or cellstr object"); sv = file_ops::tilde_expand (sv); diff -r 98e75f952a36 -r fc9cca99b2de libinterp/corefcn/utils.cc --- a/libinterp/corefcn/utils.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/corefcn/utils.cc Sat Dec 26 18:59:45 2015 -0800 @@ -313,7 +313,7 @@ if (nargin < 1 || nargin > 2) print_usage (); - string_vector names = args(0).xall_strings ("file_in_loadpath: FILE argument must be a string"); + string_vector names = args(0).xstring_vector_value ("file_in_loadpath: FILE argument must be a string"); if (names.empty ()) error ("file_in_loadpath: FILE argument must not be empty"); @@ -384,7 +384,7 @@ std::string path = args(0).xstring_value ("file_in_path: PATH must be a string"); - string_vector names = args(1).xall_strings ("file_in_path: FILE argument must be a string"); + string_vector names = args(1).xstring_vector_value ("file_in_path: FILE argument must be a string"); if (names.empty ()) error ("file_in_path: FILE argument must not be empty"); diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-base.cc --- a/libinterp/octave-value/ov-base.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-base.cc Sat Dec 26 18:59:45 2015 -0800 @@ -880,13 +880,13 @@ } string_vector -octave_base_value::all_strings (bool pad) const +octave_base_value::string_vector_value (bool pad) const { string_vector retval; octave_value tmp = convert_to_str (pad, true); - retval = tmp.all_strings (); + retval = tmp.string_vector_value (); return retval; } diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-base.h --- a/libinterp/octave-value/ov-base.h Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-base.h Sat Dec 26 18:59:45 2015 -0800 @@ -560,7 +560,7 @@ virtual uint64NDArray uint64_array_value (void) const; - virtual string_vector all_strings (bool pad = false) const; + virtual string_vector string_vector_value (bool pad = false) const; virtual std::string string_value (bool force = false) const; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-cell.cc --- a/libinterp/octave-value/ov-cell.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-cell.cc Sat Dec 26 18:59:45 2015 -0800 @@ -548,7 +548,7 @@ } string_vector -octave_cell::all_strings (bool pad) const +octave_cell::string_vector_value (bool pad) const { string_vector retval; @@ -562,7 +562,7 @@ for (octave_idx_type i = 0; i < nel; i++) { - string_vector s = matrix(i).all_strings (); + string_vector s = matrix(i).string_vector_value (); octave_idx_type s_len = s.numel (); @@ -1280,7 +1280,7 @@ return ovl (args(0)); else { - string_vector s = args(0).xall_strings ("cellstr: argument STRING must be a 2-D character array"); + string_vector s = args(0).xstring_vector_value ("cellstr: argument STRING must be a 2-D character array"); return ovl (s.is_empty () ? Cell (octave_value (std::string ())) : Cell (s, true)); diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-cell.h --- a/libinterp/octave-value/ov-cell.h Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-cell.h Sat Dec 26 18:59:45 2015 -0800 @@ -138,9 +138,9 @@ octave_value_list list_value (void) const; octave_value convert_to_str_internal (bool pad, bool, char type) const - { return octave_value (all_strings (pad), type); } + { return octave_value (string_vector_value (pad), type); } - string_vector all_strings (bool pad = false) const; + string_vector string_vector_value (bool pad = false) const; Array cellstr_value (void) const; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-class.cc --- a/libinterp/octave-value/ov-class.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-class.cc Sat Dec 26 18:59:45 2015 -0800 @@ -947,7 +947,7 @@ } string_vector -octave_class::all_strings (bool pad) const +octave_class::string_vector_value (bool pad) const { string_vector retval; @@ -966,7 +966,7 @@ if (! tmp(0).is_string ()) error ("cname/char method did not return a string"); - retval = tmp(0).all_strings (pad); + retval = tmp(0).string_vector_value (pad); } return retval; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-class.h --- a/libinterp/octave-value/ov-class.h Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-class.h Sat Dec 26 18:59:45 2015 -0800 @@ -168,7 +168,7 @@ bool is_instance_of (const std::string&) const; - string_vector all_strings (bool pad) const; + string_vector string_vector_value (bool pad) const; void print (std::ostream& os, bool pr_as_read_syntax = false); diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-str-mat.cc --- a/libinterp/octave-value/ov-str-mat.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-str-mat.cc Sat Dec 26 18:59:45 2015 -0800 @@ -214,7 +214,7 @@ } string_vector -octave_char_matrix_str::all_strings (bool) const +octave_char_matrix_str::string_vector_value (bool) const { string_vector retval; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov-str-mat.h --- a/libinterp/octave-value/ov-str-mat.h Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov-str-mat.h Sat Dec 26 18:59:45 2015 -0800 @@ -125,7 +125,7 @@ ComplexNDArray complex_array_value (bool = false) const; - string_vector all_strings (bool pad = false) const; + string_vector string_vector_value (bool pad = false) const; std::string string_value (bool force = false) const; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov.cc --- a/libinterp/octave-value/ov.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov.cc Sat Dec 26 18:59:45 2015 -0800 @@ -1967,7 +1967,7 @@ XVALUE_EXTRACTOR (uint64NDArray, xuint64_array_value, uint64_array_value) XVALUE_EXTRACTOR (std::string, xstring_value, rep->xstring_value) -XVALUE_EXTRACTOR (string_vector, xall_strings, all_strings) +XVALUE_EXTRACTOR (string_vector, xstring_vector_value, string_vector_value) XVALUE_EXTRACTOR (Cell, xcell_value, cell_value) XVALUE_EXTRACTOR (Array, xcellstr_value, cellstr_value) diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ov.h --- a/libinterp/octave-value/ov.h Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ov.h Sat Dec 26 18:59:45 2015 -0800 @@ -892,8 +892,11 @@ std::string string_value (bool force = false) const { return rep->string_value (force); } - string_vector all_strings (bool pad = false) const - { return rep->all_strings (pad); } + string_vector string_vector_value (bool pad = false) const + { return rep->string_vector_value (pad); } + + string_vector all_strings (bool pad = false) const GCC_ATTR_DEPRECATED + { return string_vector_value (pad); } Cell cell_value (void) const; @@ -1111,7 +1114,7 @@ std::string xstring_value (const char *fmt, ...) const; - string_vector xall_strings (const char *fmt, ...) const; + string_vector xstring_vector_value (const char *fmt, ...) const; Cell xcell_value (const char *fmt, ...) const; diff -r 98e75f952a36 -r fc9cca99b2de libinterp/octave-value/ovl.cc --- a/libinterp/octave-value/ovl.cc Sat Dec 26 20:46:08 2015 +0100 +++ b/libinterp/octave-value/ovl.cc Sat Dec 26 18:59:45 2015 -0800 @@ -249,7 +249,7 @@ argv[k++] = elem(i).string_value (); else { - string_vector tmp = elem(i).all_strings (); + string_vector tmp = elem(i).string_vector_value (); for (octave_idx_type j = 0; j < nr; j++) argv[k++] = tmp[j];