CUpnpHttpFileAccess Class Reference

class CUpnpHttpFileAccess : public CBase
Since
Series60 2.6

Inherits from

Public Member Functions
~CUpnpHttpFileAccess ()
TInt BytesWritten ()
void DeleteFile ()
TBool Download ()
TBool EncodingMode ()
TInt EndPosOfFile ()
TBool FileExist ()
TDesC16 & FileToServe ()
const TDesC8 & GetHeaders ()
TBool GetL ( TPtr8 &, TInt )
TBool HeadersSent ()
CUpnpHttpFileAccess * NewL ( CUpnpHttpSession *, const TDesC8 &, const TDesC16 &, TInt )
CUpnpHttpFileAccess * NewL ( CUpnpHttpSession *, const TDesC16 &)
TUint PosOfFile ()
TInt SaveL ( TDesC8 &)
void SetChunkCompleted ( TBool )
void SetEncodingMode ( TBool )
void SetEndPosOfFile ( TInt )
void SetHeadersSent ()
void SetOffset ( TUint )
void SetPosOfFile ( TUint )
void SetPosOfHeader ( TUint )
void SetTotalSize ( TInt )
void SetTransferTotal ( TInt )
TInt TransferTotal ()
TInt TransferredBytes ()
Private Member Functions
CUpnpHttpFileAccess ( TInt )
CUpnpHttpFileAccess ()
void ConstructL ( CUpnpHttpSession *, const TDesC8 &, const TDesC16 &)
void ConstructL ( CUpnpHttpSession *, const TDesC16 &)
TBool IsEndOfFile ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TInt iBytesWritten
TInt iEndPosOfFile
RFile iFile
HBufC16 * iFileToServe
RFs iFsSession
HBufC8 * iHeaderBuffer
TInt iHeaderLength
TBool iHeadersSent
TBool iIsChunkCompleted
TBool iIsChunked
TBool iIsDeleted
TBool iIsDownload
TInt iOpen
HBufC * iOpenedFile
TInt iPosInFile
TInt iPosToReadHeader
CUpnpHttpSession * iSession
TInt iSizeOfFile
RFile iTargetFile
TInt iTotalSizeOfDownload

Constructor & Destructor Documentation

CUpnpHttpFileAccess(TInt)

CUpnpHttpFileAccess ( TInt aFileSize ) [private]
First phase constructor. This constructor is used when file is to be sent from HttpServer.
Since
Series60 2.6

Parameters

TInt aFileSize Size of file to be served.

CUpnpHttpFileAccess()

CUpnpHttpFileAccess ( ) [private]
First phase constructor. This constructor is used when file is to be received.
Since
Series60 2.6

~CUpnpHttpFileAccess()

~CUpnpHttpFileAccess ( )

Virtual Destructor function.

Member Functions Documentation

BytesWritten()

TInt BytesWritten ( )
Returnes the number of bytes written
Since
Series60 3.2

ConstructL(CUpnpHttpSession *, const TDesC8 &, const TDesC16 &)

void ConstructL ( CUpnpHttpSession * aSession,
const TDesC8 & aHeaderBuffer,
const TDesC16 & aFilename
) [private]

By default Symbian 2nd phase constructor is private.

Parameters

CUpnpHttpSession * aSession handle to parent session that owns this object.
const TDesC8 & aHeaderBuffer descriptor with message headers.
const TDesC16 & aFilename

ConstructL(CUpnpHttpSession *, const TDesC16 &)

void ConstructL ( CUpnpHttpSession * aSession,
const TDesC16 & aFilename
) [private]

By default Symbian 2nd phase constructor is private.

Parameters

CUpnpHttpSession * aSession handle to parent session that owns this object.
const TDesC16 & aFilename

DeleteFile()

void DeleteFile ( )
Deletes file in error cases.
Since
Series60 2.6

Download()

TBool Download ( )
Returnes if currently handled file is downloaded or uploaded.
Since
Series60 2.6

EncodingMode()

TBool EncodingMode ( )
Returns the encoding mode
Since
Series60 3.2

EndPosOfFile()

TInt EndPosOfFile ( )
Returns the position where to stop reading the file.
Since
Series60 2.6

FileExist()

TBool FileExist ( )
Returnes true if currently handled file is not removed.
Since
Series60 3.2

FileToServe()

TDesC16 & FileToServe ( )
Returns the filename of the served file.
Since
Series60 2.6

GetHeaders()

const TDesC8 & GetHeaders ( )
Gets the headers of content to be sent
Since
Series60 3.2

GetL(TPtr8 &, TInt)

TBool GetL ( TPtr8 & aPointer,
TInt aBytesToSend
)
Gets bytes to be sent
Since
Series60 3.2

Parameters

TPtr8 & aPointer to write the read content
TInt aBytesToSend Number of bytes to send.

HeadersSent()

TBool HeadersSent ( )
True if HTTP headers sent
Since
Series60 3.2

IsEndOfFile()

