UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
StrAr.H
1 // StrAr.H $Revision: 1.5 $ $Date: 1998/05/15 08:55:51 $
2 
3 #if !defined __StrAr_H
4 
5 #define __StrAr_H
6 
7 #include <mix/SortedAr.H>
8 
9 
10 /*************************************************************
11  * Dynamic Array of Zero-Strings with fixed length
12  *************************************************************/
13 
14 class StrAr : public SortedAr
15 {
16 public:
17 
18  StrAr (const StrAr& star);
19  StrAr (unsigned max_len,
20  unsigned quant = DEFAULT_QUANT,
21  unsigned volume = START_VOLUME);
22 
23  unsigned max_len () const;
24 
25  char* fetch (unsigned i);
26  const char* get (unsigned i) const;
27 
28  void insert (unsigned i, const char* szString);
29 
30  void addh (const char* szString);
31  void addl (const char* szString);
32 
33  void addh (const StrAr& star);
34  void addl (const StrAr& star);
35 
36  StrAr& assign (const StrAr& star);
37  StrAr& assign (unsigned n, const char* const* arofstr);
38 
39  // Array independent pointers at chars
40  char** vector () const;
41 
42  // Synonyms
43  char* operator[] (unsigned i) {return fetch(i);};
44  const char* operator() (unsigned i) const {return get(i);};
45  StrAr& operator= (const StrAr& star) {return assign(star);};
46 
47  // Usual compare by strcmp() between two strings
48  // item1 and item2 are pointers at (char*) !!!!
49  virtual Compar compare (const char* szStr1, const char* szStr2) const;
50 
51  // For debug purpose
52  virtual void print_item (unsigned i) const;
53  virtual void print_contents () const;
54 };
55 
56 
57 #endif // StrAr.H
Definition: SortedAr.H:14
Definition: StrAr.H:14