|
||
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. CObexFileObject::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.
CBase
-
Base class for all classes to be instantiated on the heap.
CObexBaseObject
- Objects of this class are used to describe the objects to be transferred and tho...
CObexFileObject
- This class is a concrete derivation of the CObexBaseObject class. Use it to stor...
Defined in CObexFileObject
:
DataSize()
GetData(TInt,TDes8 &)
Virtual pure function form the base object. Tries to fill aDes with data startin...InitFromFileL(const TDesC &)
Initialises this object from the specified file.NewData(TInt,TDes8 &)
Virtual pure function overload. inserts aDes into the data file at location aPos...NewL()
Creates a new CObexFileObject object. Static file object factory. returns a new ...NewL(const TDesC &)
Creates a new CObexFileObject object. Static file object factory. returns a new ...ResetData()
Set object back to a null file. ~CObexFileObject()
Destructor.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...Inherited from CObexBaseObject
:
AddHeaderL(CObexHeader &)
Adds a CObexHeader into the CObexHeaderSet
AddHttpL(const TDesC8 &)
Add an Http header.AppParam()const
Gets the object's Application Parameters attributeBytesReceived()
Returns the number of bytes of the body of the object transferred while receivin...BytesSent()
Returns the number of bytes of the body of the object transferred so far while s...Description()
Gets the object's Description attribute.EComplete
EContinue
EError
ELastPacket
HeaderMask()
Returns the currently set header mask. This defaults to 0xFF (i.e. allow everyth...HeaderSet()
HeaderSet()const
Http()const
Firstly updates the iHttp list, ensuring that the entries are the same as those ...Length()
Gets the object's Length attribute.Name()
Gets the object's Name attribute.Reset()
Resets the object, to make it represent nothing.SetAppParamL(const TDesC8 &)
Sets the Application Parameters attribute of the object.SetDescriptionL(const TDesC &)
Sets the Description attribute of the object.SetHeaderMask(const TObexHeaderMask)
Sets the header mask. aHeaderMask is built up by bit-wise ‘or’ing any of the K...SetLengthL(const TUint32)
Sets the Length attribute of the object, in bytes.SetNameL(const TDesC &)
Sets the Name attribute of the object.SetTargetL(const TDesC8 &)
Sets the Target attribute of the object.SetTimeL(const TTime)
Sets the Time attribute of the object (stored in UTC).SetTypeL(const TDesC8 &)
Sets the Type attribute of the object.TProgress
Target()
Gets the object's Target attribute.Time()
Returns the time attribute of the object in local time. Returns TTime (0) if no ...Type()
Gets the object's Type attribute.ValidHeaders()
Returns the current valid header mask. This allows inspection of the current set...IMPORT_C static CObexFileObject* NewL();
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.
|
IMPORT_C static CObexFileObject* NewL(const TDesC &aDataFile);
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.
|
|
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.
|
private: virtual void GetData(TInt aPos, TDes8 &aDes);
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.
|
private: virtual void NewData(TInt aPos, TDes8 &aDes);
Virtual pure function overload. inserts aDes into the data file at location aPos
|
private: virtual TInt DataSize();
|
private: virtual void ResetData();
Set object back to a null file.