7
<member name="F:OpenMcdf.Header.OLE_CFS_SIGNATURE">
9
Structured Storage signature
12
<member name="P:OpenMcdf.Header.FirstMiniFATSectorID">
14
This integer field contains the starting sector number for the mini FAT
17
<member name="T:BinaryTrees.TraversalMethod">
19
Provides the set of values by which a binary search tree can be enumerated.
22
<member name="T:OpenMcdf.Ver3SizeLimitReached">
24
Action to implement when transaction support - sector
25
has to be written to the underlying stream (see specs).
28
<member name="T:OpenMcdf.SectorCollection">
30
Ad-hoc Heap Friendly sector collection to avoid using
31
large array that may create some problem to GC collection
32
(see http://www.simple-talk.com/dotnet/.net-framework/the-dangers-of-the-large-object-heap/ )
35
<member name="T:OpenMcdf.CFItem">
37
Abstract base class for Structured Storage entities.
42
const String STORAGE_NAME = "report.xls";
43
CompoundFile cf = new CompoundFile(STORAGE_NAME);
45
FileStream output = new FileStream("LogEntries.txt", FileMode.Create);
46
TextWriter tw = new StreamWriter(output);
48
// CFItem represents both storage and stream items
49
VisitedEntryAction va = delegate(CFItem item)
51
tw.WriteLine(item.Name);
54
cf.RootStorage.VisitEntries(va, true);
61
<member name="P:OpenMcdf.CFItem.Name">
66
<member name="P:OpenMcdf.CFItem.Size">
68
Size in bytes of the item. It has a valid value
69
only if entity is a stream, otherwise it is setted to zero.
72
<member name="P:OpenMcdf.CFItem.IsStorage">
74
Return true if item is Storage
77
This check doesn't use reflection or runtime type information
78
and doesn't suffer related performance penalties.
81
<member name="P:OpenMcdf.CFItem.IsStream">
83
Return true if item is a Stream
86
This check doesn't use reflection or runtime type information
87
and doesn't suffer related performance penalties.
90
<member name="P:OpenMcdf.CFItem.IsRoot">
92
Return true if item is the Root Storage
95
This check doesn't use reflection or runtime type information
96
and doesn't suffer related performance penalties.
99
<member name="P:OpenMcdf.CFItem.CreationDate">
101
Get/Set the Creation Date of the current item
104
<member name="P:OpenMcdf.CFItem.ModifyDate">
106
Get/Set the Modify Date of the current item
109
<member name="P:OpenMcdf.CFItem.CLSID">
111
Get/Set Object class Guid for Root and Storage entries.
114
<member name="T:BinaryTrees.NodeList`1">
116
Represents a collection of Node<T> instances.
118
<typeparam name="T">The type of data held in the Node instances referenced by this class.</typeparam>
120
<member name="M:BinaryTrees.NodeList`1.FindByValue(`0)">
122
Searches the NodeList for a Node containing a particular value.
124
<param name="value">The value to search for.</param>
125
<returns>The Node in the NodeList, if it exists; null otherwise.</returns>
127
<member name="T:BinaryTrees.BinarySearchTree`1">
129
Represents a binary search tree. A binary search tree is a binary tree whose nodes are arranged
130
such that for any given node k, all nodes in k's left subtree have a value less than k, and all
131
nodes in k's right subtree have a value greater than k.
133
<typeparam name="T">The type of data stored in the binary tree nodes.</typeparam>
135
<member name="M:BinaryTrees.BinarySearchTree`1.Clear">
137
Removes the contents of the BST
140
<member name="M:BinaryTrees.BinarySearchTree`1.CopyTo(`0[],System.Int32)">
142
Copies the contents of the BST to an appropriately-sized array of type T, using the Inorder
146
<member name="M:BinaryTrees.BinarySearchTree`1.CopyTo(`0[],System.Int32,BinaryTrees.TraversalMethod)">
148
Copies the contents of the BST to an appropriately-sized array of type T, using a specified
152
<member name="M:BinaryTrees.BinarySearchTree`1.Add(`0)">
154
Adds a new value to the BST.
156
<param name="data">The data to insert into the BST.</param>
157
<remarks>Adding a value already in the BST has no effect; that is, the SkipList is not
158
altered, the Add() method simply exits.</remarks>
160
<member name="M:BinaryTrees.BinarySearchTree`1.Contains(`0)">
162
Returns a Boolean, indicating if a specified value is contained within the BST.
164
<param name="data">The data to search for.</param>
165
<returns>True if data is found in the BST; false otherwise.</returns>
167
<member name="M:BinaryTrees.BinarySearchTree`1.TryFind(`0,`0@)">
169
Returns a Boolean, indicating if a specified value is contained within the BST.
171
<param name="data">The data to search for.</param>
172
<returns>True if data is found in the BST; false otherwise.</returns>
174
<member name="M:BinaryTrees.BinarySearchTree`1.Remove(`0)">
176
Attempts to remove the specified data element from the BST.
178
<param name="data">The data to remove from the BST.</param>
179
<returns>True if the element is found in the tree, and removed; false if the element is not
180
found in the tree.</returns>
182
<member name="M:BinaryTrees.BinarySearchTree`1.GetEnumerator">
184
Enumerates the BST's contents using inorder traversal.
186
<returns>An enumerator that provides inorder access to the BST's elements.</returns>
188
<member name="M:BinaryTrees.BinarySearchTree`1.GetEnumerator(BinaryTrees.TraversalMethod)">
190
Enumerates the BST's contents using a specified traversal method.
192
<param name="TraversalMethod">The type of traversal to perform.</param>
193
<returns>An enumerator that provides access to the BST's elements using a specified traversal technique.</returns>
195
<member name="P:BinaryTrees.BinarySearchTree`1.Preorder">
197
Provides enumeration through the BST using preorder traversal.
200
<member name="P:BinaryTrees.BinarySearchTree`1.Inorder">
202
Provides enumeration through the BST using inorder traversal.
205
<member name="P:BinaryTrees.BinarySearchTree`1.Postorder">
207
Provides enumeration through the BST using postorder traversal.
210
<member name="P:BinaryTrees.BinarySearchTree`1.Count">
212
Returns the number of elements in the BST.
215
<member name="T:OpenMcdf.CFSVersion">
217
Binary File Format Version. Sector size is 512 byte for version 3,
221
<member name="F:OpenMcdf.CFSVersion.Ver_3">
223
Compound file version 3 - The default and most common version available. Sector size 512 bytes, 2GB max file size.
226
<member name="F:OpenMcdf.CFSVersion.Ver_4">
228
Compound file version 4 - Sector size is 4096 bytes. Using this version could bring some compatibility problem with existing applications.
231
<member name="T:OpenMcdf.UpdateMode">
233
Update mode of the compound file.
237
<member name="F:OpenMcdf.UpdateMode.ReadOnly">
239
ReadOnly update mode prevents overwriting
241
Data changes are allowed but they have to be
242
persisted on a different file when required.
245
<member name="F:OpenMcdf.UpdateMode.Update">
247
Update mode allows subsequent data changing operations
248
to be persisted directly on the opened file or stream
249
using the <see cref="M:OpenMcdf.CompoundFile.Commit">Commit</see>
250
method when required. Warning: this option may cause existing data loss if misused.
253
<member name="T:OpenMcdf.CompoundFile">
255
Standard Microsoft© Compound File implementation.
256
It is also known as OLE/COM structured storage
257
and contains a hierarchy of storage and stream objects providing
258
efficent storage of multiple kinds of documents in a single file.
259
Version 3 and 4 of specifications are supported.
262
<member name="F:OpenMcdf.CompoundFile.HEADER_DIFAT_ENTRIES_COUNT">
264
Number of DIFAT entries in the header
267
<member name="F:OpenMcdf.CompoundFile.SIZE_OF_SID">
272
<member name="F:OpenMcdf.CompoundFile.FLUSHING_QUEUE_SIZE">
274
Initial capacity of the flushing queue used
275
to optimize commit writing operations
278
<member name="F:OpenMcdf.CompoundFile.FLUSHING_BUFFER_MAX_SIZE">
280
Maximum size of the flushing buffer used
281
to optimize commit writing operations
284
<member name="M:OpenMcdf.CompoundFile.GetSectorSize">
286
Returns the size of standard sectors switching on CFS version (3 or 4)
288
<returns>Standard sector size</returns>
290
<member name="F:OpenMcdf.CompoundFile.DIFAT_SECTOR_FAT_ENTRIES_COUNT">
292
Number of FAT entries in a DIFAT Sector
295
<member name="F:OpenMcdf.CompoundFile.FAT_SECTOR_ENTRIES_COUNT">
297
Sectors ID entries in a FAT Sector
300
<member name="F:OpenMcdf.CompoundFile.sectorRecycle">
302
Flag for sector recycling.
305
<member name="F:OpenMcdf.CompoundFile.eraseFreeSectors">
307
Flag for unallocated sector zeroing out.
310
<member name="F:OpenMcdf.CompoundFile.header">
315
<member name="F:OpenMcdf.CompoundFile.sourceStream">
317
Compound underlying stream. Null when new CF has been created.
320
<member name="M:OpenMcdf.CompoundFile.#ctor">
322
Create a blank, version 3 compound file.
323
Sector recycle is turned off to achieve the best reading/writing
324
performance in most common scenarios.
329
byte[] b = new byte[10000];
330
for (int i = 0; i < 10000; i++)
332
b[i % 120] = (byte)i;
335
CompoundFile cf = new CompoundFile();
336
CFStream myStream = cf.RootStorage.AddStream("MyStream");
338
Assert.IsNotNull(myStream);
340
cf.Save("MyCompoundFile.cfs");
346
<member name="M:OpenMcdf.CompoundFile.#ctor(OpenMcdf.CFSVersion,System.Boolean,System.Boolean)">
348
Create a new, blank, compound file.
350
<param name="cfsVersion">Use a specific Compound File Version to set 512 or 4096 bytes sectors</param>
351
<param name="sectorRecycle">If true, recycle unused sectors</param>
352
<param name="eraseFreeSectors">If true, unallocated sectors will be overwritten with zeros</param>
356
byte[] b = new byte[10000];
357
for (int i = 0; i < 10000; i++)
359
b[i % 120] = (byte)i;
362
CompoundFile cf = new CompoundFile(CFSVersion.Ver_4, true, true);
363
CFStream myStream = cf.RootStorage.AddStream("MyStream");
365
Assert.IsNotNull(myStream);
367
cf.Save("MyCompoundFile.cfs");
373
Sector recycling reduces data writing performances but avoids space wasting in scenarios with frequently
374
data manipulation of the same streams. The new compound file is open in Update mode.
377
<member name="M:OpenMcdf.CompoundFile.#ctor(System.String)">
379
Load an existing compound file.
381
<param name="fileName">Compound file to read from</param>
384
//A xls file should have a Workbook stream
385
String filename = "report.xls";
387
CompoundFile cf = new CompoundFile(filename);
388
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
390
byte[] temp = foundStream.GetData();
392
Assert.IsNotNull(temp);
398
File will be open in read-only mode: it has to be saved
399
with a different filename. A wrapping implementation has to be provided
400
in order to remove/substitute an existing file. Version will be
401
automatically recognized from the file. Sector recycle is turned off
402
to achieve the best reading/writing performance in most common scenarios.
405
<member name="M:OpenMcdf.CompoundFile.#ctor(System.String,OpenMcdf.UpdateMode,System.Boolean,System.Boolean)">
407
Load an existing compound file.
409
<param name="fileName">Compound file to read from</param>
410
<param name="sectorRecycle">If true, recycle unused sectors</param>
411
<param name="updateMode">Select the update mode of the underlying data file</param>
412
<param name="eraseFreeSectors">If true, overwrite with zeros unallocated sectors</param>
415
String srcFilename = "data_YOU_CAN_CHANGE.xls";
417
CompoundFile cf = new CompoundFile(srcFilename, UpdateMode.Update, true, true);
419
Random r = new Random();
421
byte[] buffer = GetBuffer(r.Next(3, 4095), 0x0A);
423
cf.RootStorage.AddStream("MyStream").SetData(buffer);
425
//This will persist data to the underlying media.
432
<member name="M:OpenMcdf.CompoundFile.#ctor(System.String,OpenMcdf.UpdateMode,System.Boolean,System.Boolean,System.Boolean)">
434
Load an existing compound file.
436
<param name="fileName">Compound file to read from</param>
437
<param name="sectorRecycle">If true, recycle unused sectors</param>
438
<param name="updateMode">Select the update mode of the underlying data file</param>
439
<param name="eraseFreeSectors">If true, overwrite with zeros unallocated sectors</param>
440
<param name="noValidationException">If true, no <see cref="T:OpenMcdf.CFCorruptedFileException">CFCorruptedFileException</see>
441
will be thrown even if corrupted file is loaded. Please note that this option is could pose a potential security threat</param>
444
String srcFilename = "data_YOU_CAN_CHANGE.xls";
446
CompoundFile cf = new CompoundFile(srcFilename, UpdateMode.Update, true, true, true);
449
Random r = new Random();
451
byte[] buffer = GetBuffer(r.Next(3, 4095), 0x0A);
453
cf.RootStorage.AddStream("MyStream").SetData(buffer);
455
//This will persist data to the underlying media.
462
<member name="M:OpenMcdf.CompoundFile.#ctor(System.IO.Stream,OpenMcdf.UpdateMode,System.Boolean,System.Boolean)">
464
Load an existing compound file.
466
<param name="stream">A stream containing a compound file to read</param>
467
<param name="sectorRecycle">If true, recycle unused sectors</param>
468
<param name="updateMode">Select the update mode of the underlying data file</param>
469
<param name="eraseFreeSectors">If true, overwrite with zeros unallocated sectors</param>
473
String filename = "reportREAD.xls";
475
FileStream fs = new FileStream(filename, FileMode.Open);
476
CompoundFile cf = new CompoundFile(fs, UpdateMode.ReadOnly, false, false);
477
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
479
byte[] temp = foundStream.GetData();
481
Assert.IsNotNull(temp);
487
<exception cref="T:OpenMcdf.CFException">Raised when trying to open a non-seekable stream</exception>
488
<exception cref="T:OpenMcdf.CFException">Raised stream is null</exception>
490
<member name="M:OpenMcdf.CompoundFile.#ctor(System.IO.Stream,OpenMcdf.UpdateMode,System.Boolean,System.Boolean,System.Boolean)">
492
Load an existing compound file.
494
<param name="stream">A stream containing a compound file to read</param>
495
<param name="sectorRecycle">If true, recycle unused sectors</param>
496
<param name="updateMode">Select the update mode of the underlying data file</param>
497
<param name="eraseFreeSectors">If true, overwrite with zeros unallocated sectors</param>
498
<param name="noValidationException">If true, openMcdf will try to ignore invalid references or format in order to load a possibly corrupted file anyway </param>
499
<remarks>The 'noValidationEcxception' parameter could possibly lead to security issues so it's recommanded to use it only on trusted sources</remarks>
503
String filename = "reportREAD.xls";
505
FileStream fs = new FileStream(filename, FileMode.Open);
506
CompoundFile cf = new CompoundFile(fs, UpdateMode.ReadOnly, false, false, false, true);
507
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
509
byte[] temp = foundStream.GetData(); //if 'reportRead.xls' is corrupted, openMcdf will try to lad it anyway [noValidationException set true]
511
Assert.IsNotNull(temp);
517
<exception cref="T:OpenMcdf.CFException">Raised when trying to open a non-seekable stream</exception>
518
<exception cref="T:OpenMcdf.CFException">Raised stream is null</exception>
520
<member name="M:OpenMcdf.CompoundFile.#ctor(System.IO.Stream)">
522
Load an existing compound file from a stream.
524
<param name="stream">Streamed compound file</param>
528
String filename = "reportREAD.xls";
530
FileStream fs = new FileStream(filename, FileMode.Open);
531
CompoundFile cf = new CompoundFile(fs);
532
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
534
byte[] temp = foundStream.GetData();
536
Assert.IsNotNull(temp);
542
<exception cref="T:OpenMcdf.CFException">Raised when trying to open a non-seekable stream</exception>
543
<exception cref="T:OpenMcdf.CFException">Raised stream is null</exception>
545
<member name="M:OpenMcdf.CompoundFile.Commit">
547
Commit data changes since the previously commit operation
548
to the underlying supporting stream or file on the disk.
551
This method can be used
552
only if the supporting stream has been opened in
553
<see cref="T:OpenMcdf.UpdateMode">Update mode</see>.
556
<member name="M:OpenMcdf.CompoundFile.Commit(System.Boolean)">
558
Commit data changes since the previously commit operation
559
to the underlying supporting stream or file on the disk.
561
<param name="releaseMemory">If true, release loaded sectors to limit memory usage but reduces following read operations performance</param>
563
This method can be used only if
564
the supporting stream has been opened in
565
<see cref="T:OpenMcdf.UpdateMode">Update mode</see>.
568
<member name="M:OpenMcdf.CompoundFile.Load(System.IO.Stream)">
570
Load compound file from an existing stream.
572
<param name="stream">Stream to load compound file from</param>
574
<member name="M:OpenMcdf.CompoundFile.SetMiniSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
576
Allocate space, setup sectors id and refresh header
577
for the new or updated mini sector chain.
579
<param name="sectorChain">The new MINI sector chain</param>
581
<member name="M:OpenMcdf.CompoundFile.SetNormalSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
583
Allocate space, setup sectors id and refresh header
584
for the new or updated sector chain.
586
<param name="sectorChain">The new or updated generic sector chain</param>
588
<member name="M:OpenMcdf.CompoundFile.CheckForLockSector">
590
Check for transaction lock sector addition and mark it in the FAT.
593
<member name="M:OpenMcdf.CompoundFile.SetFATSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
595
Allocate space, setup sectors id and refresh header
596
for the new or updated FAT sector chain.
598
<param name="sectorChain">The new or updated generic sector chain</param>
600
<member name="M:OpenMcdf.CompoundFile.SetDIFATSectorChain(System.Collections.Generic.List{OpenMcdf.Sector})">
602
Setup the DIFAT sector chain
604
<param name="FATsectorChain">A FAT sector chain</param>
606
<member name="M:OpenMcdf.CompoundFile.GetDifatSectorChain">
608
Get the DIFAT Sector chain
610
<returns>A list of DIFAT sectors</returns>
612
<member name="M:OpenMcdf.CompoundFile.GetFatSectorChain">
614
Get the FAT sector chain
616
<returns>List of FAT sectors</returns>
618
<member name="M:OpenMcdf.CompoundFile.GetNormalSectorChain(System.Int32)">
620
Get a standard sector chain
622
<param name="secID">First SecID of the required chain</param>
623
<returns>A list of sectors</returns>
625
<member name="M:OpenMcdf.CompoundFile.GetMiniSectorChain(System.Int32)">
627
Get a mini sector chain
629
<param name="secID">First SecID of the required chain</param>
630
<returns>A list of mini sectors (64 bytes)</returns>
632
<member name="M:OpenMcdf.CompoundFile.GetSectorChain(System.Int32,OpenMcdf.SectorType)">
634
Get a sector chain from a compound file given the first sector ID
635
and the required sector type.
637
<param name="secID">First chain sector's id </param>
638
<param name="chainType">Type of Sectors in the required chain (mini sectors, normal sectors or FAT)</param>
639
<returns>A list of Sectors as the result of their concatenation</returns>
641
<member name="M:OpenMcdf.CompoundFile.ResetDirectoryEntry(System.Int32)">
643
Reset a directory entry setting it to StgInvalid in the Directory.
645
<param name="sid">Sid of the directory to invalidate</param>
647
<member name="M:OpenMcdf.CompoundFile.LoadDirectories">
649
Load directory entries from compound file. Header and FAT MUST be already loaded.
652
<member name="M:OpenMcdf.CompoundFile.CommitDirectory">
654
Commit directory entries change on the Current Source stream
657
<member name="M:OpenMcdf.CompoundFile.Save(System.String)">
659
Saves the in-memory image of Compound File to a file.
661
<param name="fileName">File name to write the compound file to</param>
662
<exception cref="T:OpenMcdf.CFException">Raised if destination file is not seekable</exception>
664
<member name="M:OpenMcdf.CompoundFile.Save(System.IO.Stream)">
666
Saves the in-memory image of Compound File to a stream.
669
Destination Stream must be seekable.
671
<param name="stream">The stream to save compound File to</param>
672
<exception cref="T:OpenMcdf.CFException">Raised if destination stream is not seekable</exception>
673
<exception cref="T:OpenMcdf.CFDisposedException">Raised if Compound File Storage has been already disposed</exception>
676
MemoryStream ms = new MemoryStream(size);
678
CompoundFile cf = new CompoundFile();
679
CFStorage st = cf.RootStorage.AddStorage("MyStorage");
680
CFStream sm = st.AddStream("MyStream");
682
byte[] b = new byte[]{0x00,0x01,0x02,0x03};
690
<member name="M:OpenMcdf.CompoundFile.FindFreeSectors(OpenMcdf.SectorType)">
692
Scan FAT o miniFAT for free sectors to reuse.
694
<param name="sType">Type of sector to look for</param>
695
<returns>A stack of available sectors or minisectors already allocated</returns>
697
<!-- Badly formed XML comment ignored for member "M:OpenMcdf.CompoundFile.AppendData(OpenMcdf.CFItem,System.Byte[])" -->
698
<member name="M:OpenMcdf.CompoundFile.CheckFileLength">
700
Check file size limit ( 2GB for version 3 )
703
<member name="M:OpenMcdf.CompoundFile.Close">
705
Close the Compound File object <see cref="T:OpenMcdf.CompoundFile">CompoundFile</see> and
706
free all associated resources (e.g. open file handle and allocated memory).
708
When the <see cref="T:OpenMcdf.CompoundFile.Close()">Close</see> method is called,
709
all the associated stream and storage objects are invalidated:
710
any operation invoked on them will produce a <see cref="T:OpenMcdf.CFDisposedException">CFDisposedException</see>.
715
const String FILENAME = "CompoundFile.cfs";
716
CompoundFile cf = new CompoundFile(FILENAME);
718
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
723
byte[] temp = st.GetStream("MyStream").GetData();
725
// The following line will fail because back-end object has been closed
726
Assert.Fail("Stream without media");
730
Assert.IsTrue(ex is CFDisposedException);
735
<member name="M:OpenMcdf.CompoundFile.Dispose(System.Boolean)">
737
When called from user code, release all resources, otherwise, in the case runtime called it,
738
only unmanagd resources are released.
740
<param name="disposing">If true, method has been called from User code, if false it's been called from .net runtime</param>
742
<member name="M:OpenMcdf.CompoundFile.GetAllNamedEntries(System.String)">
744
Get a list of all entries with a given name contained in the document.
746
<param name="entryName">Name of entries to retrive</param>
747
<returns>A list of name-matching entries</returns>
748
<remarks>This function is aimed to speed up entity lookup in
749
flat-structure files (only one or little more known entries)
750
without the performance penalty related to entities hierarchy constraints.
751
There is no implied hierarchy in the returned list.
754
<member name="M:OpenMcdf.CompoundFile.ShrinkCompoundFile(System.IO.Stream)">
756
Compress free space by removing unallocated sectors from compound file
757
effectively reducing stream or file size.
760
Current implementation supports compression only for ver. 3 compound files.
765
//This code has been extracted from unit test
767
String FILENAME = "MultipleStorage3.cfs";
769
FileInfo srcFile = new FileInfo(FILENAME);
771
File.Copy(FILENAME, "MultipleStorage_Deleted_Compress.cfs", true);
773
CompoundFile cf = new CompoundFile("MultipleStorage_Deleted_Compress.cfs", UpdateMode.Update, true, true);
775
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
776
st = st.GetStorage("AnotherStorage");
778
Assert.IsNotNull(st);
779
st.Delete("Another2Stream"); //17Kb
783
CompoundFile.ShrinkCompoundFile("MultipleStorage_Deleted_Compress.cfs");
785
FileInfo dstFile = new FileInfo("MultipleStorage_Deleted_Compress.cfs");
787
Assert.IsTrue(srcFile.Length > dstFile.Length);
792
<member name="M:OpenMcdf.CompoundFile.ShrinkCompoundFile(System.String)">
794
Remove unallocated sectors from compound file in order to reduce its size.
797
Current implementation supports compression only for ver. 3 compound files.
802
//This code has been extracted from unit test
804
String FILENAME = "MultipleStorage3.cfs";
806
FileInfo srcFile = new FileInfo(FILENAME);
808
File.Copy(FILENAME, "MultipleStorage_Deleted_Compress.cfs", true);
810
CompoundFile cf = new CompoundFile("MultipleStorage_Deleted_Compress.cfs", UpdateMode.Update, true, true);
812
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
813
st = st.GetStorage("AnotherStorage");
815
Assert.IsNotNull(st);
816
st.Delete("Another2Stream"); //17Kb
820
CompoundFile.ShrinkCompoundFile("MultipleStorage_Deleted_Compress.cfs");
822
FileInfo dstFile = new FileInfo("MultipleStorage_Deleted_Compress.cfs");
824
Assert.IsTrue(srcFile.Length > dstFile.Length);
829
<member name="M:OpenMcdf.CompoundFile.DoCompression(OpenMcdf.CFStorage,OpenMcdf.CFStorage)">
831
Recursively clones valid structures, avoiding to copy free sectors.
833
<param name="currSrcStorage">Current source storage to clone</param>
834
<param name="currDstStorage">Current cloned destination storage</param>
836
<member name="P:OpenMcdf.CompoundFile.HasSourceStream">
838
Return true if this compound file has been
839
loaded from an existing file or stream
842
<member name="P:OpenMcdf.CompoundFile.RootStorage">
844
The entry point object that represents the
845
root of the structures tree to get or set storage or
851
//Create a compound file
852
string FILENAME = "MyFileName.cfs";
853
CompoundFile ncf = new CompoundFile();
855
CFStorage l1 = ncf.RootStorage.AddStorage("Storage Level 1");
857
l1.AddStream("l1ns1");
858
l1.AddStream("l1ns2");
859
l1.AddStream("l1ns3");
860
CFStorage l2 = l1.AddStorage("Storage Level 2");
861
l2.AddStream("l2ns1");
862
l2.AddStream("l2ns2");
869
<member name="T:OpenMcdf.CFStream">
871
OLE structured storage <see cref="T:OpenMcdf.CFStream">stream</see> Object
872
It is contained inside a Storage object in a file-directory
873
relationship and indexed by its name.
876
<member name="M:OpenMcdf.CFStream.SetData(System.Byte[])">
878
Set the data associated with the stream object.
882
byte[] b = new byte[]{0x0,0x1,0x2,0x3};
883
CompoundFile cf = new CompoundFile();
884
CFStream myStream = cf.RootStorage.AddStream("MyStream");
888
<param name="data">Data bytes to write to this stream</param>
890
<member name="M:OpenMcdf.CFStream.AppendData(System.Byte[])">
892
Append the provided data to stream data.
896
byte[] b = new byte[]{0x0,0x1,0x2,0x3};
897
byte[] b2 = new byte[]{0x4,0x5,0x6,0x7};
898
CompoundFile cf = new CompoundFile();
899
CFStream myStream = cf.RootStorage.AddStream("MyStream");
900
myStream.SetData(b); // here we could also have invoked .AppendData
901
myStream.AppendData(b2);
902
cf.Save("MyLargeStreamsFile.cfs);
906
<param name="data">Data bytes to append to this stream</param>
908
This method allows user to create stream with more than 2GB of data,
909
appending data to the end of existing ones.
910
Large streams (>2GB) are only supported by CFS version 4.
911
Append data can also be invoked on streams with no data in order
912
to simplify its use inside loops.
915
<member name="M:OpenMcdf.CFStream.GetData">
917
Get the data associated with the stream object.
921
CompoundFile cf2 = new CompoundFile("AFileName.cfs");
922
CFStream st = cf2.RootStorage.GetStream("MyStream");
923
byte[] buffer = st.GetData();
926
<returns>Array of byte containing stream data</returns>
927
<exception cref="T:OpenMcdf.CFDisposedException">
928
Raised when the owner compound file has been closed.
931
<member name="M:OpenMcdf.CFStream.GetData(System.Int64,System.Int32@)">
933
Get <paramref name="count"/> bytes associated with the stream object, starting from
934
a provided <paramref name="offset"/>. When method returns, count will contain the
935
effective count of bytes read.
939
CompoundFile cf = new CompoundFile("AFileName.cfs");
940
CFStream st = cf.RootStorage.GetStream("MyStream");
942
// The stream is supposed to have a length greater than offset + count
943
byte[] data = st.GetData(20, ref count);
947
<returns>Array of byte containing stream data</returns>
948
<exception cref="T:OpenMcdf.CFDisposedException">
949
Raised when the owner compound file has been closed.
952
<member name="M:OpenMcdf.CFStream.CopyFrom(System.IO.Stream)">
954
Copy data from an existing stream.
956
<param name="input">A stream to read from</param>
958
Input stream is NOT closed after method invocation.
961
<member name="T:OpenMcdf.VisitedEntryAction">
963
Action to apply to visited items in the OLE structured storage
965
<param name="item">Currently visited <see cref="T:OpenMcdf.CFItem">item</see></param>
969
//We assume that xls file should be a valid OLE compound file
970
const String STORAGE_NAME = "report.xls";
971
CompoundFile cf = new CompoundFile(STORAGE_NAME);
973
FileStream output = new FileStream("LogEntries.txt", FileMode.Create);
974
TextWriter tw = new StreamWriter(output);
976
VisitedEntryAction va = delegate(CFItem item)
978
tw.WriteLine(item.Name);
981
cf.RootStorage.VisitEntries(va, true);
988
<member name="T:OpenMcdf.CFStorage">
990
Storage entity that acts like a logic container for streams
991
or substorages in a compound file.
994
<member name="M:OpenMcdf.CFStorage.#ctor(OpenMcdf.CompoundFile)">
996
Create a new CFStorage
998
<param name="compFile">The Storage Owner - CompoundFile</param>
1000
<member name="M:OpenMcdf.CFStorage.#ctor(OpenMcdf.CompoundFile,OpenMcdf.IDirectoryEntry)">
1002
Create a CFStorage using an existing directory (previously loaded).
1004
<param name="compFile">The Storage Owner - CompoundFile</param>
1005
<param name="dirEntry">An existing Directory Entry</param>
1007
<member name="M:OpenMcdf.CFStorage.AddStream(System.String)">
1009
Create a new child stream inside the current <see cref="T:OpenMcdf.CFStorage">storage</see>
1011
<param name="streamName">The new stream name</param>
1012
<returns>The new <see cref="T:OpenMcdf.CFStream">stream</see> reference</returns>
1013
<exception cref="T:OpenMcdf.CFDuplicatedItemException">Raised when adding an item with the same name of an existing one</exception>
1014
<exception cref="T:OpenMcdf.CFDisposedException">Raised when adding a stream to a closed compound file</exception>
1015
<exception cref="T:OpenMcdf.CFException">Raised when adding a stream with null or empty name</exception>
1019
String filename = "A_NEW_COMPOUND_FILE_YOU_CAN_WRITE_TO.cfs";
1021
CompoundFile cf = new CompoundFile();
1023
CFStorage st = cf.RootStorage.AddStorage("MyStorage");
1024
CFStream sm = st.AddStream("MyStream");
1025
byte[] b = Helpers.GetBuffer(220, 0x0A);
1033
<member name="M:OpenMcdf.CFStorage.GetStream(System.String)">
1035
Get a named <see cref="T:OpenMcdf.CFStream">stream</see> contained in the current storage if existing.
1037
<param name="streamName">Name of the stream to look for</param>
1038
<returns>A stream reference if existing</returns>
1039
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
1040
<exception cref="T:OpenMcdf.CFItemNotFound">Raised if item to delete is not found</exception>
1043
String filename = "report.xls";
1045
CompoundFile cf = new CompoundFile(filename);
1046
CFStream foundStream = cf.RootStorage.GetStream("Workbook");
1048
byte[] temp = foundStream.GetData();
1050
Assert.IsNotNull(temp);
1056
<member name="M:OpenMcdf.CFStorage.GetStorage(System.String)">
1058
Get a named storage contained in the current one if existing.
1060
<param name="storageName">Name of the storage to look for</param>
1061
<returns>A storage reference if existing.</returns>
1062
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
1063
<exception cref="T:OpenMcdf.CFItemNotFound">Raised if item to delete is not found</exception>
1067
String FILENAME = "MultipleStorage2.cfs";
1068
CompoundFile cf = new CompoundFile(FILENAME, UpdateMode.ReadOnly, false, false);
1070
CFStorage st = cf.RootStorage.GetStorage("MyStorage");
1072
Assert.IsNotNull(st);
1077
<member name="M:OpenMcdf.CFStorage.AddStorage(System.String)">
1079
Create new child storage directory inside the current storage.
1081
<param name="storageName">The new storage name</param>
1082
<returns>Reference to the new <see cref="T:OpenMcdf.CFStorage">storage</see></returns>
1083
<exception cref="T:OpenMcdf.CFDuplicatedItemException">Raised when adding an item with the same name of an existing one</exception>
1084
<exception cref="T:OpenMcdf.CFDisposedException">Raised when adding a storage to a closed compound file</exception>
1085
<exception cref="T:OpenMcdf.CFException">Raised when adding a storage with null or empty name</exception>
1089
String filename = "A_NEW_COMPOUND_FILE_YOU_CAN_WRITE_TO.cfs";
1091
CompoundFile cf = new CompoundFile();
1093
CFStorage st = cf.RootStorage.AddStorage("MyStorage");
1094
CFStream sm = st.AddStream("MyStream");
1095
byte[] b = Helpers.GetBuffer(220, 0x0A);
1103
<member name="M:OpenMcdf.CFStorage.VisitEntries(OpenMcdf.VisitedEntryAction,System.Boolean)">
1105
Visit all entities contained in the storage applying a user provided action
1107
<exception cref="T:OpenMcdf.CFDisposedException">Raised when visiting items of a closed compound file</exception>
1108
<param name="action">User <see cref="T:OpenMcdf.VisitedEntryAction">action</see> to apply to visited entities</param>
1109
<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>
1112
const String STORAGE_NAME = "report.xls";
1113
CompoundFile cf = new CompoundFile(STORAGE_NAME);
1115
FileStream output = new FileStream("LogEntries.txt", FileMode.Create);
1116
TextWriter tw = new StreamWriter(output);
1118
VisitedEntryAction va = delegate(CFItem item)
1120
tw.WriteLine(item.Name);
1123
cf.RootStorage.VisitEntries(va, true);
1129
<member name="M:OpenMcdf.CFStorage.Delete(System.String)">
1131
Remove an entry from the current storage and compound file.
1133
<param name="entryName">The name of the entry in the current storage to delete</param>
1136
cf = new CompoundFile("A_FILE_YOU_CAN_CHANGE.cfs", UpdateMode.Update, true, false);
1137
cf.RootStorage.Delete("AStream"); // AStream item is assumed to exist.
1142
<exception cref="T:OpenMcdf.CFDisposedException">Raised if trying to delete item from a closed compound file</exception>
1143
<exception cref="T:OpenMcdf.CFItemNotFound">Raised if item to delete is not found</exception>
1144
<exception cref="T:OpenMcdf.CFException">Raised if trying to delete root storage</exception>
1146
<member name="M:OpenMcdf.DirectoryEntry.fnv_hash(System.Byte[])">
1148
FNV hash, short for Fowler/Noll/Vo
1150
<param name="buffer"></param>
1151
<returns>(not warranted) unique hash for byte array</returns>
1153
<member name="T:BinaryTrees.BinaryTreeNode`1">
1155
The BinaryTreeNode class represents a node in a binary tree, or a binary search tree.
1156
It has precisely two neighbors, which can be accessed via the Left and Right properties.
1158
<typeparam name="T">The type of data stored in the binary tree node.</typeparam>
1160
<member name="T:BinaryTrees.Node`1">
1162
The Node<T> class represents the base concept of a Node for a tree or graph. It contains
1163
a data item of type T, and a list of neighbors.
1165
<typeparam name="T">The type of data contained in the Node.</typeparam>
1166
<remarks>None of the classes in the SkmDataStructures2 namespace use the Node class directly;
1167
they all derive from this class, adding necessary functionality specific to each data structure.</remarks>
1169
<member name="M:OpenMcdf.Sector.Dispose(System.Boolean)">
1171
When called from user code, release all resources, otherwise, in the case runtime called it,
1172
only unmanagd resources are released.
1174
<param name="disposing">If true, method has been called from User code, if false it's been called from .net runtime</param>
1176
<member name="T:RBTree.RedBlack">
1178
A red-black tree must satisfy these properties:
1180
1. The root is black.
1181
2. All leaves are black.
1182
3. Red nodes can only have black children.
1183
4. All paths from a node to its leaves contain the same number of black nodes.
1186
<member name="M:RBTree.RedBlack.Add(System.IComparable,System.Object)">
1189
args: ByVal key As IComparable, ByVal data As Object
1190
key is object that implements IComparable interface
1191
performance tip: change to use use int type (such as the hashcode)
1194
<member name="M:RBTree.RedBlack.RestoreAfterInsert(RBTree.RedBlackNode)">
1197
Additions to red-black trees usually destroy the red-black
1198
properties. Examine the tree and restore. Rotations are normally
1199
required to restore it
1202
<member name="M:RBTree.RedBlack.RotateLeft(RBTree.RedBlackNode)">
1205
Rebalance the tree by rotating the nodes to the left
1208
<member name="M:RBTree.RedBlack.RotateRight(RBTree.RedBlackNode)">
1211
Rebalance the tree by rotating the nodes to the right
1214
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.GetData(System.IComparable)" -->
1215
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.GetMinKey" -->
1216
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.GetMaxKey" -->
1217
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.GetMinValue" -->
1218
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.GetMaxValue" -->
1219
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.GetEnumerator" -->
1220
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Keys" -->
1221
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Values" -->
1222
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Elements" -->
1223
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.IsEmpty" -->
1224
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Remove(System.IComparable)" -->
1225
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Delete(RBTree.RedBlackNode)" -->
1226
<member name="M:RBTree.RedBlack.RestoreAfterDelete(RBTree.RedBlackNode)">
1229
Deletions from red-black trees may destroy the red-black
1230
properties. Examine the tree and restore. Rotations are normally
1231
required to restore it
1234
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.RemoveMin" -->
1235
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.RemoveMax" -->
1236
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Clear" -->
1237
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Size" -->
1238
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.Equals(System.Object)" -->
1239
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.GetHashCode" -->
1240
<!-- Badly formed XML comment ignored for member "M:RBTree.RedBlack.ToString" -->
1241
<member name="T:OpenMcdf.CFMock">
1243
Used as internal template object for binary tree searches.
1246
<member name="T:RBTree.RedBlackNode">
1248
The RedBlackNode class encapsulates a node in the tree
1251
<member name="P:RBTree.RedBlackNode.Key">
1256
<member name="P:RBTree.RedBlackNode.Data">
1261
<member name="P:RBTree.RedBlackNode.Color">
1266
<member name="P:RBTree.RedBlackNode.Left">
1271
<member name="P:RBTree.RedBlackNode.Right">
1276
<member name="T:OpenMcdf.CFException">
1278
OpenMCDF base exception.
1281
<member name="T:OpenMcdf.CFDisposedException">
1283
Raised when a data setter/getter method is invoked
1284
on a stream or storage object after the disposal of the owner
1285
compound file object.
1288
<member name="T:OpenMcdf.CFFileFormatException">
1290
Raised when opening a file with invalid header
1291
or not supported COM/OLE Structured storage version.
1294
<member name="T:OpenMcdf.CFItemNotFound">
1296
Raised when a named stream or a storage object
1297
are not found in a parent storage.
1300
<member name="T:OpenMcdf.CFInvalidOperation">
1302
Raised when a method call is invalid for the current object state
1305
<member name="T:OpenMcdf.CFDuplicatedItemException">
1307
Raised when trying to add a duplicated CFItem
1310
Items are compared by name as indicated by specs.
1311
Two items with the same name CANNOT be added within
1312
the same storage or sub-storage.
1315
<member name="T:OpenMcdf.CFCorruptedFileException">
1317
Raised when trying to load a Compound File with invalid, corrupted or mismatched fields (4.1 - specifications)
1320
This exception is NOT raised when Compound file has been opened with NO_VALIDATION_EXCEPTION option.
1323
<member name="T:BinaryTrees.BinaryTree`1">
1325
Represents a binary tree. This class provides access to the Root of the tree. The developer
1326
must manually create the binary tree by adding descendents to the root.
1328
<typeparam name="T">The type of data stored in the binary tree's nodes.</typeparam>
1330
<member name="M:BinaryTrees.BinaryTree`1.Clear">
1332
Clears out the contents of the binary tree.
1335
<member name="T:OpenMcdf.StreamView">
1337
Stream decorator for a Sector or miniSector chain
1340
<member name="T:RBTree.RedBlackEnumerator">
1342
The RedBlackEnumerator class returns the keys or data objects of the treap in
1346
<member name="M:RBTree.RedBlackEnumerator.#ctor(RBTree.RedBlackNode,System.Boolean,System.Boolean)">
1348
Determine order, walk the tree and push the nodes onto the stack
1351
<member name="M:RBTree.RedBlackEnumerator.HasMoreElements">
1356
<member name="M:RBTree.RedBlackEnumerator.NextElement">
1361
<member name="M:RBTree.RedBlackEnumerator.MoveNext">
1364
For .NET compatibility
1367
<member name="P:RBTree.RedBlackEnumerator.Key">
1372
<member name="P:RBTree.RedBlackEnumerator.Value">
1377
<member name="T:RBTree.RedBlackException">
1379
The RedBlackException class distinguishes read black tree exceptions from .NET