summaryrefslogtreecommitdiff
path: root/objective-c
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-07-13 01:25:10 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-07-13 01:25:10 +0200
commit2fec699a92e64f80c36c5616e2bf7bdf3a4c4ef3 (patch)
treef10b9a5f769dbc76c44bf3e1932e7e1c3c0fc080 /objective-c
parentSimplified SDKSettings.plist properties (diff)
downloadice-2fec699a92e64f80c36c5616e2bf7bdf3a4c4ef3.tar.bz2
ice-2fec699a92e64f80c36c5616e2bf7bdf3a4c4ef3.tar.xz
ice-2fec699a92e64f80c36c5616e2bf7bdf3a4c4ef3.zip
Fixed ICE-8282 - added IceIAPObjC library
Diffstat (limited to 'objective-c')
-rw-r--r--objective-c/Makefile2
-rw-r--r--objective-c/config/Make.rules2
-rw-r--r--objective-c/config/Make.xcodesdk.rules2
-rw-r--r--objective-c/include/objc/IceIAP.h10
-rw-r--r--objective-c/include/objc/IceIAP/IceIAP.h11
-rw-r--r--objective-c/src/IceIAP/ConnectionInfoI.mm51
-rw-r--r--objective-c/src/IceIAP/EndpointInfoI.mm45
-rw-r--r--objective-c/src/IceIAP/Makefile.mk24
8 files changed, 144 insertions, 3 deletions
diff --git a/objective-c/Makefile b/objective-c/Makefile
index 83e33f09ae3..39b1ef8df1c 100644
--- a/objective-c/Makefile
+++ b/objective-c/Makefile
@@ -17,7 +17,7 @@ include $(lang_srcdir)/config/Make.rules
# Load C++ dependencies
#
$(eval $(call load-translator-dependencies,$(top_srcdir)/cpp/src/slice2objc))
-$(eval $(call load-dependencies,$(addprefix $(top_srcdir)/cpp/src/,Ice IceSSL)))
+$(eval $(call load-dependencies,$(addprefix $(top_srcdir)/cpp/src/,Ice IceSSL IceIAP)))
#
# Load source projects
diff --git a/objective-c/config/Make.rules b/objective-c/config/Make.rules
index efe4ddd6ea1..630b64eeae1 100644
--- a/objective-c/config/Make.rules
+++ b/objective-c/config/Make.rules
@@ -28,7 +28,7 @@ endif
#
# Build only few components with the static configuration (libraries)
#
-static_components = Ice IceSSL IceObjC IceSSLObjC Glacier2ObjC IceStormObjC IceGridObjC
+static_components = Ice IceSSL IceIAP IceObjC IceSSLObjC IceIAPObjC Glacier2ObjC IceStormObjC IceGridObjC
static_projects = test/%
static_ldflags += $(if $(filter program,$($1_target)),-ObjC)
diff --git a/objective-c/config/Make.xcodesdk.rules b/objective-c/config/Make.xcodesdk.rules
index 74d017ab6b0..0d3ebe9ba52 100644
--- a/objective-c/config/Make.xcodesdk.rules
+++ b/objective-c/config/Make.xcodesdk.rules
@@ -18,7 +18,7 @@ xcodesdk_targetdir = $(if $(filter %/build,$5),xcodesdk,$(if $(filter all c
xcodesdk_installdir = $(if $(filter %/build,$5),xcodesdk,../sdk/$2.sdk/usr/lib)
xcodesdk_targetrule = $(if $(filter-out program,$($1_target)),static)
-xcodesdk_components = Ice IceSSL IceObjC IceSSLObjC Glacier2ObjC IceStormObjC IceGridObjC TestCommonObjC
+xcodesdk_components = Ice IceSSL IceIAP IceObjC IceSSLObjC IceIAPObjC Glacier2ObjC IceStormObjC IceGridObjC TestCommonObjC
xcodesdk_projects = test/Ice/%
iphoneos_excludes = test/%
diff --git a/objective-c/include/objc/IceIAP.h b/objective-c/include/objc/IceIAP.h
new file mode 100644
index 00000000000..3dfba5265a0
--- /dev/null
+++ b/objective-c/include/objc/IceIAP.h
@@ -0,0 +1,10 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#import <objc/IceIAP/IceIAP.h>
diff --git a/objective-c/include/objc/IceIAP/IceIAP.h b/objective-c/include/objc/IceIAP/IceIAP.h
new file mode 100644
index 00000000000..ad792c0414e
--- /dev/null
+++ b/objective-c/include/objc/IceIAP/IceIAP.h
@@ -0,0 +1,11 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#import <objc/IceIAP/EndpointInfo.h>
+#import <objc/IceIAP/ConnectionInfo.h>
diff --git a/objective-c/src/IceIAP/ConnectionInfoI.mm b/objective-c/src/IceIAP/ConnectionInfoI.mm
new file mode 100644
index 00000000000..aa1f4f477bc
--- /dev/null
+++ b/objective-c/src/IceIAP/ConnectionInfoI.mm
@@ -0,0 +1,51 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#import <objc/IceIAP/ConnectionInfo.h>
+#import <ConnectionI.h>
+#import <LocalObjectI.h>
+#import <Util.h>
+
+#include <IceIAP/ConnectionInfo.h>
+
+using namespace std;
+
+@implementation ICEIAPConnectionInfo (IceIAP)
+
++(void) load
+{
+ IceObjC::registerConnectionInfoClass([ICEIAPConnectionInfo class]);
+}
+
+-(id) initWithIAPConnectionInfo:(IceIAP::ConnectionInfo*)iapConnectionInfo
+{
+ self = [super initWithConnectionInfo:iapConnectionInfo];
+ if(self)
+ {
+ self->name = toNSString(iapConnectionInfo->name);
+ self->manufacturer = toNSString(iapConnectionInfo->manufacturer);
+ self->modelNumber = toNSString(iapConnectionInfo->modelNumber);
+ self->firmwareRevision = toNSString(iapConnectionInfo->firmwareRevision);
+ self->hardwareRevision = toNSString(iapConnectionInfo->hardwareRevision);
+ self->protocol = toNSString(iapConnectionInfo->protocol);
+ }
+ return self;
+}
+
++(id) checkedConnectionInfoWithConnectionInfo:(Ice::ConnectionInfo*)connectionInfo
+{
+ IceIAP::ConnectionInfo* iapConnectionInfo = dynamic_cast<IceIAP::ConnectionInfo*>(connectionInfo);
+ if(iapConnectionInfo)
+ {
+ return [[ICEIAPConnectionInfo alloc] initWithIAPConnectionInfo:iapConnectionInfo];
+ }
+ return nil;
+}
+
+@end
diff --git a/objective-c/src/IceIAP/EndpointInfoI.mm b/objective-c/src/IceIAP/EndpointInfoI.mm
new file mode 100644
index 00000000000..e6f0b64b790
--- /dev/null
+++ b/objective-c/src/IceIAP/EndpointInfoI.mm
@@ -0,0 +1,45 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#import <objc/IceIAP/EndpointInfo.h>
+#import <EndpointI.h>
+#import <LocalObjectI.h>
+#import <Util.h>
+
+#include <IceIAP/EndpointInfo.h>
+
+@implementation ICEIAPEndpointInfo (IceIAP)
++(void) load
+{
+ IceObjC::registerEndpointInfoClass([ICEIAPEndpointInfo class]);
+}
+
+-(id) initWithIAPEndpointInfo:(IceIAP::EndpointInfo*)iapEndpointInfo
+{
+ self = [super initWithEndpointInfo:iapEndpointInfo];
+ if(self)
+ {
+ self->name = toNSString(iapEndpointInfo->name);
+ self->manufacturer = toNSString(iapEndpointInfo->manufacturer);
+ self->modelNumber = toNSString(iapEndpointInfo->modelNumber);
+ self->protocol = toNSString(iapEndpointInfo->protocol);
+ }
+ return self;
+}
+
++(id) checkedEndpointInfoWithEndpointInfo:(Ice::EndpointInfo*)endpointInfo
+{
+ IceIAP::EndpointInfo* iapEndpointInfo = dynamic_cast<IceIAP::EndpointInfo*>(endpointInfo);
+ if(iapEndpointInfo)
+ {
+ return [[ICEIAPEndpointInfo alloc] initWithEndpointInfo:iapEndpointInfo];
+ }
+ return nil;
+}
+@end
diff --git a/objective-c/src/IceIAP/Makefile.mk b/objective-c/src/IceIAP/Makefile.mk
new file mode 100644
index 00000000000..d1644edc301
--- /dev/null
+++ b/objective-c/src/IceIAP/Makefile.mk
@@ -0,0 +1,24 @@
+# **********************************************************************
+#
+# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+$(project)_libraries = IceIAPObjC
+
+IceIAPObjC_configs := xcodesdk
+IceIAPObjC_platforms := iphoneos iphonesimulator
+
+IceIAPObjC_targetdir := $(libdir)
+IceIAPObjC_cppflags := -DICEIAP_API_EXPORTS -Isrc/Ice -I$(top_srcdir)/cpp/include -I$(top_srcdir)/cpp/include/generated
+IceIAPObjC_sliceflags := --include-dir objc/IceIAP
+IceIAPObjC_dependencies := IceObjC IceIAP Ice
+IceIAPObjC_slicedir := $(slicedir)/IceIAP
+IceIAPObjC_includedir := $(includedir)/objc/IceIAP
+
+IceIAPObjC_install:: $(install_includedir)/objc/IceIAP.h
+
+projects += $(project)