Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QObexHeader Class Reference
[QtBaseModule]

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

    #include <QObexHeader>

Public Types

  • enum HeaderId { Count, Name, Type, Length, ..., MaximumHeaderId }

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!=().

Publicité

Best Of

Actualités les plus lues

Semaine
Mois
Année
  1. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 102
  2. Pourquoi les programmeurs sont-ils moins payés que les gestionnaires de programmes ? Manquent-ils de pouvoir de négociation ? 53
  3. «Le projet de loi des droits du développeur» : quelles conditions doivent remplir les entreprises pour que le développeur puisse réussir ? 73
  4. Les développeurs détestent-ils les antivirus ? Un programmeur manifeste sa haine envers ces solutions de sécurité 28
  5. Qt Commercial : Digia organise un webinar gratuit le 27 mars sur la conception d'interfaces utilisateur et d'applications avec le framework 0
  6. Quelles nouveautés de C++11 Visual C++ doit-il rapidement intégrer ? Donnez-nous votre avis 10
  7. 2017 : un quinquennat pour une nouvelle version du C++ ? Possible, selon Herb Sutter 11
Page suivante
  1. Linus Torvalds : le "C++ est un langage horrible", en justifiant le choix du C pour le système de gestion de version Git 100
  2. Comment prendre en compte l'utilisateur dans vos applications ? Pour un développeur, « 90 % des utilisateurs sont des idiots » 229
  3. Quel est LE livre que tout développeur doit lire absolument ? Celui qui vous a le plus marqué et inspiré 96
  4. Apple cède et s'engage à payer des droits à Nokia, le conflit des brevets entre les deux firmes s'achève 158
  5. Nokia porte à nouveau plainte contre Apple pour violation de sept nouveaux brevets 158
  6. Quel est le code dont vous êtes le plus fier ? Pourquoi l'avez-vous écrit ? Et pourquoi vous a-t-il donné autant de satisfaction ? 83
  7. « Quelque chose ne va vraiment pas avec les développeurs "modernes" », un développeur à "l'ancienne" critique la multiplication des bibliothèques 101
Page suivante

Le blog Digia au hasard

Logo

Déploiement d'applications Qt Commercial sur les tablettes Windows 8

Le blog Digia est l'endroit privilégié pour la communication sur l'édition commerciale de Qt, où des réponses publiques sont apportées aux questions les plus posées au support. Lire l'article.

Communauté

Ressources

Liens utiles

Contact

  • Vous souhaitez rejoindre la rédaction ou proposer un tutoriel, une traduction, une question... ? Postez dans le forum Contribuez ou contactez-nous par MP ou par email (voir en bas de page).

Qt dans le magazine

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt qtextended4.4
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web