00001
00002
00003 #ifndef _WL_H
00004 #define _WL_H
00005
00006 #include "w.h"
00007 #include "xmlsimplestruct.h"
00008 #include <vector>
00009 #include <string>
00010
00015 class WL {
00016 std::vector <W> wV;
00017 unsigned int ind;
00018 bool showDisabled;
00019
00020 void printErrorea(const char* msg, XMLSimpleNode*, XMLSimpleNode*) const;
00021
00022 public:
00023
00025 WL();
00026
00030 WL( const WL & wl );
00031
00035 WL operator =( const WL & wl);
00036
00037 friend class WXMLDoc;
00038
00041 void begin();
00042
00045 void next();
00046
00049 void previous();
00050
00054 void add(const W & w);
00055
00059 void insert(const W & w);
00060
00065 void insert(const W & w, unsigned int pos);
00066
00070 void remove(const W & w);
00071
00075 void remove(const WId & wid);
00076
00080 void change(const W & w);
00081
00082
00083
00087 W current() const;
00088
00092 bool ready() const;
00093
00097 unsigned int size() const;
00098
00102 unsigned int currentPosition() const;
00103
00107 W get(const unsigned) const;
00108
00112 W get(const WId &) const;
00113
00117 int getPosition(const WId &) const;
00118
00122 bool getShowDisabled() const;
00123
00127 void putShowDisabled(bool sd);
00128
00135 WId mergeTokens(const WId & wid1, const WId & wid2, const std::string & value);
00136
00143 WId mergeTokens(unsigned int ind1, unsigned int ind2, const std::string & value);
00144
00152 WId mergeTokens(const WId & wid1, const WId & wid2, const std::string & value, const std::string & target);
00153
00161 WId mergeTokens(unsigned int ind1, unsigned int ind2, const std::string & value, const std::string & target);
00162
00168 const std::list<W> splitToken(const WId & wid, const std::list<unsigned int> & poslst);
00169
00175 const std::list<W> splitToken(unsigned int ind1, const std::list<unsigned int> & poslst);
00176
00182 const std::list<W> splitToken(const WId & wid, const std::list<W> & wlst);
00183
00189 const std::list<W> splitToken(unsigned int ind1, const std::list<W> & wlst);
00190
00195 XMLSimpleNode* toXML(XMLSimpleStruct* xmlstruct, std::string docRef) const;
00196
00201 void init(XMLSimpleNode* tlItem) throw (char*);
00202
00203 protected:
00204
00208 void forceAdd(const W & w);
00209
00210 private:
00211
00216 std::vector<W>::iterator getVWIterator(unsigned int pos);
00217
00218 bool syncEnabledUp();
00219
00220 bool syncEnabledDown();
00221
00222 };
00223
00224 #endif //_WL_H
00225