From e3c45123799d84b0ff85035db606cc36b8379427 Mon Sep 17 00:00:00 2001 From: "Hoa V. DINH" Date: Wed, 19 Nov 2014 00:48:34 -0800 Subject: Renamed .cc files to .cpp (fixed #983) --- .../imap/MCIMAPFetchParsedContentOperation.cpp | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/async/imap/MCIMAPFetchParsedContentOperation.cpp (limited to 'src/async/imap/MCIMAPFetchParsedContentOperation.cpp') diff --git a/src/async/imap/MCIMAPFetchParsedContentOperation.cpp b/src/async/imap/MCIMAPFetchParsedContentOperation.cpp new file mode 100644 index 00000000..e32112e6 --- /dev/null +++ b/src/async/imap/MCIMAPFetchParsedContentOperation.cpp @@ -0,0 +1,79 @@ +// +// IMAPFetchParsedContentOperation.cc +// mailcore2 +// +// Created by DINH Viêt Hoà on 1/12/13. +// Copyright (c) 2013 MailCore. All rights reserved. +// + +#include "MCIMAPFetchParsedContentOperation.h" + +#include "MCIMAPSession.h" +#include "MCIMAPAsyncConnection.h" + +using namespace mailcore; + +IMAPFetchParsedContentOperation::IMAPFetchParsedContentOperation() +{ + mUid = 0; + mNumber = 0; + mEncoding = Encoding7Bit; + mParser = NULL; +} + +IMAPFetchParsedContentOperation::~IMAPFetchParsedContentOperation() +{ + MC_SAFE_RELEASE(mParser); +} + +void IMAPFetchParsedContentOperation::setUid(uint32_t uid) +{ + mUid = uid; +} + +uint32_t IMAPFetchParsedContentOperation::uid() +{ + return mUid; +} + +void IMAPFetchParsedContentOperation::setNumber(uint32_t value) +{ + mNumber = value; +} + +uint32_t IMAPFetchParsedContentOperation::number() +{ + return mNumber; +} + +void IMAPFetchParsedContentOperation::setEncoding(Encoding encoding) +{ + mEncoding = encoding; +} + +Encoding IMAPFetchParsedContentOperation::encoding() +{ + return mEncoding; +} + +MessageParser * IMAPFetchParsedContentOperation::parser() +{ + return mParser; +} + +void IMAPFetchParsedContentOperation::main() +{ + ErrorCode error; + Data * data; + if (mUid != 0) { + data = session()->session()->fetchMessageByUID(folder(), mUid, this, &error); + } + else { + data = session()->session()->fetchMessageByNumber(folder(), mNumber, this, &error); + } + if (data) { + mParser = new mailcore::MessageParser(data); + } + setError(error); +} + -- cgit v1.2.3