File: smapmsgrange.H

package info (click to toggle)
cone 0.89-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 25,628 kB
  • ctags: 14,171
  • sloc: ansic: 85,400; cpp: 82,903; sh: 11,713; makefile: 1,732; perl: 832; yacc: 291; sed: 16
file content (59 lines) | stat: -rw-r--r-- 1,286 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
** Copyright 2003, Double Precision Inc.
**
** See COPYING for distribution information.
*/
#ifndef libmail_smapmsgrange_H
#define libmail_smapmsgrange_H

#include "imap.H"
#include "imapfolder.H"
#include "namespace.H"

#include <list>
#include <set>
#include <vector>
#include <sstream>

LIBMAIL_START

//
// Helper class for the helper class: after the time a request was made,
// and before it actually comes up in the scheduling queue, some messages
// might be expunged.  Therefore, at first save everyone's UID, and
// then rebuild the message range from the UID list, when our turn comes
// up.

class smapUidSet : public std::set< std::string> {
public:
	smapUidSet( mail::imap &, const std::vector<size_t> &);
	~smapUidSet();

	// Convert to smap message ranges on the fly

	bool getNextRange( mail::imap &imapAccount,
			   std::ostringstream &s);

};

//
// Helper class: take a list of messages and convert it to smap message ranges
//

class smapMsgRange : public std::list< std::pair<size_t, size_t> > {

public:
	smapMsgRange();

	void init( mail::imap &, const smapUidSet &);
	~smapMsgRange();

	bool operator>>( std::ostringstream &);
	// Pop off up to hunnert ranges into a stringstream
	// Returns false if no ranges are left to process.

};

LIBMAIL_END

#endif