Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: s32stor.h
Link against: estor.lib

Class CEmbeddedStore

CEmbeddedStore

Support

Supported from 5.0

Description

Encapsulates an embedded store.

The embedded store may contain an arbitrarily complex network of streams, but is viewed as simply another stream by the embedding store. This means that the embedded store can dealt with as a single stream for purposes of copying or deleting.

Once streams within the embedded store have been committed and closed, they cannot subsequently be changed, i.e. streams cannot be replaced, deleted, extended or changed in any way.

Derivation

CBaseBase class for all classes to be instantiated on the heap
CEmbeddedStoreEncapsulates an embedded store
CPersistentStorePersistent store abstract base class
CStreamStoreProvides the core abstract framework for stores allowing streams to be created and manipulated

Defined in CEmbeddedStore:
Detach(), FromL(), FromLC(), Host(), NewL(), NewLC(), Position(), Reattach(), Start(), ~CEmbeddedStore()

Inherited from CBase:
operator new()

Inherited from CPersistentStore:
Root(), SetRootL()

Inherited from CStreamStore:
Commit(), CommitL(), CompactL(), Delete(), DeleteL(), DoCommitL(), DoCompactL(), DoCreateL(), DoDeleteL(), DoReadL(), DoReclaimL(), DoReplaceL(), DoRevertL(), DoWriteL(), ExtendL(), ReclaimL(), Revert(), RevertL()

See also:


Construction and destruction


NewL()

static CEmbeddedStore* NewL(RWriteStream& aHost);

Description

Creates an embedded store within the specified host stream.

Note that ownership of the stream passes to the store and the referenced RWriteStream is cleared.

Parameters

RWriteStream& aHost

A reference to the stream which is to host the embedded store.

Return value

CEmbeddedStore*

A pointer to the embedded store object.


NewLC()

static CEmbeddedStore* NewLC(RWriteStream& aHost);

Description

Creates an embedded store within the specified host stream, putting a pointer to the store onto the cleanup stack.

Putting a pointer to the embedded store object onto the cleanup stack allows the object and allocated resources to be cleaned up if a subsequent leave occurs.

Note that ownership of the stream passes to the store and the referenced RWriteStream is cleared.

Parameters

RWriteStream& aHost

A reference to the stream which is to host the embedded store.

Return value

CEmbeddedStore*

A pointer to the embedded store object.


~CEmbeddedStore()

~CEmbeddedStore();

Description

Frees resources owned by the object, prior to its destruction. In particular, the destructor closes the associated file.

[Top]


Open embedded store


FromL()

static CEmbeddedStore* FromL(RReadStream& aHost);

Description

Opens the store hosted by the specified stream.

Note that ownership of the stream passes to the store; the referenced RReadStream is cleared.

Parameters

RReadStream& aHost

A reference to the stream hosting the embedded store.

Return value

CEmbeddedStore*

A pointer to the embedded store object.


FromLC()

static CEmbeddedStore* FromLC(RReadStream& aHost);

Description

Open the store hosted by the specified stream, putting a pointer to the store onto the cleanup stack.

Putting a pointer to the embedded store object onto the cleanup stack allows the object and allocated resources to be cleaned up if a subsequent leave occurs.

Note that ownership of the stream passes to the store and the referenced RReadStream is cleared.

Parameters

RReadStream& aHost

A reference to the stream hosting the embedded store.

Return value

CEmbeddedStore*

A pointer to the embedded store object.

[Top]


Access the host stream buffer


Start()

TStreamPos Start() const;

Description

Returns the start position of this embedded store within the host stream.

Return value

TStreamPos

The position of the this embedded store within the host stream.


Position()

static TStreamPos Position(TStreamId anId);

Description

Returns the position of the specified stream, within the host stream.

Parameters

TStreamId anId

The stream id of the stream in the embedded store whose position within the host stream is to be returned.

Return value

TStreamPos

The position of the stream with id anId within the host stream.


Host()

MStreamBuf* Host() const;

Description

Returns a pointer to the stream buffer which is acting as host to this embedded store. The embedded store retains ownership of the host stream buffer.

Return value

MStreamBuf*

A pointer to the stream buffer which is host to this embedded store.


Detach()

void Detach();

Description

Gives up ownership of the host stream buffer. The caller takes on the responsibility for discarding the buffer.


Reattach()

void Reattach(MStreamBuf* aHost);

Description

Takes ownership of the specified stream buffer. On return from this function, the embedded store assumes this to be the host stream buffer.

Parameters

MStreamBuf* aHost

A pointer to the stream buffer over which the embedded store is to take ownership.