38
38
class ReadMBox : public MBoxFile
44
* @param info The information of the file to read
45
* @param parent The instance of the parent MBoxProtocol.
46
* @param onlynew Only read new messages from the MBox file.
47
* @param savetime If true, the atime of the mbox-file is preserved (note that this touch the ctime).
49
ReadMBox( const UrlInfo* info, MBoxProtocol* parent, bool onlynew = false, bool savetime = false );
57
* This functions return the current line
58
* @return The line last read, or QString() if there wasn't such last line
60
QString currentLine() const;
63
* This function returns the current id. The id is the first line of an email,
64
* and is used in filenaming. The id normally starts with "From ".
65
* @return The current ID, or QString() if no id was found yet.
67
QString currentID() const;
70
* This function reads the next line. The next line can be read by the currentLine()
73
* @return true if succesfull, otherwise false.
78
* This function search the file for a certain id.
79
* If not found, the position is EOF.
80
* @param id The id of the message to be found.
81
* @return true if the message was found, false otherwise.
83
bool searchMessage( const QString& id );
86
* Skips all lines which belongs to the current message. The cursor is on the first line
87
* of a new message message at the end of this function, or at EOF if the cursor was already
88
* on the last message.
89
* @return The number of bytes read while skipping the message.
91
unsigned int skipMessage();
94
* Sets the cursor back to the beginning of the file
99
* Returns true if the cursor is at EOF.
100
* @return true if and only if the cursor is at EOF.
105
* Return true if the message is a new message, or all messages are listed
106
* @return true if it must be listed
108
bool inListing() const;
112
* @return true Returns true if opening was successful.
114
bool open( bool savetime );
123
QTextStream* m_stream;
124
QString m_current_line;
125
QString m_current_id;
128
struct utimbuf* m_prev_time;
130
bool m_only_new, m_savetime;
132
bool m_status, m_prev_status, m_header;
44
* @param info The information of the file to read
45
* @param parent The instance of the parent MBoxProtocol.
46
* @param onlynew Only read new messages from the MBox file.
47
* @param savetime If true, the atime of the mbox-file is preserved (note that this touch the ctime).
49
ReadMBox( const UrlInfo* info, MBoxProtocol* parent, bool onlynew = false, bool savetime = false );
57
* This functions return the current line
58
* @return The line last read, or QString() if there wasn't such last line
60
QString currentLine() const;
63
* This function returns the current id. The id is the first line of an email,
64
* and is used in filenaming. The id normally starts with "From ".
65
* @return The current ID, or QString() if no id was found yet.
67
QString currentID() const;
70
* This function reads the next line. The next line can be read by the currentLine()
73
* @return true if succesfull, otherwise false.
78
* This function search the file for a certain id.
79
* If not found, the position is EOF.
80
* @param id The id of the message to be found.
81
* @return true if the message was found, false otherwise.
83
bool searchMessage( const QString& id );
86
* Skips all lines which belongs to the current message. The cursor is on the first line
87
* of a new message message at the end of this function, or at EOF if the cursor was already
88
* on the last message.
89
* @return The number of bytes read while skipping the message.
91
unsigned int skipMessage();
94
* Sets the cursor back to the beginning of the file
99
* Returns true if the cursor is at EOF.
100
* @return true if and only if the cursor is at EOF.
105
* Return true if the message is a new message, or all messages are listed
106
* @return true if it must be listed
108
bool inListing() const;
112
* @return true Returns true if opening was successful.
114
bool open( bool savetime );
123
QTextStream* m_stream;
124
QString m_current_line;
125
QString m_current_id;
128
struct utimbuf* m_prev_time;
130
bool m_only_new, m_savetime;
132
bool m_status, m_prev_status, m_header;