GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
op-str-m.cc
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2003-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if defined (HAVE_CONFIG_H)
27# include "config.h"
28#endif
29
30#include "errwarn.h"
31#include "ovl.h"
32#include "ov.h"
33#include "ov-re-mat.h"
34#include "ov-str-mat.h"
35#include "ov-typeinfo.h"
36#include "ops.h"
37
38OCTAVE_NAMESPACE_BEGIN
39
40DEFASSIGNOP (assign, char_matrix_str, octave_matrix)
41{
42 octave_char_matrix_str& v1 = dynamic_cast<octave_char_matrix_str&> (a1);
43 const octave_matrix& v2 = dynamic_cast<const octave_matrix&> (a2);
44
45 octave_value tmp
46 = v2.convert_to_str_internal (false, false,
47 a1.is_sq_string () ? '\'' : '"');
48
49 v1.assign (idx, tmp.char_array_value ());
50
51 return octave_value ();
52}
53
54DEFNDCHARCATOP_FN (str_m, char_matrix_str, matrix, concat)
55
56DEFNDCHARCATOP_FN (m_str, matrix, char_matrix_str, concat)
57
58void
60{
62 assign);
64 assign);
65
68
71}
72
73OCTAVE_NAMESPACE_END
ComplexNDArray concat(NDArray &ra, ComplexNDArray &rb, const Array< octave_idx_type > &ra_idx)
Definition: CNDArray.cc:418
OCTINTERP_API void assign(const octave_value_list &idx, const MT &rhs)
Definition: ov-base-mat.cc:225
octave_value convert_to_str_internal(bool, bool, char type) const
Definition: ov-ch-mat.h:148
charNDArray char_array_value(bool frc_str_conv=false) const
Definition: ov.h:942
const octave_base_value & a2
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
const octave_char_matrix & v2
void install_str_m_ops(octave::type_info &ti)
Definition: op-str-m.cc:59
#define DEFASSIGNOP(name, t1, t2)
Definition: ops.h:79
#define INSTALL_CATOP_TI(ti, t1, t2, f)
Definition: ops.h:58
#define INSTALL_ASSIGNOP_TI(ti, op, t1, t2, f)
Definition: ops.h:62
#define DEFNDCHARCATOP_FN(name, t1, t2, f)
Definition: ops.h:359