1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fdumperole.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_FDUMPEROLE_HXX
32 #define SC_FDUMPEROLE_HXX
34 #include <sot/storage.hxx>
35 #include <sot/storinfo.hxx>
36 #include "fdumper.hxx"
43 // ============================================================================
44 // ============================================================================
46 class OleStorageObject
: public ObjectBase
49 explicit OleStorageObject( const OleStorageObject
& rParentStrg
, const String
& rStrgName
);
50 explicit OleStorageObject( const ObjectBase
& rParent
, SotStorageRef xRootStrg
);
51 explicit OleStorageObject( const ObjectBase
& rParent
, SvStream
& rRootStrm
);
52 explicit OleStorageObject( const ObjectBase
& rParent
);
53 virtual ~OleStorageObject();
55 inline SotStorageRef
GetStorage() const { return mxStrg
; }
56 inline const String
& GetStoragePath() const { return maPath
; }
57 inline const String
& GetStorageName() const { return maName
; }
58 String
GetFullName() const;
60 void ExtractStorageToFileSystem();
63 inline explicit OleStorageObject() {}
64 void Construct( const ObjectBase
& rParent
, SotStorageRef xStrg
, const String
& rPath
);
65 void Construct( const OleStorageObject
& rParentStrg
, const String
& rStrgName
);
66 void Construct( const ObjectBase
& rParent
, SvStream
& rRootStrm
);
67 void Construct( const ObjectBase
& rParent
);
69 virtual bool ImplIsValid() const;
70 virtual void ImplDumpHeader();
71 virtual void ImplDumpFooter();
73 using ObjectBase::Construct
;
76 void DumpStorageInfo( bool bExtended
);
84 typedef ScfRef
< OleStorageObject
> OleStorageObjectRef
;
86 // ============================================================================
88 class OleStorageIterator
: public Base
91 explicit OleStorageIterator( const OleStorageObject
& rStrg
);
92 explicit OleStorageIterator( SotStorageRef xStrg
);
93 ~OleStorageIterator();
95 ULONG
GetSize() const;
97 OleStorageIterator
& operator++();
98 const SvStorageInfo
* operator->() const;
101 void Construct( SotStorageRef xStrg
);
104 virtual bool ImplIsValid() const;
107 typedef ScfRef
< SvStorageInfoList
> SvStorageInfoListRef
;
108 SvStorageInfoListRef mxInfoList
;
112 // ============================================================================
113 // ============================================================================
115 class OleStreamObject
: public StreamObjectBase
118 explicit OleStreamObject( const OleStorageObject
& rParentStrg
, const String
& rStrmName
);
119 virtual ~OleStreamObject();
122 inline explicit OleStreamObject() {}
123 void Construct( const OleStorageObject
& rParentStrg
, const String
& rStrmName
);
125 virtual bool ImplIsValid() const;
127 using StreamObjectBase::Construct
;
130 SotStorageStreamRef mxStrm
;
133 typedef ScfRef
< OleStreamObject
> OleStreamObjectRef
;
135 // ============================================================================
137 class OlePropertyStreamObject
: public OleStreamObject
140 explicit OlePropertyStreamObject( const OleStorageObject
& rParentStrg
, const String
& rStrmName
);
143 inline explicit OlePropertyStreamObject() {}
144 void Construct( const OleStorageObject
& rParentStrg
, const String
& rStrmName
);
146 virtual void ImplDumpBody();
148 using OleStreamObject::Construct
;
151 void DumpSection( const String
& rGuid
, sal_uInt32 nStartPos
);
153 void DumpProperty( sal_Int32 nPropId
, sal_uInt32 nStartPos
);
154 void DumpCodePageProperty( sal_uInt32 nStartPos
);
155 void DumpDictionaryProperty( sal_uInt32 nStartPos
);
157 void DumpPropertyContents( sal_Int32 nPropId
);
158 void DumpPropertyValue( sal_Int32 nPropId
, sal_Int32 nBaseType
);
160 sal_Int32
DumpPropertyType();
161 void DumpBlob( const sal_Char
* pcName
);
162 String
DumpString8( const sal_Char
* pcName
);
163 String
DumpCharArray8( const sal_Char
* pcName
, sal_Int32 nCharCount
);
164 String
DumpString16( const sal_Char
* pcName
);
165 String
DumpCharArray16( const sal_Char
* pcName
, sal_Int32 nCharCount
);
166 DateTime
DumpFileTime( const sal_Char
* pcName
);
168 bool StartElement( sal_uInt32 nStartPos
);
169 void WriteSectionHeader( const String
& rGuid
, sal_uInt32 nStartPos
);
170 void WritePropertyHeader( sal_Int32 nPropId
, sal_uInt32 nStartPos
);
173 NameListRef mxPropIds
;
174 rtl_TextEncoding meTextEnc
;
178 // ============================================================================
179 // ============================================================================