op-str-m.cc

Go to the documentation of this file.
00001 /*
00002 
00003 Copyright (C) 2003-2012 John W. Eaton
00004 
00005 This file is part of Octave.
00006 
00007 Octave is free software; you can redistribute it and/or modify it
00008 under the terms of the GNU General Public License as published by the
00009 Free Software Foundation; either version 3 of the License, or (at your
00010 option) any later version.
00011 
00012 Octave is distributed in the hope that it will be useful, but WITHOUT
00013 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00014 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00015 for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Octave; see the file COPYING.  If not, see
00019 <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifdef HAVE_CONFIG_H
00024 #include <config.h>
00025 #endif
00026 
00027 #include "gripes.h"
00028 #include "oct-obj.h"
00029 #include "ov.h"
00030 #include "ov-re-mat.h"
00031 #include "ov-str-mat.h"
00032 #include "ov-typeinfo.h"
00033 #include "ops.h"
00034 
00035 DEFASSIGNOP (assign, char_matrix_str, octave_matrix)
00036 {
00037   CAST_BINOP_ARGS (octave_char_matrix_str&, const octave_matrix&);
00038 
00039   octave_value tmp
00040     = v2.convert_to_str_internal (false, false,
00041                                   a1.is_sq_string () ? '\'' : '"');
00042 
00043   if (! error_state)
00044     v1.assign (idx, tmp.char_array_value ());
00045 
00046   return octave_value ();
00047 }
00048 
00049 DEFNDCHARCATOP_FN (str_m, char_matrix_str, matrix, concat)
00050 
00051 DEFNDCHARCATOP_FN (m_str, matrix, char_matrix_str, concat)
00052 
00053 void
00054 install_str_m_ops (void)
00055 {
00056   INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_str, octave_matrix, assign);
00057   INSTALL_ASSIGNOP (op_asn_eq, octave_char_matrix_sq_str, octave_matrix, assign);
00058 
00059   INSTALL_CATOP (octave_char_matrix_str, octave_matrix, str_m);
00060   INSTALL_CATOP (octave_char_matrix_sq_str, octave_matrix, str_m);
00061 
00062   INSTALL_CATOP (octave_matrix, octave_char_matrix_str, m_str);
00063   INSTALL_CATOP (octave_matrix, octave_char_matrix_sq_str, m_str);
00064 }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines