aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/async/imap/MCIMAPFetchParsedContentOperation.cpp
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-11-19 00:48:34 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2014-11-19 00:48:34 -0800
commite3c45123799d84b0ff85035db606cc36b8379427 (patch)
tree17b16bd16f57d097eae1458e8fa10943fb75e54c /src/async/imap/MCIMAPFetchParsedContentOperation.cpp
parentb030d6139ba3f0eb39818ce6f9852e48db079feb (diff)
Renamed .cc files to .cpp (fixed #983)
Diffstat (limited to 'src/async/imap/MCIMAPFetchParsedContentOperation.cpp')
-rw-r--r--src/async/imap/MCIMAPFetchParsedContentOperation.cpp79
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);
+}
+