OpendTect-6_4  6.4
bufstringset.h
Go to the documentation of this file.
1 #ifndef bufstringset_h
2 #define bufstringset_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Oct 2003
10  Contents: Set of BufferStrings
11  RCS: $Id$
12 ________________________________________________________________________
13 
14 -*/
15 
16 #include "basicmod.h"
17 #include "bufstring.h"
18 #include "manobjectset.h"
19 class GlobExpr;
20 class uiString;
21 class uiStringSet;
22 class QString;
23 
29 {
30 public:
31 
32  BufferStringSet(int n=0,const char* s=0);
33  BufferStringSet(const char* arr[],int len=-1);
34  bool operator ==(const BufferStringSet&) const;
35 
36  BufferString& get( int idx ) { return *((*this)[idx]); }
37  const BufferString& get( int idx ) const { return *((*this)[idx]); }
38  int indexOf(const char*) const;
39  int indexOf(const GlobExpr&) const;
40  int indexOf( const BufferString* b ) const
42  inline bool isPresent( const BufferString* b ) const
44  inline bool isPresent( const char* s ) const
45  { return indexOf(s) >= 0; }
46  int nearestMatch(const char*,bool caseinsens=true) const;
47  bool isSubsetOf(const BufferStringSet&) const;
48 
49  BufferStringSet& add(const char*);
50  BufferStringSet& add(const OD::String&);
51  BufferStringSet& add(const QString&);
52  BufferStringSet& add(const BufferStringSet&,bool allowduplicates);
53  BufferStringSet& add(const char* arr[],int len=-1);
54  BufferStringSet& addToAll(const char*,bool infront=false);
55  bool addIfNew(const char*);
56  bool addIfNew(const OD::String&);
57 
58  int maxLength() const;
59  void sort(bool caseinsens=true,bool asc=true);
60  BufferString commonStart() const;
61 
62  int* getSortIndexes(bool caseinsns=true,bool asc=true) const;
65  void useIndexes(const int*);
66 
67  virtual void fillPar(IOPar&) const;
68  virtual void usePar(const IOPar&);
69 
70  void fill(uiStringSet&) const;
71  void use(const uiStringSet&);
72 
73  BufferString cat(const char* sepstr="\n") const;
74  void unCat(const char*,const char* sepstr="\n");
75 
76  BufferString getDispString(int maxnritems=-1,bool quoted=true) const;
77 
78 };
79 
80 
81 #endif
#define mExpClass(module)
Definition: commondefs.h:160
bool operator==(const ArrayNDInfo &a1, const ArrayNDInfo &a2)
Definition: arrayndinfo.h:53
bool isPresent(const BufferString *b) const
Definition: bufstringset.h:42
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
virtual bool isPresent(const T *) const
Definition: objectset.h:344
Definition: uistring.h:89
Set of BufferString objects.
Definition: bufstringset.h:28
ObjectSet< T >::size_type indexOf(const ObjectSet< T > &os, const S &val)
Locate object in set.
Definition: objectset.h:169
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
encapsulates the read-access-only part of strings in OD.
Definition: odstring.h:31
bool isPresent(const char *s) const
Definition: bufstringset.h:44
int indexOf(const BufferString *b) const
Definition: bufstringset.h:40
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Glob-expression matching like UNIX shells.
Definition: globexpr.h:26
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
void sort(ObjectSet< T > &os)
Sort ObjectSet. Must have operator > defined for elements.
Definition: objectset.h:220
Definition: uistring.h:218
ObjectSet where the objects contained are owned by this set.
Definition: manobjectset.h:23
virtual size_type indexOf(const T *) const
Definition: objectset.h:337

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019