807
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
807
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
807
|
20 |
|
21 */ |
|
22 |
|
23 #ifdef HAVE_CONFIG_H |
1192
|
24 #include <config.h> |
807
|
25 #endif |
|
26 |
1355
|
27 #include <cctype> |
807
|
28 |
|
29 #include "dMatrix.h" |
|
30 |
1355
|
31 #include "defun.h" |
807
|
32 #include "error.h" |
|
33 #include "gripes.h" |
2366
|
34 #include "ov.h" |
1355
|
35 #include "oct-obj.h" |
807
|
36 #include "utils.h" |
|
37 |
1957
|
38 DEFUN (isstr, args, , |
807
|
39 "isstr (X): return 1 if X is a string, 0 otherwise") |
|
40 { |
2086
|
41 octave_value_list retval; |
807
|
42 |
|
43 int nargin = args.length (); |
|
44 |
|
45 if (nargin == 1 && args(0).is_defined ()) |
2800
|
46 retval = static_cast<double> (args(0).is_string ()); |
807
|
47 else |
|
48 print_usage ("isstr"); |
|
49 |
|
50 return retval; |
|
51 } |
|
52 |
1957
|
53 DEFUN (setstr, args, , |
807
|
54 "setstr (V): convert a vector to a string") |
|
55 { |
2086
|
56 octave_value_list retval; |
807
|
57 |
|
58 int nargin = args.length (); |
|
59 |
|
60 if (nargin == 1 && args(0).is_defined ()) |
|
61 retval = args(0).convert_to_str (); |
|
62 else |
|
63 print_usage ("setstr"); |
|
64 |
|
65 return retval; |
|
66 } |
|
67 |
|
68 /* |
|
69 ;;; Local Variables: *** |
|
70 ;;; mode: C++ *** |
|
71 ;;; End: *** |
|
72 */ |