diff options
author | CodaFi <devteam.codafi@gmail.com> | 2014-08-13 19:11:10 -0600 |
---|---|---|
committer | CodaFi <devteam.codafi@gmail.com> | 2014-08-13 19:11:10 -0600 |
commit | 5f82321bf14e8836da9d9a9f9caf9f12d021eef8 (patch) | |
tree | 10dad00a41cdb224bde372697827ac746dbf66a4 /src/objc/nntp | |
parent | 9fdbf0688e3c8bc9ad94ff8b475ce534749f418d (diff) |
cpp -> cc
Diffstat (limited to 'src/objc/nntp')
-rw-r--r-- | src/objc/nntp/MCONNTP.h | 5 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPFetchArticleOperation.h (renamed from src/objc/nntp/MCONNTPFetchMessageOperation.h) | 4 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPFetchArticleOperation.mm (renamed from src/objc/nntp/MCONNTPFetchMessageOperation.mm) | 22 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPFetchArticlesOperation.h (renamed from src/objc/nntp/MCONNTPFetchMessagesOperation.h) | 4 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPFetchArticlesOperation.mm (renamed from src/objc/nntp/MCONNTPFetchMessagesOperation.mm) | 8 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPMessageInfo.h | 2 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPSession.h | 16 | ||||
-rw-r--r-- | src/objc/nntp/MCONNTPSession.mm | 14 |
8 files changed, 37 insertions, 38 deletions
diff --git a/src/objc/nntp/MCONNTP.h b/src/objc/nntp/MCONNTP.h index f96f296c..20eb035b 100644 --- a/src/objc/nntp/MCONNTP.h +++ b/src/objc/nntp/MCONNTP.h @@ -13,11 +13,10 @@ #include <MailCore/MCONNTPSession.h> #include <MailCore/MCONNTPOperation.h> #include <MailCore/MCONNTPFetchHeaderOperation.h> -#include <MailCore/MCONNTPFetchMessageOperation.h> -#include <MailCore/MCONNTPFetchMessagesOperation.h> +#include <MailCore/MCONNTPFetchArticleOperation.h> +#include <MailCore/MCONNTPFetchArticlesOperation.h> #include <MailCore/MCONNTPListNewsgroupsOperation.h> #include <MailCore/MCONNTPMessageInfo.h> #include <MailCore/MCONNTPGroupInfo.h> -#include <MailCore/MCONNTPOperationCallback.h> #endif diff --git a/src/objc/nntp/MCONNTPFetchMessageOperation.h b/src/objc/nntp/MCONNTPFetchArticleOperation.h index c0cfbf68..c72351d9 100644 --- a/src/objc/nntp/MCONNTPFetchMessageOperation.h +++ b/src/objc/nntp/MCONNTPFetchArticleOperation.h @@ -1,5 +1,5 @@ // -// MCONNTPFetchMessageOperation.h +// MCONNTPFetchArticleOperation.h // mailcore2 // // Created by Robert Widmann on 8/13/14. @@ -17,7 +17,7 @@ typedef void (^MCONNTPOperationProgressBlock)(unsigned int current, unsigned int maximum); -@interface MCONNTPFetchMessageOperation : MCONNTPOperation +@interface MCONNTPFetchArticleOperation : MCONNTPOperation /** This block will be called as data is downloaded from the network */ @property (nonatomic, copy) MCONNTPOperationProgressBlock progress; diff --git a/src/objc/nntp/MCONNTPFetchMessageOperation.mm b/src/objc/nntp/MCONNTPFetchArticleOperation.mm index 6de52de3..1d43d1b6 100644 --- a/src/objc/nntp/MCONNTPFetchMessageOperation.mm +++ b/src/objc/nntp/MCONNTPFetchArticleOperation.mm @@ -1,35 +1,35 @@ // -// MCONNTPFetchMessageOperation.m +// MCONNTPFetchArticleOperation.m // mailcore2 // // Created by Robert Widmann on 8/13/14. // Copyright (c) 2014 MailCore. All rights reserved. // -#import "MCONNTPFetchMessageOperation.h" +#import "MCONNTPFetchArticleOperation.h" #import "MCAsyncNNTP.h" #import "MCOUtils.h" #import "MCOOperation+Private.h" -#define nativeType mailcore::NNTPFetchMessageOperation +#define nativeType mailcore::NNTPFetchArticleOperation typedef void (^CompletionType)(NSError *error, NSData * messageData); -@interface MCONNTPFetchMessageOperation () +@interface MCONNTPFetchArticleOperation () - (void) bodyProgress:(unsigned int)current maximum:(unsigned int)maximum; @end -class MCONNTPFetchMessageOperationCallback : public mailcore::NNTPOperationCallback { +class MCONNTPFetchArticleOperationCallback : public mailcore::NNTPOperationCallback { public: - MCONNTPFetchMessageOperationCallback(MCONNTPFetchMessageOperation * op) + MCONNTPFetchArticleOperationCallback(MCONNTPFetchArticleOperation * op) { mOperation = op; } - virtual ~MCONNTPFetchMessageOperationCallback() + virtual ~MCONNTPFetchArticleOperationCallback() { } @@ -38,12 +38,12 @@ public: } private: - MCONNTPFetchMessageOperation * mOperation; + MCONNTPFetchArticleOperation * mOperation; }; -@implementation MCONNTPFetchMessageOperation { +@implementation MCONNTPFetchArticleOperation { CompletionType _completionBlock; - MCONNTPFetchMessageOperationCallback * _popCallback; + MCONNTPFetchArticleOperationCallback * _popCallback; MCONNTPOperationProgressBlock _progress; } @@ -64,7 +64,7 @@ private: { self = [super initWithMCOperation:op]; - _popCallback = new MCONNTPFetchMessageOperationCallback(self); + _popCallback = new MCONNTPFetchArticleOperationCallback(self); ((mailcore::NNTPOperation *) op)->setNNTPCallback(_popCallback); return self; diff --git a/src/objc/nntp/MCONNTPFetchMessagesOperation.h b/src/objc/nntp/MCONNTPFetchArticlesOperation.h index 57159ad0..bd28d99d 100644 --- a/src/objc/nntp/MCONNTPFetchMessagesOperation.h +++ b/src/objc/nntp/MCONNTPFetchArticlesOperation.h @@ -1,5 +1,5 @@ // -// MCONNTPFetchMessagesOperation.h +// MCONNTPFetchArticlesOperation.h // mailcore2 // // Created by Robert Widmann on 8/13/14. @@ -15,7 +15,7 @@ /** This is an asynchronous operation that will fetch the list of a messages on the NNTP3 account. */ -@interface MCONNTPFetchMessagesOperation : MCONNTPOperation +@interface MCONNTPFetchArticlesOperation : MCONNTPOperation /** Starts the asynchronous fetch operation. diff --git a/src/objc/nntp/MCONNTPFetchMessagesOperation.mm b/src/objc/nntp/MCONNTPFetchArticlesOperation.mm index 338af1fa..b7c4670e 100644 --- a/src/objc/nntp/MCONNTPFetchMessagesOperation.mm +++ b/src/objc/nntp/MCONNTPFetchArticlesOperation.mm @@ -1,12 +1,12 @@ // -// MCONNTPFetchMessagesOperation.m +// MCONNTPFetchArticlesOperation.m // mailcore2 // // Created by Robert Widmann on 8/13/14. // Copyright (c) 2014 MailCore. All rights reserved. // -#import "MCONNTPFetchMessagesOperation.h" +#import "MCONNTPFetchArticlesOperation.h" #include "MCAsyncNNTP.h" @@ -15,11 +15,11 @@ typedef void (^CompletionType)(NSError *error, NSArray * messages); -@implementation MCONNTPFetchMessagesOperation { +@implementation MCONNTPFetchArticlesOperation { CompletionType _completionBlock; } -#define nativeType mailcore::NNTPFetchMessagesOperation +#define nativeType mailcore::MCNNTPFetchArticlesOperation + (void) load { diff --git a/src/objc/nntp/MCONNTPMessageInfo.h b/src/objc/nntp/MCONNTPMessageInfo.h index 0b62547a..d4f06b04 100644 --- a/src/objc/nntp/MCONNTPMessageInfo.h +++ b/src/objc/nntp/MCONNTPMessageInfo.h @@ -12,7 +12,7 @@ #import <Foundation/Foundation.h> -/** This is information of a message fetched by MCONNTPFetchMessagesOperation.*/ +/** This is information of a message fetched by MCONNTPFetchArticlesOperation.*/ @interface MCONNTPMessageInfo : NSObject <NSCopying> diff --git a/src/objc/nntp/MCONNTPSession.h b/src/objc/nntp/MCONNTPSession.h index 214e9d9d..6d6ea26f 100644 --- a/src/objc/nntp/MCONNTPSession.h +++ b/src/objc/nntp/MCONNTPSession.h @@ -16,9 +16,9 @@ #import <MailCore/MCOConstants.h> -@class MCONNTPFetchMessagesOperation; +@class MCONNTPFetchArticlesOperation; @class MCONNTPFetchHeaderOperation; -@class MCONNTPFetchMessageOperation; +@class MCONNTPFetchArticleOperation; @class MCONNTPListNewsgroupsOperation; @class MCONNTPOperation; @@ -68,33 +68,33 @@ /** Returns an operation that will fetch the list of messages. - MCONNTPFetchMessagesOperation * op = [session fetchMessagesOperation]; + MCONNTPFetchArticlesOperation * op = [session fetchMessagesOperation]; [op start:^(NSError * error, NSArray * messages) { // messages is an array of MCONNTPMessageInfo // [info index] can be used as reference for a given message in the other operations. }]; */ -- (MCONNTPFetchMessagesOperation *) fetchMessagesOperation:(NSString *)group; +- (MCONNTPFetchArticlesOperation *) fetchArticlesOperation:(NSString *)group; /** Returns an operation that will fetch the header of the given message. - MCONNTPFetchHeaderOperation * op = [session fetchHeaderOperationWithIndex:idx]; + MCONNTPFetchHeaderOperation * op = [session fetchHeaderOperationWithIndex:idx inGroup:@"Group"]; [op start:^(NSError * error, MCOMessageHeader * header) { // header is the parsed header of the message. }]; */ -- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index; +- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index inGroup:(NSString *)group; /** Returns an operation that will fetch the content of the given message. - MCONNTPFetchMessageOperation * op = [session fetchMessageOperationWithIndex:idx inGroup:@"Group"]; + MCONNTPFetchArticleOperation * op = [session fetchMessageOperationWithIndex:idx inGroup:@"Group"]; [op start:^(NSError * error, NSData * messageData) { // messageData is the RFC 822 formatted message data. }]; */ -- (MCONNTPFetchMessageOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group; +- (MCONNTPFetchArticleOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group; /** Returns an operation that will list all available newsgroups. diff --git a/src/objc/nntp/MCONNTPSession.mm b/src/objc/nntp/MCONNTPSession.mm index eb7ce4ab..e661eb65 100644 --- a/src/objc/nntp/MCONNTPSession.mm +++ b/src/objc/nntp/MCONNTPSession.mm @@ -13,7 +13,7 @@ #import "MCOUtils.h" #import "MCONNTPOperation.h" #import "MCOOperation+Private.h" -#import "MCONNTPFetchMessagesOperation.h" +#import "MCONNTPFetchArticlesOperation.h" #import "MCONNTPOperation+Private.h" using namespace mailcore; @@ -121,21 +121,21 @@ MCO_OBJC_SYNTHESIZE_SCALAR(dispatch_queue_t, dispatch_queue_t, setDispatchQueue, return result; } -- (MCONNTPFetchMessagesOperation *) fetchMessagesOperation:(NSString *)group +- (MCONNTPFetchArticlesOperation *) fetchArticlesOperation:(NSString *)group { - mailcore::NNTPFetchMessagesOperation * coreOp = MCO_NATIVE_INSTANCE->fetchMessagesOperation(MCO_FROM_OBJC(mailcore::String, group)); + mailcore::MCNNTPFetchArticlesOperation * coreOp = MCO_NATIVE_INSTANCE->fetchArticlesOperation(MCO_FROM_OBJC(mailcore::String, group)); return MCO_TO_OBJC_OP(coreOp); } -- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index +- (MCONNTPFetchHeaderOperation *) fetchHeaderOperationWithIndex:(unsigned int)index inGroup:(NSString *)group { - mailcore::NNTPFetchHeaderOperation * coreOp = MCO_NATIVE_INSTANCE->fetchHeaderOperation(index); + mailcore::NNTPFetchHeaderOperation * coreOp = MCO_NATIVE_INSTANCE->fetchHeaderOperation(MCO_FROM_OBJC(mailcore::String, group), index); return MCO_TO_OBJC_OP(coreOp); } -- (MCONNTPFetchMessageOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group +- (MCONNTPFetchArticleOperation *) fetchArticleOperationWithIndex:(unsigned int)index inGroup:(NSString *)group { - mailcore::NNTPFetchMessageOperation * coreOp = MCO_NATIVE_INSTANCE->fetchArticleOperation(MCO_FROM_OBJC(mailcore::String, group), index); + mailcore::NNTPFetchArticleOperation * coreOp = MCO_NATIVE_INSTANCE->fetchArticleOperation(MCO_FROM_OBJC(mailcore::String, group), index); return MCO_TO_OBJC_OP(coreOp); } |