obexobjects.h File Reference

NONSHARABLE_CLASS ( TObexBufData )

NONSHARABLE_CLASS(TObexBufData)

Buffer data class

NONSHARABLE_CLASS ( CObexFileObject )

NONSHARABLE_CLASS(CObexFileObject)

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 CObexFileObjects 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.

NONSHARABLE_CLASS ( CObexBufObject )

NONSHARABLE_CLASS(CObexBufObject)

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.

NONSHARABLE_CLASS ( TObexBufferingDetails )

NONSHARABLE_CLASS(TObexBufferingDetails)

Wraps parameters which can affect the buffering method used by the CObexBufObject. This version provides a single memory buffer which holds the entire object. Subclasses will always use a memory buffer, but can override the way that Obex uses it.

NONSHARABLE_CLASS ( TObexPureFileBuffer )

NONSHARABLE_CLASS(TObexPureFileBuffer)

Provides alternate behaviour for a CObexBufObject, allowing use of a file to hold the object in its entirety. No memory buffer is used. This is a special case option provided to cater for the MObexServerNotify interface which requires the use of CObexBufObject objects. It is generally better to use a buffered variant.

NONSHARABLE_CLASS ( TObexFilenameBackedBuffer )

NONSHARABLE_CLASS(TObexFilenameBackedBuffer)

Provides alternate behaviour for a CObexBufObject, allowing use of a file to hold the object in its entirety. Writes to this object are buffered through the supplied CBufBase derived object, which is never enlarged. Once it is full, the data is flushed to the file.

NONSHARABLE_CLASS ( TObexRFileBackedBuffer )

NONSHARABLE_CLASS(TObexRFileBackedBuffer)

Provides alternate behaviour for a CObexBufObject, allowing use of a file to hold the object in its entirety. Writes to this object are buffered through the supplied CBufBase derived object, which is never enlarged. Once it is full, the data is flushed to the file.

NONSHARABLE_CLASS ( CObexNullObject )

NONSHARABLE_CLASS(CObexNullObject)

Concrete OBEX object with NULL data representation. Use when only the headers of an object are required, and the data (if any) can safely be discarded.