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
d5dd5294
Commit
d5dd5294
authored
Mar 22, 2015
by
Miro Knejp
Committed by
Jacob Potter
May 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactored record code generation to utilize translation types like JNI does
parent
30e73aeb
Changes
68
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
68 changed files
with
1264 additions
and
934 deletions
+1264
-934
example/generated-src/objc/TXSItemList+Private.h
example/generated-src/objc/TXSItemList+Private.h
+16
-5
example/generated-src/objc/TXSItemList+Private.mm
example/generated-src/objc/TXSItemList+Private.mm
+40
-0
example/generated-src/objc/TXSItemList.h
example/generated-src/objc/TXSItemList.h
+0
-1
example/generated-src/objc/TXSItemList.m
example/generated-src/objc/TXSItemList.m
+32
-0
example/generated-src/objc/TXSItemList.mm
example/generated-src/objc/TXSItemList.mm
+0
-64
example/generated-src/objc/TXSSortItems.h
example/generated-src/objc/TXSSortItems.h
+1
-1
example/generated-src/objc/TXSSortItems.mm
example/generated-src/objc/TXSSortItems.mm
+1
-1
example/generated-src/objc/TXSTextboxListener.h
example/generated-src/objc/TXSTextboxListener.h
+1
-1
example/generated-src/objc/TXSTextboxListener.mm
example/generated-src/objc/TXSTextboxListener.mm
+1
-1
src/source/ObjcGenerator.scala
src/source/ObjcGenerator.scala
+204
-11
src/source/ObjcppGenerator.scala
src/source/ObjcppGenerator.scala
+54
-215
test-suite/generated-src/objc/DBAssortedIntegers+Private.h
test-suite/generated-src/objc/DBAssortedIntegers+Private.h
+16
-5
test-suite/generated-src/objc/DBAssortedIntegers+Private.mm
test-suite/generated-src/objc/DBAssortedIntegers+Private.mm
+93
-0
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
+1
-74
test-suite/generated-src/objc/DBClientInterface.h
test-suite/generated-src/objc/DBClientInterface.h
+1
-1
test-suite/generated-src/objc/DBClientInterface.mm
test-suite/generated-src/objc/DBClientInterface.mm
+1
-1
test-suite/generated-src/objc/DBClientReturnedRecord+Private.h
...suite/generated-src/objc/DBClientReturnedRecord+Private.h
+16
-5
test-suite/generated-src/objc/DBClientReturnedRecord+Private.mm
...uite/generated-src/objc/DBClientReturnedRecord+Private.mm
+33
-0
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
+1
-24
test-suite/generated-src/objc/DBConstants+Private.h
test-suite/generated-src/objc/DBConstants+Private.h
+16
-5
test-suite/generated-src/objc/DBConstants+Private.mm
test-suite/generated-src/objc/DBConstants+Private.mm
+34
-0
test-suite/generated-src/objc/DBConstants.h
test-suite/generated-src/objc/DBConstants.h
+11
-11
test-suite/generated-src/objc/DBConstants.mm
test-suite/generated-src/objc/DBConstants.mm
+1
-25
test-suite/generated-src/objc/DBDateRecord+Private.h
test-suite/generated-src/objc/DBDateRecord+Private.h
+16
-5
test-suite/generated-src/objc/DBDateRecord+Private.mm
test-suite/generated-src/objc/DBDateRecord+Private.mm
+30
-0
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
+1
-22
test-suite/generated-src/objc/DBMapDateRecord+Private.h
test-suite/generated-src/objc/DBMapDateRecord+Private.h
+16
-5
test-suite/generated-src/objc/DBMapDateRecord+Private.mm
test-suite/generated-src/objc/DBMapDateRecord+Private.mm
+45
-0
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
+8
-47
test-suite/generated-src/objc/DBMapListRecord+Private.h
test-suite/generated-src/objc/DBMapListRecord+Private.h
+16
-5
test-suite/generated-src/objc/DBMapListRecord+Private.mm
test-suite/generated-src/objc/DBMapListRecord+Private.mm
+55
-0
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
+12
-62
test-suite/generated-src/objc/DBMapRecord+Private.h
test-suite/generated-src/objc/DBMapRecord+Private.h
+16
-5
test-suite/generated-src/objc/DBMapRecord+Private.mm
test-suite/generated-src/objc/DBMapRecord+Private.mm
+44
-0
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
+8
-46
test-suite/generated-src/objc/DBNestedCollection+Private.h
test-suite/generated-src/objc/DBNestedCollection+Private.h
+16
-5
test-suite/generated-src/objc/DBNestedCollection+Private.mm
test-suite/generated-src/objc/DBNestedCollection+Private.mm
+50
-0
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
+9
-52
test-suite/generated-src/objc/DBPrimitiveList+Private.h
test-suite/generated-src/objc/DBPrimitiveList+Private.h
+16
-5
test-suite/generated-src/objc/DBPrimitiveList+Private.mm
test-suite/generated-src/objc/DBPrimitiveList+Private.mm
+40
-0
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
+5
-37
test-suite/generated-src/objc/DBRecordWithDerivings+Private.h
...-suite/generated-src/objc/DBRecordWithDerivings+Private.h
+16
-5
test-suite/generated-src/objc/DBRecordWithDerivings+Private.mm
...suite/generated-src/objc/DBRecordWithDerivings+Private.mm
+33
-0
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
+1
-24
test-suite/generated-src/objc/DBRecordWithNestedDerivings+Private.h
.../generated-src/objc/DBRecordWithNestedDerivings+Private.h
+16
-5
test-suite/generated-src/objc/DBRecordWithNestedDerivings+Private.mm
...generated-src/objc/DBRecordWithNestedDerivings+Private.mm
+34
-0
test-suite/generated-src/objc/DBRecordWithNestedDerivings.h
test-suite/generated-src/objc/DBRecordWithNestedDerivings.h
+1
-2
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
+1
-25
test-suite/generated-src/objc/DBSetRecord+Private.h
test-suite/generated-src/objc/DBSetRecord+Private.h
+16
-5
test-suite/generated-src/objc/DBSetRecord+Private.mm
test-suite/generated-src/objc/DBSetRecord+Private.mm
+39
-0
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
+5
-36
test-suite/generated-src/objc/DBTestHelpers.h
test-suite/generated-src/objc/DBTestHelpers.h
+5
-5
test-suite/generated-src/objc/DBTestHelpers.mm
test-suite/generated-src/objc/DBTestHelpers.mm
+10
-10
test-suite/handwritten-src/objc/tests/DBMapRecordTests.mm
test-suite/handwritten-src/objc/tests/DBMapRecordTests.mm
+8
-6
test-suite/handwritten-src/objc/tests/DBNestedCollectionTests.mm
...ite/handwritten-src/objc/tests/DBNestedCollectionTests.mm
+2
-2
test-suite/handwritten-src/objc/tests/DBPrimitiveListTests.mm
...-suite/handwritten-src/objc/tests/DBPrimitiveListTests.mm
+2
-2
test-suite/handwritten-src/objc/tests/DBSetRecordTests.mm
test-suite/handwritten-src/objc/tests/DBSetRecordTests.mm
+2
-2
test-suite/objc/DjinniObjcTest.xcodeproj/project.pbxproj
test-suite/objc/DjinniObjcTest.xcodeproj/project.pbxproj
+96
-48
No files found.
example/generated-src/objc/TXSItemList+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "TXSItemList.h"
#import "TXSItemList.h"
#include "item_list.hpp"
#include "item_list.hpp"
#import <Foundation/Foundation.h>
@interface
TXSItemList
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppItemList
:(
const
::
textsort
::
ItemList
&
)
itemList
;
@
class
TXSItemList
;
-
(
::
textsort
::
ItemList
)
cppItemList
;
@end
namespace
djinni_generated
{
struct
ItemList
{
using
CppType
=
::
textsort
::
ItemList
;
using
ObjcType
=
TXSItemList
*
;
using
Boxed
=
ItemList
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
example/generated-src/objc/TXSItemList+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSItemList+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
ItemList
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
vector
<
std
::
string
>
items
;
items
.
reserve
([
obj
.
items
count
]);
for
(
NSString
*
objcValue_0
in
obj
.
items
)
{
std
::
string
cppValue_0
=
::
djinni
::
String
::
toCpp
(
objcValue_0
);
items
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
textsort
::
ItemList
(
items
);
}
auto
ItemList
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
std
::
vector
<
NSString
*>
itemsTempVector
;
itemsTempVector
.
reserve
(
cpp
.
items
.
size
());
for
(
const
auto
&
cppValue_0
:
cpp
.
items
)
{
NSString
*
objcValue_0
=
::
djinni
::
String
::
fromCpp
(
cppValue_0
);
itemsTempVector
.
push_back
(
objcValue_0
);
}
NSArray
*
items
=
[
NSArray
arrayWithObjects
:
&
itemsTempVector
[
0
]
count
:
itemsTempVector
.
size
()];
return
[[
TXSItemList
alloc
]
initWithItems:
items
];
}
}
// namespace djinni_generated
example/generated-src/objc/TXSItemList.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
TXSItemList
:
NSObject
@interface
TXSItemList
:
NSObject
-
(
id
)
initWithItemList
:(
TXSItemList
*
)
itemList
;
-
(
id
)
initWithItemList
:(
TXSItemList
*
)
itemList
;
-
(
id
)
initWithItems
:(
NSArray
*
)
items
;
-
(
id
)
initWithItems
:(
NSArray
*
)
items
;
...
...
example/generated-src/objc/TXSItemList.m
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSItemList.h"
@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
:(
NSArray
*
)
items
{
if
(
self
=
[
super
init
])
{
_items
=
items
;
}
return
self
;
}
@end
example/generated-src/objc/TXSItemList.mm
deleted
100644 → 0
View file @
30e73aeb
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSItemList+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
TXSItemList
-
(
id
)
initWithItemList
:(
TXSItemList
*
)
itemList
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_itemsTempVector
;
_itemsTempVector
.
reserve
([
itemList
.
items
count
]);
for
(
NSString
*
currentValue_0
in
itemList
.
items
)
{
NSString
*
copiedValue_0
;
copiedValue_0
=
[
currentValue_0
copy
];
_itemsTempVector
.
push_back
(
copiedValue_0
);
}
_items
=
[
NSArray
arrayWithObjects
:
&
_itemsTempVector
[
0
]
count
:
_itemsTempVector
.
size
()];
}
return
self
;
}
-
(
id
)
initWithItems
:(
NSArray
*
)
items
{
if
(
self
=
[
super
init
])
{
_items
=
items
;
}
return
self
;
}
-
(
id
)
initWithCppItemList
:(
const
::
textsort
::
ItemList
&
)
itemList
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_itemsTempVector
;
_itemsTempVector
.
reserve
(
itemList
.
items
.
size
());
for
(
const
auto
&
cppValue_0
:
itemList
.
items
)
{
NSString
*
objcValue_0
=
::
djinni
::
String
::
fromCpp
(
cppValue_0
);
_itemsTempVector
.
push_back
(
objcValue_0
);
}
_items
=
[
NSArray
arrayWithObjects
:
&
_itemsTempVector
[
0
]
count
:
_itemsTempVector
.
size
()];
}
return
self
;
}
-
(
::
textsort
::
ItemList
)
cppItemList
{
std
::
vector
<
std
::
string
>
items
;
items
.
reserve
([
_items
count
]);
for
(
NSString
*
objcValue_0
in
_items
)
{
std
::
string
cppValue_0
=
::
djinni
::
String
::
toCpp
(
objcValue_0
);
items
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
textsort
::
ItemList
(
std
::
move
(
items
));
}
@end
example/generated-src/objc/TXSSortItems.h
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
// This file generated by Djinni from example.djinni
#import "TXSItemList.h"
#import "TXSSortOrder.h"
#import "TXSSortOrder.h"
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@class
TXSItemList
;
@class
TXSSortItems
;
@class
TXSSortItems
;
@protocol
TXSTextboxListener
;
@protocol
TXSTextboxListener
;
...
...
example/generated-src/objc/TXSSortItems.mm
View file @
d5dd5294
...
@@ -54,7 +54,7 @@ auto SortItems::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -54,7 +54,7 @@ auto SortItems::fromCpp(const CppType& cpp) -> ObjcType
-
(
void
)
sort
:(
TXSSortOrder
)
order
items
:(
TXSItemList
*
)
items
{
-
(
void
)
sort
:(
TXSSortOrder
)
order
items
:(
TXSItemList
*
)
items
{
try
{
try
{
::
textsort
::
sort_order
cppOrder
=
::
djinni
::
Enum
<::
textsort
::
sort_order
,
TXSSortOrder
>::
toCpp
(
order
);
::
textsort
::
sort_order
cppOrder
=
::
djinni
::
Enum
<::
textsort
::
sort_order
,
TXSSortOrder
>::
toCpp
(
order
);
::
textsort
::
ItemList
cppItems
=
std
::
move
([
items
cppItemList
]
);
::
textsort
::
ItemList
cppItems
=
::
djinni_generated
::
ItemList
::
toCpp
(
items
);
_cppRef
.
get
()
->
sort
(
std
::
move
(
cppOrder
),
std
::
move
(
cppItems
));
_cppRef
.
get
()
->
sort
(
std
::
move
(
cppOrder
),
std
::
move
(
cppItems
));
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
...
...
example/generated-src/objc/TXSTextboxListener.h
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
// This file generated by Djinni from example.djinni
#import "TXSItemList.h"
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@class
TXSItemList
;
@protocol
TXSTextboxListener
@protocol
TXSTextboxListener
...
...
example/generated-src/objc/TXSTextboxListener.mm
View file @
d5dd5294
...
@@ -40,7 +40,7 @@ auto TextboxListener::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -40,7 +40,7 @@ auto TextboxListener::fromCpp(const CppType& cpp) -> ObjcType
void
ObjcProxy
::
update
(
const
::
textsort
::
ItemList
&
items
)
void
ObjcProxy
::
update
(
const
::
textsort
::
ItemList
&
items
)
{
{
@autoreleasepool
{
@autoreleasepool
{
TXSItemList
*
cpp_items
=
[[
TXSItemList
alloc
]
initWithCppItemList
:
items
]
;
TXSItemList
*
cpp_items
=
::
djinni_generated
::
ItemList
::
fromCpp
(
items
)
;
[
Handle
:
:
get
()
update
:
cpp_items
];
[
Handle
:
:
get
()
update
:
cpp_items
];
}
}
}
}
src/source/ObjcGenerator.scala
View file @
d5dd5294
This diff is collapsed.
Click to expand it.
src/source/ObjcppGenerator.scala
View file @
d5dd5294
This diff is collapsed.
Click to expand it.
test-suite/generated-src/objc/DBAssortedIntegers+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBAssortedIntegers.h"
#import "DBAssortedIntegers.h"
#include "assorted_integers.hpp"
#include "assorted_integers.hpp"
#import <Foundation/Foundation.h>
@interface
DBAssortedIntegers
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppAssortedIntegers
:(
const
::
AssortedIntegers
&
)
assortedIntegers
;
@
class
DBAssortedIntegers
;
-
(
::
AssortedIntegers
)
cppAssortedIntegers
;
@end
namespace
djinni_generated
{
struct
AssortedIntegers
{
using
CppType
=
::
AssortedIntegers
;
using
ObjcType
=
DBAssortedIntegers
*
;
using
Boxed
=
AssortedIntegers
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBAssortedIntegers+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni
#import "DBAssortedIntegers+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
AssortedIntegers
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
int8_t
eight
=
::
djinni
::
I8
::
toCpp
(
obj
.
eight
);
int16_t
sixteen
=
::
djinni
::
I16
::
toCpp
(
obj
.
sixteen
);
int32_t
thirtytwo
=
::
djinni
::
I32
::
toCpp
(
obj
.
thirtytwo
);
int64_t
sixtyfour
=
::
djinni
::
I64
::
toCpp
(
obj
.
sixtyfour
);
std
::
experimental
::
optional
<
int8_t
>
o_eight
;
if
(
obj
.
oEight
!=
nil
)
{
int8_t
optValue
=
::
djinni
::
I8
::
Boxed
::
toCpp
(
obj
.
oEight
);
o_eight
=
optValue
;
}
std
::
experimental
::
optional
<
int16_t
>
o_sixteen
;
if
(
obj
.
oSixteen
!=
nil
)
{
int16_t
optValue
=
::
djinni
::
I16
::
Boxed
::
toCpp
(
obj
.
oSixteen
);
o_sixteen
=
optValue
;
}
std
::
experimental
::
optional
<
int32_t
>
o_thirtytwo
;
if
(
obj
.
oThirtytwo
!=
nil
)
{
int32_t
optValue
=
::
djinni
::
I32
::
Boxed
::
toCpp
(
obj
.
oThirtytwo
);
o_thirtytwo
=
optValue
;
}
std
::
experimental
::
optional
<
int64_t
>
o_sixtyfour
;
if
(
obj
.
oSixtyfour
!=
nil
)
{
int64_t
optValue
=
::
djinni
::
I64
::
Boxed
::
toCpp
(
obj
.
oSixtyfour
);
o_sixtyfour
=
optValue
;
}
return
::
AssortedIntegers
(
eight
,
sixteen
,
thirtytwo
,
sixtyfour
,
o_eight
,
o_sixteen
,
o_thirtytwo
,
o_sixtyfour
);
}
auto
AssortedIntegers
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
int8_t
eight
=
::
djinni
::
I8
::
fromCpp
(
cpp
.
eight
);
int16_t
sixteen
=
::
djinni
::
I16
::
fromCpp
(
cpp
.
sixteen
);
int32_t
thirtytwo
=
::
djinni
::
I32
::
fromCpp
(
cpp
.
thirtytwo
);
int64_t
sixtyfour
=
::
djinni
::
I64
::
fromCpp
(
cpp
.
sixtyfour
);
NSNumber
*
oEight
;
if
(
cpp
.
o_eight
)
{
oEight
=
::
djinni
::
I8
::
Boxed
::
fromCpp
((
*
(
cpp
.
o_eight
)));
}
else
{
oEight
=
nil
;
}
NSNumber
*
oSixteen
;
if
(
cpp
.
o_sixteen
)
{
oSixteen
=
::
djinni
::
I16
::
Boxed
::
fromCpp
((
*
(
cpp
.
o_sixteen
)));
}
else
{
oSixteen
=
nil
;
}
NSNumber
*
oThirtytwo
;
if
(
cpp
.
o_thirtytwo
)
{
oThirtytwo
=
::
djinni
::
I32
::
Boxed
::
fromCpp
((
*
(
cpp
.
o_thirtytwo
)));
}
else
{
oThirtytwo
=
nil
;
}
NSNumber
*
oSixtyfour
;
if
(
cpp
.
o_sixtyfour
)
{
oSixtyfour
=
::
djinni
::
I64
::
Boxed
::
fromCpp
((
*
(
cpp
.
o_sixtyfour
)));
}
else
{
oSixtyfour
=
nil
;
}
return
[[
DBAssortedIntegers
alloc
]
initWithEight:
eight
sixteen:
sixteen
thirtytwo:
thirtytwo
sixtyfour:
sixtyfour
oEight:
oEight
oSixteen:
oSixteen
oThirtytwo:
oThirtytwo
oSixtyfour:
oSixtyfour
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBAssortedIntegers.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBAssortedIntegers
:
NSObject
@interface
DBAssortedIntegers
:
NSObject
-
(
id
)
initWithAssortedIntegers
:(
DBAssortedIntegers
*
)
assortedIntegers
;
-
(
id
)
initWithAssortedIntegers
:(
DBAssortedIntegers
*
)
assortedIntegers
;
-
(
id
)
initWithEight
:(
int8_t
)
eight
sixteen
:(
int16_t
)
sixteen
thirtytwo
:(
int32_t
)
thirtytwo
sixtyfour
:(
int64_t
)
sixtyfour
oEight
:(
NSNumber
*
)
oEight
oSixteen
:(
NSNumber
*
)
oSixteen
oThirtytwo
:(
NSNumber
*
)
oThirtytwo
oSixtyfour
:(
NSNumber
*
)
oSixtyfour
;
-
(
id
)
initWithEight
:(
int8_t
)
eight
sixteen
:(
int16_t
)
sixteen
thirtytwo
:(
int32_t
)
thirtytwo
sixtyfour
:(
int64_t
)
sixtyfour
oEight
:(
NSNumber
*
)
oEight
oSixteen
:(
NSNumber
*
)
oSixteen
oThirtytwo
:(
NSNumber
*
)
oThirtytwo
oSixtyfour
:(
NSNumber
*
)
oSixtyfour
;
...
...
test-suite/generated-src/objc/DBAssortedIntegers.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni
// This file generated by Djinni from inttypes.djinni
#import "DBAssortedIntegers+Private.h"
#import "DBAssortedIntegers.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBAssortedIntegers
@implementation
DBAssortedIntegers
...
@@ -58,73 +52,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -58,73 +52,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppAssortedIntegers
:(
const
::
AssortedIntegers
&
)
assortedIntegers
{
if
(
self
=
[
super
init
])
{
_eight
=
::
djinni
::
I8
::
fromCpp
(
assortedIntegers
.
eight
);
_sixteen
=
::
djinni
::
I16
::
fromCpp
(
assortedIntegers
.
sixteen
);
_thirtytwo
=
::
djinni
::
I32
::
fromCpp
(
assortedIntegers
.
thirtytwo
);
_sixtyfour
=
::
djinni
::
I64
::
fromCpp
(
assortedIntegers
.
sixtyfour
);
if
(
assortedIntegers
.
o_eight
)
{
_oEight
=
::
djinni
::
I8
::
Boxed
::
fromCpp
((
*
(
assortedIntegers
.
o_eight
)));
}
else
{
_oEight
=
nil
;
}
if
(
assortedIntegers
.
o_sixteen
)
{
_oSixteen
=
::
djinni
::
I16
::
Boxed
::
fromCpp
((
*
(
assortedIntegers
.
o_sixteen
)));
}
else
{
_oSixteen
=
nil
;
}
if
(
assortedIntegers
.
o_thirtytwo
)
{
_oThirtytwo
=
::
djinni
::
I32
::
Boxed
::
fromCpp
((
*
(
assortedIntegers
.
o_thirtytwo
)));
}
else
{
_oThirtytwo
=
nil
;
}
if
(
assortedIntegers
.
o_sixtyfour
)
{
_oSixtyfour
=
::
djinni
::
I64
::
Boxed
::
fromCpp
((
*
(
assortedIntegers
.
o_sixtyfour
)));
}
else
{
_oSixtyfour
=
nil
;
}
}
return
self
;
}
-
(
::
AssortedIntegers
)
cppAssortedIntegers
{
int8_t
eight
=
::
djinni
::
I8
::
toCpp
(
_eight
);
int16_t
sixteen
=
::
djinni
::
I16
::
toCpp
(
_sixteen
);
int32_t
thirtytwo
=
::
djinni
::
I32
::
toCpp
(
_thirtytwo
);
int64_t
sixtyfour
=
::
djinni
::
I64
::
toCpp
(
_sixtyfour
);
std
::
experimental
::
optional
<
int8_t
>
oEight
;
if
(
_oEight
!=
nil
)
{
int8_t
optValue
=
::
djinni
::
I8
::
Boxed
::
toCpp
(
_oEight
);
oEight
=
optValue
;
}
std
::
experimental
::
optional
<
int16_t
>
oSixteen
;
if
(
_oSixteen
!=
nil
)
{
int16_t
optValue
=
::
djinni
::
I16
::
Boxed
::
toCpp
(
_oSixteen
);
oSixteen
=
optValue
;
}
std
::
experimental
::
optional
<
int32_t
>
oThirtytwo
;
if
(
_oThirtytwo
!=
nil
)
{
int32_t
optValue
=
::
djinni
::
I32
::
Boxed
::
toCpp
(
_oThirtytwo
);
oThirtytwo
=
optValue
;
}
std
::
experimental
::
optional
<
int64_t
>
oSixtyfour
;
if
(
_oSixtyfour
!=
nil
)
{
int64_t
optValue
=
::
djinni
::
I64
::
Boxed
::
toCpp
(
_oSixtyfour
);
oSixtyfour
=
optValue
;
}
return
::
AssortedIntegers
(
std
::
move
(
eight
),
std
::
move
(
sixteen
),
std
::
move
(
thirtytwo
),
std
::
move
(
sixtyfour
),
std
::
move
(
oEight
),
std
::
move
(
oSixteen
),
std
::
move
(
oThirtytwo
),
std
::
move
(
oSixtyfour
));
}
-
(
BOOL
)
isEqual
:(
id
)
other
-
(
BOOL
)
isEqual
:(
id
)
other
{
{
if
(
!
[
other
isKindOfClass
:[
DBAssortedIntegers
class
]])
{
if
(
!
[
other
isKindOfClass
:[
DBAssortedIntegers
class
]])
{
...
...
test-suite/generated-src/objc/DBClientInterface.h
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni
// This file generated by Djinni from client_interface.djinni
#import "DBClientReturnedRecord.h"
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@class
DBClientReturnedRecord
;
@protocol
DBClientInterface
@protocol
DBClientInterface
...
...
test-suite/generated-src/objc/DBClientInterface.mm
View file @
d5dd5294
...
@@ -44,7 +44,7 @@ auto ClientInterface::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -44,7 +44,7 @@ auto ClientInterface::fromCpp(const CppType& cpp) -> ObjcType
int64_t
cpp_record_id
=
::
djinni
::
I64
::
fromCpp
(
record_id
);
int64_t
cpp_record_id
=
::
djinni
::
I64
::
fromCpp
(
record_id
);
NSString
*
cpp_utf8string
=
::
djinni
::
String
::
fromCpp
(
utf8string
);
NSString
*
cpp_utf8string
=
::
djinni
::
String
::
fromCpp
(
utf8string
);
DBClientReturnedRecord
*
objcRet
=
[
Handle
:
:
get
()
getRecord
:
cpp_record_id
utf8string
:
cpp_utf8string
];
DBClientReturnedRecord
*
objcRet
=
[
Handle
:
:
get
()
getRecord
:
cpp_record_id
utf8string
:
cpp_utf8string
];
::
ClientReturnedRecord
cppRet
=
std
::
move
([
objcRet
cppClientReturnedRecord
]
);
::
ClientReturnedRecord
cppRet
=
::
djinni_generated
::
ClientReturnedRecord
::
toCpp
(
objcRet
);
return
cppRet
;
return
cppRet
;
}
}
}
}
test-suite/generated-src/objc/DBClientReturnedRecord+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBClientReturnedRecord.h"
#import "DBClientReturnedRecord.h"
#include "client_returned_record.hpp"
#include "client_returned_record.hpp"
#import <Foundation/Foundation.h>
@interface
DBClientReturnedRecord
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppClientReturnedRecord
:(
const
::
ClientReturnedRecord
&
)
clientReturnedRecord
;
@
class
DBClientReturnedRecord
;
-
(
::
ClientReturnedRecord
)
cppClientReturnedRecord
;
@end
namespace
djinni_generated
{
struct
ClientReturnedRecord
{
using
CppType
=
::
ClientReturnedRecord
;
using
ObjcType
=
DBClientReturnedRecord
*
;
using
Boxed
=
ClientReturnedRecord
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBClientReturnedRecord+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni
#import "DBClientReturnedRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
ClientReturnedRecord
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
int64_t
record_id
=
::
djinni
::
I64
::
toCpp
(
obj
.
recordId
);
std
::
string
content
=
::
djinni
::
String
::
toCpp
(
obj
.
content
);
return
::
ClientReturnedRecord
(
record_id
,
content
);
}
auto
ClientReturnedRecord
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
int64_t
recordId
=
::
djinni
::
I64
::
fromCpp
(
cpp
.
record_id
);
NSString
*
content
=
::
djinni
::
String
::
fromCpp
(
cpp
.
content
);
return
[[
DBClientReturnedRecord
alloc
]
initWithRecordId:
recordId
content:
content
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBClientReturnedRecord.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBClientReturnedRecord
:
NSObject
@interface
DBClientReturnedRecord
:
NSObject
-
(
id
)
initWithClientReturnedRecord
:(
DBClientReturnedRecord
*
)
clientReturnedRecord
;
-
(
id
)
initWithClientReturnedRecord
:(
DBClientReturnedRecord
*
)
clientReturnedRecord
;
-
(
id
)
initWithRecordId
:(
int64_t
)
recordId
content
:(
NSString
*
)
content
;
-
(
id
)
initWithRecordId
:(
int64_t
)
recordId
content
:(
NSString
*
)
content
;
...
...
test-suite/generated-src/objc/DBClientReturnedRecord.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni
// This file generated by Djinni from client_interface.djinni
#import "DBClientReturnedRecord+Private.h"
#import "DBClientReturnedRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBClientReturnedRecord
@implementation
DBClientReturnedRecord
...
@@ -30,22 +24,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -30,22 +24,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppClientReturnedRecord
:(
const
::
ClientReturnedRecord
&
)
clientReturnedRecord
{
if
(
self
=
[
super
init
])
{
_recordId
=
::
djinni
::
I64
::
fromCpp
(
clientReturnedRecord
.
record_id
);
_content
=
::
djinni
::
String
::
fromCpp
(
clientReturnedRecord
.
content
);
}
return
self
;
}
-
(
::
ClientReturnedRecord
)
cppClientReturnedRecord
{
int64_t
recordId
=
::
djinni
::
I64
::
toCpp
(
_recordId
);
std
::
string
content
=
::
djinni
::
String
::
toCpp
(
_content
);
return
::
ClientReturnedRecord
(
std
::
move
(
recordId
),
std
::
move
(
content
));
}
@end
@end
test-suite/generated-src/objc/DBConstants+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBConstants.h"
#import "DBConstants.h"
#include "constants.hpp"
#include "constants.hpp"
#import <Foundation/Foundation.h>
@interface
DBConstants
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppConstants
:(
const
::
Constants
&
)
constants
;
@
class
DBConstants
;
-
(
::
Constants
)
cppConstants
;
@end
namespace
djinni_generated
{
struct
Constants
{
using
CppType
=
::
Constants
;
using
ObjcType
=
DBConstants
*
;
using
Boxed
=
Constants
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBConstants+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from constants.djinni
#import "DBConstants+Private.h"
#import "DBConstants+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
Constants
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
int32_t
some_integer
=
::
djinni
::
I32
::
toCpp
(
obj
.
someInteger
);
std
::
string
some_string
=
::
djinni
::
String
::
toCpp
(
obj
.
someString
);
return
::
Constants
(
some_integer
,
some_string
);
}
auto
Constants
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
int32_t
someInteger
=
::
djinni
::
I32
::
fromCpp
(
cpp
.
some_integer
);
NSString
*
someString
=
::
djinni
::
String
::
fromCpp
(
cpp
.
some_string
);
return
[[
DBConstants
alloc
]
initWithSomeInteger:
someInteger
someString:
someString
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBConstants.h
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from constants.djinni
// This file generated by Djinni from constants.djinni
#import "DBConstants.h"
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@class
DBConstants
;
extern
const
BOOL
DBConstantsBoolConstant
;
extern
const
int8_t
DBConstantsI8Constant
;
extern
const
int16_t
DBConstantsI16Constant
;
extern
const
int32_t
DBConstantsI32Constant
;
extern
const
int64_t
DBConstantsI64Constant
;
extern
const
double
DBConstantsF64Constant
;
extern
NSString
*
const
DBConstantsStringConstant
;
extern
NSNumber
*
const
DBConstantsOptionalIntegerConstant
;
extern
DBConstants
*
const
DBConstantsObjectConstant
;
@interface
DBConstants
:
NSObject
@interface
DBConstants
:
NSObject
-
(
id
)
initWithConstants
:(
DBConstants
*
)
constants
;
-
(
id
)
initWithConstants
:(
DBConstants
*
)
constants
;
...
@@ -23,3 +13,13 @@ extern DBConstants * const DBConstantsObjectConstant;
...
@@ -23,3 +13,13 @@ extern DBConstants * const DBConstantsObjectConstant;
@property
(
nonatomic
,
readonly
)
NSString
*
someString
;
@property
(
nonatomic
,
readonly
)
NSString
*
someString
;
@end
@end
extern
const
BOOL
DBConstantsBoolConstant
;
extern
const
int8_t
DBConstantsI8Constant
;
extern
const
int16_t
DBConstantsI16Constant
;
extern
const
int32_t
DBConstantsI32Constant
;
extern
const
int64_t
DBConstantsI64Constant
;
extern
const
double
DBConstantsF64Constant
;
extern
NSString
*
const
DBConstantsStringConstant
;
extern
NSNumber
*
const
DBConstantsOptionalIntegerConstant
;
extern
DBConstants
*
const
DBConstantsObjectConstant
;
test-suite/generated-src/objc/DBConstants.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from constants.djinni
// This file generated by Djinni from constants.djinni
#import "DBConstants+Private.h"
#import "DBConstants.h"
#import "DBConstants+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
#pragma clang diagnostic push
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wunused-variable"
...
@@ -32,7 +26,6 @@ DBConstants * const DBConstantsObjectConstant = [[DBConstants alloc] initWithSom
...
@@ -32,7 +26,6 @@ DBConstants * const DBConstantsObjectConstant = [[DBConstants alloc] initWithSom
someString:
DBConstantsStringConstant
];
someString:
DBConstantsStringConstant
];
#pragma clang diagnostic pop
#pragma clang diagnostic pop
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBConstants
@implementation
DBConstants
...
@@ -54,22 +47,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -54,22 +47,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppConstants
:(
const
::
Constants
&
)
constants
{
if
(
self
=
[
super
init
])
{
_someInteger
=
::
djinni
::
I32
::
fromCpp
(
constants
.
some_integer
);
_someString
=
::
djinni
::
String
::
fromCpp
(
constants
.
some_string
);
}
return
self
;
}
-
(
::
Constants
)
cppConstants
{
int32_t
someInteger
=
::
djinni
::
I32
::
toCpp
(
_someInteger
);
std
::
string
someString
=
::
djinni
::
String
::
toCpp
(
_someString
);
return
::
Constants
(
std
::
move
(
someInteger
),
std
::
move
(
someString
));
}
@end
@end
test-suite/generated-src/objc/DBDateRecord+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBDateRecord.h"
#import "DBDateRecord.h"
#include "date_record.hpp"
#include "date_record.hpp"
#import <Foundation/Foundation.h>
@interface
DBDateRecord
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppDateRecord
:(
const
::
DateRecord
&
)
dateRecord
;
@
class
DBDateRecord
;
-
(
::
DateRecord
)
cppDateRecord
;
@end
namespace
djinni_generated
{
struct
DateRecord
{
using
CppType
=
::
DateRecord
;
using
ObjcType
=
DBDateRecord
*
;
using
Boxed
=
DateRecord
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBDateRecord+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni
#import "DBDateRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
DateRecord
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
chrono
::
system_clock
::
time_point
created_at
=
::
djinni
::
convert_date
([
obj
.
createdAt
timeIntervalSince1970
]);
return
::
DateRecord
(
created_at
);
}
auto
DateRecord
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
NSDate
*
createdAt
=
[
NSDate
dateWithTimeIntervalSince1970
:
std
:
:
chrono
::
duration_cast
<
std
::
chrono
::
duration
<
double
>>
(
cpp
.
created_at
.
time_since_epoch
()).
count
()];
return
[[
DBDateRecord
alloc
]
initWithCreatedAt:
createdAt
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBDateRecord.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBDateRecord
:
NSObject
@interface
DBDateRecord
:
NSObject
-
(
id
)
initWithDateRecord
:(
DBDateRecord
*
)
dateRecord
;
-
(
id
)
initWithDateRecord
:(
DBDateRecord
*
)
dateRecord
;
-
(
id
)
initWithCreatedAt
:(
NSDate
*
)
createdAt
;
-
(
id
)
initWithCreatedAt
:(
NSDate
*
)
createdAt
;
...
...
test-suite/generated-src/objc/DBDateRecord.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni
// This file generated by Djinni from date.djinni
#import "DBDateRecord+Private.h"
#import "DBDateRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBDateRecord
@implementation
DBDateRecord
...
@@ -28,20 +22,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -28,20 +22,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppDateRecord
:(
const
::
DateRecord
&
)
dateRecord
{
if
(
self
=
[
super
init
])
{
_createdAt
=
[
NSDate
dateWithTimeIntervalSince1970
:
std
:
:
chrono
::
duration_cast
<
std
::
chrono
::
duration
<
double
>>
(
dateRecord
.
created_at
.
time_since_epoch
()).
count
()];
}
return
self
;
}
-
(
::
DateRecord
)
cppDateRecord
{
std
::
chrono
::
system_clock
::
time_point
createdAt
=
::
djinni
::
convert_date
([
_createdAt
timeIntervalSince1970
]);
return
::
DateRecord
(
std
::
move
(
createdAt
));
}
@end
@end
test-suite/generated-src/objc/DBMapDateRecord+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBMapDateRecord.h"
#import "DBMapDateRecord.h"
#include "map_date_record.hpp"
#include "map_date_record.hpp"
#import <Foundation/Foundation.h>
@interface
DBMapDateRecord
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppMapDateRecord
:(
const
::
MapDateRecord
&
)
mapDateRecord
;
@
class
DBMapDateRecord
;
-
(
::
MapDateRecord
)
cppMapDateRecord
;
@end
namespace
djinni_generated
{
struct
MapDateRecord
{
using
CppType
=
::
MapDateRecord
;
using
ObjcType
=
DBMapDateRecord
*
;
using
Boxed
=
MapDateRecord
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBMapDateRecord+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni
#import "DBMapDateRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
MapDateRecord
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
unordered_map
<
std
::
string
,
std
::
chrono
::
system_clock
::
time_point
>
dates_by_id
;
for
(
id
objcKey_0
in
obj
.
datesById
)
{
std
::
string
cppKey_0
=
::
djinni
::
String
::
toCpp
(
objcKey_0
);
std
::
chrono
::
system_clock
::
time_point
cppValue_0
=
::
djinni
::
convert_date
([[
obj
.
datesById
objectForKey
:
objcKey_0
]
timeIntervalSince1970
]);
dates_by_id
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
return
::
MapDateRecord
(
dates_by_id
);
}
auto
MapDateRecord
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
std
::
vector
<
NSString
*>
datesByIdTempKeyVector
;
datesByIdTempKeyVector
.
reserve
(
cpp
.
dates_by_id
.
size
());
std
::
vector
<
NSDate
*>
datesByIdTempValueVector
;
datesByIdTempValueVector
.
reserve
(
cpp
.
dates_by_id
.
size
());
for
(
const
auto
&
cppPair_0
:
cpp
.
dates_by_id
)
{
NSString
*
objcKey_0
=
::
djinni
::
String
::
fromCpp
(
cppPair_0
.
first
);
NSDate
*
objcValue_0
=
[
NSDate
dateWithTimeIntervalSince1970
:
std
:
:
chrono
::
duration_cast
<
std
::
chrono
::
duration
<
double
>>
(
cppPair_0
.
second
.
time_since_epoch
()).
count
()];
datesByIdTempKeyVector
.
push_back
(
objcKey_0
);
datesByIdTempValueVector
.
push_back
(
objcValue_0
);
}
NSDictionary
*
datesById
=
[
NSDictionary
dictionaryWithObjects
:
&
datesByIdTempValueVector
[
0
]
forKeys
:
&
datesByIdTempKeyVector
[
0
]
count
:
cpp
.
dates_by_id
.
size
()];
return
[[
DBMapDateRecord
alloc
]
initWithDatesById:
datesById
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBMapDateRecord.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBMapDateRecord
:
NSObject
@interface
DBMapDateRecord
:
NSObject
-
(
id
)
initWithMapDateRecord
:(
DBMapDateRecord
*
)
mapDateRecord
;
-
(
id
)
initWithMapDateRecord
:(
DBMapDateRecord
*
)
mapDateRecord
;
-
(
id
)
initWithDatesById
:(
NSDictionary
*
)
datesById
;
-
(
id
)
initWithDatesById
:(
NSDictionary
*
)
datesById
;
...
...
test-suite/generated-src/objc/DBMapDateRecord.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni
// This file generated by Djinni from date.djinni
#import "DBMapDateRecord+Private.h"
#import "DBMapDateRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBMapDateRecord
@implementation
DBMapDateRecord
-
(
id
)
initWithMapDateRecord
:(
DBMapDateRecord
*
)
mapDateRecord
-
(
id
)
initWithMapDateRecord
:(
DBMapDateRecord
*
)
mapDateRecord
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_datesByIdTempKeyVector
;
NSMutableDictionary
*
_datesByIdTempDictionary
=
[
NSMutableDictionary
dictionaryWithCapacity
:[
mapDateRecord
.
datesById
count
]];
_datesByIdTempKeyVector
.
reserve
([
mapDateRecord
.
datesById
count
]);
for
(
id
key_0
in
mapDateRecord
.
datesById
)
{
std
::
vector
<
NSDate
*>
_datesByIdTempValueVector
;
id
copiedKey_0
,
copiedValue_0
;
_datesByIdTempValueVector
.
reserve
([
mapDateRecord
.
datesById
count
]);
copiedKey_0
=
[
key_0
copy
];
for
(
NSString
*
key_0
in
mapDateRecord
.
datesById
)
{
id
value_0
=
[
mapDateRecord
.
datesById
objectForKey
:
key_0
];
NSDate
*
copiedValue_0
;
_datesByIdTempKeyVector
.
push_back
(
key_0
);
NSDate
*
value_0
=
[
mapDateRecord
.
datesById
objectForKey
:
key_0
];
copiedValue_0
=
[
value_0
copy
];
copiedValue_0
=
[
value_0
copy
];
_datesByIdTempValueVector
.
push_back
(
copiedValue_0
)
;
[
_datesByIdTempDictionary
setObject
:
copiedValue_0
forKey
:
copiedKey_0
]
;
}
}
_datesById
=
[
NSDictionary
dictionaryWithObjects
:
&
_datesByIdTempValueVector
[
0
]
forKeys
:
&
_datesByIdTempKeyVector
[
0
]
count
:
[
mapDateRecord
.
datesById
count
]]
;
_datesById
=
_datesByIdTempDictionary
;
}
}
return
self
;
return
self
;
}
}
...
@@ -39,35 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -39,35 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppMapDateRecord
:(
const
::
MapDateRecord
&
)
mapDateRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_datesByIdTempKeyVector
;
_datesByIdTempKeyVector
.
reserve
(
mapDateRecord
.
dates_by_id
.
size
());
std
::
vector
<
NSDate
*>
_datesByIdTempValueVector
;
_datesByIdTempValueVector
.
reserve
(
mapDateRecord
.
dates_by_id
.
size
());
for
(
const
auto
&
cppPair_0
:
mapDateRecord
.
dates_by_id
)
{
NSString
*
objcKey_0
=
::
djinni
::
String
::
fromCpp
(
cppPair_0
.
first
);
NSDate
*
objcValue_0
=
[
NSDate
dateWithTimeIntervalSince1970
:
std
:
:
chrono
::
duration_cast
<
std
::
chrono
::
duration
<
double
>>
(
cppPair_0
.
second
.
time_since_epoch
()).
count
()];
_datesByIdTempKeyVector
.
push_back
(
objcKey_0
);
_datesByIdTempValueVector
.
push_back
(
objcValue_0
);
}
_datesById
=
[
NSDictionary
dictionaryWithObjects
:
&
_datesByIdTempValueVector
[
0
]
forKeys
:
&
_datesByIdTempKeyVector
[
0
]
count
:
mapDateRecord
.
dates_by_id
.
size
()];
}
return
self
;
}
-
(
::
MapDateRecord
)
cppMapDateRecord
{
std
::
unordered_map
<
std
::
string
,
std
::
chrono
::
system_clock
::
time_point
>
datesById
;
for
(
id
objcKey_0
in
_datesById
)
{
std
::
string
cppKey_0
=
::
djinni
::
String
::
toCpp
(
objcKey_0
);
std
::
chrono
::
system_clock
::
time_point
cppValue_0
=
::
djinni
::
convert_date
([[
_datesById
objectForKey
:
objcKey_0
]
timeIntervalSince1970
]);
datesById
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
return
::
MapDateRecord
(
std
::
move
(
datesById
));
}
@end
@end
test-suite/generated-src/objc/DBMapListRecord+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBMapListRecord.h"
#import "DBMapListRecord.h"
#include "map_list_record.hpp"
#include "map_list_record.hpp"
#import <Foundation/Foundation.h>
@interface
DBMapListRecord
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppMapListRecord
:(
const
::
MapListRecord
&
)
mapListRecord
;
@
class
DBMapListRecord
;
-
(
::
MapListRecord
)
cppMapListRecord
;
@end
namespace
djinni_generated
{
struct
MapListRecord
{
using
CppType
=
::
MapListRecord
;
using
ObjcType
=
DBMapListRecord
*
;
using
Boxed
=
MapListRecord
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBMapListRecord+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni
#import "DBMapListRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
MapListRecord
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
vector
<
std
::
unordered_map
<
std
::
string
,
int64_t
>>
map_list
;
map_list
.
reserve
([
obj
.
mapList
count
]);
for
(
NSDictionary
*
objcValue_0
in
obj
.
mapList
)
{
std
::
unordered_map
<
std
::
string
,
int64_t
>
cppValue_0
;
for
(
id
objcKey_1
in
objcValue_0
)
{
std
::
string
cppKey_1
=
::
djinni
::
String
::
toCpp
(
objcKey_1
);
int64_t
cppValue_1
=
::
djinni
::
I64
::
Boxed
::
toCpp
([
objcValue_0
objectForKey
:
objcKey_1
]);
cppValue_0
.
emplace
(
std
::
move
(
cppKey_1
),
std
::
move
(
cppValue_1
));
}
map_list
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
MapListRecord
(
map_list
);
}
auto
MapListRecord
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
std
::
vector
<
NSDictionary
*>
mapListTempVector
;
mapListTempVector
.
reserve
(
cpp
.
map_list
.
size
());
for
(
const
auto
&
cppValue_0
:
cpp
.
map_list
)
{
std
::
vector
<
NSString
*>
objcValue_0TempKeyVector
;
objcValue_0TempKeyVector
.
reserve
(
cppValue_0
.
size
());
std
::
vector
<
NSNumber
*>
objcValue_0TempValueVector
;
objcValue_0TempValueVector
.
reserve
(
cppValue_0
.
size
());
for
(
const
auto
&
cppPair_1
:
cppValue_0
)
{
NSString
*
objcKey_1
=
::
djinni
::
String
::
fromCpp
(
cppPair_1
.
first
);
NSNumber
*
objcValue_1
=
::
djinni
::
I64
::
Boxed
::
fromCpp
(
cppPair_1
.
second
);
objcValue_0TempKeyVector
.
push_back
(
objcKey_1
);
objcValue_0TempValueVector
.
push_back
(
objcValue_1
);
}
NSDictionary
*
objcValue_0
=
[
NSDictionary
dictionaryWithObjects
:
&
objcValue_0TempValueVector
[
0
]
forKeys
:
&
objcValue_0TempKeyVector
[
0
]
count
:
cppValue_0
.
size
()];
mapListTempVector
.
push_back
(
objcValue_0
);
}
NSArray
*
mapList
=
[
NSArray
arrayWithObjects
:
&
mapListTempVector
[
0
]
count
:
mapListTempVector
.
size
()];
return
[[
DBMapListRecord
alloc
]
initWithMapList:
mapList
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBMapListRecord.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBMapListRecord
:
NSObject
@interface
DBMapListRecord
:
NSObject
-
(
id
)
initWithMapListRecord
:(
DBMapListRecord
*
)
mapListRecord
;
-
(
id
)
initWithMapListRecord
:(
DBMapListRecord
*
)
mapListRecord
;
-
(
id
)
initWithMapList
:(
NSArray
*
)
mapList
;
-
(
id
)
initWithMapList
:(
NSArray
*
)
mapList
;
...
...
test-suite/generated-src/objc/DBMapListRecord.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni
// This file generated by Djinni from map.djinni
#import "DBMapListRecord+Private.h"
#import "DBMapListRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBMapListRecord
@implementation
DBMapListRecord
-
(
id
)
initWithMapListRecord
:(
DBMapListRecord
*
)
mapListRecord
-
(
id
)
initWithMapListRecord
:(
DBMapListRecord
*
)
mapListRecord
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSDictionary
*>
_mapListTempVector
;
NSMutableArray
*
_mapListTempArray
=
[
NSMutableArray
arrayWithCapacity
:[
mapListRecord
.
mapList
count
]];
_mapListTempVector
.
reserve
([
mapListRecord
.
mapList
count
]);
for
(
NSDictionary
*
currentValue_0
in
mapListRecord
.
mapList
)
{
for
(
NSDictionary
*
currentValue_0
in
mapListRecord
.
mapList
)
{
NSDictionary
*
copiedValue_0
;
id
copiedValue_0
;
std
::
vector
<
NSString
*>
copiedValue_0TempKeyVector
;
NSMutableDictionary
*
copiedValue_0TempDictionary
=
[
NSMutableDictionary
dictionaryWithCapacity
:[
currentValue_0
count
]];
copiedValue_0TempKeyVector
.
reserve
([
currentValue_0
count
]);
for
(
id
key_1
in
currentValue_0
)
{
std
::
vector
<
NSNumber
*>
copiedValue_0TempValueVector
;
id
copiedKey_1
,
copiedValue_1
;
copiedValue_0TempValueVector
.
reserve
([
currentValue_0
count
]);
copiedKey_1
=
[
key_1
copy
];
for
(
NSString
*
key_1
in
currentValue_0
)
{
id
value_1
=
[
currentValue_0
objectForKey
:
key_1
];
NSNumber
*
copiedValue_1
;
copiedValue_0TempKeyVector
.
push_back
(
key_1
);
NSNumber
*
value_1
=
[
currentValue_0
objectForKey
:
key_1
];
copiedValue_1
=
value_1
;
copiedValue_1
=
value_1
;
copiedValue_0TempValueVector
.
push_back
(
copiedValue_1
)
;
[
copiedValue_0TempDictionary
setObject
:
copiedValue_1
forKey
:
copiedKey_1
]
;
}
}
copiedValue_0
=
[
NSDictionary
dictionaryWithObjects
:
&
copiedValue_0TempValueVector
[
0
]
forKeys
:
&
copiedValue_0TempKeyVector
[
0
]
count
:
[
currentValue_0
count
]]
;
copiedValue_0
=
copiedValue_0TempDictionary
;
_mapListTempVector
.
push_back
(
copiedValue_0
)
;
[
_mapListTempArray
addObject
:
copiedValue_0
]
;
}
}
_mapList
=
[
NSArray
arrayWithObjects
:
&
_mapListTempVector
[
0
]
count
:
_mapListTempVector
.
size
()]
;
_mapList
=
_mapListTempArray
;
}
}
return
self
;
return
self
;
}
}
...
@@ -46,45 +36,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -46,45 +36,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppMapListRecord
:(
const
::
MapListRecord
&
)
mapListRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSDictionary
*>
_mapListTempVector
;
_mapListTempVector
.
reserve
(
mapListRecord
.
map_list
.
size
());
for
(
const
auto
&
cppValue_0
:
mapListRecord
.
map_list
)
{
std
::
vector
<
NSString
*>
objcValue_0TempKeyVector
;
objcValue_0TempKeyVector
.
reserve
(
cppValue_0
.
size
());
std
::
vector
<
NSNumber
*>
objcValue_0TempValueVector
;
objcValue_0TempValueVector
.
reserve
(
cppValue_0
.
size
());
for
(
const
auto
&
cppPair_1
:
cppValue_0
)
{
NSString
*
objcKey_1
=
::
djinni
::
String
::
fromCpp
(
cppPair_1
.
first
);
NSNumber
*
objcValue_1
=
::
djinni
::
I64
::
Boxed
::
fromCpp
(
cppPair_1
.
second
);
objcValue_0TempKeyVector
.
push_back
(
objcKey_1
);
objcValue_0TempValueVector
.
push_back
(
objcValue_1
);
}
NSDictionary
*
objcValue_0
=
[
NSDictionary
dictionaryWithObjects
:
&
objcValue_0TempValueVector
[
0
]
forKeys
:
&
objcValue_0TempKeyVector
[
0
]
count
:
cppValue_0
.
size
()];
_mapListTempVector
.
push_back
(
objcValue_0
);
}
_mapList
=
[
NSArray
arrayWithObjects
:
&
_mapListTempVector
[
0
]
count
:
_mapListTempVector
.
size
()];
}
return
self
;
}
-
(
::
MapListRecord
)
cppMapListRecord
{
std
::
vector
<
std
::
unordered_map
<
std
::
string
,
int64_t
>>
mapList
;
mapList
.
reserve
([
_mapList
count
]);
for
(
NSDictionary
*
objcValue_0
in
_mapList
)
{
std
::
unordered_map
<
std
::
string
,
int64_t
>
cppValue_0
;
for
(
id
objcKey_1
in
objcValue_0
)
{
std
::
string
cppKey_1
=
::
djinni
::
String
::
toCpp
(
objcKey_1
);
int64_t
cppValue_1
=
::
djinni
::
I64
::
Boxed
::
toCpp
([
objcValue_0
objectForKey
:
objcKey_1
]);
cppValue_0
.
emplace
(
std
::
move
(
cppKey_1
),
std
::
move
(
cppValue_1
));
}
mapList
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
MapListRecord
(
std
::
move
(
mapList
));
}
@end
@end
test-suite/generated-src/objc/DBMapRecord+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBMapRecord.h"
#import "DBMapRecord.h"
#include "map_record.hpp"
#include "map_record.hpp"
#import <Foundation/Foundation.h>
@interface
DBMapRecord
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppMapRecord
:(
const
::
MapRecord
&
)
mapRecord
;
@
class
DBMapRecord
;
-
(
::
MapRecord
)
cppMapRecord
;
@end
namespace
djinni_generated
{
struct
MapRecord
{
using
CppType
=
::
MapRecord
;
using
ObjcType
=
DBMapRecord
*
;
using
Boxed
=
MapRecord
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBMapRecord+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni
#import "DBMapRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
MapRecord
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
unordered_map
<
std
::
string
,
int64_t
>
map
;
for
(
id
objcKey_0
in
obj
.
map
)
{
std
::
string
cppKey_0
=
::
djinni
::
String
::
toCpp
(
objcKey_0
);
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
([
obj
.
map
objectForKey
:
objcKey_0
]);
map
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
return
::
MapRecord
(
map
);
}
auto
MapRecord
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
std
::
vector
<
NSString
*>
mapTempKeyVector
;
mapTempKeyVector
.
reserve
(
cpp
.
map
.
size
());
std
::
vector
<
NSNumber
*>
mapTempValueVector
;
mapTempValueVector
.
reserve
(
cpp
.
map
.
size
());
for
(
const
auto
&
cppPair_0
:
cpp
.
map
)
{
NSString
*
objcKey_0
=
::
djinni
::
String
::
fromCpp
(
cppPair_0
.
first
);
NSNumber
*
objcValue_0
=
::
djinni
::
I64
::
Boxed
::
fromCpp
(
cppPair_0
.
second
);
mapTempKeyVector
.
push_back
(
objcKey_0
);
mapTempValueVector
.
push_back
(
objcValue_0
);
}
NSDictionary
*
map
=
[
NSDictionary
dictionaryWithObjects
:
&
mapTempValueVector
[
0
]
forKeys
:
&
mapTempKeyVector
[
0
]
count
:
cpp
.
map
.
size
()];
return
[[
DBMapRecord
alloc
]
initWithMap:
map
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBMapRecord.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBMapRecord
:
NSObject
@interface
DBMapRecord
:
NSObject
-
(
id
)
initWithMapRecord
:(
DBMapRecord
*
)
mapRecord
;
-
(
id
)
initWithMapRecord
:(
DBMapRecord
*
)
mapRecord
;
-
(
id
)
initWithMap
:(
NSDictionary
*
)
map
;
-
(
id
)
initWithMap
:(
NSDictionary
*
)
map
;
...
...
test-suite/generated-src/objc/DBMapRecord.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni
// This file generated by Djinni from map.djinni
#import "DBMapRecord+Private.h"
#import "DBMapRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBMapRecord
@implementation
DBMapRecord
-
(
id
)
initWithMapRecord
:(
DBMapRecord
*
)
mapRecord
-
(
id
)
initWithMapRecord
:(
DBMapRecord
*
)
mapRecord
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_mapTempKeyVector
;
NSMutableDictionary
*
_mapTempDictionary
=
[
NSMutableDictionary
dictionaryWithCapacity
:[
mapRecord
.
map
count
]];
_mapTempKeyVector
.
reserve
([
mapRecord
.
map
count
]);
for
(
id
key_0
in
mapRecord
.
map
)
{
std
::
vector
<
NSNumber
*>
_mapTempValueVector
;
id
copiedKey_0
,
copiedValue_0
;
_mapTempValueVector
.
reserve
([
mapRecord
.
map
count
]);
copiedKey_0
=
[
key_0
copy
];
for
(
NSString
*
key_0
in
mapRecord
.
map
)
{
id
value_0
=
[
mapRecord
.
map
objectForKey
:
key_0
];
NSNumber
*
copiedValue_0
;
_mapTempKeyVector
.
push_back
(
key_0
);
NSNumber
*
value_0
=
[
mapRecord
.
map
objectForKey
:
key_0
];
copiedValue_0
=
value_0
;
copiedValue_0
=
value_0
;
_mapTempValueVector
.
push_back
(
copiedValue_0
)
;
[
_mapTempDictionary
setObject
:
copiedValue_0
forKey
:
copiedKey_0
]
;
}
}
_map
=
[
NSDictionary
dictionaryWithObjects
:
&
_mapTempValueVector
[
0
]
forKeys
:
&
_mapTempKeyVector
[
0
]
count
:
[
mapRecord
.
map
count
]]
;
_map
=
_mapTempDictionary
;
}
}
return
self
;
return
self
;
}
}
...
@@ -39,34 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -39,34 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppMapRecord
:(
const
::
MapRecord
&
)
mapRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_mapTempKeyVector
;
_mapTempKeyVector
.
reserve
(
mapRecord
.
map
.
size
());
std
::
vector
<
NSNumber
*>
_mapTempValueVector
;
_mapTempValueVector
.
reserve
(
mapRecord
.
map
.
size
());
for
(
const
auto
&
cppPair_0
:
mapRecord
.
map
)
{
NSString
*
objcKey_0
=
::
djinni
::
String
::
fromCpp
(
cppPair_0
.
first
);
NSNumber
*
objcValue_0
=
::
djinni
::
I64
::
Boxed
::
fromCpp
(
cppPair_0
.
second
);
_mapTempKeyVector
.
push_back
(
objcKey_0
);
_mapTempValueVector
.
push_back
(
objcValue_0
);
}
_map
=
[
NSDictionary
dictionaryWithObjects
:
&
_mapTempValueVector
[
0
]
forKeys
:
&
_mapTempKeyVector
[
0
]
count
:
mapRecord
.
map
.
size
()];
}
return
self
;
}
-
(
::
MapRecord
)
cppMapRecord
{
std
::
unordered_map
<
std
::
string
,
int64_t
>
map
;
for
(
id
objcKey_0
in
_map
)
{
std
::
string
cppKey_0
=
::
djinni
::
String
::
toCpp
(
objcKey_0
);
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
([
_map
objectForKey
:
objcKey_0
]);
map
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
return
::
MapRecord
(
std
::
move
(
map
));
}
@end
@end
test-suite/generated-src/objc/DBNestedCollection+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBNestedCollection.h"
#import "DBNestedCollection.h"
#include "nested_collection.hpp"
#include "nested_collection.hpp"
#import <Foundation/Foundation.h>
@interface
DBNestedCollection
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppNestedCollection
:(
const
::
NestedCollection
&
)
nestedCollection
;
@
class
DBNestedCollection
;
-
(
::
NestedCollection
)
cppNestedCollection
;
@end
namespace
djinni_generated
{
struct
NestedCollection
{
using
CppType
=
::
NestedCollection
;
using
ObjcType
=
DBNestedCollection
*
;
using
Boxed
=
NestedCollection
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBNestedCollection+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from nested_collection.djinni
#import "DBNestedCollection+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
NestedCollection
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
vector
<
std
::
unordered_set
<
std
::
string
>>
set_list
;
set_list
.
reserve
([
obj
.
setList
count
]);
for
(
NSSet
*
objcValue_0
in
obj
.
setList
)
{
std
::
unordered_set
<
std
::
string
>
cppValue_0
;
for
(
NSString
*
objcValue_1
in
objcValue_0
)
{
std
::
string
cppValue_1
=
::
djinni
::
String
::
toCpp
(
objcValue_1
);
cppValue_0
.
insert
(
std
::
move
(
cppValue_1
));
}
set_list
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
NestedCollection
(
set_list
);
}
auto
NestedCollection
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
std
::
vector
<
NSSet
*>
setListTempVector
;
setListTempVector
.
reserve
(
cpp
.
set_list
.
size
());
for
(
const
auto
&
cppValue_0
:
cpp
.
set_list
)
{
std
::
vector
<
NSString
*>
objcValue_0TempVector
;
objcValue_0TempVector
.
reserve
(
cppValue_0
.
size
());
for
(
const
auto
&
cppValue_1
:
cppValue_0
)
{
NSString
*
objcValue_1
=
::
djinni
::
String
::
fromCpp
(
cppValue_1
);
objcValue_0TempVector
.
push_back
(
objcValue_1
);
}
NSSet
*
objcValue_0
=
[
NSSet
setWithObjects
:
&
objcValue_0TempVector
[
0
]
count
:
objcValue_0TempVector
.
size
()];
setListTempVector
.
push_back
(
objcValue_0
);
}
NSArray
*
setList
=
[
NSArray
arrayWithObjects
:
&
setListTempVector
[
0
]
count
:
setListTempVector
.
size
()];
return
[[
DBNestedCollection
alloc
]
initWithSetList:
setList
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBNestedCollection.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBNestedCollection
:
NSObject
@interface
DBNestedCollection
:
NSObject
-
(
id
)
initWithNestedCollection
:(
DBNestedCollection
*
)
nestedCollection
;
-
(
id
)
initWithNestedCollection
:(
DBNestedCollection
*
)
nestedCollection
;
-
(
id
)
initWithSetList
:(
NSArray
*
)
setList
;
-
(
id
)
initWithSetList
:(
NSArray
*
)
setList
;
...
...
test-suite/generated-src/objc/DBNestedCollection.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from nested_collection.djinni
// This file generated by Djinni from nested_collection.djinni
#import "DBNestedCollection+Private.h"
#import "DBNestedCollection.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBNestedCollection
@implementation
DBNestedCollection
-
(
id
)
initWithNestedCollection
:(
DBNestedCollection
*
)
nestedCollection
-
(
id
)
initWithNestedCollection
:(
DBNestedCollection
*
)
nestedCollection
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSSet
*>
_setListTempVector
;
NSMutableArray
*
_setListTempArray
=
[
NSMutableArray
arrayWithCapacity
:[
nestedCollection
.
setList
count
]];
_setListTempVector
.
reserve
([
nestedCollection
.
setList
count
]);
for
(
NSSet
*
currentValue_0
in
nestedCollection
.
setList
)
{
for
(
NSSet
*
currentValue_0
in
nestedCollection
.
setList
)
{
NSSet
*
copiedValue_0
;
id
copiedValue_0
;
std
::
vector
<
NSString
*>
copiedValue_0TempVector
;
NSMutableSet
*
copiedValue_0TempSet
=
[
NSMutableSet
setWithCapacity
:[
currentValue_0
count
]];
copiedValue_0TempVector
.
reserve
([
currentValue_0
count
]);
for
(
NSString
*
currentValue_1
in
currentValue_0
)
{
for
(
NSString
*
currentValue_1
in
currentValue_0
)
{
NSString
*
copiedValue_1
;
id
copiedValue_1
;
copiedValue_1
=
[
currentValue_1
copy
];
copiedValue_1
=
[
currentValue_1
copy
];
copiedValue_0TempVector
.
push_back
(
copiedValue_1
)
;
[
copiedValue_0TempSet
addObject
:
copiedValue_1
]
;
}
}
copiedValue_0
=
[
NSSet
setWithObjects
:
&
copiedValue_0TempVector
[
0
]
count
:
copiedValue_0TempVector
.
size
()]
;
copiedValue_0
=
copiedValue_0TempSet
;
_setListTempVector
.
push_back
(
copiedValue_0
)
;
[
_setListTempArray
addObject
:
copiedValue_0
]
;
}
}
_setList
=
[
NSArray
arrayWithObjects
:
&
_setListTempVector
[
0
]
count
:
_setListTempVector
.
size
()]
;
_setList
=
_setListTempArray
;
}
}
return
self
;
return
self
;
}
}
...
@@ -42,40 +34,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -42,40 +34,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppNestedCollection
:(
const
::
NestedCollection
&
)
nestedCollection
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSSet
*>
_setListTempVector
;
_setListTempVector
.
reserve
(
nestedCollection
.
set_list
.
size
());
for
(
const
auto
&
cppValue_0
:
nestedCollection
.
set_list
)
{
std
::
vector
<
NSString
*>
objcValue_0TempVector
;
objcValue_0TempVector
.
reserve
(
cppValue_0
.
size
());
for
(
const
auto
&
cppValue_1
:
cppValue_0
)
{
NSString
*
objcValue_1
=
::
djinni
::
String
::
fromCpp
(
cppValue_1
);
objcValue_0TempVector
.
push_back
(
objcValue_1
);
}
NSSet
*
objcValue_0
=
[
NSSet
setWithObjects
:
&
objcValue_0TempVector
[
0
]
count
:
objcValue_0TempVector
.
size
()];
_setListTempVector
.
push_back
(
objcValue_0
);
}
_setList
=
[
NSArray
arrayWithObjects
:
&
_setListTempVector
[
0
]
count
:
_setListTempVector
.
size
()];
}
return
self
;
}
-
(
::
NestedCollection
)
cppNestedCollection
{
std
::
vector
<
std
::
unordered_set
<
std
::
string
>>
setList
;
setList
.
reserve
([
_setList
count
]);
for
(
NSSet
*
objcValue_0
in
_setList
)
{
std
::
unordered_set
<
std
::
string
>
cppValue_0
;
for
(
NSString
*
objcValue_1
in
objcValue_0
)
{
std
::
string
cppValue_1
=
::
djinni
::
String
::
toCpp
(
objcValue_1
);
cppValue_0
.
insert
(
std
::
move
(
cppValue_1
));
}
setList
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
NestedCollection
(
std
::
move
(
setList
));
}
@end
@end
test-suite/generated-src/objc/DBPrimitiveList+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBPrimitiveList.h"
#import "DBPrimitiveList.h"
#include "primitive_list.hpp"
#include "primitive_list.hpp"
#import <Foundation/Foundation.h>
@interface
DBPrimitiveList
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppPrimitiveList
:(
const
::
PrimitiveList
&
)
primitiveList
;
@
class
DBPrimitiveList
;
-
(
::
PrimitiveList
)
cppPrimitiveList
;
@end
namespace
djinni_generated
{
struct
PrimitiveList
{
using
CppType
=
::
PrimitiveList
;
using
ObjcType
=
DBPrimitiveList
*
;
using
Boxed
=
PrimitiveList
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBPrimitiveList+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from primitive_list.djinni
#import "DBPrimitiveList+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
PrimitiveList
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
vector
<
int64_t
>
list
;
list
.
reserve
([
obj
.
list
count
]);
for
(
NSNumber
*
objcValue_0
in
obj
.
list
)
{
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
(
objcValue_0
);
list
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
PrimitiveList
(
list
);
}
auto
PrimitiveList
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
std
::
vector
<
NSNumber
*>
listTempVector
;
listTempVector
.
reserve
(
cpp
.
list
.
size
());
for
(
const
auto
&
cppValue_0
:
cpp
.
list
)
{
NSNumber
*
objcValue_0
=
::
djinni
::
I64
::
Boxed
::
fromCpp
(
cppValue_0
);
listTempVector
.
push_back
(
objcValue_0
);
}
NSArray
*
list
=
[
NSArray
arrayWithObjects
:
&
listTempVector
[
0
]
count
:
listTempVector
.
size
()];
return
[[
DBPrimitiveList
alloc
]
initWithList:
list
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBPrimitiveList.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBPrimitiveList
:
NSObject
@interface
DBPrimitiveList
:
NSObject
-
(
id
)
initWithPrimitiveList
:(
DBPrimitiveList
*
)
primitiveList
;
-
(
id
)
initWithPrimitiveList
:(
DBPrimitiveList
*
)
primitiveList
;
-
(
id
)
initWithList
:(
NSArray
*
)
list
;
-
(
id
)
initWithList
:(
NSArray
*
)
list
;
...
...
test-suite/generated-src/objc/DBPrimitiveList.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from primitive_list.djinni
// This file generated by Djinni from primitive_list.djinni
#import "DBPrimitiveList+Private.h"
#import "DBPrimitiveList.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBPrimitiveList
@implementation
DBPrimitiveList
-
(
id
)
initWithPrimitiveList
:(
DBPrimitiveList
*
)
primitiveList
-
(
id
)
initWithPrimitiveList
:(
DBPrimitiveList
*
)
primitiveList
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSNumber
*>
_listTempVector
;
NSMutableArray
*
_listTempArray
=
[
NSMutableArray
arrayWithCapacity
:[
primitiveList
.
list
count
]];
_listTempVector
.
reserve
([
primitiveList
.
list
count
]);
for
(
NSNumber
*
currentValue_0
in
primitiveList
.
list
)
{
for
(
NSNumber
*
currentValue_0
in
primitiveList
.
list
)
{
NSNumber
*
copiedValue_0
;
id
copiedValue_0
;
copiedValue_0
=
currentValue_0
;
copiedValue_0
=
currentValue_0
;
_listTempVector
.
push_back
(
copiedValue_0
)
;
[
_listTempArray
addObject
:
copiedValue_0
]
;
}
}
_list
=
[
NSArray
arrayWithObjects
:
&
_listTempVector
[
0
]
count
:
_listTempVector
.
size
()]
;
_list
=
_listTempArray
;
}
}
return
self
;
return
self
;
}
}
...
@@ -35,30 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -35,30 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppPrimitiveList
:(
const
::
PrimitiveList
&
)
primitiveList
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSNumber
*>
_listTempVector
;
_listTempVector
.
reserve
(
primitiveList
.
list
.
size
());
for
(
const
auto
&
cppValue_0
:
primitiveList
.
list
)
{
NSNumber
*
objcValue_0
=
::
djinni
::
I64
::
Boxed
::
fromCpp
(
cppValue_0
);
_listTempVector
.
push_back
(
objcValue_0
);
}
_list
=
[
NSArray
arrayWithObjects
:
&
_listTempVector
[
0
]
count
:
_listTempVector
.
size
()];
}
return
self
;
}
-
(
::
PrimitiveList
)
cppPrimitiveList
{
std
::
vector
<
int64_t
>
list
;
list
.
reserve
([
_list
count
]);
for
(
NSNumber
*
objcValue_0
in
_list
)
{
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
(
objcValue_0
);
list
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
PrimitiveList
(
std
::
move
(
list
));
}
@end
@end
test-suite/generated-src/objc/DBRecordWithDerivings+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBRecordWithDerivings.h"
#import "DBRecordWithDerivings.h"
#include "record_with_derivings.hpp"
#include "record_with_derivings.hpp"
#import <Foundation/Foundation.h>
@interface
DBRecordWithDerivings
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppRecordWithDerivings
:(
const
::
RecordWithDerivings
&
)
recordWithDerivings
;
@
class
DBRecordWithDerivings
;
-
(
::
RecordWithDerivings
)
cppRecordWithDerivings
;
@end
namespace
djinni_generated
{
struct
RecordWithDerivings
{
using
CppType
=
::
RecordWithDerivings
;
using
ObjcType
=
DBRecordWithDerivings
*
;
using
Boxed
=
RecordWithDerivings
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBRecordWithDerivings+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni
#import "DBRecordWithDerivings+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
RecordWithDerivings
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
int32_t
key1
=
::
djinni
::
I32
::
toCpp
(
obj
.
key1
);
std
::
string
key2
=
::
djinni
::
String
::
toCpp
(
obj
.
key2
);
return
::
RecordWithDerivings
(
key1
,
key2
);
}
auto
RecordWithDerivings
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
int32_t
key1
=
::
djinni
::
I32
::
fromCpp
(
cpp
.
key1
);
NSString
*
key2
=
::
djinni
::
String
::
fromCpp
(
cpp
.
key2
);
return
[[
DBRecordWithDerivings
alloc
]
initWithKey1:
key1
key2:
key2
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBRecordWithDerivings.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBRecordWithDerivings
:
NSObject
@interface
DBRecordWithDerivings
:
NSObject
-
(
id
)
initWithRecordWithDerivings
:(
DBRecordWithDerivings
*
)
recordWithDerivings
;
-
(
id
)
initWithRecordWithDerivings
:(
DBRecordWithDerivings
*
)
recordWithDerivings
;
-
(
id
)
initWithKey1
:(
int32_t
)
key1
key2
:(
NSString
*
)
key2
;
-
(
id
)
initWithKey1
:(
int32_t
)
key1
key2
:(
NSString
*
)
key2
;
...
...
test-suite/generated-src/objc/DBRecordWithDerivings.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni
// This file generated by Djinni from derivings.djinni
#import "DBRecordWithDerivings+Private.h"
#import "DBRecordWithDerivings.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBRecordWithDerivings
@implementation
DBRecordWithDerivings
...
@@ -30,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -30,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppRecordWithDerivings
:(
const
::
RecordWithDerivings
&
)
recordWithDerivings
{
if
(
self
=
[
super
init
])
{
_key1
=
::
djinni
::
I32
::
fromCpp
(
recordWithDerivings
.
key1
);
_key2
=
::
djinni
::
String
::
fromCpp
(
recordWithDerivings
.
key2
);
}
return
self
;
}
-
(
::
RecordWithDerivings
)
cppRecordWithDerivings
{
int32_t
key1
=
::
djinni
::
I32
::
toCpp
(
_key1
);
std
::
string
key2
=
::
djinni
::
String
::
toCpp
(
_key2
);
return
::
RecordWithDerivings
(
std
::
move
(
key1
),
std
::
move
(
key2
));
}
-
(
BOOL
)
isEqual
:(
id
)
other
-
(
BOOL
)
isEqual
:(
id
)
other
{
{
if
(
!
[
other
isKindOfClass
:[
DBRecordWithDerivings
class
]])
{
if
(
!
[
other
isKindOfClass
:[
DBRecordWithDerivings
class
]])
{
...
...
test-suite/generated-src/objc/DBRecordWithNestedDerivings+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBRecordWithNestedDerivings.h"
#import "DBRecordWithNestedDerivings.h"
#include "record_with_nested_derivings.hpp"
#include "record_with_nested_derivings.hpp"
#import <Foundation/Foundation.h>
@interface
DBRecordWithNestedDerivings
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppRecordWithNestedDerivings
:(
const
::
RecordWithNestedDerivings
&
)
recordWithNestedDerivings
;
@
class
DBRecordWithNestedDerivings
;
-
(
::
RecordWithNestedDerivings
)
cppRecordWithNestedDerivings
;
@end
namespace
djinni_generated
{
struct
RecordWithNestedDerivings
{
using
CppType
=
::
RecordWithNestedDerivings
;
using
ObjcType
=
DBRecordWithNestedDerivings
*
;
using
Boxed
=
RecordWithNestedDerivings
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBRecordWithNestedDerivings+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni
#import "DBRecordWithNestedDerivings+Private.h"
#import "DBRecordWithDerivings+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
RecordWithNestedDerivings
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
int32_t
key
=
::
djinni
::
I32
::
toCpp
(
obj
.
key
);
::
RecordWithDerivings
rec
=
::
djinni_generated
::
RecordWithDerivings
::
toCpp
(
obj
.
rec
);
return
::
RecordWithNestedDerivings
(
key
,
rec
);
}
auto
RecordWithNestedDerivings
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
int32_t
key
=
::
djinni
::
I32
::
fromCpp
(
cpp
.
key
);
DBRecordWithDerivings
*
rec
=
::
djinni_generated
::
RecordWithDerivings
::
fromCpp
(
cpp
.
rec
);
return
[[
DBRecordWithNestedDerivings
alloc
]
initWithKey:
key
rec:
rec
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBRecordWithNestedDerivings.h
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni
// This file generated by Djinni from derivings.djinni
#import "DBRecordWithDerivings.h"
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@class
DBRecordWithDerivings
;
@interface
DBRecordWithNestedDerivings
:
NSObject
@interface
DBRecordWithNestedDerivings
:
NSObject
-
(
id
)
initWithRecordWithNestedDerivings
:(
DBRecordWithNestedDerivings
*
)
recordWithNestedDerivings
;
-
(
id
)
initWithRecordWithNestedDerivings
:(
DBRecordWithNestedDerivings
*
)
recordWithNestedDerivings
;
...
...
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni
// This file generated by Djinni from derivings.djinni
#import "DBRecordWithNestedDerivings+Private.h"
#import "DBRecordWithNestedDerivings.h"
#import "DBRecordWithDerivings+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBRecordWithNestedDerivings
@implementation
DBRecordWithNestedDerivings
...
@@ -31,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -31,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppRecordWithNestedDerivings
:(
const
::
RecordWithNestedDerivings
&
)
recordWithNestedDerivings
{
if
(
self
=
[
super
init
])
{
_key
=
::
djinni
::
I32
::
fromCpp
(
recordWithNestedDerivings
.
key
);
_rec
=
[[
DBRecordWithDerivings
alloc
]
initWithCppRecordWithDerivings
:
recordWithNestedDerivings
.
rec
];
}
return
self
;
}
-
(
::
RecordWithNestedDerivings
)
cppRecordWithNestedDerivings
{
int32_t
key
=
::
djinni
::
I32
::
toCpp
(
_key
);
::
RecordWithDerivings
rec
=
std
::
move
([
_rec
cppRecordWithDerivings
]);
return
::
RecordWithNestedDerivings
(
std
::
move
(
key
),
std
::
move
(
rec
));
}
-
(
BOOL
)
isEqual
:(
id
)
other
-
(
BOOL
)
isEqual
:(
id
)
other
{
{
if
(
!
[
other
isKindOfClass
:[
DBRecordWithNestedDerivings
class
]])
{
if
(
!
[
other
isKindOfClass
:[
DBRecordWithNestedDerivings
class
]])
{
...
...
test-suite/generated-src/objc/DBSetRecord+Private.h
View file @
d5dd5294
...
@@ -3,11 +3,22 @@
...
@@ -3,11 +3,22 @@
#import "DBSetRecord.h"
#import "DBSetRecord.h"
#include "set_record.hpp"
#include "set_record.hpp"
#import <Foundation/Foundation.h>
@interface
DBSetRecord
()
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
-
(
id
)
initWithCppSetRecord
:(
const
::
SetRecord
&
)
setRecord
;
@
class
DBSetRecord
;
-
(
::
SetRecord
)
cppSetRecord
;
@end
namespace
djinni_generated
{
struct
SetRecord
{
using
CppType
=
::
SetRecord
;
using
ObjcType
=
DBSetRecord
*
;
using
Boxed
=
SetRecord
;
static
CppType
toCpp
(
ObjcType
objc
);
static
ObjcType
fromCpp
(
const
CppType
&
cpp
);
};
}
// namespace djinni_generated
test-suite/generated-src/objc/DBSetRecord+Private.mm
0 → 100644
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from set.djinni
#import "DBSetRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace
djinni_generated
{
auto
SetRecord
::
toCpp
(
ObjcType
obj
)
->
CppType
{
assert
(
obj
);
std
::
unordered_set
<
std
::
string
>
set
;
for
(
NSString
*
objcValue_0
in
obj
.
set
)
{
std
::
string
cppValue_0
=
::
djinni
::
String
::
toCpp
(
objcValue_0
);
set
.
insert
(
std
::
move
(
cppValue_0
));
}
return
::
SetRecord
(
set
);
}
auto
SetRecord
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
std
::
vector
<
NSString
*>
setTempVector
;
setTempVector
.
reserve
(
cpp
.
set
.
size
());
for
(
const
auto
&
cppValue_0
:
cpp
.
set
)
{
NSString
*
objcValue_0
=
::
djinni
::
String
::
fromCpp
(
cppValue_0
);
setTempVector
.
push_back
(
objcValue_0
);
}
NSSet
*
set
=
[
NSSet
setWithObjects
:
&
setTempVector
[
0
]
count
:
setTempVector
.
size
()];
return
[[
DBSetRecord
alloc
]
initWithSet:
set
];
}
}
// namespace djinni_generated
test-suite/generated-src/objc/DBSetRecord.h
View file @
d5dd5294
...
@@ -3,7 +3,6 @@
...
@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@interface
DBSetRecord
:
NSObject
@interface
DBSetRecord
:
NSObject
-
(
id
)
initWithSetRecord
:(
DBSetRecord
*
)
setRecord
;
-
(
id
)
initWithSetRecord
:(
DBSetRecord
*
)
setRecord
;
-
(
id
)
initWithSet
:(
NSSet
*
)
set
;
-
(
id
)
initWithSet
:(
NSSet
*
)
set
;
...
...
test-suite/generated-src/objc/DBSetRecord.mm
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from set.djinni
// This file generated by Djinni from set.djinni
#import "DBSetRecord+Private.h"
#import "DBSetRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert
(
__has_feature
(
objc_arc
),
"Djinni requires ARC to be enabled for this file"
);
@implementation
DBSetRecord
@implementation
DBSetRecord
-
(
id
)
initWithSetRecord
:(
DBSetRecord
*
)
setRecord
-
(
id
)
initWithSetRecord
:(
DBSetRecord
*
)
setRecord
{
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_setTempVector
;
NSMutableSet
*
_setTempSet
=
[
NSMutableSet
setWithCapacity
:[
setRecord
.
set
count
]];
_setTempVector
.
reserve
([
setRecord
.
set
count
]);
for
(
NSString
*
currentValue_0
in
setRecord
.
set
)
{
for
(
NSString
*
currentValue_0
in
setRecord
.
set
)
{
NSString
*
copiedValue_0
;
id
copiedValue_0
;
copiedValue_0
=
[
currentValue_0
copy
];
copiedValue_0
=
[
currentValue_0
copy
];
_setTempVector
.
push_back
(
copiedValue_0
)
;
[
_setTempSet
addObject
:
copiedValue_0
]
;
}
}
_set
=
[
NSSet
setWithObjects
:
&
_setTempVector
[
0
]
count
:
_setTempVector
.
size
()]
;
_set
=
_setTempSet
;
}
}
return
self
;
return
self
;
}
}
...
@@ -35,29 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
...
@@ -35,29 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
return
self
;
}
}
-
(
id
)
initWithCppSetRecord
:(
const
::
SetRecord
&
)
setRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_setTempVector
;
_setTempVector
.
reserve
(
setRecord
.
set
.
size
());
for
(
const
auto
&
cppValue_0
:
setRecord
.
set
)
{
NSString
*
objcValue_0
=
::
djinni
::
String
::
fromCpp
(
cppValue_0
);
_setTempVector
.
push_back
(
objcValue_0
);
}
_set
=
[
NSSet
setWithObjects
:
&
_setTempVector
[
0
]
count
:
_setTempVector
.
size
()];
}
return
self
;
}
-
(
::
SetRecord
)
cppSetRecord
{
std
::
unordered_set
<
std
::
string
>
set
;
for
(
NSString
*
objcValue_0
in
_set
)
{
std
::
string
cppValue_0
=
::
djinni
::
String
::
toCpp
(
objcValue_0
);
set
.
insert
(
std
::
move
(
cppValue_0
));
}
return
::
SetRecord
(
std
::
move
(
set
));
}
@end
@end
test-suite/generated-src/objc/DBTestHelpers.h
View file @
d5dd5294
// AUTOGENERATED FILE - DO NOT MODIFY!
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from test.djinni
// This file generated by Djinni from test.djinni
#import "DBAssortedIntegers.h"
#import "DBColor.h"
#import "DBColor.h"
#import "DBMapListRecord.h"
#import "DBNestedCollection.h"
#import "DBPrimitiveList.h"
#import "DBSetRecord.h"
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
@class
DBAssortedIntegers
;
@class
DBMapListRecord
;
@class
DBNestedCollection
;
@class
DBPrimitiveList
;
@class
DBSetRecord
;
@class
DBToken
;
@class
DBToken
;
@protocol
DBClientInterface
;
@protocol
DBClientInterface
;
...
...
test-suite/generated-src/objc/DBTestHelpers.mm
View file @
d5dd5294
...
@@ -58,14 +58,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -58,14 +58,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBSetRecord
*
)
getSetRecord
{
+
(
DBSetRecord
*
)
getSetRecord
{
try
{
try
{
::
SetRecord
cppRet
=
::
TestHelpers
::
get_set_record
();
::
SetRecord
cppRet
=
::
TestHelpers
::
get_set_record
();
DBSetRecord
*
objcRet
=
[[
DBSetRecord
alloc
]
initWithCppSetRecord
:
cppRet
]
;
DBSetRecord
*
objcRet
=
::
djinni_generated
::
SetRecord
::
fromCpp
(
cppRet
)
;
return
objcRet
;
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
BOOL
)
checkSetRecord
:(
DBSetRecord
*
)
rec
{
+
(
BOOL
)
checkSetRecord
:(
DBSetRecord
*
)
rec
{
try
{
try
{
::
SetRecord
cppRec
=
std
::
move
([
rec
cppSetRecord
]
);
::
SetRecord
cppRec
=
::
djinni_generated
::
SetRecord
::
toCpp
(
rec
);
bool
cppRet
=
::
TestHelpers
::
check_set_record
(
std
::
move
(
cppRec
));
bool
cppRet
=
::
TestHelpers
::
check_set_record
(
std
::
move
(
cppRec
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
return
objcRet
;
...
@@ -75,14 +75,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -75,14 +75,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBPrimitiveList
*
)
getPrimitiveList
{
+
(
DBPrimitiveList
*
)
getPrimitiveList
{
try
{
try
{
::
PrimitiveList
cppRet
=
::
TestHelpers
::
get_primitive_list
();
::
PrimitiveList
cppRet
=
::
TestHelpers
::
get_primitive_list
();
DBPrimitiveList
*
objcRet
=
[[
DBPrimitiveList
alloc
]
initWithCppPrimitiveList
:
cppRet
]
;
DBPrimitiveList
*
objcRet
=
::
djinni_generated
::
PrimitiveList
::
fromCpp
(
cppRet
)
;
return
objcRet
;
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
BOOL
)
checkPrimitiveList
:(
DBPrimitiveList
*
)
pl
{
+
(
BOOL
)
checkPrimitiveList
:(
DBPrimitiveList
*
)
pl
{
try
{
try
{
::
PrimitiveList
cppPl
=
std
::
move
([
pl
cppPrimitiveList
]
);
::
PrimitiveList
cppPl
=
::
djinni_generated
::
PrimitiveList
::
toCpp
(
pl
);
bool
cppRet
=
::
TestHelpers
::
check_primitive_list
(
std
::
move
(
cppPl
));
bool
cppRet
=
::
TestHelpers
::
check_primitive_list
(
std
::
move
(
cppPl
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
return
objcRet
;
...
@@ -92,14 +92,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -92,14 +92,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBNestedCollection
*
)
getNestedCollection
{
+
(
DBNestedCollection
*
)
getNestedCollection
{
try
{
try
{
::
NestedCollection
cppRet
=
::
TestHelpers
::
get_nested_collection
();
::
NestedCollection
cppRet
=
::
TestHelpers
::
get_nested_collection
();
DBNestedCollection
*
objcRet
=
[[
DBNestedCollection
alloc
]
initWithCppNestedCollection
:
cppRet
]
;
DBNestedCollection
*
objcRet
=
::
djinni_generated
::
NestedCollection
::
fromCpp
(
cppRet
)
;
return
objcRet
;
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
BOOL
)
checkNestedCollection
:(
DBNestedCollection
*
)
nc
{
+
(
BOOL
)
checkNestedCollection
:(
DBNestedCollection
*
)
nc
{
try
{
try
{
::
NestedCollection
cppNc
=
std
::
move
([
nc
cppNestedCollection
]
);
::
NestedCollection
cppNc
=
::
djinni_generated
::
NestedCollection
::
toCpp
(
nc
);
bool
cppRet
=
::
TestHelpers
::
check_nested_collection
(
std
::
move
(
cppNc
));
bool
cppRet
=
::
TestHelpers
::
check_nested_collection
(
std
::
move
(
cppNc
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
return
objcRet
;
...
@@ -173,14 +173,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -173,14 +173,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBMapListRecord
*
)
getMapListRecord
{
+
(
DBMapListRecord
*
)
getMapListRecord
{
try
{
try
{
::
MapListRecord
cppRet
=
::
TestHelpers
::
get_map_list_record
();
::
MapListRecord
cppRet
=
::
TestHelpers
::
get_map_list_record
();
DBMapListRecord
*
objcRet
=
[[
DBMapListRecord
alloc
]
initWithCppMapListRecord
:
cppRet
]
;
DBMapListRecord
*
objcRet
=
::
djinni_generated
::
MapListRecord
::
fromCpp
(
cppRet
)
;
return
objcRet
;
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
+
(
BOOL
)
checkMapListRecord
:(
DBMapListRecord
*
)
m
{
+
(
BOOL
)
checkMapListRecord
:(
DBMapListRecord
*
)
m
{
try
{
try
{
::
MapListRecord
cppM
=
std
::
move
([
m
cppMapListRecord
]
);
::
MapListRecord
cppM
=
::
djinni_generated
::
MapListRecord
::
toCpp
(
m
);
bool
cppRet
=
::
TestHelpers
::
check_map_list_record
(
std
::
move
(
cppM
));
bool
cppRet
=
::
TestHelpers
::
check_map_list_record
(
std
::
move
(
cppM
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
return
objcRet
;
...
@@ -261,9 +261,9 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
...
@@ -261,9 +261,9 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBAssortedIntegers
*
)
assortedIntegersId
:(
DBAssortedIntegers
*
)
i
{
+
(
DBAssortedIntegers
*
)
assortedIntegersId
:(
DBAssortedIntegers
*
)
i
{
try
{
try
{
::
AssortedIntegers
cppI
=
std
::
move
([
i
cppAssortedIntegers
]
);
::
AssortedIntegers
cppI
=
::
djinni_generated
::
AssortedIntegers
::
toCpp
(
i
);
::
AssortedIntegers
cppRet
=
::
TestHelpers
::
assorted_integers_id
(
std
::
move
(
cppI
));
::
AssortedIntegers
cppRet
=
::
TestHelpers
::
assorted_integers_id
(
std
::
move
(
cppI
));
DBAssortedIntegers
*
objcRet
=
[[
DBAssortedIntegers
alloc
]
initWithCppAssortedIntegers
:
cppRet
]
;
DBAssortedIntegers
*
objcRet
=
::
djinni_generated
::
AssortedIntegers
::
fromCpp
(
cppRet
)
;
return
objcRet
;
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
}
...
...
test-suite/handwritten-src/objc/tests/DBMapRecordTests.mm
View file @
d5dd5294
#import "DBMapRecord+Private.h"
#import "DBMapRecord+Private.h"
#import "DBMapRecord.h"
#import "DBMapListRecord+Private.h"
#import "DBMapListRecord+Private.h"
#import "DBMapListRecord.h"
#import <XCTest/XCTest.h>
#import <XCTest/XCTest.h>
#include "map_record.hpp"
#include "map_record.hpp"
...
@@ -23,21 +25,21 @@
...
@@ -23,21 +25,21 @@
-
(
void
)
testCppToObjc
-
(
void
)
testCppToObjc
{
{
MapRecord
cppMapRecord
([
self
getCppMap
]);
MapRecord
cppMapRecord
([
self
getCppMap
]);
DBMapRecord
*
objcMapRecord
=
[[
DBMapRecord
alloc
]
initWithCppMapRecord
:
cppMapRecord
]
;
DBMapRecord
*
objcMapRecord
=
djinni_generated
::
MapRecord
::
fromCpp
(
cppMapRecord
)
;
[
self
checkObjcMap
:
objcMapRecord
.
map
];
[
self
checkObjcMap
:
objcMapRecord
.
map
];
}
}
-
(
void
)
testObjcToCpp
-
(
void
)
testObjcToCpp
{
{
DBMapRecord
*
objcMapRecord
=
[[
DBMapRecord
alloc
]
initWithMap
:[
self
getObjcMap
]];
DBMapRecord
*
objcMapRecord
=
[[
DBMapRecord
alloc
]
initWithMap
:[
self
getObjcMap
]];
MapRecord
cppMapRecord
=
[
objcMapRecord
cppMapRecord
]
;
MapRecord
cppMapRecord
=
djinni_generated
::
MapRecord
::
toCpp
(
objcMapRecord
)
;
[
self
checkCppMap
:
cppMapRecord
.
map
];
[
self
checkCppMap
:
cppMapRecord
.
map
];
}
}
-
(
void
)
testCppToObjcEmpty
-
(
void
)
testCppToObjcEmpty
{
{
MapRecord
cppMapRecord
{
{}
};
MapRecord
cppMapRecord
{
{}
};
DBMapRecord
*
objcMapRecord
=
[[
DBMapRecord
alloc
]
initWithCppMapRecord
:
cppMapRecord
]
;
DBMapRecord
*
objcMapRecord
=
djinni_generated
::
MapRecord
::
fromCpp
(
cppMapRecord
)
;
XCTAssertEqual
([
objcMapRecord
.
map
count
],
(
NSUInteger
)
0
,
@"Count 0 expected, actual: %lu"
,
(
unsigned
long
)[
objcMapRecord
.
map
count
]);
XCTAssertEqual
([
objcMapRecord
.
map
count
],
(
NSUInteger
)
0
,
@"Count 0 expected, actual: %lu"
,
(
unsigned
long
)[
objcMapRecord
.
map
count
]);
}
}
...
@@ -45,7 +47,7 @@
...
@@ -45,7 +47,7 @@
-
(
void
)
testObjcToCppEmpty
-
(
void
)
testObjcToCppEmpty
{
{
DBMapRecord
*
objcMapRecord
=
[[
DBMapRecord
alloc
]
initWithMap
:[[
NSDictionary
alloc
]
init
]];
DBMapRecord
*
objcMapRecord
=
[[
DBMapRecord
alloc
]
initWithMap
:[[
NSDictionary
alloc
]
init
]];
MapRecord
cppMapRecord
=
[
objcMapRecord
cppMapRecord
]
;
MapRecord
cppMapRecord
=
djinni_generated
::
MapRecord
::
toCpp
(
objcMapRecord
)
;
auto
&
cppMap
=
cppMapRecord
.
map
;
auto
&
cppMap
=
cppMapRecord
.
map
;
XCTAssertEqual
(
cppMap
.
size
(),
(
size_t
)
0
,
@"Count 0 expected, actual: %zd"
,
cppMap
.
size
());
XCTAssertEqual
(
cppMap
.
size
(),
(
size_t
)
0
,
@"Count 0 expected, actual: %zd"
,
cppMap
.
size
());
}
}
...
@@ -53,7 +55,7 @@
...
@@ -53,7 +55,7 @@
-
(
void
)
testCppMapListToObjc
-
(
void
)
testCppMapListToObjc
{
{
MapListRecord
cppMapListRecord
{
{
[
self
getCppMap
]
}
};
MapListRecord
cppMapListRecord
{
{
[
self
getCppMap
]
}
};
DBMapListRecord
*
objcMapListRecord
=
[[
DBMapListRecord
alloc
]
initWithCppMapListRecord
:
cppMapListRecord
]
;
DBMapListRecord
*
objcMapListRecord
=
djinni_generated
::
MapListRecord
::
fromCpp
(
cppMapListRecord
)
;
NSArray
*
objcMapList
=
objcMapListRecord
.
mapList
;
NSArray
*
objcMapList
=
objcMapListRecord
.
mapList
;
XCTAssertEqual
([
objcMapList
count
],
(
NSUInteger
)
1
,
@"List with 1 map expected, actual no: %lu"
,
(
unsigned
long
)[
objcMapList
count
]);
XCTAssertEqual
([
objcMapList
count
],
(
NSUInteger
)
1
,
@"List with 1 map expected, actual no: %lu"
,
(
unsigned
long
)[
objcMapList
count
]);
[
self
checkObjcMap
:[
objcMapList
objectAtIndex
:
0
]];
[
self
checkObjcMap
:[
objcMapList
objectAtIndex
:
0
]];
...
@@ -63,7 +65,7 @@
...
@@ -63,7 +65,7 @@
{
{
NSArray
*
objcMapList
=
[[
NSArray
alloc
]
initWithObjects
:[
self
getObjcMap
],
nil
];
NSArray
*
objcMapList
=
[[
NSArray
alloc
]
initWithObjects
:[
self
getObjcMap
],
nil
];
DBMapListRecord
*
objcMapListRecord
=
[[
DBMapListRecord
alloc
]
initWithMapList
:
objcMapList
];
DBMapListRecord
*
objcMapListRecord
=
[[
DBMapListRecord
alloc
]
initWithMapList
:
objcMapList
];
auto
cppMapListRecord
=
[
objcMapListRecord
cppMapListRecord
]
;
auto
cppMapListRecord
=
djinni_generated
::
MapListRecord
::
toCpp
(
objcMapListRecord
)
;
auto
&
cppMapList
=
cppMapListRecord
.
map_list
;
auto
&
cppMapList
=
cppMapListRecord
.
map_list
;
XCTAssertEqual
(
cppMapList
.
size
(),
(
size_t
)
1
,
@"List with 1 map expected, actual no: %zd"
,
cppMapList
.
size
());
XCTAssertEqual
(
cppMapList
.
size
(),
(
size_t
)
1
,
@"List with 1 map expected, actual no: %zd"
,
cppMapList
.
size
());
[
self
checkCppMap
:
cppMapList
[
0
]];
[
self
checkCppMap
:
cppMapList
[
0
]];
...
...
test-suite/handwritten-src/objc/tests/DBNestedCollectionTests.mm
View file @
d5dd5294
...
@@ -27,13 +27,13 @@ static DBNestedCollection *objcNestedCollection = [[DBNestedCollection alloc] in
...
@@ -27,13 +27,13 @@ static DBNestedCollection *objcNestedCollection = [[DBNestedCollection alloc] in
-
(
void
)
testCppNestedCollectionToObjc
-
(
void
)
testCppNestedCollectionToObjc
{
{
DBNestedCollection
*
converted
=
[[
DBNestedCollection
alloc
]
initWithCppNestedCollection
:
cppNestedCollection
]
;
DBNestedCollection
*
converted
=
djinni_generated
::
NestedCollection
::
fromCpp
(
cppNestedCollection
)
;
XCTAssertEqualObjects
(
objcNestedCollection
.
setList
,
converted
.
setList
,
@"List expected to be equivalent"
);
XCTAssertEqualObjects
(
objcNestedCollection
.
setList
,
converted
.
setList
,
@"List expected to be equivalent"
);
}
}
-
(
void
)
testObjcNestedCollectionToCpp
-
(
void
)
testObjcNestedCollectionToCpp
{
{
NestedCollection
converted
=
[
objcNestedCollection
cppNestedCollection
]
;
NestedCollection
converted
=
djinni_generated
::
NestedCollection
::
toCpp
(
objcNestedCollection
)
;
XCTAssertEqual
(
cppNestedCollection
.
set_list
,
converted
.
set_list
,
@"List expected to be equivalent"
);
XCTAssertEqual
(
cppNestedCollection
.
set_list
,
converted
.
set_list
,
@"List expected to be equivalent"
);
}
}
...
...
test-suite/handwritten-src/objc/tests/DBPrimitiveListTests.mm
View file @
d5dd5294
...
@@ -35,13 +35,13 @@ static DBPrimitiveList *objcPrimitiveList = [[DBPrimitiveList alloc] initWithLis
...
@@ -35,13 +35,13 @@ static DBPrimitiveList *objcPrimitiveList = [[DBPrimitiveList alloc] initWithLis
-
(
void
)
testObjcToCppConverter
-
(
void
)
testObjcToCppConverter
{
{
PrimitiveList
convert
=
[
objcPrimitiveList
cppPrimitiveList
]
;
PrimitiveList
convert
=
djinni_generated
::
PrimitiveList
::
toCpp
(
objcPrimitiveList
)
;
XCTAssertEqual
(
convert
.
list
,
cppPrimitiveList
.
list
,
@"C++ converted list should be the same."
);
XCTAssertEqual
(
convert
.
list
,
cppPrimitiveList
.
list
,
@"C++ converted list should be the same."
);
}
}
-
(
void
)
testCppToObjcConverter
-
(
void
)
testCppToObjcConverter
{
{
DBPrimitiveList
*
convert
=
[[
DBPrimitiveList
alloc
]
initWithCppPrimitiveList
:
cppPrimitiveList
]
;
DBPrimitiveList
*
convert
=
djinni_generated
::
PrimitiveList
::
fromCpp
(
cppPrimitiveList
)
;
XCTAssertEqualObjects
(
convert
.
list
,
objcPrimitiveList
.
list
,
@"Objective-C converted list should be the same."
);
XCTAssertEqualObjects
(
convert
.
list
,
objcPrimitiveList
.
list
,
@"Objective-C converted list should be the same."
);
}
}
...
...
test-suite/handwritten-src/objc/tests/DBSetRecordTests.mm
View file @
d5dd5294
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
-
(
void
)
testCppToObjc
-
(
void
)
testCppToObjc
{
{
SetRecord
cppSetRecord
=
[
self
getCppSetRecord
];
SetRecord
cppSetRecord
=
[
self
getCppSetRecord
];
DBSetRecord
*
objcSetRecord
=
[[
DBSetRecord
alloc
]
initWithCppSetRecord
:
cppSetRecord
]
;
DBSetRecord
*
objcSetRecord
=
djinni_generated
::
SetRecord
::
fromCpp
(
cppSetRecord
)
;
XCTAssertEqual
([
objcSetRecord
.
set
count
],
(
NSUInteger
)
3
,
@"Set length 3 expected, actual: %lu"
,
(
unsigned
long
)[
objcSetRecord
.
set
count
]);
XCTAssertEqual
([
objcSetRecord
.
set
count
],
(
NSUInteger
)
3
,
@"Set length 3 expected, actual: %lu"
,
(
unsigned
long
)[
objcSetRecord
.
set
count
]);
XCTAssert
([
objcSetRecord
.
set
containsObject
:
@"StringA"
],
@"
\"
StringA
\"
expected but does not exist"
);
XCTAssert
([
objcSetRecord
.
set
containsObject
:
@"StringA"
],
@"
\"
StringA
\"
expected but does not exist"
);
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
-
(
void
)
testObjcToCpp
-
(
void
)
testObjcToCpp
{
{
DBSetRecord
*
objcSetRecord
=
[
self
getObjcSetRecord
];
DBSetRecord
*
objcSetRecord
=
[
self
getObjcSetRecord
];
SetRecord
cppSetRecord
=
[
objcSetRecord
cppSetRecord
]
;
SetRecord
cppSetRecord
=
djinni_generated
::
SetRecord
::
toCpp
(
objcSetRecord
)
;
auto
&
cppSet
=
cppSetRecord
.
set
;
auto
&
cppSet
=
cppSetRecord
.
set
;
XCTAssertEqual
(
cppSet
.
size
(),
(
NSUInteger
)
3
,
@"Set length 3 expected, actual: %zd"
,
cppSet
.
size
());
XCTAssertEqual
(
cppSet
.
size
(),
(
NSUInteger
)
3
,
@"Set length 3 expected, actual: %zd"
,
cppSet
.
size
());
...
...
test-suite/objc/DjinniObjcTest.xcodeproj/project.pbxproj
View file @
d5dd5294
This diff is collapsed.
Click to expand it.
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