You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
namespace com.azkoss.excellite
|
|
{
|
|
using System;
|
|
|
|
internal abstract class StructuredStorageFileBase : IDisposable
|
|
{
|
|
// Methods
|
|
protected StructuredStorageFileBase()
|
|
{
|
|
}
|
|
|
|
public void Close()
|
|
{
|
|
this.Dispose();
|
|
}
|
|
|
|
public static StructuredStorageFileBase Create(string fileName)
|
|
{
|
|
return new UnmanagedStorage(fileName, true);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
if (!this.Disposed)
|
|
{
|
|
GC.SuppressFinalize(this);
|
|
this.Dispose(true);
|
|
}
|
|
}
|
|
|
|
protected abstract void Dispose(bool disposing);
|
|
|
|
~StructuredStorageFileBase()
|
|
{
|
|
this.Dispose(false);
|
|
}
|
|
|
|
public static StructuredStorageFileBase Open(string fileName)
|
|
{
|
|
return new UnmanagedStorage(fileName, false);
|
|
}
|
|
|
|
public abstract byte[] ReadStream(string name);
|
|
|
|
public abstract void WriteStream(string name, byte[] buffer);
|
|
|
|
|
|
// Properties
|
|
protected abstract bool Disposed { get; }
|
|
|
|
}
|
|
}
|
|
|