diff options
author | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2014-11-19 00:48:34 -0800 |
---|---|---|
committer | Hoa V. DINH <dinh.viet.hoa@gmail.com> | 2014-11-19 00:48:34 -0800 |
commit | e3c45123799d84b0ff85035db606cc36b8379427 (patch) | |
tree | 17b16bd16f57d097eae1458e8fa10943fb75e54c /src/async/imap/MCIMAPFetchParsedContentOperation.cpp | |
parent | b030d6139ba3f0eb39818ce6f9852e48db079feb (diff) |
Renamed .cc files to .cpp (fixed #983)
Diffstat (limited to 'src/async/imap/MCIMAPFetchParsedContentOperation.cpp')
-rw-r--r-- | src/async/imap/MCIMAPFetchParsedContentOperation.cpp | 79 |
1 files changed, 79 insertions, 0 deletions
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); +} + |