Mercurial > hg > octave-jordi
diff libinterp/corefcn/variables.cc @ 20699:68e3a747ca02
rename octave_value value extractors that accept error message args
* ov.h, ov.cc (octave_value::xcell_value, octave_value::xstring_value,
octave_value::xcellstr_value): Rename functions that accept error
message args. Handle error directly. Only forward to functions that
don't attempt type conversion. Change all uses.
* ov-base.h, ov-base.cc (octave_base_value::xstring_value): Don't do
type conversion.
(octave_base_value::cell_value, octave_base_value::cellstr_value):
Delete versions that accept error message args.
* ov-str-mat.h, ov-str-mat.cc (octave_char_matrix_str::string_value,
octave_char_matrix_str::cell_value): Delete.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 13 Nov 2015 14:10:26 -0500 (2015-11-13) |
parents | fd0efcdb3718 |
children | 571508c1ed06 |
line wrap: on
line diff
--- a/libinterp/corefcn/variables.cc +++ b/libinterp/corefcn/variables.cc @@ -147,7 +147,7 @@ if (! retval) { - std::string s = arg.string_value ("%s: expecting first argument to be a string", + std::string s = arg.xstring_value ("%s: expecting first argument to be a string", warn_for.c_str ()); std::string cmd = header; @@ -590,11 +590,11 @@ if (nargin == 1 || nargin == 2) { - std::string name = args(0).string_value ("exist: NAME must be a string"); + std::string name = args(0).xstring_value ("exist: NAME must be a string"); if (nargin == 2) { - std::string type = args(1).string_value ("exist: TYPE must be a string"); + std::string type = args(1).xstring_value ("exist: TYPE must be a string"); if (type == "class") warning ("exist: \"class\" type argument is not implemented"); @@ -811,7 +811,7 @@ if (nargin == 1) { - std::string sval = args(0).string_value ("%s: argument must be a single character", nm); + std::string sval = args(0).xstring_value ("%s: argument must be a single character", nm); switch (sval.length ()) { @@ -934,7 +934,7 @@ if (nargin == 1) { - std::string sval = args(0).string_value ("%s: first argument must be a string", nm); + std::string sval = args(0).xstring_value ("%s: first argument must be a string", nm); if (empty_ok || ! sval.empty ()) var = sval; @@ -970,7 +970,7 @@ if (nargin == 1) { - std::string sval = args(0).string_value ("%s: first argument must be a string", nm); + std::string sval = args(0).xstring_value ("%s: first argument must be a string", nm); int i = 0; for (; i < nchoices; i++) @@ -2063,7 +2063,7 @@ if (args.length () == 1) { - std::string name = args(0).string_value ("munlock: FCN must be a string"); + std::string name = args(0).xstring_value ("munlock: FCN must be a string"); munlock (name); } @@ -2097,7 +2097,7 @@ if (args.length () == 1) { - std::string name = args(0).string_value ("mislocked: FCN must be a string"); + std::string name = args(0).xstring_value ("mislocked: FCN must be a string"); retval = mislocked (name); } @@ -2674,7 +2674,7 @@ if (args.length () == 1) { - std::string name = args(0).string_value ("__varval__: expecting argument to be variable name"); + std::string name = args(0).xstring_value ("__varval__: expecting argument to be variable name"); retval = symbol_table::varval (args(0).string_value ()); }