TBool IsEndOfFile ( ) [private]

Checks if whole file has been read - returns ETrue if yes Close iTargetFile when returns ETrue

NewL(CUpnpHttpSession *, const TDesC8 &, const TDesC16 &, TInt)

CUpnpHttpFileAccess * NewL ( CUpnpHttpSession * aSession,
const TDesC8 & aHeaderBuffer,
const TDesC16 & aFilename,
TInt aFileSize
) [static]
Constructor function. This constructor is used when file is served by HttpServer.
Since
Series60 2.6

Parameters

CUpnpHttpSession * aSession Pointer to owning session of this CUpnpHttpFileAccess.
const TDesC8 & aHeaderBuffer Buffer that contains the headers of message to be served.
const TDesC16 & aFilename Name of file to be served.
TInt aFileSize Size of file to be served.

NewL(CUpnpHttpSession *, const TDesC16 &)

CUpnpHttpFileAccess * NewL ( CUpnpHttpSession * aSession,
const TDesC16 & aFilename
) [static]
Constructor function. This constructor is used when file is to be received.
Since
Series60 2.6

Parameters

CUpnpHttpSession * aSession Pointer to owning session of this CUpnpHttpFileAccess.
const TDesC16 & aFilename Name of file to be saved locally.

PosOfFile()

TUint PosOfFile ( )
Returns the reading position of the file.
Since
Series60 2.6

SaveL(TDesC8 &)

TInt SaveL ( TDesC8 & aBuffer )
Saves aBuffer at the end of file used in this CUpnpHttpFileAccess .
Since
Series60 3.2

Parameters

TDesC8 & aBuffer Content to save (append) to file.

SetChunkCompleted(TBool)

void SetChunkCompleted ( TBool aCompleted )
True when chunk tranfer completes
Since
Series60 3.2

Parameters

TBool aCompleted

SetEncodingMode(TBool)

void SetEncodingMode ( TBool aIsChunked )
Sets the encoding mode
Since
Series60 3.2

Parameters

TBool aIsChunked

SetEndPosOfFile(TInt)

void SetEndPosOfFile ( TInt aNewEndPos )
Sets the position where to stop reading the file.
Since
Series60 2.6

Parameters

TInt aNewEndPos

SetHeadersSent()

void SetHeadersSent ( )
Called after headers were queued to be sent
Since
Series60 3.2

SetOffset(TUint)

void SetOffset ( TUint aOffset )
Sets the offset of the local file at which should be downloaded content saved.
Since
Series60 2.6

Parameters

TUint aOffset

SetPosOfFile(TUint)

void SetPosOfFile ( TUint aNewPos )
Sets the reading position of the file.
Since
Series60 2.6

Parameters

TUint aNewPos Position of reading, counting from start of file.

SetPosOfHeader(TUint)

void SetPosOfHeader ( TUint aNewPos )
Sets the reading position of the headerbuffer.
Since
Series60 2.6

Parameters

TUint aNewPos Position of reading, counting from start of headerbuffer.

SetTotalSize(TInt)

void SetTotalSize ( TInt aSizeToSet )
Sets the total size of file transfer (FileSize).
Since
Series60 2.6

Parameters

TInt aSizeToSet

SetTransferTotal(TInt)

void SetTransferTotal ( TInt aLength )
Sets the size of the transfer
Since
Series60 3.2

Parameters

TInt aLength

TransferTotal()

TInt TransferTotal ( )
Returns the number of bytes that is to be transferred, ie size of file.
Since
Series60 2.6

TransferredBytes()

TInt TransferredBytes ( )
Returns the number of bytes that has been transferred
Since
Series60 2.6

Member Data Documentation

TInt iBytesWritten

TInt iBytesWritten [private]

TInt iEndPosOfFile

TInt iEndPosOfFile [private]

RFile iFile

RFile iFile [private]

HBufC16 * iFileToServe

HBufC16 * iFileToServe [private]

RFs iFsSession

RFs iFsSession [private]

HBufC8 * iHeaderBuffer

HBufC8 * iHeaderBuffer [private]

TInt iHeaderLength

TInt iHeaderLength [private]

TBool iHeadersSent

TBool iHeadersSent [private]

TBool iIsChunkCompleted

TBool iIsChunkCompleted [private]

TBool iIsChunked

TBool iIsChunked [private]

TBool iIsDeleted

TBool iIsDeleted [private]

TBool iIsDownload

TBool iIsDownload [private]

TInt iOpen

TInt iOpen [private]

HBufC * iOpenedFile

HBufC * iOpenedFile [private]

TInt iPosInFile

TInt iPosInFile [private]

TInt iPosToReadHeader

TInt iPosToReadHeader [private]

CUpnpHttpSession * iSession

CUpnpHttpSession * iSession [private]

TInt iSizeOfFile

TInt iSizeOfFile [private]

RFile iTargetFile

RFile iTargetFile [private]

TInt iTotalSizeOfDownload

TInt iTotalSizeOfDownload [private]