Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QObexHeader Class Reference
[QtBaseModule]

The QObexHeader class contains header information for an OBEX request or response. More...

    #include <QObexHeader>

Public Types

Public Functions

Static Public Members


Detailed Description

The QObexHeader class contains header information for an OBEX request or response.

The QObexHeader class provides a container for a set of headers for an OBEX request or response.

Convenience methods are provided to set and get header values for all header identifiers that are defined in the IrOBEX specification; for example, setName(), name(), setType(), type().

Additionally, setValue() and value() can be used to set and retrieve custom header values as QVariant values.

See also QObexClientSession and QObexServerSession.


Member Type Documentation

enum QObexHeader::HeaderId

This enum defines the Header Identifiers that can be added to a QObexHeader. Note the range 0x30 to 0x3F can be used for user-defined headers.

ConstantValueDescription
QObexHeader::Count0xc0The number of objects in the operation.
QObexHeader::Name0x01The name of the object.
QObexHeader::Type0x42The type of the object.
QObexHeader::Length0xc3The size of the object.
QObexHeader::Time0x44A date/time stamp in ISO 8601 format.
QObexHeader::Description0x05A text description of the object.
QObexHeader::Target0x46The service that is the target of the operation.
QObexHeader::Http0x47A HTTP 1.x header.
QObexHeader::Who0x4AIdentifies the OBEX application.
QObexHeader::ConnectionId0xcbAn identifier used for OBEX connection multiplexing.
QObexHeader::AppParameters0x4cUsed for extended application request and response information.
QObexHeader::AuthChallenge0x4dAn authentication digest-challenge.
QObexHeader::AuthResponse0x4eAn authentication digest-response.
QObexHeader::CreatorId0xcfIndicates the creator of an object.
QObexHeader::WanUuid0x50Uniquely identifies a network client (OBEX server).
QObexHeader::ObjectClass0x51Details the object class and properties.
QObexHeader::SessionParameters0x52Parameters used in session commands and responses.
QObexHeader::SessionSequenceNumber0x93Sequence number used in each OBEX packet for reliability.
QObexHeader::MaximumHeaderId0x3fThe maximum value for a Header Identifer, as defined in the OBEX specification.


Member Function Documentation

QObexHeader::QObexHeader ()

Constructs an empty QObexHeader.

QObexHeader::QObexHeader ( const QObexHeader & other )

Constructs a QObexHeader with the contents from other.

QObexHeader::~QObexHeader ()

Destroys the header.

QByteArray QObexHeader::appParameters () const

Returns the value of the OBEX header field Application Parameters.

Returns an empty byte array if the Application Parameters header is not present.

See also setAppParameters().

void QObexHeader::clear ()

Removes all header entries.

quint32 QObexHeader::connectionId () const

Returns the value of the OBEX header field Connection Id.

Returns 0 if the Connection Id header is not present.

See also setConnectionId().

bool QObexHeader::contains ( int headerId ) const

Returns true if this set of headers has a header entry with the header identifier headerId; otherwise returns false.

See also headerIds().

quint32 QObexHeader::count () const

Returns the value of the OBEX header field Count.

Returns 0 if the Count header is not present.

See also setCount().

quint32 QObexHeader::creatorId () const

Returns the value of the OBEX header field Connection Id.

Returns 0 if the Creator ID header is not present.

See also setCreatorId().

QDateTime QObexHeader::dateTimeFromString ( const QString & dateTimeString )   [static]

Returns a QDateTime that represents the date/time specified by dateTimeString, which must be in the Time header value format defined in the OBEX specification. That is, it must be in the format YYYYMMDDTHHMMSS (for local times) or YYYYMMDDTHHMMSSZ (for UTC time). The letter 'T' separates the date from the time.

Returns an invalid QDateTime if dateTimeString could not be parsed.

See also stringFromDateTime().

QString QObexHeader::description () const

Returns the value of the OBEX header field Description.

Returns an empty string if the Description header is not present.

See also setDescription().

QList<int> QObexHeader::headerIds () const

Returns a list of the header identifiers in this set of headers.

See also contains().

QByteArray QObexHeader::http () const

Returns the value of the OBEX header field HTTP.

Returns an empty byte array if the HTTP header is not present.

See also setHttp().

quint32 QObexHeader::length () const

Returns the value of the OBEX header field Length.

Returns 0 if the Length header is not present.

See also setLength().

QString QObexHeader::name () const

Returns the value of the OBEX header field Name.

Returns an empty string if the Name header is not present.

See also setName().

QByteArray QObexHeader::objectClass () const

Returns the value of the OBEX header field Object Class.

Returns an empty byte array if the Object Class header is not present.

See also setObjectClass().

bool QObexHeader::remove ( int headerId )

Removes the header entry with identifier headerId.

Returns true if the value was removed, or returns false if no entry exists for the identifier headerId.

QByteArray QObexHeader::sessionParameters () const

Returns the value of the OBEX header field Session-Parameters.

Returns an empty byte array if the Session-Parameters header is not present.

See also setSessionParameters().

quint8 QObexHeader::sessionSequenceNumber () const

Returns the value of the OBEX header field Session-Sequence-Number.

Returns 0 if the Session-Sequence-Number header is not present.

See also setSessionSequenceNumber().

void QObexHeader::setAppParameters ( const QByteArray & params )

Sets the value of the OBEX header field Application Parameters to params.

See also appParameters().

void QObexHeader::setAuthenticationChallenge ( QObex::AuthChallengeOptions options = 0, const QString & realm = QString() )

Sets the value of the OBEX header field Authentication Challenge to an authentication challenge generated using the given options and realm.

The realm is a string that can be displayed to users to inform them of the username and password to be used for authentication. The supported encodings for the realm are ASCII, ISO-8859-1 and Unicode.

The options and realm fields are optional when creating a challenge.

void QObexHeader::setConnectionId ( quint32 connectionId )

Sets the value of the OBEX header field Connection Id to connectionId.

This value identifies the OBEX connection to which an OBEX request belongs, in order to differentiate between multiple clients on the same connection.

Note: If this header is to be sent in an OBEX request, you should not also add a Target value, as it is illegal to send a Target header and a Connection Id header in the same request (as stated in the OBEX specification).

See also connectionId() and QObexClientSession::connectionId().

void QObexHeader::setCount ( quint32 count )

Sets the value of the OBEX header field Count to count.

This value indicates the number of objects involved in the OBEX operation.

See also count().

void QObexHeader::setCreatorId ( quint32 creatorId )

Sets the value of the OBEX header field Creator ID to creatorId.

See also creatorId().

void QObexHeader::setDescription ( const QString & description )

Sets the value of the OBEX header field Description to description.

This value can be used to provide additional information about the operation.

See also description().

void QObexHeader::setHttp ( const QByteArray & http )

Sets the value of the OBEX header field HTTP to http.

This value should be a byte sequence containing a HTTP 1.x header.

See also http().

void QObexHeader::setLength ( quint32 length )

Sets the value of the OBEX header field Length to length.

If the length of the object to be transferred is known in advance, this header should be used.

See also length().

void QObexHeader::setName ( const QString & name )

Sets the value of the OBEX header field Name to name.

If an object is being sent to another device, this value should generally be the filename of the object.

An empty name string is used to specify particular behaviors for some GET and SETPATH operations. For GET, an empty string means that the "default" object should be retrieved. For SETPATH, an empty string means the path should be reset to the "default" folder.

See also name().

void QObexHeader::setObjectClass ( const QByteArray & objectClass )

Sets the value of the OBEX header field Object Class to objectClass.

See also objectClass().

void QObexHeader::setSessionParameters ( const QByteArray & params )

Sets the value of the OBEX header field Session-Parameters to params.

See also sessionParameters().

void QObexHeader::setSessionSequenceNumber ( quint8 num )

Sets the value of the OBEX header field Session-Sequence-Number to num.

See also sessionSequenceNumber().

void QObexHeader::setTarget ( const QByteArray & target )

Sets the value of the OBEX header field Target to target.

This value should identify the intended target of an OBEX operation.

Note: If this header is to be sent in an OBEX request, you should not also add a Connection Id value, as it is illegal to send a Target header and a Connection Id header in the same request (as stated in the OBEX specification).

See also target().

void QObexHeader::setTime ( const QDateTime & dateTime )

If dateTime is a valid QDateTime object, sets the value of the OBEX header field Time to dateTime.

See also time().

void QObexHeader::setType ( const QString & type )

Sets the value of the OBEX header field Type to type.

This header corresponds to the content-type header in HTTP. The type value should be a standard ASCII mime type string, e.g. "text/plain", "image/jpeg".

See also type().

bool QObexHeader::setValue ( int headerId, const QVariant & variant )

Sets the value of the header entry with identifier headerId to the value in variant.

The variant must be able to be converted into one of the following types:

The header encoding of headerId will be used to determine which of the data types should be used for conversion.

Returns true if the value was set for the header. Otherwise, returns false (for example, if the value in variant cannot be converted to the data type specified by headerId).

See also value().

void QObexHeader::setWanUuid ( QUuid uuid )

Sets the value of the OBEX header field WAN UUID to uuid.

See also wanUuid().

void QObexHeader::setWho ( const QByteArray & who )

Sets the value of the OBEX header field Who to who.

This value can be used to allow peer applications to identify each other.

See also who().

int QObexHeader::size () const

Returns the number of entries in the OBEX header.

QString QObexHeader::stringFromDateTime ( const QDateTime & dateTime )   [static]

Returns a date/time string that represents dateTime in the format defined for the Time header value in the OBEX specification.

The dateTime timeSpec() value is used to determine the time zone information. That is, the string will be in the format YYYYMMDDTHHMMSS if timeSpec() is Qt::LocalTime, or the format YYYYMMDDTHHMMSSZ if it is Qt::UTC.

Returns an empty string if dateTime is invalid.

See also dateTimeFromString().

QByteArray QObexHeader::target () const

Returns the value of the OBEX header field Target.

Returns an empty byte array if the Target header is not present.

See also setTarget().

QDateTime QObexHeader::time () const

Returns the value of the OBEX header field Time.

Returns an invalid QDateTime object if the Time header is not present, or if the header value does not conform to the ISO 8601 format.

See also setTime().

QString QObexHeader::type () const

Returns the value of the OBEX header field Type.

Returns an empty string if the Type header is not present.

See also setType().

QVariant QObexHeader::value ( int headerId ) const

Returns the value of the header entry with identifier headerId.

Returns an invalid variant if no entry exists for headerId.

See also setValue().

QUuid QObexHeader::wanUuid () const

Returns the value of the OBEX header field WAN UUID.

Returns a null UUID if the WAN UUID header is not present.

See also setWanUuid().

QByteArray QObexHeader::who () const

Returns the value of the OBEX header field Who.

Returns an empty byte array if the Who header is not present.

See also setWho().

bool QObexHeader::operator!= ( const QObexHeader & other ) const

Returns true if other is not equal to this header; otherwise returns false.

See also operator==().

QObexHeader & QObexHeader::operator= ( const QObexHeader & other )

Assigns the contents of other to this object and returns a reference to this header.

bool QObexHeader::operator== ( const QObexHeader & other ) const

Returns true if other contains the same values as this header; otherwise returns false.

See also operator!=().


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3