filters
listeformat.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __KWORD_LISTEFORMAT_H__
00025 #define __KWORD_LISTEFORMAT_H__
00026
00027 #include "format.h"
00028
00029 class FormatElt
00030 {
00031 Format* _format;
00032 FormatElt* _next;
00033
00034 private:
00035
00036 protected:
00037
00038 public:
00043
00044 FormatElt() {
00045 _format = 0;
00046 _next = 0;
00047 }
00048
00050 FormatElt(FormatElt * eltt) {
00051 _format = eltt->getFormat();
00052 _next = eltt->getNext();
00053 }
00055
00060
00061 virtual ~FormatElt();
00063
00068 Format* getFormat () const { return _format; }
00069 FormatElt* getNext () const { return _next; }
00071
00076 void setFormat (Format*);
00077 void remFormat ();
00078 void setNext (FormatElt*);
00079 void remNext ();
00081
00086
00087 FormatElt& operator = (const FormatElt &);
00089
00093
00095 };
00096
00097 class ListeFormat
00098 {
00099
00100
00101 private:
00102 FormatElt* _first;
00103 FormatElt* _end;
00104 int _size;
00105
00106 protected:
00107
00108 public:
00113
00114 ListeFormat();
00116
00121 virtual ~ListeFormat();
00123
00128 Format* getFirst () const { return _first->getFormat(); }
00129 FormatElt* getFirstElt() const { return _first; }
00130 Format* getLast () const { return _end->getFormat(); }
00131 bool isVide () const { return (_size == 0); }
00132 int getSize () const { return _size; }
00134
00139 void addLast (Format*);
00140 void addFirst(Format*);
00141 void remLast ();
00142 void remFirst();
00143
00145
00150
00151
00155 void vider();
00156
00158 };
00159
00160 class FormatIter {
00161 FormatElt *_courant;
00162
00163 protected:
00164
00165 public:
00170
00171 FormatIter() { _courant = 0; }
00173 FormatIter(ListeFormat& l) { _courant = l.getFirstElt(); }
00175 FormatIter(ListeFormat*);
00177
00182
00183 virtual ~FormatIter() { }
00185
00190
00191 Format* getCourant() const { return _courant->getFormat(); }
00192 bool isTerminate() const { return (_courant == 0); }
00194
00199 void next () { _courant = _courant->getNext(); }
00200 void setList(ListeFormat* l) { _courant = l->getFirstElt(); }
00202
00207
00208
00212
00214
00215 };
00216
00217 #endif
00218
|