diff libinterp/corefcn/dirfns.cc @ 20700: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
parents 8742e0b1cc49
children 7b608fadc663
line wrap: on
line diff
--- a/libinterp/corefcn/dirfns.cc	Thu Nov 12 19:27:25 2015 -0800
+++ b/libinterp/corefcn/dirfns.cc	Fri Nov 13 14:10:26 2015 -0500
@@ -184,7 +184,7 @@
 
   if (args.length () == 1)
     {
-      std::string dirname = args(0).string_value ("readdir: DIR must be a string");
+      std::string dirname = args(0).xstring_value ("readdir: DIR must be a string");
 
       dir_entry dir (dirname);
 
@@ -240,13 +240,13 @@
 
   if (nargin == 2)
     {
-      std::string parent = args(0).string_value ("mkdir: PARENT must be a string");
-      std::string dir = args(1).string_value ("mkdir: DIR must be a string");
+      std::string parent = args(0).xstring_value ("mkdir: PARENT must be a string");
+      std::string dir = args(1).xstring_value ("mkdir: DIR must be a string");
 
       dirname = file_ops::concat (parent, dir);
     }
   else if (nargin == 1)
-    dirname = args(0).string_value ("mkdir: DIR must be a string");
+    dirname = args(0).xstring_value ("mkdir: DIR must be a string");
 
   if (nargin == 1 || nargin == 2)
     {
@@ -312,7 +312,7 @@
 
   if (nargin == 1 || nargin == 2)
     {
-      std::string dirname = args(0).string_value ("rmdir: DIR must be a string");
+      std::string dirname = args(0).xstring_value ("rmdir: DIR must be a string");
 
       std::string fulldir = file_ops::tilde_expand (dirname);
       int status = -1;
@@ -375,8 +375,8 @@
 
   if (args.length () == 2)
     {
-      std::string from = args(0).string_value ("link: OLD must be a string");
-      std::string to = args(1).string_value ("link: NEW must be a string");
+      std::string from = args(0).xstring_value ("link: OLD must be a string");
+      std::string to = args(1).xstring_value ("link: NEW must be a string");
 
       std::string msg;
 
@@ -412,8 +412,8 @@
 
   if (args.length () == 2)
     {
-      std::string from = args(0).string_value ("symlink: OLD must be a string");
-      std::string to = args(1).string_value ("symlink: NEW must be a string");
+      std::string from = args(0).xstring_value ("symlink: OLD must be a string");
+      std::string to = args(1).xstring_value ("symlink: NEW must be a string");
 
       std::string msg;
 
@@ -451,7 +451,7 @@
 
   if (args.length () == 1)
     {
-      std::string symlink = args(0).string_value ("readlink: SYMLINK must be a string");
+      std::string symlink = args(0).xstring_value ("readlink: SYMLINK must be a string");
 
       std::string result;
       std::string msg;
@@ -489,8 +489,8 @@
 
   if (args.length () == 2)
     {
-      std::string from = args(0).string_value ("rename: OLD must be a string");
-      std::string to = args(1).string_value ("rename: NEW must be a string");
+      std::string from = args(0).xstring_value ("rename: OLD must be a string");
+      std::string to = args(1).xstring_value ("rename: NEW must be a string");
 
       std::string msg;
 
@@ -659,7 +659,7 @@
     retval = file_ops::dir_sep_str ();
   else if (args.length () == 1)
     {
-      std::string s = args(0).string_value ("filesep: argument must be a string");
+      std::string s = args(0).xstring_value ("filesep: argument must be a string");
       if (s == "all")
         retval = file_ops::dir_sep_chars ();
       else
@@ -688,7 +688,7 @@
 
   if (nargin == 1)
     {
-      std::string sval = args(0).string_value ("pathsep: argument must be a single character");
+      std::string sval = args(0).xstring_value ("pathsep: argument must be a single character");
 
       switch (sval.length ())
         {