00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef WPXPROPERTYLIST_H
00027 #define WPXPROPERTYLIST_H
00028 #include "WPXProperty.h"
00029
00030
00031
00032
00033 class WPXMapImpl
00034 {
00035 public:
00036 virtual ~WPXMapImpl() {}
00037 virtual void insert(const char *name, WPXProperty *property) = 0;
00038 virtual const WPXProperty * operator[](const char *name) const = 0;
00039 virtual void remove(const char *name) = 0;
00040 virtual void clear() = 0;
00041
00042 friend class WPXMapIterImpl;
00043 };
00044
00045 class WPXMapIterImpl
00046 {
00047 public:
00048 virtual void rewind() = 0;
00049 virtual bool next() = 0;
00050 virtual bool last() = 0;
00051 virtual const WPXProperty * operator()() const = 0;
00052 virtual const char * key() = 0;
00053 };
00054
00055 class WPXPropertyList
00056 {
00057 public:
00058 WPXPropertyList();
00059 WPXPropertyList(const WPXPropertyList &);
00060 virtual ~WPXPropertyList();
00061 void insert(const char * name, WPXProperty *prop);
00062 void insert(const char * name, const char *val);
00063 void insert(const char * name, const int val);
00064 void insert(const char * name, const bool val);
00065 void insert(const char * name, const WPXString &val);
00066 void insert(const char * name, const float val, const WPXUnit units = INCH);
00067
00068 void remove(const char * name);
00069 const WPXProperty * operator[](const char *name) const;
00070 void clear();
00071
00072 class Iter
00073 {
00074 public:
00075 Iter(const WPXPropertyList &propList);
00076 virtual ~Iter();
00077 void rewind();
00078 bool next();
00079 bool last();
00080 const WPXProperty * operator()() const;
00081 const char * key();
00082 private:
00083 WPXMapIterImpl *m_iterImpl;
00084 };
00085 friend class WPXPropertyList::Iter;
00086
00087 private:
00088 mutable WPXMapImpl *m_mapImpl;
00089 };
00090 #endif