kioslaves

ReadMBox Class Reference

This class handels reading from a mbox-file. More...

#include <readmbox.h>

Inheritance diagram for ReadMBox:

List of all members.


Public Member Functions

bool atEnd () const
QString currentID () const
QString currentLine () const
bool inListing () const
bool nextLine ()
 ReadMBox (const UrlInfo *info, MBoxProtocol *parent, bool onlynew=false, bool savetime=false)
void rewind ()
bool searchMessage (const QString &id)
unsigned int skipMessage ()
 ~ReadMBox ()

Detailed Description

This class handels reading from a mbox-file.

Definition at line 36 of file readmbox.h.


Constructor & Destructor Documentation

ReadMBox::ReadMBox ( const UrlInfo info,
MBoxProtocol parent,
bool  onlynew = false,
bool  savetime = false 
)

Constructor.

Parameters:
info The information of the file to read
parent The instance of the parent MBoxProtocol.
onlynew Only read new messages from the MBox file.
savetime If true, the atime of the mbox-file is preserved (note that this touch the ctime).

Definition at line 40 of file readmbox.cc.

ReadMBox::~ReadMBox (  ) 

Destructor.

Definition at line 66 of file readmbox.cc.


Member Function Documentation

bool ReadMBox::atEnd (  )  const

Returns true if the cursor is at EOF.

Returns:
true if and only if the cursor is at EOF.

Definition at line 152 of file readmbox.cc.

QString ReadMBox::currentID (  )  const

This function returns the current id.

The id is the first line of an email, and is used in filenaming. The id normally starts with "From ".

Returns:
The current ID, or QString::null if no id was found yet.

Definition at line 77 of file readmbox.cc.

QString ReadMBox::currentLine (  )  const

This functions return the current line.

Returns:
The line last read, or QString::null if there wasn't such last line

Definition at line 72 of file readmbox.cc.

bool ReadMBox::inListing (  )  const

Return true if the message is a new message, or all messages are listed.

Returns:
true if it must be listed

Definition at line 160 of file readmbox.cc.

bool ReadMBox::nextLine (  ) 

This function reads the next line.

The next line can be read by the currentLine() function call.

Returns:
true if succesfull, otherwise false.

Definition at line 82 of file readmbox.cc.

void ReadMBox::rewind (  ) 

Sets the cursor back to the beginning of the file.

Definition at line 143 of file readmbox.cc.

bool ReadMBox::searchMessage ( const QString id  ) 

This function search the file for a certain id.

If not found, the position is EOF.

Parameters:
id The id of the message to be found.
Returns:
true if the message was found, false otherwise.

Definition at line 119 of file readmbox.cc.

unsigned int ReadMBox::skipMessage (  ) 

Skips all lines which belongs to the current message.

The cursor is on the first line of a new message message at the end of this function, or at EOF if the cursor was already on the last message.

Returns:
The number of bytes read while skipping the message.

Definition at line 130 of file readmbox.cc.


The documentation for this class was generated from the following files: