Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
djinni
Commits
d028dfbb
Commit
d028dfbb
authored
Sep 29, 2015
by
j4cbo
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #130 from PSPDFKit-labs/peter/objc-generics
Objective-C generics
parents
180b4ba7
a6a2ca2f
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
59 additions
and
53 deletions
+59
-53
src/source/ObjcMarshal.scala
src/source/ObjcMarshal.scala
+9
-3
test-suite/generated-src/objc/DBMapDateRecord.h
test-suite/generated-src/objc/DBMapDateRecord.h
+3
-3
test-suite/generated-src/objc/DBMapDateRecord.mm
test-suite/generated-src/objc/DBMapDateRecord.mm
+2
-2
test-suite/generated-src/objc/DBMapListRecord.h
test-suite/generated-src/objc/DBMapListRecord.h
+3
-3
test-suite/generated-src/objc/DBMapListRecord.mm
test-suite/generated-src/objc/DBMapListRecord.mm
+2
-2
test-suite/generated-src/objc/DBMapRecord.h
test-suite/generated-src/objc/DBMapRecord.h
+6
-6
test-suite/generated-src/objc/DBMapRecord.mm
test-suite/generated-src/objc/DBMapRecord.mm
+4
-4
test-suite/generated-src/objc/DBNestedCollection.h
test-suite/generated-src/objc/DBNestedCollection.h
+3
-3
test-suite/generated-src/objc/DBNestedCollection.mm
test-suite/generated-src/objc/DBNestedCollection.mm
+2
-2
test-suite/generated-src/objc/DBPrimitiveList.h
test-suite/generated-src/objc/DBPrimitiveList.h
+3
-3
test-suite/generated-src/objc/DBPrimitiveList.mm
test-suite/generated-src/objc/DBPrimitiveList.mm
+2
-2
test-suite/generated-src/objc/DBSetRecord.h
test-suite/generated-src/objc/DBSetRecord.h
+6
-6
test-suite/generated-src/objc/DBSetRecord.mm
test-suite/generated-src/objc/DBSetRecord.mm
+4
-4
test-suite/generated-src/objc/DBTestHelpers+Private.mm
test-suite/generated-src/objc/DBTestHelpers+Private.mm
+5
-5
test-suite/generated-src/objc/DBTestHelpers.h
test-suite/generated-src/objc/DBTestHelpers.h
+5
-5
No files found.
src/source/ObjcMarshal.scala
View file @
d028dfbb
...
@@ -93,6 +93,7 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
...
@@ -93,6 +93,7 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
def
toObjcType
(
ty
:
TypeRef
,
needRef
:
Boolean
)
:
(
String
,
Boolean
)
=
toObjcType
(
ty
.
resolved
,
needRef
)
def
toObjcType
(
ty
:
TypeRef
,
needRef
:
Boolean
)
:
(
String
,
Boolean
)
=
toObjcType
(
ty
.
resolved
,
needRef
)
def
toObjcType
(
tm
:
MExpr
)
:
(
String
,
Boolean
)
=
toObjcType
(
tm
,
false
)
def
toObjcType
(
tm
:
MExpr
)
:
(
String
,
Boolean
)
=
toObjcType
(
tm
,
false
)
def
toObjcType
(
tm
:
MExpr
,
needRef
:
Boolean
)
:
(
String
,
Boolean
)
=
{
def
toObjcType
(
tm
:
MExpr
,
needRef
:
Boolean
)
:
(
String
,
Boolean
)
=
{
def
args
(
tm
:
MExpr
)
=
if
(
tm
.
args
.
isEmpty
)
""
else
tm
.
args
.
map
(
toBoxedParamType
).
mkString
(
"<"
,
", "
,
">"
)
def
f
(
tm
:
MExpr
,
needRef
:
Boolean
)
:
(
String
,
Boolean
)
=
{
def
f
(
tm
:
MExpr
,
needRef
:
Boolean
)
:
(
String
,
Boolean
)
=
{
tm
.
base
match
{
tm
.
base
match
{
case
MOptional
=>
case
MOptional
=>
...
@@ -110,9 +111,9 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
...
@@ -110,9 +111,9 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
case
MDate
=>
(
"NSDate"
,
true
)
case
MDate
=>
(
"NSDate"
,
true
)
case
MBinary
=>
(
"NSData"
,
true
)
case
MBinary
=>
(
"NSData"
,
true
)
case
MOptional
=>
throw
new
AssertionError
(
"optional should have been special cased"
)
case
MOptional
=>
throw
new
AssertionError
(
"optional should have been special cased"
)
case
MList
=>
(
"NSArray"
,
true
)
case
MList
=>
(
"NSArray"
+
args
(
tm
)
,
true
)
case
MSet
=>
(
"NSSet"
,
true
)
case
MSet
=>
(
"NSSet"
+
args
(
tm
)
,
true
)
case
MMap
=>
(
"NSDictionary"
,
true
)
case
MMap
=>
(
"NSDictionary"
+
args
(
tm
)
,
true
)
case
d
:
MDef
=>
d
.
defType
match
{
case
d
:
MDef
=>
d
.
defType
match
{
case
DEnum
=>
if
(
needRef
)
(
"NSNumber"
,
true
)
else
(
idObjc
.
ty
(
d
.
name
),
false
)
case
DEnum
=>
if
(
needRef
)
(
"NSNumber"
,
true
)
else
(
idObjc
.
ty
(
d
.
name
),
false
)
case
DRecord
=>
(
idObjc
.
ty
(
d
.
name
),
true
)
case
DRecord
=>
(
idObjc
.
ty
(
d
.
name
),
true
)
...
@@ -135,6 +136,11 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
...
@@ -135,6 +136,11 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
f
(
tm
,
needRef
)
f
(
tm
,
needRef
)
}
}
def
toBoxedParamType
(
tm
:
MExpr
)
:
String
=
{
val
(
name
,
needRef
)
=
toObjcType
(
tm
,
true
)
name
+
(
if
(
needRef
)
" *"
else
""
)
}
def
toObjcParamType
(
tm
:
MExpr
)
:
String
=
{
def
toObjcParamType
(
tm
:
MExpr
)
:
String
=
{
val
(
name
,
needRef
)
=
toObjcType
(
tm
)
val
(
name
,
needRef
)
=
toObjcType
(
tm
)
name
+
(
if
(
needRef
)
" *"
else
""
)
name
+
(
if
(
needRef
)
" *"
else
""
)
...
...
test-suite/generated-src/objc/DBMapDateRecord.h
View file @
d028dfbb
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBMapDateRecord
:
NSObject
@interface
DBMapDateRecord
:
NSObject
-
(
nonnull
instancetype
)
initWithDatesById
:(
nonnull
NSDictionary
*
)
datesById
;
-
(
nonnull
instancetype
)
initWithDatesById
:(
nonnull
NSDictionary
<
NSString
*
,
NSDate
*>
*
)
datesById
;
+
(
nonnull
instancetype
)
mapDateRecordWithDatesById
:(
nonnull
NSDictionary
*
)
datesById
;
+
(
nonnull
instancetype
)
mapDateRecordWithDatesById
:(
nonnull
NSDictionary
<
NSString
*
,
NSDate
*>
*
)
datesById
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
*
datesById
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
<
NSString
*
,
NSDate
*>
*
datesById
;
@end
@end
test-suite/generated-src/objc/DBMapDateRecord.mm
View file @
d028dfbb
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
@implementation
DBMapDateRecord
@implementation
DBMapDateRecord
-
(
nonnull
instancetype
)
initWithDatesById
:(
nonnull
NSDictionary
*
)
datesById
-
(
nonnull
instancetype
)
initWithDatesById
:(
nonnull
NSDictionary
<
NSString
*
,
NSDate
*>
*
)
datesById
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_datesById
=
datesById
;
_datesById
=
datesById
;
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
return
self
;
return
self
;
}
}
+
(
nonnull
instancetype
)
mapDateRecordWithDatesById
:(
nonnull
NSDictionary
*
)
datesById
+
(
nonnull
instancetype
)
mapDateRecordWithDatesById
:(
nonnull
NSDictionary
<
NSString
*
,
NSDate
*>
*
)
datesById
{
{
return
[[
self
alloc
]
initWithDatesById
:
datesById
];
return
[[
self
alloc
]
initWithDatesById
:
datesById
];
}
}
...
...
test-suite/generated-src/objc/DBMapListRecord.h
View file @
d028dfbb
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBMapListRecord
:
NSObject
@interface
DBMapListRecord
:
NSObject
-
(
nonnull
instancetype
)
initWithMapList
:(
nonnull
NSArray
*
)
mapList
;
-
(
nonnull
instancetype
)
initWithMapList
:(
nonnull
NSArray
<
NSDictionary
<
NSString
*
,
NSNumber
*>
*>
*
)
mapList
;
+
(
nonnull
instancetype
)
mapListRecordWithMapList
:(
nonnull
NSArray
*
)
mapList
;
+
(
nonnull
instancetype
)
mapListRecordWithMapList
:(
nonnull
NSArray
<
NSDictionary
<
NSString
*
,
NSNumber
*>
*>
*
)
mapList
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
*
mapList
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
<
NSDictionary
<
NSString
*
,
NSNumber
*>
*>
*
mapList
;
@end
@end
test-suite/generated-src/objc/DBMapListRecord.mm
View file @
d028dfbb
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
@implementation
DBMapListRecord
@implementation
DBMapListRecord
-
(
nonnull
instancetype
)
initWithMapList
:(
nonnull
NSArray
*
)
mapList
-
(
nonnull
instancetype
)
initWithMapList
:(
nonnull
NSArray
<
NSDictionary
<
NSString
*
,
NSNumber
*>
*>
*
)
mapList
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_mapList
=
mapList
;
_mapList
=
mapList
;
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
return
self
;
return
self
;
}
}
+
(
nonnull
instancetype
)
mapListRecordWithMapList
:(
nonnull
NSArray
*
)
mapList
+
(
nonnull
instancetype
)
mapListRecordWithMapList
:(
nonnull
NSArray
<
NSDictionary
<
NSString
*
,
NSNumber
*>
*>
*
)
mapList
{
{
return
[[
self
alloc
]
initWithMapList
:
mapList
];
return
[[
self
alloc
]
initWithMapList
:
mapList
];
}
}
...
...
test-suite/generated-src/objc/DBMapRecord.h
View file @
d028dfbb
...
@@ -4,13 +4,13 @@
...
@@ -4,13 +4,13 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBMapRecord
:
NSObject
@interface
DBMapRecord
:
NSObject
-
(
nonnull
instancetype
)
initWithMap
:(
nonnull
NSDictionary
*
)
map
-
(
nonnull
instancetype
)
initWithMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
map
imap
:(
nonnull
NSDictionary
*
)
imap
;
imap
:(
nonnull
NSDictionary
<
NSNumber
*
,
NSNumber
*>
*
)
imap
;
+
(
nonnull
instancetype
)
mapRecordWithMap
:(
nonnull
NSDictionary
*
)
map
+
(
nonnull
instancetype
)
mapRecordWithMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
map
imap
:(
nonnull
NSDictionary
*
)
imap
;
imap
:(
nonnull
NSDictionary
<
NSNumber
*
,
NSNumber
*>
*
)
imap
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
*
map
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
<
NSString
*
,
NSNumber
*>
*
map
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
*
imap
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
<
NSNumber
*
,
NSNumber
*>
*
imap
;
@end
@end
test-suite/generated-src/objc/DBMapRecord.mm
View file @
d028dfbb
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
@implementation
DBMapRecord
@implementation
DBMapRecord
-
(
nonnull
instancetype
)
initWithMap
:(
nonnull
NSDictionary
*
)
map
-
(
nonnull
instancetype
)
initWithMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
map
imap
:(
nonnull
NSDictionary
*
)
imap
imap
:(
nonnull
NSDictionary
<
NSNumber
*
,
NSNumber
*>
*
)
imap
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_map
=
map
;
_map
=
map
;
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
return
self
;
return
self
;
}
}
+
(
nonnull
instancetype
)
mapRecordWithMap
:(
nonnull
NSDictionary
*
)
map
+
(
nonnull
instancetype
)
mapRecordWithMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
map
imap
:(
nonnull
NSDictionary
*
)
imap
imap
:(
nonnull
NSDictionary
<
NSNumber
*
,
NSNumber
*>
*
)
imap
{
{
return
[[
self
alloc
]
initWithMap
:
map
return
[[
self
alloc
]
initWithMap
:
map
imap:
imap
];
imap:
imap
];
...
...
test-suite/generated-src/objc/DBNestedCollection.h
View file @
d028dfbb
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBNestedCollection
:
NSObject
@interface
DBNestedCollection
:
NSObject
-
(
nonnull
instancetype
)
initWithSetList
:(
nonnull
NSArray
*
)
setList
;
-
(
nonnull
instancetype
)
initWithSetList
:(
nonnull
NSArray
<
NSSet
<
NSString
*>
*>
*
)
setList
;
+
(
nonnull
instancetype
)
nestedCollectionWithSetList
:(
nonnull
NSArray
*
)
setList
;
+
(
nonnull
instancetype
)
nestedCollectionWithSetList
:(
nonnull
NSArray
<
NSSet
<
NSString
*>
*>
*
)
setList
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
*
setList
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
<
NSSet
<
NSString
*>
*>
*
setList
;
@end
@end
test-suite/generated-src/objc/DBNestedCollection.mm
View file @
d028dfbb
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
@implementation
DBNestedCollection
@implementation
DBNestedCollection
-
(
nonnull
instancetype
)
initWithSetList
:(
nonnull
NSArray
*
)
setList
-
(
nonnull
instancetype
)
initWithSetList
:(
nonnull
NSArray
<
NSSet
<
NSString
*>
*>
*
)
setList
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_setList
=
setList
;
_setList
=
setList
;
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
return
self
;
return
self
;
}
}
+
(
nonnull
instancetype
)
nestedCollectionWithSetList
:(
nonnull
NSArray
*
)
setList
+
(
nonnull
instancetype
)
nestedCollectionWithSetList
:(
nonnull
NSArray
<
NSSet
<
NSString
*>
*>
*
)
setList
{
{
return
[[
self
alloc
]
initWithSetList
:
setList
];
return
[[
self
alloc
]
initWithSetList
:
setList
];
}
}
...
...
test-suite/generated-src/objc/DBPrimitiveList.h
View file @
d028dfbb
...
@@ -4,9 +4,9 @@
...
@@ -4,9 +4,9 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBPrimitiveList
:
NSObject
@interface
DBPrimitiveList
:
NSObject
-
(
nonnull
instancetype
)
initWithList
:(
nonnull
NSArray
*
)
list
;
-
(
nonnull
instancetype
)
initWithList
:(
nonnull
NSArray
<
NSNumber
*>
*
)
list
;
+
(
nonnull
instancetype
)
primitiveListWithList
:(
nonnull
NSArray
*
)
list
;
+
(
nonnull
instancetype
)
primitiveListWithList
:(
nonnull
NSArray
<
NSNumber
*>
*
)
list
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
*
list
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
<
NSNumber
*>
*
list
;
@end
@end
test-suite/generated-src/objc/DBPrimitiveList.mm
View file @
d028dfbb
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
@implementation
DBPrimitiveList
@implementation
DBPrimitiveList
-
(
nonnull
instancetype
)
initWithList
:(
nonnull
NSArray
*
)
list
-
(
nonnull
instancetype
)
initWithList
:(
nonnull
NSArray
<
NSNumber
*>
*
)
list
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_list
=
list
;
_list
=
list
;
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
return
self
;
return
self
;
}
}
+
(
nonnull
instancetype
)
primitiveListWithList
:(
nonnull
NSArray
*
)
list
+
(
nonnull
instancetype
)
primitiveListWithList
:(
nonnull
NSArray
<
NSNumber
*>
*
)
list
{
{
return
[[
self
alloc
]
initWithList
:
list
];
return
[[
self
alloc
]
initWithList
:
list
];
}
}
...
...
test-suite/generated-src/objc/DBSetRecord.h
View file @
d028dfbb
...
@@ -4,13 +4,13 @@
...
@@ -4,13 +4,13 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBSetRecord
:
NSObject
@interface
DBSetRecord
:
NSObject
-
(
nonnull
instancetype
)
initWithSet
:(
nonnull
NSSet
*
)
set
-
(
nonnull
instancetype
)
initWithSet
:(
nonnull
NSSet
<
NSString
*>
*
)
set
iset
:(
nonnull
NSSet
*
)
iset
;
iset
:(
nonnull
NSSet
<
NSNumber
*>
*
)
iset
;
+
(
nonnull
instancetype
)
setRecordWithSet
:(
nonnull
NSSet
*
)
set
+
(
nonnull
instancetype
)
setRecordWithSet
:(
nonnull
NSSet
<
NSString
*>
*
)
set
iset
:(
nonnull
NSSet
*
)
iset
;
iset
:(
nonnull
NSSet
<
NSNumber
*>
*
)
iset
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSSet
*
set
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSSet
<
NSString
*>
*
set
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSSet
*
iset
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSSet
<
NSNumber
*>
*
iset
;
@end
@end
test-suite/generated-src/objc/DBSetRecord.mm
View file @
d028dfbb
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
@implementation
DBSetRecord
@implementation
DBSetRecord
-
(
nonnull
instancetype
)
initWithSet
:(
nonnull
NSSet
*
)
set
-
(
nonnull
instancetype
)
initWithSet
:(
nonnull
NSSet
<
NSString
*>
*
)
set
iset
:(
nonnull
NSSet
*
)
iset
iset
:(
nonnull
NSSet
<
NSNumber
*>
*
)
iset
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
_set
=
set
;
_set
=
set
;
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
return
self
;
return
self
;
}
}
+
(
nonnull
instancetype
)
setRecordWithSet
:(
nonnull
NSSet
*
)
set
+
(
nonnull
instancetype
)
setRecordWithSet
:(
nonnull
NSSet
<
NSString
*>
*
)
set
iset
:(
nonnull
NSSet
*
)
iset
iset
:(
nonnull
NSSet
<
NSNumber
*>
*
)
iset
{
{
return
[[
self
alloc
]
initWithSet
:
set
return
[[
self
alloc
]
initWithSet
:
set
iset:
iset
];
iset:
iset
];
...
...
test-suite/generated-src/objc/DBTestHelpers+Private.mm
View file @
d028dfbb
...
@@ -78,28 +78,28 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -78,28 +78,28 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
nonnull
NSDictionary
*
)
getMap
{
+
(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
getMap
{
try
{
try
{
auto
r
=
::
testsuite
::
TestHelpers
::
get_map
();
auto
r
=
::
testsuite
::
TestHelpers
::
get_map
();
return
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
fromCpp
(
r
);
return
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
fromCpp
(
r
);
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
BOOL
)
checkMap
:(
nonnull
NSDictionary
*
)
m
{
+
(
BOOL
)
checkMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
m
{
try
{
try
{
auto
r
=
::
testsuite
::
TestHelpers
::
check_map
(
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
toCpp
(
m
));
auto
r
=
::
testsuite
::
TestHelpers
::
check_map
(
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
toCpp
(
m
));
return
::
djinni
::
Bool
::
fromCpp
(
r
);
return
::
djinni
::
Bool
::
fromCpp
(
r
);
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
nonnull
NSDictionary
*
)
getEmptyMap
{
+
(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
getEmptyMap
{
try
{
try
{
auto
r
=
::
testsuite
::
TestHelpers
::
get_empty_map
();
auto
r
=
::
testsuite
::
TestHelpers
::
get_empty_map
();
return
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
fromCpp
(
r
);
return
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
fromCpp
(
r
);
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
BOOL
)
checkEmptyMap
:(
nonnull
NSDictionary
*
)
m
{
+
(
BOOL
)
checkEmptyMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
m
{
try
{
try
{
auto
r
=
::
testsuite
::
TestHelpers
::
check_empty_map
(
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
toCpp
(
m
));
auto
r
=
::
testsuite
::
TestHelpers
::
check_empty_map
(
::
djinni
::
Map
<::
djinni
::
String
,
::
djinni
::
I64
>::
toCpp
(
m
));
return
::
djinni
::
Bool
::
fromCpp
(
r
);
return
::
djinni
::
Bool
::
fromCpp
(
r
);
...
@@ -132,7 +132,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -132,7 +132,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
void
)
checkEnumMap
:(
nonnull
NSDictionary
*
)
m
{
+
(
void
)
checkEnumMap
:(
nonnull
NSDictionary
<
NSNumber
*
,
NSString
*>
*
)
m
{
try
{
try
{
::
testsuite
::
TestHelpers
::
check_enum_map
(
::
djinni
::
Map
<::
djinni
::
Enum
<::
testsuite
::
color
,
DBColor
>
,
::
djinni
::
String
>::
toCpp
(
m
));
::
testsuite
::
TestHelpers
::
check_enum_map
(
::
djinni
::
Map
<::
djinni
::
Enum
<::
testsuite
::
color
,
DBColor
>
,
::
djinni
::
String
>::
toCpp
(
m
));
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
test-suite/generated-src/objc/DBTestHelpers.h
View file @
d028dfbb
...
@@ -37,13 +37,13 @@
...
@@ -37,13 +37,13 @@
+
(
BOOL
)
checkNestedCollection
:(
nonnull
DBNestedCollection
*
)
nc
;
+
(
BOOL
)
checkNestedCollection
:(
nonnull
DBNestedCollection
*
)
nc
;
+
(
nonnull
NSDictionary
*
)
getMap
;
+
(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
getMap
;
+
(
BOOL
)
checkMap
:(
nonnull
NSDictionary
*
)
m
;
+
(
BOOL
)
checkMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
m
;
+
(
nonnull
NSDictionary
*
)
getEmptyMap
;
+
(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
getEmptyMap
;
+
(
BOOL
)
checkEmptyMap
:(
nonnull
NSDictionary
*
)
m
;
+
(
BOOL
)
checkEmptyMap
:(
nonnull
NSDictionary
<
NSString
*
,
NSNumber
*>
*
)
m
;
+
(
nonnull
DBMapListRecord
*
)
getMapListRecord
;
+
(
nonnull
DBMapListRecord
*
)
getMapListRecord
;
...
@@ -53,7 +53,7 @@
...
@@ -53,7 +53,7 @@
+
(
void
)
checkClientInterfaceNonascii
:(
nullable
id
<
DBClientInterface
>
)
i
;
+
(
void
)
checkClientInterfaceNonascii
:(
nullable
id
<
DBClientInterface
>
)
i
;
+
(
void
)
checkEnumMap
:(
nonnull
NSDictionary
*
)
m
;
+
(
void
)
checkEnumMap
:(
nonnull
NSDictionary
<
NSNumber
*
,
NSString
*>
*
)
m
;
+
(
void
)
checkEnum
:(
DBColor
)
c
;
+
(
void
)
checkEnum
:(
DBColor
)
c
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment