3
Copyright (C) 1996, 1997, 2000, 2002, 2003, 2005, 2006, 2007
6
This file is part of Octave.
8
Octave is free software; you can redistribute it and/or modify it
9
under the terms of the GNU General Public License as published by the
10
Free Software Foundation; either version 3 of the License, or (at your
11
option) any later version.
13
Octave is distributed in the hope that it will be useful, but WITHOUT
14
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18
You should have received a copy of the GNU General Public License
19
along with Octave; see the file COPYING. If not, see
20
<http://www.gnu.org/licenses/>.
24
#if !defined (octave_str_vec_h)
25
#define octave_str_vec_h 1
35
string_vector : public Array<std::string>
39
string_vector (void) : Array<std::string> () { }
41
explicit string_vector (octave_idx_type n) : Array<std::string> (n) { }
43
string_vector (const char *s) : Array<std::string> (1, s) { }
45
string_vector (const std::string& s) : Array<std::string> (1, s) { }
47
string_vector (const string_vector& s) : Array<std::string> (s) { }
49
string_vector (const std::list<std::string>& lst);
51
string_vector (const char * const *s);
53
string_vector (const char * const *s, octave_idx_type n);
55
string_vector& operator = (const string_vector& s)
58
Array<std::string>::operator = (s);
63
~string_vector (void) { }
65
bool empty (void) const { return length () == 0; }
67
octave_idx_type max_length (void) const
69
octave_idx_type n = length ();
70
octave_idx_type longest = 0;
72
for (octave_idx_type i = 0; i < n; i++)
74
octave_idx_type tmp = elem(i).length ();
83
std::string& operator[] (octave_idx_type i) { return Array<std::string>::elem (i); }
85
std::string operator[] (octave_idx_type i) const { return Array<std::string>::elem (i); }
87
static int compare (const void *a_arg, const void *b_arg);
89
string_vector& qsort (bool make_uniq = false)
91
Array<std::string>::qsort (compare);
99
string_vector& uniq (void);
101
string_vector& append (const std::string& s);
103
string_vector& append (const string_vector& sv);
105
char **c_str_vec (void) const;
107
static void delete_c_str_vec (const char * const*);
109
std::ostream& list_in_columns (std::ostream&, int width = 0) const;
115
;;; Local Variables: ***