aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/objc/nntp/MCONNTPGroupInfo.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/objc/nntp/MCONNTPGroupInfo.mm')
-rw-r--r--src/objc/nntp/MCONNTPGroupInfo.mm70
1 files changed, 70 insertions, 0 deletions
diff --git a/src/objc/nntp/MCONNTPGroupInfo.mm b/src/objc/nntp/MCONNTPGroupInfo.mm
new file mode 100644
index 00000000..342192f2
--- /dev/null
+++ b/src/objc/nntp/MCONNTPGroupInfo.mm
@@ -0,0 +1,70 @@
+//
+// MCONNTPGroupInfo.m
+// mailcore2
+//
+// Created by Robert Widmann on 8/13/14.
+// Copyright (c) 2014 MailCore. All rights reserved.
+//
+
+#import "MCONNTPGroupInfo.h"
+
+#include "MCAsyncNNTP.h"
+#include "MCNNTP.h"
+
+#import "MCOUtils.h"
+
+@implementation MCONNTPGroupInfo {
+ mailcore::NNTPGroupInfo * _nativeInfo;
+}
+
+#define nativeType mailcore::NNTPGroupInfo
+
++ (void) load
+{
+ MCORegisterClass(self, &typeid(nativeType));
+}
+
+- (id) copyWithZone:(NSZone *)zone
+{
+ nativeType * nativeObject = (nativeType *) [self mco_mcObject]->copy();
+ id result = [[self class] mco_objectWithMCObject:nativeObject];
+ MC_SAFE_RELEASE(nativeObject);
+ return [result retain];
+}
+
++ (NSObject *) mco_objectWithMCObject:(mailcore::Object *)object
+{
+ mailcore::NNTPGroupInfo * groupInfo = (mailcore::NNTPGroupInfo *) object;
+ return [[[self alloc] initWithMCNNTPGroupInfo:groupInfo] autorelease];
+}
+
+- (mailcore::Object *) mco_mcObject
+{
+ return _nativeInfo;
+}
+
+- (NSString *) description
+{
+ return MCO_OBJC_BRIDGE_GET(description);
+}
+
+- (id) initWithMCNNTPGroupInfo:(mailcore::NNTPGroupInfo *)info
+{
+ self = [super init];
+
+ _nativeInfo = info;
+ _nativeInfo->retain();
+
+ return self;
+}
+
+- (void) dealloc
+{
+ MC_SAFE_RELEASE(_nativeInfo);
+ [super dealloc];
+}
+
+MCO_OBJC_SYNTHESIZE_STRING(setName, name)
+MCO_OBJC_SYNTHESIZE_SCALAR(unsigned int, unsigned int, setMessageCount, messageCount)
+
+@end