CoreMS 4.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- corems/__init__.py +63 -0
- corems/chroma_peak/__init__.py +0 -0
- corems/chroma_peak/calc/ChromaPeakCalc.py +480 -0
- corems/chroma_peak/calc/__init__.py +0 -0
- corems/chroma_peak/calc/subset.py +196 -0
- corems/chroma_peak/factory/__init__.py +0 -0
- corems/chroma_peak/factory/chroma_peak_classes.py +1178 -0
- corems/encapsulation/__init__.py +0 -0
- corems/encapsulation/constant.py +1283 -0
- corems/encapsulation/factory/__init__.py +0 -0
- corems/encapsulation/factory/parameters.py +392 -0
- corems/encapsulation/factory/processingSetting.py +1244 -0
- corems/encapsulation/input/__init__.py +0 -0
- corems/encapsulation/input/parameter_from_json.py +579 -0
- corems/encapsulation/output/__init__.py +0 -0
- corems/encapsulation/output/parameter_to_dict.py +142 -0
- corems/encapsulation/output/parameter_to_json.py +332 -0
- corems/mass_spectra/__init__.py +0 -0
- corems/mass_spectra/calc/GC_Calc.py +84 -0
- corems/mass_spectra/calc/GC_Deconvolution.py +558 -0
- corems/mass_spectra/calc/GC_RI_Calibration.py +44 -0
- corems/mass_spectra/calc/MZSearch.py +249 -0
- corems/mass_spectra/calc/SignalProcessing.py +656 -0
- corems/mass_spectra/calc/__init__.py +0 -0
- corems/mass_spectra/calc/lc_calc.py +5790 -0
- corems/mass_spectra/calc/lc_calc_operations.py +1127 -0
- corems/mass_spectra/factory/GC_Class.py +791 -0
- corems/mass_spectra/factory/__init__.py +0 -0
- corems/mass_spectra/factory/chromat_data.py +51 -0
- corems/mass_spectra/factory/lc_class.py +2721 -0
- corems/mass_spectra/input/__init__.py +0 -0
- corems/mass_spectra/input/andiNetCDF.py +200 -0
- corems/mass_spectra/input/boosterHDF5.py +216 -0
- corems/mass_spectra/input/brukerSolarix.py +153 -0
- corems/mass_spectra/input/brukerSolarix_utils.py +73 -0
- corems/mass_spectra/input/corems_hdf5.py +1710 -0
- corems/mass_spectra/input/massList.py +133 -0
- corems/mass_spectra/input/mzml.py +668 -0
- corems/mass_spectra/input/parserbase.py +239 -0
- corems/mass_spectra/input/rawFileReader.py +1839 -0
- corems/mass_spectra/output/__init__.py +0 -0
- corems/mass_spectra/output/export.py +2800 -0
- corems/mass_spectrum/__init__.py +0 -0
- corems/mass_spectrum/calc/AutoRecalibration.py +237 -0
- corems/mass_spectrum/calc/Calibration.py +602 -0
- corems/mass_spectrum/calc/CalibrationCalc.py +253 -0
- corems/mass_spectrum/calc/KendrickGroup.py +239 -0
- corems/mass_spectrum/calc/MassErrorPrediction.py +436 -0
- corems/mass_spectrum/calc/MassSpectrumCalc.py +303 -0
- corems/mass_spectrum/calc/MeanResolvingPowerFilter.py +212 -0
- corems/mass_spectrum/calc/NoiseCalc.py +371 -0
- corems/mass_spectrum/calc/NoiseCalc_Bayes.py +93 -0
- corems/mass_spectrum/calc/PeakPicking.py +994 -0
- corems/mass_spectrum/calc/__init__.py +0 -0
- corems/mass_spectrum/factory/MassSpectrumClasses.py +1753 -0
- corems/mass_spectrum/factory/__init__.py +0 -0
- corems/mass_spectrum/input/__init__.py +0 -0
- corems/mass_spectrum/input/baseClass.py +531 -0
- corems/mass_spectrum/input/boosterHDF5.py +161 -0
- corems/mass_spectrum/input/coremsHDF5.py +475 -0
- corems/mass_spectrum/input/massList.py +402 -0
- corems/mass_spectrum/input/numpyArray.py +133 -0
- corems/mass_spectrum/output/__init__.py +0 -0
- corems/mass_spectrum/output/export.py +841 -0
- corems/molecular_formula/__init__.py +0 -0
- corems/molecular_formula/calc/MolecularFormulaCalc.py +885 -0
- corems/molecular_formula/calc/__init__.py +0 -0
- corems/molecular_formula/factory/MolecularFormulaFactory.py +895 -0
- corems/molecular_formula/factory/__init__.py +0 -0
- corems/molecular_formula/input/__init__.py +0 -0
- corems/molecular_formula/input/masslist_ref.py +355 -0
- corems/molecular_id/__init__.py +0 -0
- corems/molecular_id/calc/ClusterFilter.py +251 -0
- corems/molecular_id/calc/MolecularFilter.py +122 -0
- corems/molecular_id/calc/SpectralSimilarity.py +632 -0
- corems/molecular_id/calc/__init__.py +0 -0
- corems/molecular_id/calc/math_distance.py +1637 -0
- corems/molecular_id/data/FAMES_REF.msp +980 -0
- corems/molecular_id/data/PNNLMetV20191015.msp +157267 -0
- corems/molecular_id/factory/EI_SQL.py +650 -0
- corems/molecular_id/factory/MolecularLookupTable.py +914 -0
- corems/molecular_id/factory/__init__.py +0 -0
- corems/molecular_id/factory/classification.py +884 -0
- corems/molecular_id/factory/lipid_molecular_metadata.py +50 -0
- corems/molecular_id/factory/molecularSQL.py +827 -0
- corems/molecular_id/factory/spectrum_search_results.py +119 -0
- corems/molecular_id/input/__init__.py +0 -0
- corems/molecular_id/input/nistMSI.py +148 -0
- corems/molecular_id/search/__init__.py +0 -0
- corems/molecular_id/search/compoundSearch.py +214 -0
- corems/molecular_id/search/database_interfaces.py +1527 -0
- corems/molecular_id/search/findOxygenPeaks.py +330 -0
- corems/molecular_id/search/lcms_spectral_search.py +348 -0
- corems/molecular_id/search/molecularFormulaSearch.py +1117 -0
- corems/molecular_id/search/priorityAssignment.py +723 -0
- corems/ms_peak/__init__.py +0 -0
- corems/ms_peak/calc/MSPeakCalc.py +1010 -0
- corems/ms_peak/calc/__init__.py +0 -0
- corems/ms_peak/factory/MSPeakClasses.py +542 -0
- corems/ms_peak/factory/__init__.py +0 -0
- corems/transient/__init__.py +0 -0
- corems/transient/calc/TransientCalc.py +362 -0
- corems/transient/calc/__init__.py +0 -0
- corems/transient/factory/TransientClasses.py +457 -0
- corems/transient/factory/__init__.py +0 -0
- corems/transient/input/__init__.py +0 -0
- corems/transient/input/brukerSolarix.py +461 -0
- corems/transient/input/midasDatFile.py +172 -0
- corems-4.0.0.dist-info/METADATA +475 -0
- corems-4.0.0.dist-info/RECORD +171 -0
- corems-4.0.0.dist-info/WHEEL +5 -0
- corems-4.0.0.dist-info/licenses/LICENSE +22 -0
- corems-4.0.0.dist-info/top_level.txt +4 -0
- examples/archive/scripts/CoreMS_tutorial.py +94 -0
- examples/archive/scripts/DI HR-MS Halogens Bruker.py +196 -0
- examples/archive/scripts/DI HR-MS MassList.py +385 -0
- examples/archive/scripts/GC-MS MetabRef.py +213 -0
- examples/archive/scripts/GC-MS NetCDF.py +217 -0
- examples/archive/scripts/HR-MS Thermo Raw 21T.py +136 -0
- examples/archive/scripts/LC-ICPMS_metal_peaks.py +297 -0
- examples/archive/scripts/LCMS-Thermo.py +460 -0
- examples/archive/scripts/LCMS_isotopes.py +283 -0
- examples/archive/scripts/MSParams_example.py +21 -0
- examples/archive/scripts/Molecular Formula Data Aggreation.py +84 -0
- examples/archive/scripts/Single Mz Search.py +69 -0
- examples/test_notebooks.py +145 -0
- ext_lib/ChemstationMSFileReader.dll +0 -0
- ext_lib/ChemstationMSFileReader.xml +126 -0
- ext_lib/RawFileReaderLicense.doc +0 -0
- ext_lib/ThermoFisher.CommonCore.BackgroundSubtraction.dll +0 -0
- ext_lib/ThermoFisher.CommonCore.BackgroundSubtraction.xml +2307 -0
- ext_lib/ThermoFisher.CommonCore.Data.dll +0 -0
- ext_lib/ThermoFisher.CommonCore.Data.xml +28974 -0
- ext_lib/ThermoFisher.CommonCore.MassPrecisionEstimator.dll +0 -0
- ext_lib/ThermoFisher.CommonCore.MassPrecisionEstimator.xml +241 -0
- ext_lib/ThermoFisher.CommonCore.RawFileReader.dll +0 -0
- ext_lib/ThermoFisher.CommonCore.RawFileReader.xml +31174 -0
- ext_lib/__init__.py +0 -0
- ext_lib/dotnet/OpenMcdf.Extensions.dll +0 -0
- ext_lib/dotnet/OpenMcdf.dll +0 -0
- ext_lib/dotnet/OpenMcdf.xml +1154 -0
- ext_lib/dotnet/System.IO.FileSystem.AccessControl.dll +0 -0
- ext_lib/dotnet/System.IO.FileSystem.AccessControl.xml +506 -0
- ext_lib/dotnet/System.Security.AccessControl.dll +0 -0
- ext_lib/dotnet/System.Security.AccessControl.xml +2043 -0
- ext_lib/dotnet/System.Security.Principal.Windows.dll +0 -0
- ext_lib/dotnet/System.Security.Principal.Windows.xml +1011 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.BackgroundSubtraction.dll +0 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.BackgroundSubtraction.xml +2307 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.Data.dll +0 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.Data.xml +29148 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.MassPrecisionEstimator.dll +0 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.MassPrecisionEstimator.xml +241 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.RawFileReader.dll +0 -0
- ext_lib/dotnet/ThermoFisher.CommonCore.RawFileReader.xml +31492 -0
- ext_lib/version +18 -0
- support_code/atom_parsers/AtomsDescription.py +359 -0
- support_code/atom_parsers/CreateAtomsDescription.py +56 -0
- support_code/nmdc/filefinder.py +90 -0
- support_code/nmdc/lipidomics/lipidomics_workflow.py +748 -0
- support_code/nmdc/lipidomics/manifest_examples.py +49 -0
- support_code/nmdc/metabolomics/gcms_workflow.py +158 -0
- support_code/nmdc/metabolomics/lcms_metabolomics_targeted_search.py +59 -0
- support_code/nmdc/metabolomics/lcms_metabolomics_workflow.py +248 -0
- support_code/nmdc/metabolomics/metabolomics_collection.py +628 -0
- support_code/nmdc/metadata/dms_api.py +42 -0
- support_code/nmdc/nom/archived_scripts/nmdc_metadata_gen.py +288 -0
- support_code/nmdc/nom/archived_scripts/nom_grow_workflow.py +209 -0
- support_code/nmdc/nom/nom_workflow.py +312 -0
- support_code/windows_only_importers/BrukerCompassXtract.py +180 -0
- support_code/windows_only_importers/ThermoMSFileReader.py +405 -0
|
@@ -0,0 +1,1154 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<doc>
|
|
3
|
+
<assembly>
|
|
4
|
+
<name>OpenMcdf</name>
|
|
5
|
+
</assembly>
|
|
6
|
+
<members>
|
|
7
|
+
<member name="T:OpenMcdf.CFException">
|
|
8
|
+
<summary>
|
|
9
|
+
OpenMCDF base exception.
|
|
10
|
+
</summary>
|
|
11
|
+
</member>
|
|
12
|
+
<member name="T:OpenMcdf.CFDisposedException">
|
|
13
|
+
<summary>
|
|
14
|
+
Raised when a data setter/getter method is invoked
|
|
15
|
+
on a stream or storage object after the disposal of the owner
|
|
16
|
+
compound file object.
|
|
17
|
+
</summary>
|
|
18
|
+
</member>
|
|
19
|
+
<member name="T:OpenMcdf.CFFileFormatException">
|
|
20
|
+
<summary>
|
|
21
|
+
Raised when opening a file with invalid header
|
|
22
|
+
or not supported COM/OLE Structured storage version.
|
|
23
|
+
</summary>
|
|
24
|
+
</member>
|
|
25
|
+
<member name="T:OpenMcdf.CFItemNotFound">
|
|
26
|
+
<summary>
|
|
27
|
+
Raised when a named stream or a storage object
|
|
28
|
+
are not found in a parent storage.
|
|
29
|
+
</summary>
|
|
30
|
+
</member>
|
|
31
|
+
<member name="T:OpenMcdf.CFInvalidOperation">
|
|
32
|
+
<summary>
|
|
33
|
+
Raised when a method call is invalid for the current object state
|
|
34
|
+
</summary>
|
|
35
|
+
</member>
|
|
36
|
+
<member name="T:OpenMcdf.CFDuplicatedItemException">
|
|
37
|
+
<summary>
|
|
38
|
+
Raised when trying to add a duplicated CFItem
|
|
39
|
+
</summary>
|
|
40
|
+
<remarks>
|
|
41
|
+
Items are compared by name as indicated by specs.
|
|
42
|
+
Two items with the same name CANNOT be added within
|
|
43
|
+
the same storage or sub-storage.
|
|
44
|
+
</remarks>
|
|
45
|
+
</member>
|
|
46
|
+
<member name="T:OpenMcdf.CFCorruptedFileException">
|
|
47
|
+
<summary>
|
|
48
|
+
Raised when trying to load a Compound File with invalid, corrupted or mismatched fields (4.1 - specifications)
|
|
49
|
+
</summary>
|
|
50
|
+
<remarks>
|
|
51
|
+
This exception is NOT raised when Compound file has been opened with NO_VALIDATION_EXCEPTION option.
|
|
52
|
+
</remarks>
|
|
53
|
+
</member>
|
|
54
|
+
<member name="T:OpenMcdf.CFItem">
|
|
55
|
+
<summary>
|
|
56
|
+
Abstract base class for Structured Storage entities.
|
|
57
|
+
</summary>
|
|
58
|
+
<example>
|
|
59
|
+
<code>
|
|
60
|
+
|
|
61
|
+
const String STORAGE_NAME = "report.xls";
|
|
62
|
+
CompoundFile cf = new CompoundFile(STORAGE_NAME);
|
|
63
|
+
|
|
64
|
+
FileStream output = new FileStream("LogEntries.txt", FileMode.Create);
|
|
65
|
+
TextWriter tw = new StreamWriter(output);
|
|
66
|
+
|
|
67
|
+
// CFItem represents both storage and stream items
|
|
68
|
+
VisitedEntryAction va = delegate(CFItem item)
|
|
69
|
+
{
|
|
70
|
+
tw.WriteLine(item.Name);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
cf.RootStorage.VisitEntries(va, true);
|
|
74
|
+
|
|
75
|
+
tw.Close();
|
|
76
|
+
|
|
77
|
+
</code>
|
|
78
|
+
</example>
|
|
79
|
+
</member>
|
|
80
|
+
<member name="P:OpenMcdf.CFItem.Name">
|
|
81
|
+
<summary>
|
|
82
|
+
Get entity name
|
|
83
|
+
</summary>
|
|
84
|
+
</member>
|
|
85
|
+
<member name="P:OpenMcdf.CFItem.Size">
|
|
86
|
+
<summary>
|
|
87
|
+
Size in bytes of the item. It has a valid value
|
|
88
|
+
only if entity is a stream, otherwise it is setted to zero.
|
|
89
|
+
</summary>
|
|
90
|
+
</member>
|
|
91
|
+
<member name="P:OpenMcdf.CFItem.IsStorage">
|
|
92
|
+
<summary>
|
|
93
|
+
Return true if item is Storage
|
|
94
|
+
</summary>
|
|
95
|
+
<remarks>
|
|
96
|
+
This check doesn't use reflection or runtime type information
|
|
97
|
+
and doesn't suffer related performance penalties.
|
|
98
|
+
</remarks>
|
|
99
|
+
</member>
|
|
100
|
+
<member name="P:OpenMcdf.CFItem.IsStream">
|
|
101
|
+
<summary>
|
|
102
|
+
Return true if item is a Stream
|
|
103
|
+
</summary>
|
|
104
|
+
<remarks>
|
|
105
|
+
This check doesn't use reflection or runtime type information
|
|
106
|
+
and doesn't suffer related performance penalties.
|
|
107
|
+
</remarks>
|
|
108
|
+
</member>
|
|
109
|
+
<member name="P:OpenMcdf.CFItem.IsRoot">
|
|
110
|
+
<summary>
|
|
111
|
+
Return true if item is the Root Storage
|
|
112
|
+
</summary>
|
|
113
|
+
<remarks>
|
|
114
|
+
This check doesn't use reflection or runtime type information
|
|
115
|
+
and doesn't suffer related performance penalties.
|
|
116
|
+
</remarks>
|
|
117
|
+
</member>
|
|
118
|
+
<member name="P:OpenMcdf.CFItem.CreationDate">
|
|
119
|
+
<summary>
|
|
120
|
+
Get/Set the Creation Date of the current item
|
|
121
|
+
</summary>
|
|
122
|
+
</member>
|
|
123
|
+
<member name="P:OpenMcdf.CFItem.ModifyDate">
|
|
124
|
+
<summary>
|
|
125
|
+
Get/Set the Modify Date of the current item
|
|
126
|
+
</summary>
|
|
127
|
+
</member>
|
|
128
|
+
<member name="P:OpenMcdf.CFItem.CLSID">
|
|
129
|
+
<summary>
|
|
130
|
+
Get/Set Object class Guid for Root and Storage entries.
|
|
131
|
+
</summary>
|
|
132
|
+
</member>
|
|
133
|
+
<member name="T:OpenMcdf.VisitedEntryAction">
|
|
134
|
+
<summary>
|
|
135
|
+
Action to apply to visited items in the OLE structured storage
|
|
136
|
+
</summary>
|
|
137
|
+
<param name="item">Currently visited <see cref="T:OpenMcdf.CFItem">item</see></param>
|
|
138
|
+
<example>
|
|
139
|
+
<code>
|
|
140
|
+
|
|
141
|
+
//We assume that xls file should be a valid OLE compound file
|
|
142
|
+
const String STORAGE_NAME = "report.xls";
|
|
143
|
+
CompoundFile cf = new CompoundFile(STORAGE_NAME);
|
|
144
|
+
|
|
145
|
+
FileStream output = new FileStream("LogEntries.txt", FileMode.Create);
|
|
146
|
+
TextWriter tw = new StreamWriter(output);
|
|
147
|
+
|
|
148
|
+
VisitedEntryAction va = delegate(CFItem item)
|
|
149
|
+
{
|
|
150
|
+
tw.WriteLine(item.Name);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
cf.RootStorage.VisitEntries(va, true);
|
|
154
|
+
|
|
155
|
+
tw.Close();
|
|
156
|
+
|
|
157
|
+
</code>
|
|
158
|
+
</example>
|
|
159
|
+
</member>
|
|
160
|
+
<member name="T:OpenMcdf.CFStorage">
|
|
161
|
+
<summary>
|
|
162
|
+
Storage entity that acts like a logic container for streams
|
|
163
|
+
or substorages in a compound file.
|
|
164
|
+
</summary>
|
|
165
|
+
</member>
|
|
166
|
+
<member name="M:OpenMcdf.CFStorage.#ctor(OpenMcdf.CompoundFile,OpenMcdf.IDirectoryEntry)">
|
|
167
|
+
<summary>
|
|
168
|
+
Create a CFStorage using an existing directory (previously loaded).
|
|
169
|
+
</summary>
|
|
170
|
+
<param name="compFile">The Storage Owner - CompoundFile</param>
|
|
171
|
+
<param name="dirEntry">An existing Directory Entry</param>
|
|
172
|
+
</member>
|
|
173
|
+
<member name="M:OpenMcdf.CFStorage.AddStream(System.String)">
|
|
174
|
+
<summary>
|
|
175
|
+
Create a new child stream inside the current <see cref="T:OpenMcdf.CFStorage">storage</see>
|
|
176
|
+
</summary>
|
|
177
|
+
<param name="streamName">The new stream name</param>
|
|
178
|
+
<returns>The new <see cref="T:OpenMcdf.CFStream">stream</see> reference</returns>
|
|
179
|
+
<exception cref="T:OpenMcdf.CFDuplicatedItemException">Raised when adding an item with the same name of an existing one</exception>
|
|
180
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised when adding a stream to a closed compound file</exception>
|
|
181
|
+
<exception cref="T:OpenMcdf.CFException">Raised when adding a stream with null or empty name</exception>
|
|
182
|
+
<example>
|
|
183
|
+
<code>
|
|
184
|
+
|
|
185
|
+
String filename = "A_NEW_COMPOUND_FILE_YOU_CAN_WRITE_TO.cfs";
|
|
186
|
+
|
|
187
|
+
CompoundFile cf = new CompoundFile();
|
|
188
|
+
|
|
189
|
+
CFStorage st = cf.RootStorage.AddStorage("MyStorage");
|
|
190
|
+
CFStream sm = st.AddStream("MyStream");
|
|
191
|
+
byte[] b = Helpers.GetBuffer(220, 0x0A);
|
|
192
|
+
sm.SetData(b);
|
|
193
|
+
|
|
194
|
+
cf.Save(filename);
|
|
195
|
+
|
|
196
|
+
</code>
|
|
197
|
+
</example>
|
|
198
|
+
</member>
|
|
199
|
+
<member name="M:OpenMcdf.CFStorage.GetStream(System.String)">
|
|
200
|
+
<summary>
|
|
201
|
+
Get a named <see cref="T:OpenMcdf.CFStream">stream</see> contained in the current storage if existing.
|
|
202
|
+
</summary>
|
|
203
|
+
<param name="streamName">Name of the stream to look for</param>
|
|
204
|
+
<returns>A stream reference if existing</returns>
|
|
205
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
|
|
206
|
+
<exception cref="T:OpenMcdf.CFItemNotFound">Raised if item to delete is not found</exception>
|
|
207
|
+
<example>
|
|
208
|
+
<code>
|
|
209
|
+
String filename = "report.xls";
|
|
210
|
+
|
|
211
|
+
CompoundFile cf = new CompoundFile(filename);
|
|
212
|
+
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
|
|
213
|
+
|
|
214
|
+
byte[] temp = foundStream.GetData();
|
|
215
|
+
|
|
216
|
+
Assert.IsNotNull(temp);
|
|
217
|
+
|
|
218
|
+
cf.Close();
|
|
219
|
+
</code>
|
|
220
|
+
</example>
|
|
221
|
+
</member>
|
|
222
|
+
<member name="M:OpenMcdf.CFStorage.TryGetStream(System.String)">
|
|
223
|
+
<summary>
|
|
224
|
+
Get a named <see cref="T:OpenMcdf.CFStream">stream</see> contained in the current storage if existing.
|
|
225
|
+
</summary>
|
|
226
|
+
<param name="streamName">Name of the stream to look for</param>
|
|
227
|
+
<returns>A stream reference if found, else null</returns>
|
|
228
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
|
|
229
|
+
<example>
|
|
230
|
+
<code>
|
|
231
|
+
String filename = "report.xls";
|
|
232
|
+
|
|
233
|
+
CompoundFile cf = new CompoundFile(filename);
|
|
234
|
+
CFStream foundStream = cf.RootStorage.TryGetStream("Workbook");
|
|
235
|
+
|
|
236
|
+
byte[] temp = foundStream.GetData();
|
|
237
|
+
|
|
238
|
+
Assert.IsNotNull(temp);
|
|
239
|
+
|
|
240
|
+
cf.Close();
|
|
241
|
+
</code>
|
|
242
|
+
</example>
|
|
243
|
+
</member>
|
|
244
|
+
<member name="M:OpenMcdf.CFStorage.GetStorage(System.String)">
|
|
245
|
+
<summary>
|
|
246
|
+
Get a named storage contained in the current one if existing.
|
|
247
|
+
</summary>
|
|
248
|
+
<param name="storageName">Name of the storage to look for</param>
|
|
249
|
+
<returns>A storage reference if existing.</returns>
|
|
250
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
|
|
251
|
+
<exception cref="T:OpenMcdf.CFItemNotFound">Raised if item to delete is not found</exception>
|
|
252
|
+
<example>
|
|
253
|
+
<code>
|
|
254
|
+
|
|
255
|
+
String FILENAME = "MultipleStorage2.cfs";
|
|
256
|
+
CompoundFile cf = new CompoundFile(FILENAME, UpdateMode.ReadOnly, false, false);
|
|
257
|
+
|
|
258
|
+
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
|
|
259
|
+
|
|
260
|
+
Assert.IsNotNull(st);
|
|
261
|
+
cf.Close();
|
|
262
|
+
</code>
|
|
263
|
+
</example>
|
|
264
|
+
</member>
|
|
265
|
+
<member name="M:OpenMcdf.CFStorage.TryGetStorage(System.String)">
|
|
266
|
+
<summary>
|
|
267
|
+
Get a named storage contained in the current one if existing.
|
|
268
|
+
</summary>
|
|
269
|
+
<param name="storageName">Name of the storage to look for</param>
|
|
270
|
+
<returns>A storage reference if found else null</returns>
|
|
271
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
|
|
272
|
+
<example>
|
|
273
|
+
<code>
|
|
274
|
+
|
|
275
|
+
String FILENAME = "MultipleStorage2.cfs";
|
|
276
|
+
CompoundFile cf = new CompoundFile(FILENAME, UpdateMode.ReadOnly, false, false);
|
|
277
|
+
|
|
278
|
+
CFStorage st = cf.RootStorage.TryGetStorage("MyStorage");
|
|
279
|
+
|
|
280
|
+
Assert.IsNotNull(st);
|
|
281
|
+
cf.Close();
|
|
282
|
+
</code>
|
|
283
|
+
</example>
|
|
284
|
+
</member>
|
|
285
|
+
<member name="M:OpenMcdf.CFStorage.AddStorage(System.String)">
|
|
286
|
+
<summary>
|
|
287
|
+
Create new child storage directory inside the current storage.
|
|
288
|
+
</summary>
|
|
289
|
+
<param name="storageName">The new storage name</param>
|
|
290
|
+
<returns>Reference to the new <see cref="T:OpenMcdf.CFStorage">storage</see></returns>
|
|
291
|
+
<exception cref="T:OpenMcdf.CFDuplicatedItemException">Raised when adding an item with the same name of an existing one</exception>
|
|
292
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised when adding a storage to a closed compound file</exception>
|
|
293
|
+
<exception cref="T:OpenMcdf.CFException">Raised when adding a storage with null or empty name</exception>
|
|
294
|
+
<example>
|
|
295
|
+
<code>
|
|
296
|
+
|
|
297
|
+
String filename = "A_NEW_COMPOUND_FILE_YOU_CAN_WRITE_TO.cfs";
|
|
298
|
+
|
|
299
|
+
CompoundFile cf = new CompoundFile();
|
|
300
|
+
|
|
301
|
+
CFStorage st = cf.RootStorage.AddStorage("MyStorage");
|
|
302
|
+
CFStream sm = st.AddStream("MyStream");
|
|
303
|
+
byte[] b = Helpers.GetBuffer(220, 0x0A);
|
|
304
|
+
sm.SetData(b);
|
|
305
|
+
|
|
306
|
+
cf.Save(filename);
|
|
307
|
+
|
|
308
|
+
</code>
|
|
309
|
+
</example>
|
|
310
|
+
</member>
|
|
311
|
+
<member name="M:OpenMcdf.CFStorage.VisitEntries(System.Action{OpenMcdf.CFItem},System.Boolean)">
|
|
312
|
+
<summary>
|
|
313
|
+
Visit all entities contained in the storage applying a user provided action
|
|
314
|
+
</summary>
|
|
315
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised when visiting items of a closed compound file</exception>
|
|
316
|
+
<param name="action">User <see cref="T:OpenMcdf.VisitedEntryAction">action</see> to apply to visited entities</param>
|
|
317
|
+
<param name="recursive"> Visiting recursion level. True means substorages are visited recursively, false indicates that only the direct children of this storage are visited</param>
|
|
318
|
+
<example>
|
|
319
|
+
<code>
|
|
320
|
+
const String STORAGE_NAME = "report.xls";
|
|
321
|
+
CompoundFile cf = new CompoundFile(STORAGE_NAME);
|
|
322
|
+
|
|
323
|
+
FileStream output = new FileStream("LogEntries.txt", FileMode.Create);
|
|
324
|
+
TextWriter tw = new StreamWriter(output);
|
|
325
|
+
|
|
326
|
+
VisitedEntryAction va = delegate(CFItem item)
|
|
327
|
+
{
|
|
328
|
+
tw.WriteLine(item.Name);
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
cf.RootStorage.VisitEntries(va, true);
|
|
332
|
+
|
|
333
|
+
tw.Close();
|
|
334
|
+
</code>
|
|
335
|
+
</example>
|
|
336
|
+
</member>
|
|
337
|
+
<member name="M:OpenMcdf.CFStorage.Delete(System.String)">
|
|
338
|
+
<summary>
|
|
339
|
+
Remove an entry from the current storage and compound file.
|
|
340
|
+
</summary>
|
|
341
|
+
<param name="entryName">The name of the entry in the current storage to delete</param>
|
|
342
|
+
<example>
|
|
343
|
+
<code>
|
|
344
|
+
cf = new CompoundFile("A_FILE_YOU_CAN_CHANGE.cfs", UpdateMode.Update, true, false);
|
|
345
|
+
cf.RootStorage.Delete("AStream"); // AStream item is assumed to exist.
|
|
346
|
+
cf.Commit(true);
|
|
347
|
+
cf.Close();
|
|
348
|
+
</code>
|
|
349
|
+
</example>
|
|
350
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
|
|
351
|
+
<exception cref="T:OpenMcdf.CFItemNotFound">Raised if item to delete is not found</exception>
|
|
352
|
+
<exception cref="T:OpenMcdf.CFException">Raised if trying to delete root storage</exception>
|
|
353
|
+
</member>
|
|
354
|
+
<member name="T:OpenMcdf.CFStream">
|
|
355
|
+
<summary>
|
|
356
|
+
OLE structured storage <see cref="T:OpenMcdf.CFStream">stream</see> Object
|
|
357
|
+
It is contained inside a Storage object in a file-directory
|
|
358
|
+
relationship and indexed by its name.
|
|
359
|
+
</summary>
|
|
360
|
+
</member>
|
|
361
|
+
<member name="M:OpenMcdf.CFStream.SetData(System.Byte[])">
|
|
362
|
+
<summary>
|
|
363
|
+
Set the data associated with the stream object.
|
|
364
|
+
</summary>
|
|
365
|
+
<example>
|
|
366
|
+
<code>
|
|
367
|
+
byte[] b = new byte[]{0x0,0x1,0x2,0x3};
|
|
368
|
+
CompoundFile cf = new CompoundFile();
|
|
369
|
+
CFStream myStream = cf.RootStorage.AddStream("MyStream");
|
|
370
|
+
myStream.SetData(b);
|
|
371
|
+
</code>
|
|
372
|
+
</example>
|
|
373
|
+
<param name="data">Data bytes to write to this stream</param>
|
|
374
|
+
<remarks>Existing associated data will be lost after method invocation</remarks>
|
|
375
|
+
</member>
|
|
376
|
+
<member name="M:OpenMcdf.CFStream.Write(System.Byte[],System.Int64)">
|
|
377
|
+
<summary>
|
|
378
|
+
Write a data buffer to a specific position into current CFStream object
|
|
379
|
+
</summary>
|
|
380
|
+
<param name="data">Data buffer to Write</param>
|
|
381
|
+
<param name="position">Position into the stream object to start writing from</param>
|
|
382
|
+
<remarks>Current stream will be extended to receive data buffer over
|
|
383
|
+
its current size</remarks>
|
|
384
|
+
</member>
|
|
385
|
+
<member name="M:OpenMcdf.CFStream.Write(System.Byte[],System.Int64,System.Int32,System.Int32)">
|
|
386
|
+
<summary>
|
|
387
|
+
Write <paramref name="count">count</paramref> bytes of a data buffer to a specific position into
|
|
388
|
+
the current CFStream object starting from the specified position.
|
|
389
|
+
</summary>
|
|
390
|
+
<param name="data">Data buffer to copy bytes from</param>
|
|
391
|
+
<param name="position">Position into the stream object to start writing from</param>
|
|
392
|
+
<param name="offset">The zero-based byte offset in buffer at which to
|
|
393
|
+
begin copying bytes to the current <see cref="T:OpenMcdf.CFStream">CFStream</see>. </param>
|
|
394
|
+
<param name="count">The number of bytes to be written to the current <see cref="T:OpenMcdf.CFStream">CFStream</see> </param>
|
|
395
|
+
<remarks>Current stream will be extended to receive data buffer over
|
|
396
|
+
its current size.</remarks>
|
|
397
|
+
</member>
|
|
398
|
+
<member name="M:OpenMcdf.CFStream.Append(System.Byte[])">
|
|
399
|
+
<summary>
|
|
400
|
+
Append the provided data to stream data.
|
|
401
|
+
</summary>
|
|
402
|
+
<example>
|
|
403
|
+
<code>
|
|
404
|
+
byte[] b = new byte[]{0x0,0x1,0x2,0x3};
|
|
405
|
+
byte[] b2 = new byte[]{0x4,0x5,0x6,0x7};
|
|
406
|
+
CompoundFile cf = new CompoundFile();
|
|
407
|
+
CFStream myStream = cf.RootStorage.AddStream("MyStream");
|
|
408
|
+
myStream.SetData(b); // here we could also have invoked .AppendData
|
|
409
|
+
myStream.AppendData(b2);
|
|
410
|
+
cf.Save("MyLargeStreamsFile.cfs);
|
|
411
|
+
cf.Close();
|
|
412
|
+
</code>
|
|
413
|
+
</example>
|
|
414
|
+
<param name="data">Data bytes to append to this stream</param>
|
|
415
|
+
<remarks>
|
|
416
|
+
This method allows user to create stream with more than 2GB of data,
|
|
417
|
+
appending data to the end of existing ones.
|
|
418
|
+
Large streams (>2GB) are only supported by CFS version 4.
|
|
419
|
+
Append data can also be invoked on streams with no data in order
|
|
420
|
+
to simplify its use inside loops.
|
|
421
|
+
</remarks>
|
|
422
|
+
</member>
|
|
423
|
+
<member name="M:OpenMcdf.CFStream.GetData">
|
|
424
|
+
<summary>
|
|
425
|
+
Get all the data associated with the stream object.
|
|
426
|
+
</summary>
|
|
427
|
+
<example>
|
|
428
|
+
<code>
|
|
429
|
+
CompoundFile cf2 = new CompoundFile("AFileName.cfs");
|
|
430
|
+
CFStream st = cf2.RootStorage.GetStream("MyStream");
|
|
431
|
+
byte[] buffer = st.ReadAll();
|
|
432
|
+
</code>
|
|
433
|
+
</example>
|
|
434
|
+
<returns>Array of byte containing stream data</returns>
|
|
435
|
+
<exception cref="T:OpenMcdf.CFDisposedException">
|
|
436
|
+
Raised when the owner compound file has been closed.
|
|
437
|
+
</exception>
|
|
438
|
+
</member>
|
|
439
|
+
<!-- Commento XML in formato non corretto ignorato per il membro 'M:OpenMcdf.CFStream.Read(System.Byte[],System.Int64,System.Int32)' -->
|
|
440
|
+
<!-- Commento XML in formato non corretto ignorato per il membro 'M:OpenMcdf.CFStream.Read(System.Byte[],System.Int64,System.Int32,System.Int32)' -->
|
|
441
|
+
<member name="M:OpenMcdf.CFStream.CopyFrom(System.IO.Stream)">
|
|
442
|
+
<summary>
|
|
443
|
+
Copy data from an existing stream.
|
|
444
|
+
</summary>
|
|
445
|
+
<param name="input">A stream to read from</param>
|
|
446
|
+
<remarks>
|
|
447
|
+
Input stream will NOT be closed after method invocation.
|
|
448
|
+
Existing associated data will be deleted.
|
|
449
|
+
</remarks>
|
|
450
|
+
</member>
|
|
451
|
+
<member name="M:OpenMcdf.CFStream.Resize(System.Int64)">
|
|
452
|
+
<summary>
|
|
453
|
+
Resize stream padding with zero if enlarging, trimming data if reducing size.
|
|
454
|
+
</summary>
|
|
455
|
+
<param name="length">New length to assign to this stream</param>
|
|
456
|
+
</member>
|
|
457
|
+
<member name="T:OpenMcdf.CFSConfiguration">
|
|
458
|
+
<summary>
|
|
459
|
+
Configuration parameters for the compund files.
|
|
460
|
+
They can be OR-combined to configure
|
|
461
|
+
<see cref="T:OpenMcdf.CompoundFile">Compound file</see> behaviour.
|
|
462
|
+
All flags are NOT set by Default.
|
|
463
|
+
</summary>
|
|
464
|
+
</member>
|
|
465
|
+
<member name="F:OpenMcdf.CFSConfiguration.Default">
|
|
466
|
+
<summary>
|
|
467
|
+
Sector Recycling turn off,
|
|
468
|
+
free sectors erasing off,
|
|
469
|
+
format validation exception raised
|
|
470
|
+
</summary>
|
|
471
|
+
</member>
|
|
472
|
+
<member name="F:OpenMcdf.CFSConfiguration.SectorRecycle">
|
|
473
|
+
<summary>
|
|
474
|
+
Sector recycling reduces data writing performances
|
|
475
|
+
but avoids space wasting in scenarios with frequently
|
|
476
|
+
data manipulation of the same streams.
|
|
477
|
+
</summary>
|
|
478
|
+
</member>
|
|
479
|
+
<member name="F:OpenMcdf.CFSConfiguration.EraseFreeSectors">
|
|
480
|
+
<summary>
|
|
481
|
+
Free sectors are erased to avoid information leakage
|
|
482
|
+
</summary>
|
|
483
|
+
</member>
|
|
484
|
+
<member name="F:OpenMcdf.CFSConfiguration.NoValidationException">
|
|
485
|
+
<summary>
|
|
486
|
+
No exception is raised when a validation error occurs.
|
|
487
|
+
This can possibly lead to a security issue but gives
|
|
488
|
+
a chance to corrupted files to load.
|
|
489
|
+
</summary>
|
|
490
|
+
</member>
|
|
491
|
+
<member name="F:OpenMcdf.CFSConfiguration.LeaveOpen">
|
|
492
|
+
<summary>
|
|
493
|
+
If this flag is set true,
|
|
494
|
+
backing stream is kept open after CompoundFile disposal
|
|
495
|
+
</summary>
|
|
496
|
+
</member>
|
|
497
|
+
<member name="T:OpenMcdf.CFSVersion">
|
|
498
|
+
<summary>
|
|
499
|
+
Binary File Format Version. Sector size is 512 byte for version 3,
|
|
500
|
+
4096 for version 4
|
|
501
|
+
</summary>
|
|
502
|
+
</member>
|
|
503
|
+
<member name="F:OpenMcdf.CFSVersion.Ver_3">
|
|
504
|
+
<summary>
|
|
505
|
+
Compound file version 3 - The default and most common version available. Sector size 512 bytes, 2GB max file size.
|
|
506
|
+
</summary>
|
|
507
|
+
</member>
|
|
508
|
+
<member name="F:OpenMcdf.CFSVersion.Ver_4">
|
|
509
|
+
<summary>
|
|
510
|
+
Compound file version 4 - Sector size is 4096 bytes. Using this version could bring some compatibility problem with existing applications.
|
|
511
|
+
</summary>
|
|
512
|
+
</member>
|
|
513
|
+
<member name="T:OpenMcdf.CFSUpdateMode">
|
|
514
|
+
<summary>
|
|
515
|
+
Update mode of the compound file.
|
|
516
|
+
Default is ReadOnly.
|
|
517
|
+
</summary>
|
|
518
|
+
</member>
|
|
519
|
+
<member name="F:OpenMcdf.CFSUpdateMode.ReadOnly">
|
|
520
|
+
<summary>
|
|
521
|
+
ReadOnly update mode prevents overwriting
|
|
522
|
+
of the opened file.
|
|
523
|
+
Data changes are allowed but they have to be
|
|
524
|
+
persisted on a different file when required
|
|
525
|
+
using <see cref="M:OpenMcdf.CompoundFile.Save">method</see>
|
|
526
|
+
</summary>
|
|
527
|
+
</member>
|
|
528
|
+
<member name="F:OpenMcdf.CFSUpdateMode.Update">
|
|
529
|
+
<summary>
|
|
530
|
+
Update mode allows subsequent data changing operations
|
|
531
|
+
to be persisted directly on the opened file or stream
|
|
532
|
+
using the <see cref="M:OpenMcdf.CompoundFile.Commit">Commit</see>
|
|
533
|
+
method when required. Warning: this option may cause existing data loss if misused.
|
|
534
|
+
</summary>
|
|
535
|
+
</member>
|
|
536
|
+
<member name="T:OpenMcdf.CompoundFile">
|
|
537
|
+
<summary>
|
|
538
|
+
Standard Microsoft© Compound File implementation.
|
|
539
|
+
It is also known as OLE/COM structured storage
|
|
540
|
+
and contains a hierarchy of storage and stream objects providing
|
|
541
|
+
efficent storage of multiple kinds of documents in a single file.
|
|
542
|
+
Version 3 and 4 of specifications are supported.
|
|
543
|
+
</summary>
|
|
544
|
+
</member>
|
|
545
|
+
<member name="P:OpenMcdf.CompoundFile.Configuration">
|
|
546
|
+
<summary>
|
|
547
|
+
Get the configuration parameters of the CompoundFile object.
|
|
548
|
+
</summary>
|
|
549
|
+
</member>
|
|
550
|
+
<member name="M:OpenMcdf.CompoundFile.GetSectorSize">
|
|
551
|
+
<summary>
|
|
552
|
+
Returns the size of standard sectors switching on CFS version (3 or 4)
|
|
553
|
+
</summary>
|
|
554
|
+
<returns>Standard sector size</returns>
|
|
555
|
+
</member>
|
|
556
|
+
<member name="F:OpenMcdf.CompoundFile.HEADER_DIFAT_ENTRIES_COUNT">
|
|
557
|
+
<summary>
|
|
558
|
+
Number of DIFAT entries in the header
|
|
559
|
+
</summary>
|
|
560
|
+
</member>
|
|
561
|
+
<member name="F:OpenMcdf.CompoundFile.DIFAT_SECTOR_FAT_ENTRIES_COUNT">
|
|
562
|
+
<summary>
|
|
563
|
+
Number of FAT entries in a DIFAT Sector
|
|
564
|
+
</summary>
|
|
565
|
+
</member>
|
|
566
|
+
<member name="F:OpenMcdf.CompoundFile.FAT_SECTOR_ENTRIES_COUNT">
|
|
567
|
+
<summary>
|
|
568
|
+
Sectors ID entries in a FAT Sector
|
|
569
|
+
</summary>
|
|
570
|
+
</member>
|
|
571
|
+
<member name="F:OpenMcdf.CompoundFile.SIZE_OF_SID">
|
|
572
|
+
<summary>
|
|
573
|
+
Sector ID Size (int)
|
|
574
|
+
</summary>
|
|
575
|
+
</member>
|
|
576
|
+
<member name="F:OpenMcdf.CompoundFile.sectorRecycle">
|
|
577
|
+
<summary>
|
|
578
|
+
Flag for sector recycling.
|
|
579
|
+
</summary>
|
|
580
|
+
</member>
|
|
581
|
+
<member name="F:OpenMcdf.CompoundFile.eraseFreeSectors">
|
|
582
|
+
<summary>
|
|
583
|
+
Flag for unallocated sector zeroing out.
|
|
584
|
+
</summary>
|
|
585
|
+
</member>
|
|
586
|
+
<member name="F:OpenMcdf.CompoundFile.FLUSHING_QUEUE_SIZE">
|
|
587
|
+
<summary>
|
|
588
|
+
Initial capacity of the flushing queue used
|
|
589
|
+
to optimize commit writing operations
|
|
590
|
+
</summary>
|
|
591
|
+
</member>
|
|
592
|
+
<member name="F:OpenMcdf.CompoundFile.FLUSHING_BUFFER_MAX_SIZE">
|
|
593
|
+
<summary>
|
|
594
|
+
Maximum size of the flushing buffer used
|
|
595
|
+
to optimize commit writing operations
|
|
596
|
+
</summary>
|
|
597
|
+
</member>
|
|
598
|
+
<member name="F:OpenMcdf.CompoundFile.header">
|
|
599
|
+
<summary>
|
|
600
|
+
CompoundFile header
|
|
601
|
+
</summary>
|
|
602
|
+
</member>
|
|
603
|
+
<member name="F:OpenMcdf.CompoundFile.sourceStream">
|
|
604
|
+
<summary>
|
|
605
|
+
Compound underlying stream. Null when new CF has been created.
|
|
606
|
+
</summary>
|
|
607
|
+
</member>
|
|
608
|
+
<member name="M:OpenMcdf.CompoundFile.#ctor">
|
|
609
|
+
<summary>
|
|
610
|
+
Create a blank, version 3 compound file.
|
|
611
|
+
Sector recycle is turned off to achieve the best reading/writing
|
|
612
|
+
performance in most common scenarios.
|
|
613
|
+
</summary>
|
|
614
|
+
<example>
|
|
615
|
+
<code>
|
|
616
|
+
|
|
617
|
+
byte[] b = new byte[10000];
|
|
618
|
+
for (int i = 0; i < 10000; i++)
|
|
619
|
+
{
|
|
620
|
+
b[i % 120] = (byte)i;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
CompoundFile cf = new CompoundFile();
|
|
624
|
+
CFStream myStream = cf.RootStorage.AddStream("MyStream");
|
|
625
|
+
|
|
626
|
+
Assert.IsNotNull(myStream);
|
|
627
|
+
myStream.SetData(b);
|
|
628
|
+
cf.Save("MyCompoundFile.cfs");
|
|
629
|
+
cf.Close();
|
|
630
|
+
|
|
631
|
+
</code>
|
|
632
|
+
</example>
|
|
633
|
+
</member>
|
|
634
|
+
<member name="M:OpenMcdf.CompoundFile.#ctor(OpenMcdf.CFSVersion,OpenMcdf.CFSConfiguration)">
|
|
635
|
+
<summary>
|
|
636
|
+
Create a new, blank, compound file.
|
|
637
|
+
</summary>
|
|
638
|
+
<param name="cfsVersion">Use a specific Compound File Version to set 512 or 4096 bytes sectors</param>
|
|
639
|
+
<param name="configFlags">Set <see cref="T:OpenMcdf.CFSConfiguration">configuration</see> parameters for the new compound file</param>
|
|
640
|
+
<example>
|
|
641
|
+
<code>
|
|
642
|
+
|
|
643
|
+
byte[] b = new byte[10000];
|
|
644
|
+
for (int i = 0; i < 10000; i++)
|
|
645
|
+
{
|
|
646
|
+
b[i % 120] = (byte)i;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
CompoundFile cf = new CompoundFile(CFSVersion.Ver_4, CFSConfiguration.Default);
|
|
650
|
+
CFStream myStream = cf.RootStorage.AddStream("MyStream");
|
|
651
|
+
|
|
652
|
+
Assert.IsNotNull(myStream);
|
|
653
|
+
myStream.SetData(b);
|
|
654
|
+
cf.Save("MyCompoundFile.cfs");
|
|
655
|
+
cf.Close();
|
|
656
|
+
|
|
657
|
+
</code>
|
|
658
|
+
</example>
|
|
659
|
+
</member>
|
|
660
|
+
<member name="M:OpenMcdf.CompoundFile.#ctor(System.String)">
|
|
661
|
+
<summary>
|
|
662
|
+
Load an existing compound file.
|
|
663
|
+
</summary>
|
|
664
|
+
<param name="fileName">Compound file to read from</param>
|
|
665
|
+
<example>
|
|
666
|
+
<code>
|
|
667
|
+
//A xls file should have a Workbook stream
|
|
668
|
+
String filename = "report.xls";
|
|
669
|
+
|
|
670
|
+
CompoundFile cf = new CompoundFile(filename);
|
|
671
|
+
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
|
|
672
|
+
|
|
673
|
+
byte[] temp = foundStream.GetData();
|
|
674
|
+
|
|
675
|
+
Assert.IsNotNull(temp);
|
|
676
|
+
|
|
677
|
+
cf.Close();
|
|
678
|
+
</code>
|
|
679
|
+
</example>
|
|
680
|
+
<remarks>
|
|
681
|
+
File will be open in read-only mode: it has to be saved
|
|
682
|
+
with a different filename. A wrapping implementation has to be provided
|
|
683
|
+
in order to remove/substitute an existing file. Version will be
|
|
684
|
+
automatically recognized from the file. Sector recycle is turned off
|
|
685
|
+
to achieve the best reading/writing performance in most common scenarios.
|
|
686
|
+
</remarks>
|
|
687
|
+
</member>
|
|
688
|
+
<member name="M:OpenMcdf.CompoundFile.#ctor(System.String,OpenMcdf.CFSUpdateMode,OpenMcdf.CFSConfiguration)">
|
|
689
|
+
<summary>
|
|
690
|
+
Load an existing compound file.
|
|
691
|
+
</summary>
|
|
692
|
+
<param name="fileName">Compound file to read from</param>
|
|
693
|
+
<param name="sectorRecycle">If true, recycle unused sectors</param>
|
|
694
|
+
<param name="updateMode">Select the update mode of the underlying data file</param>
|
|
695
|
+
<param name="eraseFreeSectors">If true, overwrite with zeros unallocated sectors</param>
|
|
696
|
+
<example>
|
|
697
|
+
<code>
|
|
698
|
+
String srcFilename = "data_YOU_CAN_CHANGE.xls";
|
|
699
|
+
|
|
700
|
+
CompoundFile cf = new CompoundFile(srcFilename, UpdateMode.Update, true, true);
|
|
701
|
+
|
|
702
|
+
Random r = new Random();
|
|
703
|
+
|
|
704
|
+
byte[] buffer = GetBuffer(r.Next(3, 4095), 0x0A);
|
|
705
|
+
|
|
706
|
+
cf.RootStorage.AddStream("MyStream").SetData(buffer);
|
|
707
|
+
|
|
708
|
+
//This will persist data to the underlying media.
|
|
709
|
+
cf.Commit();
|
|
710
|
+
cf.Close();
|
|
711
|
+
|
|
712
|
+
</code>
|
|
713
|
+
</example>
|
|
714
|
+
</member>
|
|
715
|
+
<member name="M:OpenMcdf.CompoundFile.#ctor(System.IO.Stream,OpenMcdf.CFSUpdateMode,OpenMcdf.CFSConfiguration)">
|
|
716
|
+
<summary>
|
|
717
|
+
Load an existing compound file.
|
|
718
|
+
</summary>
|
|
719
|
+
<param name="stream">A stream containing a compound file to read</param>
|
|
720
|
+
<param name="sectorRecycle">If true, recycle unused sectors</param>
|
|
721
|
+
<param name="updateMode">Select the update mode of the underlying data file</param>
|
|
722
|
+
<param name="eraseFreeSectors">If true, overwrite with zeros unallocated sectors</param>
|
|
723
|
+
<example>
|
|
724
|
+
<code>
|
|
725
|
+
|
|
726
|
+
String filename = "reportREAD.xls";
|
|
727
|
+
|
|
728
|
+
FileStream fs = new FileStream(filename, FileMode.Open);
|
|
729
|
+
CompoundFile cf = new CompoundFile(fs, UpdateMode.ReadOnly, false, false);
|
|
730
|
+
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
|
|
731
|
+
|
|
732
|
+
byte[] temp = foundStream.GetData();
|
|
733
|
+
|
|
734
|
+
Assert.IsNotNull(temp);
|
|
735
|
+
|
|
736
|
+
cf.Close();
|
|
737
|
+
|
|
738
|
+
</code>
|
|
739
|
+
</example>
|
|
740
|
+
<exception cref="T:OpenMcdf.CFException">Raised when trying to open a non-seekable stream</exception>
|
|
741
|
+
<exception cref="T:OpenMcdf.CFException">Raised stream is null</exception>
|
|
742
|
+
</member>
|
|
743
|
+
<member name="M:OpenMcdf.CompoundFile.#ctor(System.IO.Stream)">
|
|
744
|
+
<summary>
|
|
745
|
+
Load an existing compound file from a stream.
|
|
746
|
+
</summary>
|
|
747
|
+
<param name="stream">Streamed compound file</param>
|
|
748
|
+
<example>
|
|
749
|
+
<code>
|
|
750
|
+
|
|
751
|
+
String filename = "reportREAD.xls";
|
|
752
|
+
|
|
753
|
+
FileStream fs = new FileStream(filename, FileMode.Open);
|
|
754
|
+
CompoundFile cf = new CompoundFile(fs);
|
|
755
|
+
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
|
|
756
|
+
|
|
757
|
+
byte[] temp = foundStream.GetData();
|
|
758
|
+
|
|
759
|
+
Assert.IsNotNull(temp);
|
|
760
|
+
|
|
761
|
+
cf.Close();
|
|
762
|
+
|
|
763
|
+
</code>
|
|
764
|
+
</example>
|
|
765
|
+
<exception cref="T:OpenMcdf.CFException">Raised when trying to open a non-seekable stream</exception>
|
|
766
|
+
<exception cref="T:OpenMcdf.CFException">Raised stream is null</exception>
|
|
767
|
+
</member>
|
|
768
|
+
<member name="M:OpenMcdf.CompoundFile.Commit">
|
|
769
|
+
<summary>
|
|
770
|
+
Commit data changes since the previously commit operation
|
|
771
|
+
to the underlying supporting stream or file on the disk.
|
|
772
|
+
</summary>
|
|
773
|
+
<remarks>
|
|
774
|
+
This method can be used
|
|
775
|
+
only if the supporting stream has been opened in
|
|
776
|
+
<see cref="T:OpenMcdf.UpdateMode">Update mode</see>.
|
|
777
|
+
</remarks>
|
|
778
|
+
</member>
|
|
779
|
+
<member name="M:OpenMcdf.CompoundFile.Commit(System.Boolean)">
|
|
780
|
+
<summary>
|
|
781
|
+
Commit data changes since the previously commit operation
|
|
782
|
+
to the underlying supporting stream or file on the disk.
|
|
783
|
+
</summary>
|
|
784
|
+
<param name="releaseMemory">If true, release loaded sectors to limit memory usage but reduces following read operations performance</param>
|
|
785
|
+
<remarks>
|
|
786
|
+
This method can be used only if
|
|
787
|
+
the supporting stream has been opened in
|
|
788
|
+
<see cref="T:OpenMcdf.UpdateMode">Update mode</see>.
|
|
789
|
+
</remarks>
|
|
790
|
+
</member>
|
|
791
|
+
<member name="M:OpenMcdf.CompoundFile.Load(System.IO.Stream)">
|
|
792
|
+
<summary>
|
|
793
|
+
Load compound file from an existing stream.
|
|
794
|
+
</summary>
|
|
795
|
+
<param name="stream">Stream to load compound file from</param>
|
|
796
|
+
</member>
|
|
797
|
+
<member name="P:OpenMcdf.CompoundFile.HasSourceStream">
|
|
798
|
+
<summary>
|
|
799
|
+
Return true if this compound file has been
|
|
800
|
+
loaded from an existing file or stream
|
|
801
|
+
</summary>
|
|
802
|
+
</member>
|
|
803
|
+
<member name="M:OpenMcdf.CompoundFile.AllocateMiniSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
|
|
804
|
+
<summary>
|
|
805
|
+
Allocate space, setup sectors id and refresh header
|
|
806
|
+
for the new or updated mini sector chain.
|
|
807
|
+
</summary>
|
|
808
|
+
<param name="sectorChain">The new MINI sector chain</param>
|
|
809
|
+
</member>
|
|
810
|
+
<member name="M:OpenMcdf.CompoundFile.SetSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
|
|
811
|
+
<summary>
|
|
812
|
+
Allocate space, setup sectors id in the FAT and refresh header
|
|
813
|
+
for the new or updated sector chain (Normal or Mini sectors)
|
|
814
|
+
</summary>
|
|
815
|
+
<param name="sectorChain">The new or updated normal or mini sector chain</param>
|
|
816
|
+
</member>
|
|
817
|
+
<member name="M:OpenMcdf.CompoundFile.AllocateSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
|
|
818
|
+
<summary>
|
|
819
|
+
Allocate space, setup sectors id and refresh header
|
|
820
|
+
for the new or updated sector chain.
|
|
821
|
+
</summary>
|
|
822
|
+
<param name="sectorChain">The new or updated generic sector chain</param>
|
|
823
|
+
</member>
|
|
824
|
+
<member name="M:OpenMcdf.CompoundFile.CheckForLockSector">
|
|
825
|
+
<summary>
|
|
826
|
+
Check for transaction lock sector addition and mark it in the FAT.
|
|
827
|
+
</summary>
|
|
828
|
+
</member>
|
|
829
|
+
<member name="M:OpenMcdf.CompoundFile.AllocateFATSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
|
|
830
|
+
<summary>
|
|
831
|
+
Allocate space, setup sectors id and refresh header
|
|
832
|
+
for the new or updated FAT sector chain.
|
|
833
|
+
</summary>
|
|
834
|
+
<param name="sectorChain">The new or updated generic sector chain</param>
|
|
835
|
+
</member>
|
|
836
|
+
<member name="M:OpenMcdf.CompoundFile.AllocateDIFATSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
|
|
837
|
+
<summary>
|
|
838
|
+
Setup the DIFAT sector chain
|
|
839
|
+
</summary>
|
|
840
|
+
<param name="FATsectorChain">A FAT sector chain</param>
|
|
841
|
+
</member>
|
|
842
|
+
<member name="M:OpenMcdf.CompoundFile.GetDifatSectorChain">
|
|
843
|
+
<summary>
|
|
844
|
+
Get the DIFAT Sector chain
|
|
845
|
+
</summary>
|
|
846
|
+
<returns>A list of DIFAT sectors</returns>
|
|
847
|
+
</member>
|
|
848
|
+
<member name="M:OpenMcdf.CompoundFile.GetFatSectorChain">
|
|
849
|
+
<summary>
|
|
850
|
+
Get the FAT sector chain
|
|
851
|
+
</summary>
|
|
852
|
+
<returns>List of FAT sectors</returns>
|
|
853
|
+
</member>
|
|
854
|
+
<member name="M:OpenMcdf.CompoundFile.GetNormalSectorChain(System.Int32)">
|
|
855
|
+
<summary>
|
|
856
|
+
Get a standard sector chain
|
|
857
|
+
</summary>
|
|
858
|
+
<param name="secID">First SecID of the required chain</param>
|
|
859
|
+
<returns>A list of sectors</returns>
|
|
860
|
+
</member>
|
|
861
|
+
<member name="M:OpenMcdf.CompoundFile.GetMiniSectorChain(System.Int32)">
|
|
862
|
+
<summary>
|
|
863
|
+
Get a mini sector chain
|
|
864
|
+
</summary>
|
|
865
|
+
<param name="secID">First SecID of the required chain</param>
|
|
866
|
+
<returns>A list of mini sectors (64 bytes)</returns>
|
|
867
|
+
</member>
|
|
868
|
+
<member name="M:OpenMcdf.CompoundFile.GetSectorChain(System.Int32,OpenMcdf.SectorType)">
|
|
869
|
+
<summary>
|
|
870
|
+
Get a sector chain from a compound file given the first sector ID
|
|
871
|
+
and the required sector type.
|
|
872
|
+
</summary>
|
|
873
|
+
<param name="secID">First chain sector's id </param>
|
|
874
|
+
<param name="chainType">Type of Sectors in the required chain (mini sectors, normal sectors or FAT)</param>
|
|
875
|
+
<returns>A list of Sectors as the result of their concatenation</returns>
|
|
876
|
+
</member>
|
|
877
|
+
<member name="P:OpenMcdf.CompoundFile.RootStorage">
|
|
878
|
+
<summary>
|
|
879
|
+
The entry point object that represents the
|
|
880
|
+
root of the structures tree to get or set storage or
|
|
881
|
+
stream data.
|
|
882
|
+
</summary>
|
|
883
|
+
<example>
|
|
884
|
+
<code>
|
|
885
|
+
|
|
886
|
+
//Create a compound file
|
|
887
|
+
string FILENAME = "MyFileName.cfs";
|
|
888
|
+
CompoundFile ncf = new CompoundFile();
|
|
889
|
+
|
|
890
|
+
CFStorage l1 = ncf.RootStorage.AddStorage("Storage Level 1");
|
|
891
|
+
|
|
892
|
+
l1.AddStream("l1ns1");
|
|
893
|
+
l1.AddStream("l1ns2");
|
|
894
|
+
l1.AddStream("l1ns3");
|
|
895
|
+
CFStorage l2 = l1.AddStorage("Storage Level 2");
|
|
896
|
+
l2.AddStream("l2ns1");
|
|
897
|
+
l2.AddStream("l2ns2");
|
|
898
|
+
|
|
899
|
+
ncf.Save(FILENAME);
|
|
900
|
+
ncf.Close();
|
|
901
|
+
</code>
|
|
902
|
+
</example>
|
|
903
|
+
</member>
|
|
904
|
+
<member name="M:OpenMcdf.CompoundFile.ResetDirectoryEntry(System.Int32)">
|
|
905
|
+
<summary>
|
|
906
|
+
Reset a directory entry setting it to StgInvalid in the Directory.
|
|
907
|
+
</summary>
|
|
908
|
+
<param name="sid">Sid of the directory to invalidate</param>
|
|
909
|
+
</member>
|
|
910
|
+
<member name="M:OpenMcdf.CompoundFile.LoadDirectories">
|
|
911
|
+
<summary>
|
|
912
|
+
Load directory entries from compound file. Header and FAT MUST be already loaded.
|
|
913
|
+
</summary>
|
|
914
|
+
</member>
|
|
915
|
+
<member name="M:OpenMcdf.CompoundFile.CommitDirectory">
|
|
916
|
+
<summary>
|
|
917
|
+
Commit directory entries change on the Current Source stream
|
|
918
|
+
</summary>
|
|
919
|
+
</member>
|
|
920
|
+
<member name="M:OpenMcdf.CompoundFile.Save(System.String)">
|
|
921
|
+
<summary>
|
|
922
|
+
Saves the in-memory image of Compound File to a file.
|
|
923
|
+
</summary>
|
|
924
|
+
<param name="fileName">File name to write the compound file to</param>
|
|
925
|
+
<exception cref="T:OpenMcdf.CFException">Raised if destination file is not seekable</exception>
|
|
926
|
+
</member>
|
|
927
|
+
<member name="M:OpenMcdf.CompoundFile.Save(System.IO.Stream)">
|
|
928
|
+
<summary>
|
|
929
|
+
Saves the in-memory image of Compound File to a stream.
|
|
930
|
+
</summary>
|
|
931
|
+
<remarks>
|
|
932
|
+
Destination Stream must be seekable. Uncommitted data will be persisted to the destination stream.
|
|
933
|
+
</remarks>
|
|
934
|
+
<param name="stream">The stream to save compound File to</param>
|
|
935
|
+
<exception cref="T:OpenMcdf.CFException">Raised if destination stream is not seekable</exception>
|
|
936
|
+
<exception cref="T:OpenMcdf.CFDisposedException">Raised if Compound File Storage has been already disposed</exception>
|
|
937
|
+
<example>
|
|
938
|
+
<code>
|
|
939
|
+
MemoryStream ms = new MemoryStream(size);
|
|
940
|
+
|
|
941
|
+
CompoundFile cf = new CompoundFile();
|
|
942
|
+
CFStorage st = cf.RootStorage.AddStorage("MyStorage");
|
|
943
|
+
CFStream sm = st.AddStream("MyStream");
|
|
944
|
+
|
|
945
|
+
byte[] b = new byte[]{0x00,0x01,0x02,0x03};
|
|
946
|
+
|
|
947
|
+
sm.SetData(b);
|
|
948
|
+
cf.Save(ms);
|
|
949
|
+
cf.Close();
|
|
950
|
+
</code>
|
|
951
|
+
</example>
|
|
952
|
+
</member>
|
|
953
|
+
<member name="M:OpenMcdf.CompoundFile.FindFreeSectors(OpenMcdf.SectorType)">
|
|
954
|
+
<summary>
|
|
955
|
+
Scan FAT o miniFAT for free sectors to reuse.
|
|
956
|
+
</summary>
|
|
957
|
+
<param name="sType">Type of sector to look for</param>
|
|
958
|
+
<returns>A Queue of available sectors or minisectors already allocated</returns>
|
|
959
|
+
</member>
|
|
960
|
+
<!-- Commento XML in formato non corretto ignorato per il membro 'M:OpenMcdf.CompoundFile.AppendData(OpenMcdf.CFItem,System.Byte[])' -->
|
|
961
|
+
<member name="M:OpenMcdf.CompoundFile.SetStreamLength(OpenMcdf.CFItem,System.Int64)">
|
|
962
|
+
<summary>
|
|
963
|
+
Resize stream length
|
|
964
|
+
</summary>
|
|
965
|
+
<param name="cfItem"></param>
|
|
966
|
+
<param name="length"></param>
|
|
967
|
+
</member>
|
|
968
|
+
<member name="M:OpenMcdf.CompoundFile.CheckFileLength">
|
|
969
|
+
<summary>
|
|
970
|
+
Check file size limit ( 2GB for version 3 )
|
|
971
|
+
</summary>
|
|
972
|
+
</member>
|
|
973
|
+
<member name="M:OpenMcdf.CompoundFile.Close">
|
|
974
|
+
<summary>
|
|
975
|
+
Close the Compound File object <see cref="T:OpenMcdf.CompoundFile">CompoundFile</see> and
|
|
976
|
+
free all associated resources (e.g. open file handle and allocated memory).
|
|
977
|
+
<remarks>
|
|
978
|
+
When the <see cref="T:OpenMcdf.CompoundFile.Close()">Close</see> method is called,
|
|
979
|
+
all the associated stream and storage objects are invalidated:
|
|
980
|
+
any operation invoked on them will produce a <see cref="T:OpenMcdf.CFDisposedException">CFDisposedException</see>.
|
|
981
|
+
</remarks>
|
|
982
|
+
</summary>
|
|
983
|
+
<example>
|
|
984
|
+
<code>
|
|
985
|
+
const String FILENAME = "CompoundFile.cfs";
|
|
986
|
+
CompoundFile cf = new CompoundFile(FILENAME);
|
|
987
|
+
|
|
988
|
+
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
|
|
989
|
+
cf.Close();
|
|
990
|
+
|
|
991
|
+
try
|
|
992
|
+
{
|
|
993
|
+
byte[] temp = st.GetStream("MyStream").GetData();
|
|
994
|
+
|
|
995
|
+
// The following line will fail because back-end object has been closed
|
|
996
|
+
Assert.Fail("Stream without media");
|
|
997
|
+
}
|
|
998
|
+
catch (Exception ex)
|
|
999
|
+
{
|
|
1000
|
+
Assert.IsTrue(ex is CFDisposedException);
|
|
1001
|
+
}
|
|
1002
|
+
</code>
|
|
1003
|
+
</example>
|
|
1004
|
+
</member>
|
|
1005
|
+
<member name="M:OpenMcdf.CompoundFile.Dispose(System.Boolean)">
|
|
1006
|
+
<summary>
|
|
1007
|
+
When called from user code, release all resources, otherwise, in the case runtime called it,
|
|
1008
|
+
only unmanagd resources are released.
|
|
1009
|
+
</summary>
|
|
1010
|
+
<param name="disposing">If true, method has been called from User code, if false it's been called from .net runtime</param>
|
|
1011
|
+
</member>
|
|
1012
|
+
<member name="M:OpenMcdf.CompoundFile.GetAllNamedEntries(System.String)">
|
|
1013
|
+
<summary>
|
|
1014
|
+
Get a list of all entries with a given name contained in the document.
|
|
1015
|
+
</summary>
|
|
1016
|
+
<param name="entryName">Name of entries to retrive</param>
|
|
1017
|
+
<returns>A list of name-matching entries</returns>
|
|
1018
|
+
<remarks>This function is aimed to speed up entity lookup in
|
|
1019
|
+
flat-structure files (only one or little more known entries)
|
|
1020
|
+
without the performance penalty related to entities hierarchy constraints.
|
|
1021
|
+
There is no implied hierarchy in the returned list.
|
|
1022
|
+
</remarks>
|
|
1023
|
+
</member>
|
|
1024
|
+
<member name="M:OpenMcdf.CompoundFile.ShrinkCompoundFile(System.IO.Stream)">
|
|
1025
|
+
<summary>
|
|
1026
|
+
Compress free space by removing unallocated sectors from compound file
|
|
1027
|
+
effectively reducing stream or file size.
|
|
1028
|
+
</summary>
|
|
1029
|
+
<remarks>
|
|
1030
|
+
Current implementation supports compression only for ver. 3 compound files.
|
|
1031
|
+
</remarks>
|
|
1032
|
+
<example>
|
|
1033
|
+
<code>
|
|
1034
|
+
|
|
1035
|
+
//This code has been extracted from unit test
|
|
1036
|
+
|
|
1037
|
+
String FILENAME = "MultipleStorage3.cfs";
|
|
1038
|
+
|
|
1039
|
+
FileInfo srcFile = new FileInfo(FILENAME);
|
|
1040
|
+
|
|
1041
|
+
File.Copy(FILENAME, "MultipleStorage_Deleted_Compress.cfs", true);
|
|
1042
|
+
|
|
1043
|
+
CompoundFile cf = new CompoundFile("MultipleStorage_Deleted_Compress.cfs", UpdateMode.Update, true, true);
|
|
1044
|
+
|
|
1045
|
+
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
|
|
1046
|
+
st = st.GetStorage("AnotherStorage");
|
|
1047
|
+
|
|
1048
|
+
Assert.IsNotNull(st);
|
|
1049
|
+
st.Delete("Another2Stream"); //17Kb
|
|
1050
|
+
cf.Commit();
|
|
1051
|
+
cf.Close();
|
|
1052
|
+
|
|
1053
|
+
CompoundFile.ShrinkCompoundFile("MultipleStorage_Deleted_Compress.cfs");
|
|
1054
|
+
|
|
1055
|
+
FileInfo dstFile = new FileInfo("MultipleStorage_Deleted_Compress.cfs");
|
|
1056
|
+
|
|
1057
|
+
Assert.IsTrue(srcFile.Length > dstFile.Length);
|
|
1058
|
+
|
|
1059
|
+
</code>
|
|
1060
|
+
</example>
|
|
1061
|
+
</member>
|
|
1062
|
+
<member name="M:OpenMcdf.CompoundFile.ShrinkCompoundFile(System.String)">
|
|
1063
|
+
<summary>
|
|
1064
|
+
Remove unallocated sectors from compound file in order to reduce its size.
|
|
1065
|
+
</summary>
|
|
1066
|
+
<remarks>
|
|
1067
|
+
Current implementation supports compression only for ver. 3 compound files.
|
|
1068
|
+
</remarks>
|
|
1069
|
+
<example>
|
|
1070
|
+
<code>
|
|
1071
|
+
|
|
1072
|
+
//This code has been extracted from unit test
|
|
1073
|
+
|
|
1074
|
+
String FILENAME = "MultipleStorage3.cfs";
|
|
1075
|
+
|
|
1076
|
+
FileInfo srcFile = new FileInfo(FILENAME);
|
|
1077
|
+
|
|
1078
|
+
File.Copy(FILENAME, "MultipleStorage_Deleted_Compress.cfs", true);
|
|
1079
|
+
|
|
1080
|
+
CompoundFile cf = new CompoundFile("MultipleStorage_Deleted_Compress.cfs", UpdateMode.Update, true, true);
|
|
1081
|
+
|
|
1082
|
+
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
|
|
1083
|
+
st = st.GetStorage("AnotherStorage");
|
|
1084
|
+
|
|
1085
|
+
Assert.IsNotNull(st);
|
|
1086
|
+
st.Delete("Another2Stream"); //17Kb
|
|
1087
|
+
cf.Commit();
|
|
1088
|
+
cf.Close();
|
|
1089
|
+
|
|
1090
|
+
CompoundFile.ShrinkCompoundFile("MultipleStorage_Deleted_Compress.cfs");
|
|
1091
|
+
|
|
1092
|
+
FileInfo dstFile = new FileInfo("MultipleStorage_Deleted_Compress.cfs");
|
|
1093
|
+
|
|
1094
|
+
Assert.IsTrue(srcFile.Length > dstFile.Length);
|
|
1095
|
+
|
|
1096
|
+
</code>
|
|
1097
|
+
</example>
|
|
1098
|
+
</member>
|
|
1099
|
+
<member name="M:OpenMcdf.CompoundFile.DoCompression(OpenMcdf.CFStorage,OpenMcdf.CFStorage)">
|
|
1100
|
+
<summary>
|
|
1101
|
+
Recursively clones valid structures, avoiding to copy free sectors.
|
|
1102
|
+
</summary>
|
|
1103
|
+
<param name="currSrcStorage">Current source storage to clone</param>
|
|
1104
|
+
<param name="currDstStorage">Current cloned destination storage</param>
|
|
1105
|
+
</member>
|
|
1106
|
+
<member name="M:OpenMcdf.DirectoryEntry.fnv_hash(System.Byte[])">
|
|
1107
|
+
<summary>
|
|
1108
|
+
FNV hash, short for Fowler/Noll/Vo
|
|
1109
|
+
</summary>
|
|
1110
|
+
<param name="buffer"></param>
|
|
1111
|
+
<returns>(not warranted) unique hash for byte array</returns>
|
|
1112
|
+
</member>
|
|
1113
|
+
<member name="P:OpenMcdf.Header.FirstMiniFATSectorID">
|
|
1114
|
+
<summary>
|
|
1115
|
+
This integer field contains the starting sector number for the mini FAT
|
|
1116
|
+
</summary>
|
|
1117
|
+
</member>
|
|
1118
|
+
<member name="F:OpenMcdf.Header.OLE_CFS_SIGNATURE">
|
|
1119
|
+
<summary>
|
|
1120
|
+
Structured Storage signature
|
|
1121
|
+
</summary>
|
|
1122
|
+
</member>
|
|
1123
|
+
<member name="M:OpenMcdf.Sector.Dispose(System.Boolean)">
|
|
1124
|
+
<summary>
|
|
1125
|
+
When called from user code, release all resources, otherwise, in the case runtime called it,
|
|
1126
|
+
only unmanagd resources are released.
|
|
1127
|
+
</summary>
|
|
1128
|
+
<param name="disposing">If true, method has been called from User code, if false it's been called from .net runtime</param>
|
|
1129
|
+
</member>
|
|
1130
|
+
<member name="T:OpenMcdf.Ver3SizeLimitReached">
|
|
1131
|
+
<summary>
|
|
1132
|
+
Action to implement when transaction support - sector
|
|
1133
|
+
has to be written to the underlying stream (see specs).
|
|
1134
|
+
</summary>
|
|
1135
|
+
</member>
|
|
1136
|
+
<member name="T:OpenMcdf.SectorCollection">
|
|
1137
|
+
<summary>
|
|
1138
|
+
Ad-hoc Heap Friendly sector collection to avoid using
|
|
1139
|
+
large array that may create some problem to GC collection
|
|
1140
|
+
(see http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/ )
|
|
1141
|
+
</summary>
|
|
1142
|
+
</member>
|
|
1143
|
+
<member name="T:OpenMcdf.StreamView">
|
|
1144
|
+
<summary>
|
|
1145
|
+
Stream decorator for a Sector or miniSector chain
|
|
1146
|
+
</summary>
|
|
1147
|
+
</member>
|
|
1148
|
+
<member name="T:RedBlackTree.IRBNode">
|
|
1149
|
+
<summary>
|
|
1150
|
+
Red Black Node interface
|
|
1151
|
+
</summary>
|
|
1152
|
+
</member>
|
|
1153
|
+
</members>
|
|
1154
|
+
</doc>
|