CObexBufObject Class Reference

class CObexBufObject : public CObexBaseObject

Use this class to hold objects where the body part is stored in a CBufFlat object. Please note that although parameters are supplied as CBufBase objects, non-CBufFlat parameters are not supported and will have unpredictable results. At no point does the CObexBufObject create, or take ownership of any CBaseBuf object it uses - it is always the responsibility of the creator/owner of the CBaseBuf to free it when no longer required.

As this class does not take ownership of the buffers it uses, it equally can not create its own buffers ad-hoc for storing new data into. Hence at no time is it valid for a CObexBufObject to exist with out it having a valid data buffer set. If such a situation arises, where it is required that received information should be discarded, consider using a CObexNullObject.

It is also posible to supply a file instead of a memory buffer, or to supply both. This functionality is due to the MObexServerNotify class expecting to work only on CObexBufObjects, so CObexFileObjects cannot be returned from the upcalls. To use a file for body storage, call NewL() passing in a NULL pointer, then call SetDataBufL() manually afterwards. There are three overloads---to allow purely memory based objects, purely file based, or a hybrid. The hybrid object buffers into a memory buffer (which is not allowed to grow), then writes data to the file when the buffer is full. The buffering behaviour can therefore be tuned to the application by setting the size of the buffer prior to use.

This class is not designed for user derivation.

Inherits from

Public Member Functions
~CObexBufObject()
IMPORT_C CBufBase *DataBuf()
HBufC *FileName()
IMPORT_C CObexBufObject *NewL(CBufBase *)
IMPORT_C voidSetDataBufL(TObexBufferingDetails &)
IMPORT_C voidSetDataBufL(CBufBase *)
IMPORT_C voidSetDataBufL(const TPtrC &)
IMPORT_C voidSetDataBufL(const TPtrC &, CBufBase *)
IMPORT_C voidSetDataBufL(const TPtrC &, CBufBase &, const TFileBuffering)
IMPORT_C TIntWriteToFile(const TPtrC &)
Private Member Functions
CObexBufObject()
voidCloseDataFile()
voidCloseFileServer()
voidConstructL(CBufBase *)
voidCopyFileL(const TDesC &)
TInt DataSize()
voidGetData(TInt, TDes8 &)
voidGetFileData(TInt, TDes8 &)
voidNewData(TInt, TDes8 &)
TInt NewFileData(TInt, TDes8 &)
TInt OpenDataFile(const TDesC &)
TInt OpenFileServer()
voidPrepareToSetBufferL()
voidResetData()
TInt WriteBufferToFile(TBool)
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()
CObexBaseObject::AddHeaderL(CObexHeader &)
CObexBaseObject::AddHttpL(const TDesC8 &)
CObexBaseObject::AppParam()const
CObexBaseObject::BytesReceived()
CObexBaseObject::BytesSent()
CObexBaseObject::CObexBaseObject()
CObexBaseObject::ConnectionID()
CObexBaseObject::CreateHeaderStorageDataL()
CObexBaseObject::Description()
CObexBaseObject::GetLastError()const
CObexBaseObject::GuessTypeFromExtL(const TDesC &)
CObexBaseObject::HeaderMask()
CObexBaseObject::HeaderSet()
CObexBaseObject::HeaderSet()const
CObexBaseObject::Http()const
CObexBaseObject::InitReceive()
CObexBaseObject::InitSend(TObexOpcode)
CObexBaseObject::Length()
CObexBaseObject::Name()
CObexBaseObject::ParseNextReceivePacket(CObexPacket &)
CObexBaseObject::PrepareConnectionHeader(CObexPacket &)
CObexBaseObject::PrepareNextSendPacket(CObexPacket &)
CObexBaseObject::Reset()
CObexBaseObject::ResetHeaders()
CObexBaseObject::SetAppParamL(const TDesC8 &)
CObexBaseObject::SetConnectionIdL(TUint32)
CObexBaseObject::SetDescriptionL(const TDesC &)
CObexBaseObject::SetHeaderMask(const TObexHeaderMask)
CObexBaseObject::SetLengthL(const TUint32)
CObexBaseObject::SetNameL(const TDesC &)
CObexBaseObject::SetTargetL(const TDesC8 &)
CObexBaseObject::SetTimeHeaderL(const TDesC8 &)
CObexBaseObject::SetTimeL(const TTime)
CObexBaseObject::SetTypeL(const TDesC8 &)
CObexBaseObject::SetUtcTimeL(const TTime)
CObexBaseObject::Target()
CObexBaseObject::Time()
CObexBaseObject::Type()
CObexBaseObject::ValidHeaders()
CObexBaseObject::~CObexBaseObject()
Public Member Enumerations
enumTFileBuffering { ESingleBuffering, EDoubleBuffering }
Inherited Enumerations
CObexBaseObject:TProgress
Private Attributes
CBufBase *iBuf
TInt iBufOffset
TInt iBufSegSize
TInt iBuffered
CBufBase *iDoubleBuf
RFile *iFile
RFs *iFileServ
HBufC *iFilename
MObexFileWriter *iWriter

