Table of Contents

Class SgaArchive

Namespace
OpenCompote.SGA
Assembly
OpenCompote.dll

Represents the open archive file itself.

public class SgaArchive : IDisposable
Inheritance
SgaArchive
Implements
Inherited Members

Constructors

SgaArchive(Stream, SgaMode, bool)

Open constructor. - Initialize new instance of SgaArchive on the given stream in the specific mode, specifying whether to leave the stream open.

public SgaArchive(Stream stream, SgaMode mode, bool leaveOpen = false)

Parameters

stream Stream

The stream containing the SGA archive.

mode SgaMode

Mode in which the archive should operate with.

leaveOpen bool

true to leave the stream open upon disposing the SgaArchive, otherwise false.

Remarks

This constructor cannot be used with SgaMode.Create. For creating new empty archives please use the Create constructor.

SgaArchive(Stream, SgaMode, SgaVersion?, bool)

Create constructor. - Initializes new instance of SgaArchive on the given empty stream in the specific mode, using specific SGA version, specifying whether to leave the stream open.

public SgaArchive(Stream stream, SgaMode mode, SgaVersion? version, bool leaveOpen = false)

Parameters

stream Stream

The stream where the SGA archive is to be stored.

mode SgaMode

Mode in which the archive should operate with.

version SgaVersion?

Expected SGA version of the archive.

leaveOpen bool

true to leave the stream open upon disposing the SgaArchive, otherwise false.

Remarks

This constructor should be used only for creating a new SGA archive. If you want to just open already existing fle, please use the Open constructor

Properties

ArchiveName

Name of the SGA archive.

public string ArchiveName { get; set; }

Property Value

string

BlockSize

public int BlockSize { get; set; }

Property Value

int

Drives

List of SGA Drives currently in the archive.

public ReadOnlyCollection<SgaDrive> Drives { get; }

Property Value

ReadOnlyCollection<SgaDrive>

Mode

Mode in which the archive was opened.

public SgaMode Mode { get; }

Property Value

SgaMode

Version

Version of the SGA archive.

public SgaVersion Version { get; }

Property Value

SgaVersion

Methods

AddDrive(string, string)

Creates new SgaDrive in the archive with the specific name and alias. New drive also contains a new empty RootFolder with the same name as the drive.

public SgaDrive AddDrive(string alias, string name)

Parameters

alias string

Alias of the new drive.

name string

Name of the new drive.

Returns

SgaDrive

New SgaDrive object

Exceptions

NotSupportedException

Archive does not support writing.

ArgumentNullException

alias or name is null.

ObjectDisposedException

The archive was already closed.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetDrive(string)

Returns SgaDrive with name or alias matching the parameter. If no matching drive is found returns null.

public SgaDrive? GetDrive(string driveName)

Parameters

driveName string

Name or alias of the Drive.

Returns

SgaDrive

SgaDrive or null if no matching drive was found.

Exceptions

ArgumentNullException

driveName is null.

ObjectDisposedException

The archive was already closed.

GetEntry(string)

NOT IMPLEMENTED! DO NOT USE

public SgaEntry GetEntry(string entryName)

Parameters

entryName string

Returns

SgaEntry