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
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #ifndef WPS_OLE_PARSER_H
00060 #define WPS_OLE_PARSER_H
00061
00062 #include <string>
00063 #include <vector>
00064
00065 #include <libwpd-stream/WPXStream.h>
00066
00067 #include "libwps_internal.h"
00068
00069 #include "WPSDebug.h"
00070
00071 class WPXBinaryData;
00072
00073 namespace libwps
00074 {
00075 class Storage;
00076 }
00077 class WPSPosition;
00078 namespace WPSOLEParserInternal
00079 {
00080 class CompObj;
00081 }
00082
00086 class WPSOLEParser
00087 {
00088 public:
00091 WPSOLEParser(const std::string &mainName);
00092
00094 ~WPSOLEParser();
00095
00098 bool parse(shared_ptr<libwps::Storage> fileInput);
00099
00101 std::vector<std::string> const &getNotParse() const
00102 {
00103 return m_unknownOLEs;
00104 }
00105
00107 std::vector<int> const &getObjectsId() const
00108 {
00109 return m_objectsId;
00110 }
00112 std::vector<WPSPosition> const &getObjectsPosition() const
00113 {
00114 return m_objectsPosition;
00115 }
00117 std::vector<WPXBinaryData> const &getObjects() const
00118 {
00119 return m_objects;
00120 }
00121
00123 bool getObject(int id, WPXBinaryData &obj, WPSPosition &pos) const;
00124
00128 void setObject(int id, WPXBinaryData const &obj, WPSPosition const &pos);
00129 protected:
00130
00132 bool readOle(WPXInputStreamPtr &ip, std::string const &oleName,
00133 libwps::DebugFile &ascii);
00135 bool readMM(WPXInputStreamPtr &input, std::string const &oleName,
00136 libwps::DebugFile &ascii);
00138 bool readObjInfo(WPXInputStreamPtr &input, std::string const &oleName,
00139 libwps::DebugFile &ascii);
00141 bool readCompObj(WPXInputStreamPtr &ip, std::string const &oleName,
00142 libwps::DebugFile &ascii);
00143
00145 bool isOlePres(WPXInputStreamPtr &ip, std::string const &oleName);
00147 bool readOlePres(WPXInputStreamPtr &ip, WPXBinaryData &data, WPSPosition &pos,
00148 libwps::DebugFile &ascii);
00149
00151 bool isOle10Native(WPXInputStreamPtr &ip, std::string const &oleName);
00153 bool readOle10Native(WPXInputStreamPtr &ip, WPXBinaryData &data,
00154 libwps::DebugFile &ascii);
00155
00159 bool readContents(WPXInputStreamPtr &input, std::string const &oleName,
00160 WPXBinaryData &pict, WPSPosition &pos, libwps::DebugFile &ascii);
00161
00167 bool readCONTENTS(WPXInputStreamPtr &input, std::string const &oleName,
00168 WPXBinaryData &pict, WPSPosition &pos, libwps::DebugFile &ascii);
00169
00170
00172 std::string m_avoidOLE;
00174 std::vector<std::string> m_unknownOLEs;
00175
00177 std::vector<WPXBinaryData> m_objects;
00179 std::vector<WPSPosition> m_objectsPosition;
00181 std::vector<int> m_objectsId;
00182
00184 shared_ptr<WPSOLEParserInternal::CompObj> m_compObjIdName;
00185
00186 };
00187
00188 #endif
00189