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
435e88ca
Commit
435e88ca
authored
May 26, 2015
by
Jacob Potter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove ObjC deep-copy constructor. Fixes #93
parent
ed11cb63
Changes
28
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
0 additions
and
298 deletions
+0
-298
example/generated-src/objc/TXSItemList.h
example/generated-src/objc/TXSItemList.h
+0
-1
example/generated-src/objc/TXSItemList.mm
example/generated-src/objc/TXSItemList.mm
+0
-14
src/source/ObjcGenerator.scala
src/source/ObjcGenerator.scala
+0
-82
test-suite/generated-src/objc/DBAssortedIntegers.h
test-suite/generated-src/objc/DBAssortedIntegers.h
+0
-1
test-suite/generated-src/objc/DBAssortedIntegers.mm
test-suite/generated-src/objc/DBAssortedIntegers.mm
+0
-31
test-suite/generated-src/objc/DBClientReturnedRecord.h
test-suite/generated-src/objc/DBClientReturnedRecord.h
+0
-1
test-suite/generated-src/objc/DBClientReturnedRecord.mm
test-suite/generated-src/objc/DBClientReturnedRecord.mm
+0
-14
test-suite/generated-src/objc/DBConstants.h
test-suite/generated-src/objc/DBConstants.h
+0
-1
test-suite/generated-src/objc/DBConstants.mm
test-suite/generated-src/objc/DBConstants.mm
+0
-9
test-suite/generated-src/objc/DBDateRecord.h
test-suite/generated-src/objc/DBDateRecord.h
+0
-1
test-suite/generated-src/objc/DBDateRecord.mm
test-suite/generated-src/objc/DBDateRecord.mm
+0
-8
test-suite/generated-src/objc/DBMapDateRecord.h
test-suite/generated-src/objc/DBMapDateRecord.h
+0
-1
test-suite/generated-src/objc/DBMapDateRecord.mm
test-suite/generated-src/objc/DBMapDateRecord.mm
+0
-16
test-suite/generated-src/objc/DBMapListRecord.h
test-suite/generated-src/objc/DBMapListRecord.h
+0
-1
test-suite/generated-src/objc/DBMapListRecord.mm
test-suite/generated-src/objc/DBMapListRecord.mm
+0
-22
test-suite/generated-src/objc/DBMapRecord.h
test-suite/generated-src/objc/DBMapRecord.h
+0
-1
test-suite/generated-src/objc/DBMapRecord.mm
test-suite/generated-src/objc/DBMapRecord.mm
+0
-16
test-suite/generated-src/objc/DBNestedCollection.h
test-suite/generated-src/objc/DBNestedCollection.h
+0
-1
test-suite/generated-src/objc/DBNestedCollection.mm
test-suite/generated-src/objc/DBNestedCollection.mm
+0
-20
test-suite/generated-src/objc/DBPrimitiveList.h
test-suite/generated-src/objc/DBPrimitiveList.h
+0
-1
test-suite/generated-src/objc/DBPrimitiveList.mm
test-suite/generated-src/objc/DBPrimitiveList.mm
+0
-14
test-suite/generated-src/objc/DBRecordWithDerivings.h
test-suite/generated-src/objc/DBRecordWithDerivings.h
+0
-1
test-suite/generated-src/objc/DBRecordWithDerivings.mm
test-suite/generated-src/objc/DBRecordWithDerivings.mm
+0
-9
test-suite/generated-src/objc/DBRecordWithNestedDerivings.h
test-suite/generated-src/objc/DBRecordWithNestedDerivings.h
+0
-1
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
+0
-9
test-suite/generated-src/objc/DBSetRecord.h
test-suite/generated-src/objc/DBSetRecord.h
+0
-1
test-suite/generated-src/objc/DBSetRecord.mm
test-suite/generated-src/objc/DBSetRecord.mm
+0
-14
test-suite/handwritten-src/objc/tests/DBPrimitiveListTests.mm
...-suite/handwritten-src/objc/tests/DBPrimitiveListTests.mm
+0
-7
No files found.
example/generated-src/objc/TXSItemList.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
TXSItemList
:
NSObject
-
(
nonnull
id
)
initWithItemList
:(
nonnull
TXSItemList
*
)
itemList
;
-
(
nonnull
id
)
initWithItems
:(
nonnull
NSArray
*
)
items
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
*
items
;
...
...
example/generated-src/objc/TXSItemList.mm
View file @
435e88ca
...
...
@@ -6,20 +6,6 @@
@implementation
TXSItemList
-
(
id
)
initWithItemList
:(
TXSItemList
*
)
itemList
{
if
(
self
=
[
super
init
])
{
NSMutableArray
*
_itemsTempArray
=
[
NSMutableArray
arrayWithCapacity
:[
itemList
.
items
count
]];
for
(
NSString
*
currentValue_0
in
itemList
.
items
)
{
id
copiedValue_0
;
copiedValue_0
=
[
currentValue_0
copy
];
[
_itemsTempArray
addObject
:
copiedValue_0
];
}
_items
=
_itemsTempArray
;
}
return
self
;
}
-
(
id
)
initWithItems
:(
nonnull
NSArray
*
)
items
{
if
(
self
=
[
super
init
])
{
...
...
src/source/ObjcGenerator.scala
View file @
435e88ca
...
...
@@ -195,8 +195,6 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
writeDoc
(
w
,
doc
)
w
.
wl
(
s
"@interface $self : NSObject"
)
// Deep copy construtor
w
.
wl
(
s
"- (nonnull id)${idObjc.method("
init_with_
" + ident.name)}:(nonnull $self *)${idObjc.local(ident)};"
)
if
(!
r
.
fields
.
isEmpty
)
{
val
head
=
r
.
fields
.
head
val
skipFirst
=
SkipFirst
()
...
...
@@ -235,16 +233,6 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
w
.
wl
w
.
wl
(
s
"@implementation $self"
)
w
.
wl
w
.
wl
(
s
"- (id)${idObjc.method("
init_with_
" + ident.name)}:($noBaseSelf *)${idObjc.local(ident)}"
)
w
.
braced
{
w
.
w
(
"if (self = [super init])"
).
braced
{
for
(
f
<-
r
.
fields
)
{
copyObjcValue
(
s
"_${idObjc.field(f.ident)}"
,
s
"${idObjc.local(ident)}.${idObjc.field(f.ident)}"
,
f
.
ty
,
w
)
}
}
w
.
wl
(
"return self;"
)
}
w
.
wl
// Constructor from all fields (not copying)
if
(!
r
.
fields
.
isEmpty
)
{
val
head
=
r
.
fields
.
head
...
...
@@ -344,76 +332,6 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
})
}
def
copyObjcValue
(
to
:
String
,
from
:
String
,
ty
:
TypeRef
,
w
:
IndentWriter
)
:
Unit
=
copyObjcValue
(
to
,
from
,
ty
.
resolved
,
w
)
def
copyObjcValue
(
to
:
String
,
from
:
String
,
tm
:
MExpr
,
w
:
IndentWriter
)
:
Unit
=
{
def
f
(
to
:
String
,
from
:
String
,
tm
:
MExpr
,
needRef
:
Boolean
,
w
:
IndentWriter
,
valueLevel
:
Int
)
:
Unit
=
{
tm
.
base
match
{
case
MOptional
=>
{
w
.
wl
(
s
"if ($from == nil) {"
).
nested
{
w
.
wl
(
s
"$to = nil;"
)
}
w
.
wl
(
"} else {"
).
nested
{
f
(
to
,
from
,
tm
.
args
.
head
,
true
,
w
,
valueLevel
)
}
w
.
wl
(
"}"
)
}
case
p
:
MPrimitive
=>
w
.
wl
(
s
"$to = $from;"
)
// NSNumber is immutable, so are primitive values
case
MString
=>
w
.
wl
(
s
"$to = [$from copy];"
)
case
MDate
=>
w
.
wl
(
s
"$to = [$from copy];"
)
case
MBinary
=>
w
.
wl
(
s
"$to = [$from copy];"
)
case
MList
=>
{
val
copyName
=
"copiedValue_"
+
valueLevel
val
currentName
=
"currentValue_"
+
valueLevel
w
.
wl
(
s
"NSMutableArray *${to}TempArray = [NSMutableArray arrayWithCapacity:[$from count]];"
)
w
.
w
(
s
"for (${toObjcTypeDef(tm.args.head, true)}$currentName in $from)"
).
braced
{
w
.
wl
(
s
"id $copyName;"
)
f
(
copyName
,
currentName
,
tm
.
args
.
head
,
true
,
w
,
valueLevel
+
1
)
w
.
wl
(
s
"[${to}TempArray addObject:$copyName];"
)
}
w
.
wl
(
s
"$to = ${to}TempArray;"
)
}
case
MSet
=>
{
val
copyName
=
"copiedValue_"
+
valueLevel
val
currentName
=
"currentValue_"
+
valueLevel
w
.
wl
(
s
"NSMutableSet *${to}TempSet = [NSMutableSet setWithCapacity:[$from count]];"
)
w
.
w
(
s
"for (${toObjcTypeDef(tm.args.head, true)}$currentName in $from)"
).
braced
{
w
.
wl
(
s
"id $copyName;"
)
f
(
copyName
,
currentName
,
tm
.
args
.
head
,
true
,
w
,
valueLevel
+
1
)
w
.
wl
(
s
"[${to}TempSet addObject:$copyName];"
)
}
w
.
wl
(
s
"$to = ${to}TempSet;"
)
}
case
MMap
=>
{
w
.
wl
(
s
"NSMutableDictionary *${to}TempDictionary = [NSMutableDictionary dictionaryWithCapacity:[$from count]];"
)
val
keyName
=
"key_"
+
valueLevel
val
valueName
=
"value_"
+
valueLevel
val
copiedKeyName
=
"copiedKey_"
+
valueLevel
val
copiedValueName
=
"copiedValue_"
+
valueLevel
w
.
w
(
s
"for (id $keyName in $from)"
).
braced
{
w
.
wl
(
s
"id $copiedKeyName, $copiedValueName;"
)
f
(
copiedKeyName
,
keyName
,
tm
.
args
.
apply
(
0
),
true
,
w
,
valueLevel
+
1
)
w
.
wl
(
s
"id $valueName = [$from objectForKey:$keyName];"
)
f
(
copiedValueName
,
valueName
,
tm
.
args
.
apply
(
1
),
true
,
w
,
valueLevel
+
1
)
w
.
wl
(
s
"[${to}TempDictionary setObject:$copiedValueName forKey:$copiedKeyName];"
)
}
w
.
wl
(
s
"$to = ${to}TempDictionary;"
)
}
case
d
:
MDef
=>
{
val
typeName
=
d
.
name
val
self
=
idObjc
.
ty
(
typeName
)
d
.
defType
match
{
case
DEnum
=>
w
.
wl
(
s
"$to = $from;"
)
case
DRecord
=>
w
.
wl
(
s
"$to = [[${idObjc.ty(d.name)} alloc] ${idObjc.method("
init_with_
" + d.name)}:$from];"
)
case
DInterface
=>
w
.
wl
(
s
"$to = $from;"
)
}
}
case
p
:
MParam
=>
}
}
f
(
to
,
from
,
tm
,
false
,
w
,
0
)
}
def
writeObjcFile
(
fileName
:
String
,
origin
:
String
,
refs
:
Iterable
[
String
],
f
:
IndentWriter
=>
Unit
)
{
createFile
(
spec
.
objcOutFolder
.
get
,
fileName
,
(
w
:
IndentWriter
)
=>
{
w
.
wl
(
"// AUTOGENERATED FILE - DO NOT MODIFY!"
)
...
...
test-suite/generated-src/objc/DBAssortedIntegers.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBAssortedIntegers
:
NSObject
-
(
nonnull
id
)
initWithAssortedIntegers
:(
nonnull
DBAssortedIntegers
*
)
assortedIntegers
;
-
(
nonnull
id
)
initWithEight
:(
int8_t
)
eight
sixteen
:(
int16_t
)
sixteen
thirtytwo
:(
int32_t
)
thirtytwo
...
...
test-suite/generated-src/objc/DBAssortedIntegers.mm
View file @
435e88ca
...
...
@@ -6,37 +6,6 @@
@implementation
DBAssortedIntegers
-
(
id
)
initWithAssortedIntegers
:(
DBAssortedIntegers
*
)
assortedIntegers
{
if
(
self
=
[
super
init
])
{
_eight
=
assortedIntegers
.
eight
;
_sixteen
=
assortedIntegers
.
sixteen
;
_thirtytwo
=
assortedIntegers
.
thirtytwo
;
_sixtyfour
=
assortedIntegers
.
sixtyfour
;
if
(
assortedIntegers
.
oEight
==
nil
)
{
_oEight
=
nil
;
}
else
{
_oEight
=
assortedIntegers
.
oEight
;
}
if
(
assortedIntegers
.
oSixteen
==
nil
)
{
_oSixteen
=
nil
;
}
else
{
_oSixteen
=
assortedIntegers
.
oSixteen
;
}
if
(
assortedIntegers
.
oThirtytwo
==
nil
)
{
_oThirtytwo
=
nil
;
}
else
{
_oThirtytwo
=
assortedIntegers
.
oThirtytwo
;
}
if
(
assortedIntegers
.
oSixtyfour
==
nil
)
{
_oSixtyfour
=
nil
;
}
else
{
_oSixtyfour
=
assortedIntegers
.
oSixtyfour
;
}
}
return
self
;
}
-
(
id
)
initWithEight
:(
int8_t
)
eight
sixteen
:(
int16_t
)
sixteen
thirtytwo
:(
int32_t
)
thirtytwo
...
...
test-suite/generated-src/objc/DBClientReturnedRecord.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBClientReturnedRecord
:
NSObject
-
(
nonnull
id
)
initWithClientReturnedRecord
:(
nonnull
DBClientReturnedRecord
*
)
clientReturnedRecord
;
-
(
nonnull
id
)
initWithRecordId
:(
int64_t
)
recordId
content
:(
nonnull
NSString
*
)
content
misc
:(
nullable
NSString
*
)
misc
;
...
...
test-suite/generated-src/objc/DBClientReturnedRecord.mm
View file @
435e88ca
...
...
@@ -6,20 +6,6 @@
@implementation
DBClientReturnedRecord
-
(
id
)
initWithClientReturnedRecord
:(
DBClientReturnedRecord
*
)
clientReturnedRecord
{
if
(
self
=
[
super
init
])
{
_recordId
=
clientReturnedRecord
.
recordId
;
_content
=
[
clientReturnedRecord
.
content
copy
];
if
(
clientReturnedRecord
.
misc
==
nil
)
{
_misc
=
nil
;
}
else
{
_misc
=
[
clientReturnedRecord
.
misc
copy
];
}
}
return
self
;
}
-
(
id
)
initWithRecordId
:(
int64_t
)
recordId
content
:(
nonnull
NSString
*
)
content
misc
:(
nullable
NSString
*
)
misc
...
...
test-suite/generated-src/objc/DBConstants.h
View file @
435e88ca
...
...
@@ -5,7 +5,6 @@
#import <Foundation/Foundation.h>
@interface
DBConstants
:
NSObject
-
(
nonnull
id
)
initWithConstants
:(
nonnull
DBConstants
*
)
constants
;
-
(
nonnull
id
)
initWithSomeInteger
:(
int32_t
)
someInteger
someString
:(
nonnull
NSString
*
)
someString
;
...
...
test-suite/generated-src/objc/DBConstants.mm
View file @
435e88ca
...
...
@@ -29,15 +29,6 @@ DBConstants * __nonnull const DBConstantsObjectConstant = [[DBConstants alloc] i
@implementation
DBConstants
-
(
id
)
initWithConstants
:(
DBConstants
*
)
constants
{
if
(
self
=
[
super
init
])
{
_someInteger
=
constants
.
someInteger
;
_someString
=
[
constants
.
someString
copy
];
}
return
self
;
}
-
(
id
)
initWithSomeInteger
:(
int32_t
)
someInteger
someString
:(
nonnull
NSString
*
)
someString
{
...
...
test-suite/generated-src/objc/DBDateRecord.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBDateRecord
:
NSObject
-
(
nonnull
id
)
initWithDateRecord
:(
nonnull
DBDateRecord
*
)
dateRecord
;
-
(
nonnull
id
)
initWithCreatedAt
:(
nonnull
NSDate
*
)
createdAt
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDate
*
createdAt
;
...
...
test-suite/generated-src/objc/DBDateRecord.mm
View file @
435e88ca
...
...
@@ -6,14 +6,6 @@
@implementation
DBDateRecord
-
(
id
)
initWithDateRecord
:(
DBDateRecord
*
)
dateRecord
{
if
(
self
=
[
super
init
])
{
_createdAt
=
[
dateRecord
.
createdAt
copy
];
}
return
self
;
}
-
(
id
)
initWithCreatedAt
:(
nonnull
NSDate
*
)
createdAt
{
if
(
self
=
[
super
init
])
{
...
...
test-suite/generated-src/objc/DBMapDateRecord.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBMapDateRecord
:
NSObject
-
(
nonnull
id
)
initWithMapDateRecord
:(
nonnull
DBMapDateRecord
*
)
mapDateRecord
;
-
(
nonnull
id
)
initWithDatesById
:(
nonnull
NSDictionary
*
)
datesById
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
*
datesById
;
...
...
test-suite/generated-src/objc/DBMapDateRecord.mm
View file @
435e88ca
...
...
@@ -6,22 +6,6 @@
@implementation
DBMapDateRecord
-
(
id
)
initWithMapDateRecord
:(
DBMapDateRecord
*
)
mapDateRecord
{
if
(
self
=
[
super
init
])
{
NSMutableDictionary
*
_datesByIdTempDictionary
=
[
NSMutableDictionary
dictionaryWithCapacity
:[
mapDateRecord
.
datesById
count
]];
for
(
id
key_0
in
mapDateRecord
.
datesById
)
{
id
copiedKey_0
,
copiedValue_0
;
copiedKey_0
=
[
key_0
copy
];
id
value_0
=
[
mapDateRecord
.
datesById
objectForKey
:
key_0
];
copiedValue_0
=
[
value_0
copy
];
[
_datesByIdTempDictionary
setObject
:
copiedValue_0
forKey
:
copiedKey_0
];
}
_datesById
=
_datesByIdTempDictionary
;
}
return
self
;
}
-
(
id
)
initWithDatesById
:(
nonnull
NSDictionary
*
)
datesById
{
if
(
self
=
[
super
init
])
{
...
...
test-suite/generated-src/objc/DBMapListRecord.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBMapListRecord
:
NSObject
-
(
nonnull
id
)
initWithMapListRecord
:(
nonnull
DBMapListRecord
*
)
mapListRecord
;
-
(
nonnull
id
)
initWithMapList
:(
nonnull
NSArray
*
)
mapList
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
*
mapList
;
...
...
test-suite/generated-src/objc/DBMapListRecord.mm
View file @
435e88ca
...
...
@@ -6,28 +6,6 @@
@implementation
DBMapListRecord
-
(
id
)
initWithMapListRecord
:(
DBMapListRecord
*
)
mapListRecord
{
if
(
self
=
[
super
init
])
{
NSMutableArray
*
_mapListTempArray
=
[
NSMutableArray
arrayWithCapacity
:[
mapListRecord
.
mapList
count
]];
for
(
NSDictionary
*
currentValue_0
in
mapListRecord
.
mapList
)
{
id
copiedValue_0
;
NSMutableDictionary
*
copiedValue_0TempDictionary
=
[
NSMutableDictionary
dictionaryWithCapacity
:[
currentValue_0
count
]];
for
(
id
key_1
in
currentValue_0
)
{
id
copiedKey_1
,
copiedValue_1
;
copiedKey_1
=
[
key_1
copy
];
id
value_1
=
[
currentValue_0
objectForKey
:
key_1
];
copiedValue_1
=
value_1
;
[
copiedValue_0TempDictionary
setObject
:
copiedValue_1
forKey
:
copiedKey_1
];
}
copiedValue_0
=
copiedValue_0TempDictionary
;
[
_mapListTempArray
addObject
:
copiedValue_0
];
}
_mapList
=
_mapListTempArray
;
}
return
self
;
}
-
(
id
)
initWithMapList
:(
nonnull
NSArray
*
)
mapList
{
if
(
self
=
[
super
init
])
{
...
...
test-suite/generated-src/objc/DBMapRecord.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBMapRecord
:
NSObject
-
(
nonnull
id
)
initWithMapRecord
:(
nonnull
DBMapRecord
*
)
mapRecord
;
-
(
nonnull
id
)
initWithMap
:(
nonnull
NSDictionary
*
)
map
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSDictionary
*
map
;
...
...
test-suite/generated-src/objc/DBMapRecord.mm
View file @
435e88ca
...
...
@@ -6,22 +6,6 @@
@implementation
DBMapRecord
-
(
id
)
initWithMapRecord
:(
DBMapRecord
*
)
mapRecord
{
if
(
self
=
[
super
init
])
{
NSMutableDictionary
*
_mapTempDictionary
=
[
NSMutableDictionary
dictionaryWithCapacity
:[
mapRecord
.
map
count
]];
for
(
id
key_0
in
mapRecord
.
map
)
{
id
copiedKey_0
,
copiedValue_0
;
copiedKey_0
=
[
key_0
copy
];
id
value_0
=
[
mapRecord
.
map
objectForKey
:
key_0
];
copiedValue_0
=
value_0
;
[
_mapTempDictionary
setObject
:
copiedValue_0
forKey
:
copiedKey_0
];
}
_map
=
_mapTempDictionary
;
}
return
self
;
}
-
(
id
)
initWithMap
:(
nonnull
NSDictionary
*
)
map
{
if
(
self
=
[
super
init
])
{
...
...
test-suite/generated-src/objc/DBNestedCollection.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBNestedCollection
:
NSObject
-
(
nonnull
id
)
initWithNestedCollection
:(
nonnull
DBNestedCollection
*
)
nestedCollection
;
-
(
nonnull
id
)
initWithSetList
:(
nonnull
NSArray
*
)
setList
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
*
setList
;
...
...
test-suite/generated-src/objc/DBNestedCollection.mm
View file @
435e88ca
...
...
@@ -6,26 +6,6 @@
@implementation
DBNestedCollection
-
(
id
)
initWithNestedCollection
:(
DBNestedCollection
*
)
nestedCollection
{
if
(
self
=
[
super
init
])
{
NSMutableArray
*
_setListTempArray
=
[
NSMutableArray
arrayWithCapacity
:[
nestedCollection
.
setList
count
]];
for
(
NSSet
*
currentValue_0
in
nestedCollection
.
setList
)
{
id
copiedValue_0
;
NSMutableSet
*
copiedValue_0TempSet
=
[
NSMutableSet
setWithCapacity
:[
currentValue_0
count
]];
for
(
NSString
*
currentValue_1
in
currentValue_0
)
{
id
copiedValue_1
;
copiedValue_1
=
[
currentValue_1
copy
];
[
copiedValue_0TempSet
addObject
:
copiedValue_1
];
}
copiedValue_0
=
copiedValue_0TempSet
;
[
_setListTempArray
addObject
:
copiedValue_0
];
}
_setList
=
_setListTempArray
;
}
return
self
;
}
-
(
id
)
initWithSetList
:(
nonnull
NSArray
*
)
setList
{
if
(
self
=
[
super
init
])
{
...
...
test-suite/generated-src/objc/DBPrimitiveList.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBPrimitiveList
:
NSObject
-
(
nonnull
id
)
initWithPrimitiveList
:(
nonnull
DBPrimitiveList
*
)
primitiveList
;
-
(
nonnull
id
)
initWithList
:(
nonnull
NSArray
*
)
list
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSArray
*
list
;
...
...
test-suite/generated-src/objc/DBPrimitiveList.mm
View file @
435e88ca
...
...
@@ -6,20 +6,6 @@
@implementation
DBPrimitiveList
-
(
id
)
initWithPrimitiveList
:(
DBPrimitiveList
*
)
primitiveList
{
if
(
self
=
[
super
init
])
{
NSMutableArray
*
_listTempArray
=
[
NSMutableArray
arrayWithCapacity
:[
primitiveList
.
list
count
]];
for
(
NSNumber
*
currentValue_0
in
primitiveList
.
list
)
{
id
copiedValue_0
;
copiedValue_0
=
currentValue_0
;
[
_listTempArray
addObject
:
copiedValue_0
];
}
_list
=
_listTempArray
;
}
return
self
;
}
-
(
id
)
initWithList
:(
nonnull
NSArray
*
)
list
{
if
(
self
=
[
super
init
])
{
...
...
test-suite/generated-src/objc/DBRecordWithDerivings.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBRecordWithDerivings
:
NSObject
-
(
nonnull
id
)
initWithRecordWithDerivings
:(
nonnull
DBRecordWithDerivings
*
)
recordWithDerivings
;
-
(
nonnull
id
)
initWithKey1
:(
int32_t
)
key1
key2
:(
nonnull
NSString
*
)
key2
;
...
...
test-suite/generated-src/objc/DBRecordWithDerivings.mm
View file @
435e88ca
...
...
@@ -6,15 +6,6 @@
@implementation
DBRecordWithDerivings
-
(
id
)
initWithRecordWithDerivings
:(
DBRecordWithDerivings
*
)
recordWithDerivings
{
if
(
self
=
[
super
init
])
{
_key1
=
recordWithDerivings
.
key1
;
_key2
=
[
recordWithDerivings
.
key2
copy
];
}
return
self
;
}
-
(
id
)
initWithKey1
:(
int32_t
)
key1
key2
:(
nonnull
NSString
*
)
key2
{
...
...
test-suite/generated-src/objc/DBRecordWithNestedDerivings.h
View file @
435e88ca
...
...
@@ -5,7 +5,6 @@
#import <Foundation/Foundation.h>
@interface
DBRecordWithNestedDerivings
:
NSObject
-
(
nonnull
id
)
initWithRecordWithNestedDerivings
:(
nonnull
DBRecordWithNestedDerivings
*
)
recordWithNestedDerivings
;
-
(
nonnull
id
)
initWithKey
:(
int32_t
)
key
rec
:(
nonnull
DBRecordWithDerivings
*
)
rec
;
...
...
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
View file @
435e88ca
...
...
@@ -6,15 +6,6 @@
@implementation
DBRecordWithNestedDerivings
-
(
id
)
initWithRecordWithNestedDerivings
:(
DBRecordWithNestedDerivings
*
)
recordWithNestedDerivings
{
if
(
self
=
[
super
init
])
{
_key
=
recordWithNestedDerivings
.
key
;
_rec
=
[[
DBRecordWithDerivings
alloc
]
initWithRecordWithDerivings
:
recordWithNestedDerivings
.
rec
];
}
return
self
;
}
-
(
id
)
initWithKey
:(
int32_t
)
key
rec
:(
nonnull
DBRecordWithDerivings
*
)
rec
{
...
...
test-suite/generated-src/objc/DBSetRecord.h
View file @
435e88ca
...
...
@@ -4,7 +4,6 @@
#import <Foundation/Foundation.h>
@interface
DBSetRecord
:
NSObject
-
(
nonnull
id
)
initWithSetRecord
:(
nonnull
DBSetRecord
*
)
setRecord
;
-
(
nonnull
id
)
initWithSet
:(
nonnull
NSSet
*
)
set
;
@property
(
nonatomic
,
readonly
,
nonnull
)
NSSet
*
set
;
...
...
test-suite/generated-src/objc/DBSetRecord.mm
View file @
435e88ca
...
...
@@ -6,20 +6,6 @@
@implementation
DBSetRecord
-
(
id
)
initWithSetRecord
:(
DBSetRecord
*
)
setRecord
{
if
(
self
=
[
super
init
])
{
NSMutableSet
*
_setTempSet
=
[
NSMutableSet
setWithCapacity
:[
setRecord
.
set
count
]];
for
(
NSString
*
currentValue_0
in
setRecord
.
set
)
{
id
copiedValue_0
;
copiedValue_0
=
[
currentValue_0
copy
];
[
_setTempSet
addObject
:
copiedValue_0
];
}
_set
=
_setTempSet
;
}
return
self
;
}
-
(
id
)
initWithSet
:(
nonnull
NSSet
*
)
set
{
if
(
self
=
[
super
init
])
{
...
...
test-suite/handwritten-src/objc/tests/DBPrimitiveListTests.mm
View file @
435e88ca
...
...
@@ -26,13 +26,6 @@ static DBPrimitiveList *objcPrimitiveList = [[DBPrimitiveList alloc] initWithLis
[
super
tearDown
];
}
-
(
void
)
testObjcCopyConstructor
{
DBPrimitiveList
*
copy
=
[[
DBPrimitiveList
alloc
]
initWithPrimitiveList
:
objcPrimitiveList
];
XCTAssertNotEqual
(
copy
.
list
,
objcPrimitiveList
.
list
,
@"The two NSArrays should not be the same object."
);
XCTAssertEqualObjects
(
copy
.
list
,
objcPrimitiveList
.
list
,
@"The two NSArrays should have the same content."
);
}
-
(
void
)
testObjcToCppConverter
{
PrimitiveList
convert
=
djinni_generated
::
PrimitiveList
::
toCpp
(
objcPrimitiveList
);
...
...
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