Constructor & Destructor Documentation

CObexBufObject()

CObexBufObject()[private]

~CObexBufObject()

IMPORT_C~CObexBufObject()[virtual]

Member Functions Documentation

CloseDataFile()

voidCloseDataFile()[private]

CloseFileServer()

voidCloseFileServer()[private]

ConstructL(CBufBase *)

voidConstructL(CBufBase *aDataBuf)[private]

Parameters

CBufBase * aDataBuf

CopyFileL(const TDesC &)

voidCopyFileL(const TDesC &aFilename)[private]

Parameters

const TDesC & aFilename

DataBuf()

IMPORT_C CBufBase *DataBuf()

DataSize()

TInt DataSize()[private, virtual]

FileName()

HBufC *FileName()

GetData(TInt, TDes8 &)

voidGetData(TIntaPos,
TDes8 &aDes
)[private, virtual]

Parameters

TInt aPos
TDes8 & aDes

GetFileData(TInt, TDes8 &)

voidGetFileData(TIntaPos,
TDes8 &aDes
)[private]

Parameters

TInt aPos
TDes8 & aDes

NewData(TInt, TDes8 &)

voidNewData(TIntaPos,
TDes8 &aDes
)[private, virtual]

Parameters

TInt aPos
TDes8 & aDes

NewFileData(TInt, TDes8 &)

TInt NewFileData(TIntaPos,
TDes8 &aDes
)[private]

Parameters

TInt aPos
TDes8 & aDes

NewL(CBufBase *)

IMPORT_C CObexBufObject *NewL(CBufBase *aDataBuf)[static]

Parameters

CBufBase * aDataBuf

OpenDataFile(const TDesC &)

TInt OpenDataFile(const TDesC &aFilename)[private]

Parameters

const TDesC & aFilename

OpenFileServer()

TInt OpenFileServer()[private]

PrepareToSetBufferL()

voidPrepareToSetBufferL()[private]

ResetData()

voidResetData()[private, virtual]

SetDataBufL(TObexBufferingDetails &)

IMPORT_C voidSetDataBufL(TObexBufferingDetails &aDetails)

Parameters

TObexBufferingDetails & aDetails

SetDataBufL(CBufBase *)

IMPORT_C voidSetDataBufL(CBufBase *aDataBuf)

Parameters

CBufBase * aDataBuf

SetDataBufL(const TPtrC &)

IMPORT_C voidSetDataBufL(const TPtrC &aFilename)

Parameters

const TPtrC & aFilename

SetDataBufL(const TPtrC &, CBufBase *)

IMPORT_C voidSetDataBufL(const TPtrC &aFilename,
CBufBase *aDataBuf
)

Parameters

const TPtrC & aFilename
CBufBase * aDataBuf

SetDataBufL(const TPtrC &, CBufBase &, const TFileBuffering)

IMPORT_C voidSetDataBufL(const TPtrC &aFilename,
CBufBase &aDataBuf,
const TFileBufferingaBufferingStrategy
)

Parameters

const TPtrC & aFilename
CBufBase & aDataBuf
const TFileBuffering aBufferingStrategy

WriteBufferToFile(TBool)

TInt WriteBufferToFile(TBoolaFinal)[private]

Parameters

TBool aFinal

WriteToFile(const TPtrC &)

IMPORT_C TIntWriteToFile(const TPtrC &aFileName)

Parameters

const TPtrC & aFileName

Member Enumerations Documentation

Enum TFileBuffering

Obex file buffering method.

Enumerators

ESingleBuffering

Only the supplied buffer will be used to buffer file writes.

EDoubleBuffering

The object will create a second buffer and perform double buffering.

Member Data Documentation

CBufBase * iBuf

CBufBase *iBuf[private]

TInt iBufOffset

TInt iBufOffset[private]

TInt iBufSegSize

TInt iBufSegSize[private]

TInt iBuffered

TInt iBuffered[private]

CBufBase * iDoubleBuf

CBufBase *iDoubleBuf[private]

RFile * iFile

RFile *iFile[private]

RFs * iFileServ

RFs *iFileServ[private]

HBufC * iFilename

HBufC *iFilename[private]

MObexFileWriter * iWriter

MObexFileWriter *iWriter[private]