• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • Contact Us
 

KIMAP Library

  • KIMAP
  • ImapStreamParser
Public Member Functions
KIMAP::ImapStreamParser Class Reference

#include <imapstreamparser.h>

List of all members.

Public Member Functions

 ImapStreamParser (QIODevice *socket, bool serverModeEnabled=false)
 ~ImapStreamParser ()
bool atCommandEnd ()
bool atListEnd ()
bool atLiteralEnd () const
bool atResponseCodeEnd ()
int availableDataSize () const
bool hasList ()
bool hasLiteral ()
bool hasResponseCode ()
bool hasString ()
QByteArray readLiteralPart ()
qint64 readNumber (bool *ok=0)
QList< QByteArray > readParenthesizedList ()
QByteArray readRemainingData ()
QByteArray readString ()
QByteArray readUntilCommandEnd ()
QString readUtf8String ()
void setData (const QByteArray &data)

Detailed Description

Parser for IMAP messages that operates on a local socket stream.

Definition at line 53 of file imapstreamparser.h.


Constructor & Destructor Documentation

ImapStreamParser::ImapStreamParser ( QIODevice *  socket,
bool  serverModeEnabled = false 
) [explicit]

Construct the parser.

Parameters:
socketthe local socket to work with.
serverModeEnabledtrue if the parser has to assume we're writing a server (e.g. sends continuation message automatically)

Definition at line 31 of file imapstreamparser.cpp.

ImapStreamParser::~ImapStreamParser ( )

Destructor.

Definition at line 39 of file imapstreamparser.cpp.


Member Function Documentation

bool ImapStreamParser::atCommandEnd ( )

Check if the command end was reached.

Returns:
true if the end of command is reached

Definition at line 466 of file imapstreamparser.cpp.

bool ImapStreamParser::atListEnd ( )

Check if the next data is a parenthesized list end.

This call might block.

Returns:
true if a parenthesized list end.

Definition at line 176 of file imapstreamparser.cpp.

bool ImapStreamParser::atLiteralEnd ( ) const

Check if the literal data end was reached.

See hasLiteral and readLiteralPart .

Returns:
true if the literal was completely read.

Definition at line 133 of file imapstreamparser.cpp.

bool ImapStreamParser::atResponseCodeEnd ( )

Check if the next data is a response code end.

This call might block.

Returns:
true if a response code end.

Definition at line 305 of file imapstreamparser.cpp.

bool ImapStreamParser::hasList ( )

Check if the next data is a parenthesized list.

This call might block.

Returns:
true if a parenthesized list comes.

Definition at line 160 of file imapstreamparser.cpp.

bool ImapStreamParser::hasLiteral ( )

Check if the next data is a literal data or not.

If a literal is found, the internal position pointer is set to the beginning of the literal data. This call might block.

Returns:
true if a literal follows

Definition at line 98 of file imapstreamparser.cpp.

bool ImapStreamParser::hasResponseCode ( )

Check if the next data is a response code.

This call might block.

Returns:
true if a response code comes.

Definition at line 288 of file imapstreamparser.cpp.

bool ImapStreamParser::hasString ( )

Check if the next data is a string or not.

This call might block.

Returns:
true if a string follows

Definition at line 74 of file imapstreamparser.cpp.

QByteArray ImapStreamParser::readLiteralPart ( )

Read the next literal sequence.

This might or might not be the full data. Example code to read a literal would be:

 ImapStreamParser parser;
  ...
 if (parser.hasLiteral())
 {
   while (!parser.atLiteralEnd())
   {
      QByteArray data = parser.readLiteralPart();
      // do something with the data
   }
 }

This call might block.

Returns:
part of a literal data

Definition at line 138 of file imapstreamparser.cpp.

qint64 ImapStreamParser::readNumber ( bool *  ok = 0)

Get the next data as a number.

This call might block.

Parameters:
oktrue if the data found was a number
Returns:
the number

Definition at line 396 of file imapstreamparser.cpp.

QList< QByteArray > ImapStreamParser::readParenthesizedList ( )

Get he next parenthesized list.

If the upcoming data is not a parenthesized list, the behavior is undefined. Use hasList to be sure a string comes. This call might block.

Returns:
the next parenthesized list.

Definition at line 193 of file imapstreamparser.cpp.

QByteArray ImapStreamParser::readRemainingData ( )

Return all the data that was read from the socket, but not processed yet.

Returns:
the remaining unprocessed data

Definition at line 456 of file imapstreamparser.cpp.

QByteArray ImapStreamParser::readString ( )

Same as above, but without decoding it to utf8.

Returns:
the next string from the message

Definition at line 52 of file imapstreamparser.cpp.

QByteArray ImapStreamParser::readUntilCommandEnd ( )

Return everything that remained from the command.

Returns:
the remaining command data

Definition at line 490 of file imapstreamparser.cpp.

QString ImapStreamParser::readUtf8String ( )

Get a string from the message.

If the upcoming data is not a quoted string, unquoted string or a literal, the behavior is undefined. Use hasString to be sure a string comes. This call might block.

Returns:
the next string from the message as an utf8 string

Definition at line 43 of file imapstreamparser.cpp.


The documentation for this class was generated from the following files:
  • imapstreamparser.h
  • imapstreamparser.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:55:09 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIMAP Library

Skip menu "KIMAP Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal