12using namespace ::
Binc;
15int main(
int argc,
char *argv[])
18 fprintf(stderr,
"usage: %s <directory> ", argv[0]);
19 fprintf(stderr,
"Updates the cache file in <directory>.\n");
20 fprintf(stderr,
"Use export $DEPOT=\"IMAPdir\" to enable updates for this type.\n");
24 Session &session = Session::getInstance();
26 DepotFactory &depotfactory = DepotFactory::getInstance();
27 depotfactory.assign(
new IMAPdirDepot());
28 depotfactory.assign(
new MaildirPPDepot());
30 string depottype = session.getEnv(
"DEPOT");
31 if (depottype ==
"") depottype =
"Maildir++";
34 if ((depot = depotfactory.get(depottype)) == 0) {
35 fprintf(stderr,
"Found no Depot for \"%s\". Please check " \
36 " your configurations file under the Mailbox section.\n",
41 depot->assign(
new Maildir());
42 depot->setDefaultType(
"Maildir");
44 Mailbox *mailbox = depot->get(depot->filenameToMailbox(argv[1]));
47 fprintf(stderr,
"selecting mailbox failed: %s\n",
48 depot->getLastError().c_str());
52 if (!mailbox->selectMailbox(argv[1], argv[1])) {
53 fprintf(stderr,
"selecting mailbox failed: %s\n",
54 mailbox->getLastError().c_str());
58 mailbox->closeMailbox();
Declaration of the Mailbox class (Mailbox is logical container)
Declaration of the Maildir class.