• Main Page
  • Namespaces
  • Classes
  • Files
  • File List

bufstringset.h

00001 #ifndef bufstringset_h
00002 #define bufstringset_h
00003 
00004 /*+
00005 ________________________________________________________________________
00006 
00007  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
00008  Author:        Bert
00009  Date:          Oct 2003
00010  Contents:      Set of BufferStrings
00011  RCS:           $Id: bufstringset.h,v 1.19 2010-06-07 13:52:16 cvsbert Exp $
00012 ________________________________________________________________________
00013 
00014 -*/
00015 
00016 #include "bufstring.h"
00017 #include "manobjectset.h"
00018 class IOPar;
00019 class GlobExpr;
00020 
00021 
00024 mClass BufferStringSet : public ManagedObjectSet<BufferString>
00025 {
00026 public:
00027                         BufferStringSet();
00028                         BufferStringSet(const char* arr[],int len=-1);
00029                         BufferStringSet( const BufferStringSet& bss )
00030                             : ManagedObjectSet<BufferString>(false)
00031                                                 { *this = bss; }
00032     BufferStringSet&    operator =(const BufferStringSet&);
00033     bool                operator ==(const BufferStringSet&) const;
00034 
00035     BufferString&       get( int idx )          { return *((*this)[idx]); }
00036     const BufferString& get( int idx ) const    { return *((*this)[idx]); }
00037     int                 indexOf(const char*) const;     
00038     int                 indexOf(const GlobExpr&) const; 
00039     inline bool         isPresent( const char* s ) const
00040                                                 { return indexOf(s) >= 0; }
00041     int                 nearestMatch(const char*) const;
00043     bool                isSubsetOf(const BufferStringSet&) const;
00044 
00045     BufferStringSet&    add(const char*);
00046     BufferStringSet&    add(const BufferString&);
00047     BufferStringSet&    add(const BufferStringSet&,bool allowduplicates);
00048     bool                addIfNew(const char*);  
00049     bool                addIfNew(const BufferString&);
00050 
00051     int                 maxLength() const;
00052     void                sort(BufferStringSet* slave=0);
00053     int*                getSortIndexes() const; 
00054     void                useIndexes(int*,BufferStringSet* slave=0);
00055 
00056     virtual void        fillPar(IOPar&) const;
00057     virtual void        usePar(const IOPar&);
00058 
00059 };
00060 
00061 
00062 #endif

Generated on Tue Nov 30 2010 for Basic by  doxygen 1.7.1