2376
|
1 /* |
|
2 |
|
3 Copyright (C) 1996 John W. Eaton |
|
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 |
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
20 |
|
21 */ |
|
22 |
|
23 #if !defined (octave_char_matrix_str_h) |
|
24 #define octave_char_matrix_str_h 1 |
|
25 |
|
26 #if defined (__GNUG__) |
|
27 #pragma interface |
|
28 #endif |
|
29 |
|
30 #include <cstdlib> |
|
31 |
|
32 #include <string> |
|
33 |
|
34 class ostream; |
|
35 |
|
36 #include "mx-base.h" |
|
37 #include "str-vec.h" |
|
38 |
|
39 #include "error.h" |
|
40 #include "ov-ch-mat.h" |
|
41 #include "ov-typeinfo.h" |
|
42 |
|
43 class Octave_map; |
|
44 class octave_value_list; |
|
45 |
|
46 class tree_walker; |
|
47 |
|
48 // Real scalar values. |
|
49 |
|
50 class |
|
51 octave_char_matrix_str : public octave_char_matrix |
|
52 { |
|
53 public: |
|
54 |
|
55 octave_char_matrix_str (void) |
|
56 : octave_char_matrix () { } |
|
57 |
|
58 octave_char_matrix_str (const charMatrix& chm) |
|
59 : octave_char_matrix (chm) { } |
|
60 |
|
61 octave_char_matrix_str (const char *s) |
|
62 : octave_char_matrix (s) { } |
|
63 |
|
64 octave_char_matrix_str (const string& s) |
|
65 : octave_char_matrix (s) { } |
|
66 |
|
67 octave_char_matrix_str (const string_vector& s) |
|
68 : octave_char_matrix (s) { } |
|
69 |
|
70 octave_char_matrix_str (const octave_char_matrix& chm) |
|
71 : octave_char_matrix (chm) { } |
|
72 |
|
73 octave_char_matrix_str (const octave_char_matrix_str& chms) |
|
74 : octave_char_matrix (chms) { } |
|
75 |
|
76 ~octave_char_matrix_str (void) { } |
|
77 |
|
78 octave_value *clone (void) { return new octave_char_matrix_str (*this); } |
|
79 |
|
80 #if 0 |
|
81 void *operator new (size_t size); |
|
82 void operator delete (void *p, size_t size); |
|
83 #endif |
|
84 |
2412
|
85 type_conv_fcn numeric_conversion_function (void) const; |
2376
|
86 |
2407
|
87 octave_value index (const octave_value_list& idx) const; |
|
88 |
|
89 void assign (const octave_value_list& idx, const charMatrix& rhs); |
|
90 |
2376
|
91 octave_value all (void) const; |
|
92 octave_value any (void) const; |
|
93 |
|
94 bool is_string (void) const { return true; } |
|
95 |
|
96 bool is_real_type (void) const { return true; } |
|
97 |
|
98 bool valid_as_scalar_index (void) const; |
|
99 bool valid_as_zero_index (void) const; |
|
100 |
|
101 bool is_true (void) const; |
|
102 |
|
103 Matrix matrix_value (bool = false) const; |
|
104 |
|
105 charMatrix char_matrix_value (bool = false) const { return matrix; } |
|
106 |
|
107 charMatrix all_strings (void) const; |
|
108 |
|
109 string string_value (void) const; |
|
110 |
|
111 void print (ostream& os); |
|
112 |
|
113 int type_id (void) const { return t_id; } |
|
114 |
|
115 string type_name (void) const { return t_name; } |
|
116 |
|
117 static int static_type_id (void) { return t_id; } |
|
118 |
|
119 static void register_type (void) |
|
120 { t_id = octave_value_typeinfo::register_type (t_name); } |
|
121 |
|
122 private: |
|
123 |
|
124 static int t_id; |
|
125 |
|
126 static const string t_name; |
|
127 }; |
|
128 |
|
129 #endif |
|
130 |
|
131 /* |
|
132 ;;; Local Variables: *** |
|
133 ;;; mode: C++ *** |
|
134 ;;; End: *** |
|
135 */ |