23 #if defined (HAVE_CONFIG_H)
88 retval =
args(0).convert_to_str (
true,
true,
96 std::queue<string_vector> args_as_strings;
100 string_vector s =
args(
i).xstring_vector_value (
"char: unable to convert some args to strings");
103 n_elts += s.
numel ();
109 if (s_max_len > max_len)
112 args_as_strings.push (s);
122 args_as_strings.pop ();
128 for (
int j = 0; j < n; j++)
209 std::queue<string_vector> args_as_strings;
213 string_vector s =
args(
i).xstring_vector_value (
"strvcat: unable to convert some args to strings");
215 size_t n = s.
numel ();
220 for (
size_t j = 0; j < n; j++)
229 if (s_max_len > max_len)
232 args_as_strings.push (s);
242 args_as_strings.pop ();
244 size_t n = s.
numel ();
248 for (
size_t j = 0; j < n; j++)
253 size_t t_len = t.
length ();
290 if (
args.length () != 1)
319 std::string::size_type))
325 bool s1_cell = arg0.
is_cell ();
327 bool s2_cell = arg1.
is_cell ();
329 if (s1_string && s2_string)
331 else if ((s1_string && s2_cell) || (s1_cell && s2_string))
350 if (r == 0 || r == 1)
362 output(
i) = str_op (cellstr(
i), s, n);
369 if (cell(
i).is_string ())
378 if (cell.
numel () == 1)
390 output(
i) = str_op (str[
i], str2, n);
401 if (cell.
numel () == r)
408 output(
i) = str_op (str[
i], cellstr(i), n);
416 output(
i) = str_op (str[
i],
428 else if (s1_cell && s2_cell)
468 output(
i) = str_op (cellstr(
i), str2, n);
478 output(
i) = str_op (str1, str2, n);
487 error (
"%s: nonconformant cell arrays", fcn_name);
494 output (
i) = str_op (cellstr1(
i), cellstr2(
i), n);
505 output(
i) = str_op (str1, str2, n);
523 template <
typename T,
typename T_
size_type>
525 strcmp_ignore_n (
const T& s1,
const T&
s2, T_size_type)
528 template <
typename T,
typename T_
size_type>
530 strcmpi_ignore_n (
const T& s1,
const T&
s2, T_size_type)
552 if (
args.length () != 2)
555 return ovl (do_strcmp_fun (
args(0),
args(1), 0,
"strcmp",
556 strcmp_ignore_n, strcmp_ignore_n));
639 if (
args.length () != 3)
645 return ovl (do_strcmp_fun (
args(0),
args(1), n,
"strncmp",
649 error (
"strncmp: N must be greater than 0");
685 if (
args.length () != 2)
688 return ovl (do_strcmp_fun (
args(0),
args(1), 0,
"strcmpi",
689 strcmpi_ignore_n, strcmpi_ignore_n));
716 if (
args.length () != 3)
722 return ovl (do_strcmp_fun (
args(0),
args(1), n,
"strncmpi",
726 error (
"strncmpi: N must be greater than 0");
769 int nargin =
args.length ();
771 if (nargin < 1 || nargin > 3)
774 string_vector s =
args(0).xstring_vector_value (
"list_in_columns: ARG must be a cellstr or char array");
779 width =
args(1).xint_value (
"list_in_columns: WIDTH must be an integer");
784 prefix =
args(2).xstring_value (
"list_in_columns: PREFIX must be a string");
786 std::ostringstream buf;
790 return ovl (buf.str ());
OCTAVE_EXPORT octave_value_list ischar
charNDArray char_array_value(bool frc_str_conv=false) const
OCTINTERP_API octave_value_list Fstrncmpi(const octave_value_list &=octave_value_list(), int=0)
octave_idx_type max_length(void) const
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
octave_idx_type numel(void) const
Number of elements in the array.
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Cell cell_value(void) const
Array< std::string > cellstr_value(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
octave_idx_type numel(const octave_value_list &idx)
std::string string_value(bool force=false) const
bool is_string(void) const
bool strcmp(const T &str_a, const T &str_b)
True if strings are the same.
OCTINTERP_API octave_value_list Fstrcmpi(const octave_value_list &=octave_value_list(), int=0)
#define DEFUNX(name, fname, args_name, nargout_name, doc)
bool is_cellstr(void) const
bool is_cellstr(void) const
std::ostream & list_in_columns(std::ostream &, int width=0, const std::string &prefix="") const
dim_vector dims(void) const
string_vector string_vector_value(bool pad=false) const
With real return the complex result
octave_idx_type length(void) const
Number of elements in the array.
bool is_empty(void) const
bool strcmpi(const T &str_a, const T &str_b)
True if strings are the same, ignoring case.
bool is_dq_string(void) const
=val(i)}if ode{val(i)}occurs in table i
bool strncmp(const T &str_a, const T &str_b, const typename T::size_type n)
True if the first N characters are the same.
bool strncmpi(const T &str_a, const T &str_b, const typename T::size_type n)
True if the first N characters are the same, ignoring case.
Vector representing the dimensions (size) of an Array.
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))