class CMTPTypeFile : public CActive |
Defines the MTP file object data type.
Public Member Functions | |
---|---|
~CMTPTypeFile() | |
IMPORT_C MMTPType * | CommitChunkL(TPtr8 &) |
IMPORT_C TBool | CommitRequired() |
IMPORT_C RFile & | File() |
IMPORT_C TInt | FirstReadChunk(TPtrC8 &) |
IMPORT_C TInt | FirstWriteChunk(TPtr8 &) |
IMPORT_C TInt64 | GetByteSent() |
IMPORT_C CMTPTypeFile * | NewL(RFs &, const TDesC &, TFileMode) |
IMPORT_C CMTPTypeFile * | NewL(RFs &, const TDesC &, TFileMode, TInt64, TInt64) |
IMPORT_C CMTPTypeFile * | NewLC(RFs &, const TDesC &, TFileMode) |
IMPORT_C CMTPTypeFile * | NewLC(RFs &, const TDesC &, TFileMode, TInt64, TInt64) |
IMPORT_C TInt | NextReadChunk(TPtrC8 &) |
IMPORT_C TInt | NextWriteChunk(TPtr8 &) |
IMPORT_C void | SetSizeL(TUint64) |
IMPORT_C TUint64 | Size() |
IMPORT_C TUint | Type() |
Protected Member Functions | |
---|---|
void | DoCancel() |
Private Member Functions | |
---|---|
CMTPTypeFile(RFs &) | |
void | ConstructL(const TDesC &, TFileMode) |
void | ConstructL(const TDesC &, TFileMode, TInt64, TInt64) |
void | CreateDoubleBufferL(TInt64) |
TInt | RunError(TInt) |
void | RunL() |
void | ToggleRdWrBuffer() |
Private Member Enumerations | |
---|---|
enum | TReadWriteSequenceState { EIdle, EInProgress } |
Inherited Enumerations | |
---|---|
CActive:TPriority |
Inherited Attributes | |
---|---|
CActive::iStatus |
void | ConstructL | ( | const TDesC & | aName, |
TFileMode | aMode, | |||
TInt64 | aRequiredSize, | |||
TInt64 | aOffSet | |||
) | [private] |
void | CreateDoubleBufferL | ( | TInt64 | aFileSize | ) | [private] |
Allocate double buffers to write to/read from file
TInt64 aFileSize |
void | DoCancel | ( | ) | [protected, virtual] |
Implements cancellation of an outstanding request.
This function is called as part of the active object's Cancel().
It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.
DoCancel() must not wait for event completion; this is handled by Cancel().
IMPORT_C RFile & | File | ( | ) |
Provides a reference to the native file object encapsulate by the MTP file object data type.
IMPORT_C CMTPTypeFile * | NewL | ( | RFs & | aFs, |
const TDesC & | aFileName, | |||
TFileMode | aFileMode | |||
) | [static] |
IMPORT_C CMTPTypeFile * | NewL | ( | RFs & | aFs, |
const TDesC & | aFileName, | |||
TFileMode | aFileMode, | |||
TInt64 | aRequiredSize, | |||
TInt64 | aOffSet = 0 | |||
) | [static] |
IMPORT_C CMTPTypeFile * | NewLC | ( | RFs & | aFs, |
const TDesC & | aFileName, | |||
TFileMode | aFileMode | |||
) | [static] |
IMPORT_C CMTPTypeFile * | NewLC | ( | RFs & | aFs, |
const TDesC & | aFileName, | |||
TFileMode | aFileMode, | |||
TInt64 | aRequiredSize, | |||
TInt64 | aOffSet = 0 | |||
) | [static] |
void | RunL | ( | ) | [private, virtual] |
Handles an active object's request completion event.
A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.
The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.
Before calling this active object's RunL() function, the active scheduler has:
1. decided that this is the highest priority active object with a completed request
2. marked this active object's request as complete (i.e. the request is no longer outstanding)
RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.
Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.
CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD
IMPORT_C void | SetSizeL | ( | TUint64 | aSize | ) |
TUint64 aSize | The new size of the file (in bytes). |
The read and write data stream states.
EIdle |
Data stream is inactive. |
EInProgress |
Data stream is in progress. |
RBuf8 | iBuffer1 | [private] |
The intermediate data buffer. Note that this is declared mutable to allow state updates while processing a read data stream.
TBool | iBuffer1AvailForWrite | [private] |
The flag indicate if this buffer is avaiable for writting data into, if true, it is ready for USB-SIC to write file data into it, if false, it already contains file data, and is waiting for writting the file data into file system. The two buffer must be used in strict sequence, if both buffer is available, the buffer1 must be firstly used by USB driver.
RBuf8 | iBuffer2 | [private] |
The intermediate data buffer. Note that this is declared mutable to allow state updates while processing a read data stream. Used for double-buffering, the 2 buffers(buffer1 and buffer2) will be switched between reading data from USB to buffer and writting data from Buffer into File System.
RFile | iFile | [private] |
The data file. Note that this is declared mutable to allow state updates while processing a read data stream.
TUint | iReadSequenceState | [private] |
The read data stream state variable. Note that this is declared mutable to allow state updates while processing a read data stream.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.