Go to the documentation of this file.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
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef MWAW_PROPERTY_HANDLER
00035 # define MWAW_PROPERTY_HANDLER
00036
00037 # include <assert.h>
00038 # include <ostream>
00039 # include <sstream>
00040 # include <string>
00041
00042 class WPXBinaryData;
00043 class WPXProperty;
00044 class WPXPropertyList;
00045 class WPXPropertyListVector;
00046 class WPXString;
00047
00049 class MWAWPropertyHandler
00050 {
00051 public:
00053 MWAWPropertyHandler() {}
00055 virtual ~MWAWPropertyHandler() {}
00056
00058 virtual void startElement(const char *psName, const WPXPropertyList &xPropList) = 0;
00060 virtual void startElement(const char *psName, const WPXPropertyList &xPropList,
00061 const WPXPropertyListVector &vect);
00063 virtual void startElement(const char *psName, const WPXPropertyList &xPropList,
00064 const WPXBinaryData &data);
00066 virtual void endElement(const char *psName) = 0;
00068 virtual void insertElement(const char *psName);
00070 virtual void characters(WPXString const &sCharacters) = 0;
00071
00073 bool checkData(WPXBinaryData const &encoded);
00075 bool readData(WPXBinaryData const &encoded);
00076 };
00077
00099 class MWAWPropertyHandlerEncoder
00100 {
00101 public:
00103 MWAWPropertyHandlerEncoder();
00104
00106 void startElement(const char *psName, const WPXPropertyList &xPropList);
00108 void startElement(const char *psName, const WPXPropertyList &xPropList,
00109 const WPXPropertyListVector &vect);
00111 void startElement(const char *psName, const WPXPropertyList &xPropList,
00112 const WPXBinaryData &data);
00114 void insertElement(const char *psName);
00116 void endElement(const char *psName);
00118 void characters(WPXString const &sCharacters);
00120 bool getData(WPXBinaryData &data);
00121
00122 protected:
00124 void writeInteger(int val) {
00125 writeLong(long(val));
00126 }
00128 void writeLong(long val);
00130 void writeString(const char *name);
00132 void writeProperty(const char *key, const WPXProperty &prop);
00134 void writePropertyList(const WPXPropertyList &prop);
00135
00137 std::stringstream m_f;
00138 };
00139
00140 #endif
00141