CObexFileObject Class Reference

class CObexFileObject : public CObexBaseObject

This class is a concrete derivation of the CObexBaseObject class. Use it to store and transfer OBEX objects with the body part stored in an EPOC file. Hence this class is particularly suited to OBEX "file" beaming applications (c.f. arbitrary object beaming), although there is in reality no restriction in what it is used to transfer. Access to the body is acheived through an additional attribute to the object; the data file. This is the file-system name of the file used to store the body of the object. Note that there is no explicit relation between this and the Name of the object, although it is expected that most applications would attempt to relate the two.

When ever a valid data file is set (i.e. DataFile() .Length > 0), this file is effectively open, hence stopping any other application from opening it with exclusive rights. Therefore, it is recommended that Reset () be called on the object as soon as it is no longer required, and definitely before (conceptually) passing ownership of the data file to any other object or user.

CObexFileObject is also suited to situations where an object is expected to be received, but no information about the purpose of this object is known. This is due to CObexFileObject s ability to create temporary files "on the fly" to store received data into, when a specific file is not provided by the application.

This class is not designed for user derivation.

Inherits from

Public Member Functions
~CObexFileObject ()
IMPORT_C void InitFromFileL (const TDesC &)
IMPORT_C CObexFileObject * NewL ()
IMPORT_C CObexFileObject * NewL (const TDesC &)
Private Member Functions
void ConstructL (const TDesC &)
const TDesC & DataFile ()
TInt DataSize ()
void GetData ( TInt , TDes8 &)
void NewData ( TInt , TDes8 &)
void QueryTempFilePath ( TDes &)
TBool RenameFile (const TDesC &)
void ResetData ()
void SetDataFileL (const TDesC &)
void SetTempFilePath (const TDesC &)
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()
Inherited Enumerations
CObexBaseObject:TProgress
Private Attributes
TParse iDataFile
RFile iFile
RFs iFs
TBuf < KObexObjectDescriptionSize > iTempFilePath

Constructor & Destructor Documentation

~CObexFileObject()

IMPORT_C ~CObexFileObject ( ) [virtual]

Destructor.

Member Functions Documentation

ConstructL(const TDesC &)

void ConstructL ( const TDesC & aDataFile ) [private]

Constructs this object.

Parameters

const TDesC & aDataFile The file to use for the object's data part.

DataFile()

const TDesC & DataFile ( ) [private]

Get the name of the file representing the object body.

DataSize()

TInt DataSize ( ) [private, virtual]

GetData(TInt, TDes8 &)

void GetData ( TInt aPos,
TDes8 & aDes
) [private, virtual]

Virtual pure function form the base object. Tries to fill aDes with data starting from aPos byte offset. returns null descriptor if no data file is set.

Parameters

TInt aPos Position (reliative to start of object) to start extracting data from
TDes8 & aDes Descriptor to fill

InitFromFileL(const TDesC &)

IMPORT_C void InitFromFileL ( const TDesC & aFile )

Initialises this object from the specified file.

The function attempts to set attribute values for the object as follows:

Length:set to the length of the file

Name:taken from the name portion of the path in aFile

Time :taken from the modification time of the file

Type:set appropriately if the file extension is .vcf (VCard), .vcs (Vcalendar), or .txt.

Parameters

const TDesC & aFile Body data file

NewData(TInt, TDes8 &)

void NewData ( TInt aPos,
TDes8 & aDes
) [private, virtual]

Virtual pure function overload. inserts aDes into the data file at location aPos

Parameters

TInt aPos Position (reliative to start of object) to start inserting data from
TDes8 & aDes Descriptor to insert

NewL()

IMPORT_C CObexFileObject * NewL ( ) [static]

Creates a new CObexFileObject object. Static file object factory. returns a new CObexFileObject , set up to use a temporary file to store received data into "on the fly". If used for sourcing an object to send a "NULL" object(body length 0) will be sent.

NewL(const TDesC &)

IMPORT_C CObexFileObject * NewL ( const TDesC & aDataFile ) [static]

Creates a new CObexFileObject object. Static file object factory. returns a new CObexFileObject , set up to use aDataFile as its data file, or will create a temp file if aDataFile is not a valid file name. If used for sourcing an object to send, and no valid data file is set, a "NULL" object(body length 0) will be sent.

Parameters

const TDesC & aDataFile Filename to configure this object to use

QueryTempFilePath(TDes &)

void QueryTempFilePath ( TDes & aPath ) [private]

Parameters

TDes & aPath

RenameFile(const TDesC &)

TBool RenameFile ( const TDesC & aDesC ) [private]

Parameters

const TDesC & aDesC

ResetData()

void ResetData ( ) [private, virtual]

Set object back to a null file.

SetDataFileL(const TDesC &)

void SetDataFileL ( const TDesC & aDesc ) [private]

Sets the name of a file which holds the data to be used as the objects body. Leaves if the file does not exist, or can not be opened for writing.

Parameters

const TDesC & aDesc Filename to configure this object to use

SetTempFilePath(const TDesC &)

void SetTempFilePath ( const TDesC & aPath ) [private]

Parameters

const TDesC & aPath

Member Data Documentation

TParse iDataFile

TParse iDataFile [private]

RFile iFile

RFile iFile [private]

RFs iFs

RFs iFs [private]

TBuf< KObexObjectDescriptionSize > iTempFilePath

TBuf < KObexObjectDescriptionSize > iTempFilePath [private]