This interface is used by the toolkit to access storage in which AAF files are to be read and written. More...
Public Member Functions | |
HRESULT | ReadAt ([in] aafUInt64 position,[out, size_is(bufSize), length_is(*pNumRead)] aafMemPtr_t buf,[in] aafUInt32 bufSize,[out] aafUInt32 *pNumRead) |
Attempts to read bufsize bytes from this storage. | |
HRESULT | WriteAt ([in] aafUInt64 position,[in, size_is(bufSize)] aafMemConstPtr_t buf,[in] aafUInt32 bufSize,[out] aafUInt32 *pNumWritten) |
Writes bufsize bytes into this storage. | |
HRESULT | GetSize ([out] aafUInt64 *pSize) |
Returns the highest byte position in this storage which has been written so far. | |
HRESULT | IsExtendable ([out] aafBoolean_t *pResult) |
Sets *pResult to true if the memory allocated to this storage can be dynamically extened; sets it to false otherwise. | |
HRESULT | GetExtent ([out] aafUInt64 *pExtent) |
Returns the number of bytes currently allocated storage. | |
HRESULT | SetExtent ([in] aafUInt64 extent) |
Requests the given capacity for this storage. |
This interface is used by the toolkit to access storage in which AAF files are to be read and written.
It is typically implemented by clients of IAAFFileXXX. Note that some implementations are provided as a convenience to IAAFFileXXX clients.
Assumes that the storage has at least random access capability.
In addition to the specific error results listed for each method, all methods in this interface may also return one of the following values:
AAFRESULT_NOMEMORY
HRESULT IAAFRandomRawStorage::GetExtent | ( | [out] aafUInt64 * | pExtent | ) |
Returns the number of bytes currently allocated storage.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
pExtent | [out] Number of bytes currently allocated for this storage |
HRESULT IAAFRandomRawStorage::GetSize | ( | [out] aafUInt64 * | pSize | ) |
Returns the highest byte position in this storage which has been written so far.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
pSize | [out] Number of bytes currently in this storage |
HRESULT IAAFRandomRawStorage::IsExtendable | ( | [out] aafBoolean_t * | pResult | ) |
Sets *pResult to true if the memory allocated to this storage can be dynamically extened; sets it to false otherwise.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
pResult | [out] set to true if extendable |
HRESULT IAAFRandomRawStorage::ReadAt | ( | [in] aafUInt64 | position, |
[out, size_is(bufSize), length_is(*pNumRead)] aafMemPtr_t | buf, | ||
[in] aafUInt32 | bufSize, | ||
[out] aafUInt32 * | pNumRead | ||
) |
Attempts to read bufsize bytes from this storage.
Places the data into buf, and puts the actual number of bytes read into pNumRead. If the end of the storage is encountered before bufSize bytes can be read, the value written into *pNumRead may be smaller than bufSize.
This call will advance the current position by *pNumRead bytes.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
AAFRESULT_NOT_READABLE
position | [in] position in this storage from which data is read |
buf | [out, size_is(bufSize), length_is(*pNumRead)] Buffer into which data is read |
bufSize | [in] Size of buf in bytes |
pNumRead | [out] Number of bytes read |
HRESULT IAAFRandomRawStorage::SetExtent | ( | [in] aafUInt64 | extent | ) |
Requests the given capacity for this storage.
If successful, subsequent calls to WriteAt() and IAAFRawStorage::Write() within that capacity are guaranteed to succeed.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_OFFSET_SIZE
extent | [in] Number of bytes capacity requested for this storage |
HRESULT IAAFRandomRawStorage::WriteAt | ( | [in] aafUInt64 | position, |
[in, size_is(bufSize)] aafMemConstPtr_t | buf, | ||
[in] aafUInt32 | bufSize, | ||
[out] aafUInt32 * | pNumWritten | ||
) |
Writes bufsize bytes into this storage.
Obtains the data from buf.
This call may fail if the capacity of this storage cannot be extended sufficiently to complete the request. The client can call SetSize() to attempt to reserve capacity for the storage; if the SetSize() call succeeds, subsequent Write() calls within requested that capacty are guaranteed to succeed.
This call will advance the current position by bufSize bytes.
Succeeds if:
This method will return the following codes. If more than one of the listed errors is in effect, it will return the first one encountered in the order given below:
AAFRESULT_SUCCESS
AAFRESULT_NULL_PARAM
AAFRESULT_NOT_WRITEABLE
AAFRESULT_OFFSET_SIZE
position | [in] position in this storage into which data is written |
buf | [in, size_is(bufSize)] Buffer from which data is written |
bufSize | [in] Number of bytes |
pNumWritten | [out] Number of bytes written |