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
6b35e333
Commit
6b35e333
authored
May 05, 2015
by
Jacob Potter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fully-qualify things in all namespaces"
This reverts commit
0807100b
.
parent
5aabdc7e
Changes
75
Hide whitespace changes
Inline
Side-by-side
Showing
75 changed files
with
281 additions
and
281 deletions
+281
-281
example/generated-src/cpp/sort_items.hpp
example/generated-src/cpp/sort_items.hpp
+2
-2
example/generated-src/cpp/textbox_listener.hpp
example/generated-src/cpp/textbox_listener.hpp
+1
-1
src/source/Marshal.scala
src/source/Marshal.scala
+1
-1
test-suite/generated-src/cpp/client_interface.hpp
test-suite/generated-src/cpp/client_interface.hpp
+1
-1
test-suite/generated-src/cpp/color.hpp
test-suite/generated-src/cpp/color.hpp
+2
-2
test-suite/generated-src/cpp/constants.cpp
test-suite/generated-src/cpp/constants.cpp
+1
-1
test-suite/generated-src/cpp/constants.hpp
test-suite/generated-src/cpp/constants.hpp
+1
-1
test-suite/generated-src/cpp/cpp_exception.hpp
test-suite/generated-src/cpp/cpp_exception.hpp
+1
-1
test-suite/generated-src/cpp/record_with_nested_derivings.hpp
...-suite/generated-src/cpp/record_with_nested_derivings.hpp
+2
-2
test-suite/generated-src/cpp/test_helpers.hpp
test-suite/generated-src/cpp/test_helpers.hpp
+16
-16
test-suite/generated-src/jni/NativeAssortedIntegers.cpp
test-suite/generated-src/jni/NativeAssortedIntegers.cpp
+3
-3
test-suite/generated-src/jni/NativeAssortedIntegers.hpp
test-suite/generated-src/jni/NativeAssortedIntegers.hpp
+3
-3
test-suite/generated-src/jni/NativeClientInterface.cpp
test-suite/generated-src/jni/NativeClientInterface.cpp
+2
-2
test-suite/generated-src/jni/NativeClientInterface.hpp
test-suite/generated-src/jni/NativeClientInterface.hpp
+7
-7
test-suite/generated-src/jni/NativeClientReturnedRecord.cpp
test-suite/generated-src/jni/NativeClientReturnedRecord.cpp
+3
-3
test-suite/generated-src/jni/NativeClientReturnedRecord.hpp
test-suite/generated-src/jni/NativeClientReturnedRecord.hpp
+3
-3
test-suite/generated-src/jni/NativeColor.hpp
test-suite/generated-src/jni/NativeColor.hpp
+3
-3
test-suite/generated-src/jni/NativeConstants.cpp
test-suite/generated-src/jni/NativeConstants.cpp
+3
-3
test-suite/generated-src/jni/NativeConstants.hpp
test-suite/generated-src/jni/NativeConstants.hpp
+3
-3
test-suite/generated-src/jni/NativeCppException.cpp
test-suite/generated-src/jni/NativeCppException.cpp
+4
-4
test-suite/generated-src/jni/NativeCppException.hpp
test-suite/generated-src/jni/NativeCppException.hpp
+4
-4
test-suite/generated-src/jni/NativeDateRecord.cpp
test-suite/generated-src/jni/NativeDateRecord.cpp
+3
-3
test-suite/generated-src/jni/NativeDateRecord.hpp
test-suite/generated-src/jni/NativeDateRecord.hpp
+3
-3
test-suite/generated-src/jni/NativeMapDateRecord.cpp
test-suite/generated-src/jni/NativeMapDateRecord.cpp
+3
-3
test-suite/generated-src/jni/NativeMapDateRecord.hpp
test-suite/generated-src/jni/NativeMapDateRecord.hpp
+3
-3
test-suite/generated-src/jni/NativeMapListRecord.cpp
test-suite/generated-src/jni/NativeMapListRecord.cpp
+3
-3
test-suite/generated-src/jni/NativeMapListRecord.hpp
test-suite/generated-src/jni/NativeMapListRecord.hpp
+3
-3
test-suite/generated-src/jni/NativeMapRecord.cpp
test-suite/generated-src/jni/NativeMapRecord.cpp
+3
-3
test-suite/generated-src/jni/NativeMapRecord.hpp
test-suite/generated-src/jni/NativeMapRecord.hpp
+3
-3
test-suite/generated-src/jni/NativeNestedCollection.cpp
test-suite/generated-src/jni/NativeNestedCollection.cpp
+3
-3
test-suite/generated-src/jni/NativeNestedCollection.hpp
test-suite/generated-src/jni/NativeNestedCollection.hpp
+3
-3
test-suite/generated-src/jni/NativePrimitiveList.cpp
test-suite/generated-src/jni/NativePrimitiveList.cpp
+3
-3
test-suite/generated-src/jni/NativePrimitiveList.hpp
test-suite/generated-src/jni/NativePrimitiveList.hpp
+3
-3
test-suite/generated-src/jni/NativeRecordWithDerivings.cpp
test-suite/generated-src/jni/NativeRecordWithDerivings.cpp
+3
-3
test-suite/generated-src/jni/NativeRecordWithDerivings.hpp
test-suite/generated-src/jni/NativeRecordWithDerivings.hpp
+3
-3
test-suite/generated-src/jni/NativeRecordWithNestedDerivings.cpp
...ite/generated-src/jni/NativeRecordWithNestedDerivings.cpp
+3
-3
test-suite/generated-src/jni/NativeRecordWithNestedDerivings.hpp
...ite/generated-src/jni/NativeRecordWithNestedDerivings.hpp
+3
-3
test-suite/generated-src/jni/NativeSetRecord.cpp
test-suite/generated-src/jni/NativeSetRecord.cpp
+3
-3
test-suite/generated-src/jni/NativeSetRecord.hpp
test-suite/generated-src/jni/NativeSetRecord.hpp
+3
-3
test-suite/generated-src/jni/NativeTestHelpers.cpp
test-suite/generated-src/jni/NativeTestHelpers.cpp
+34
-34
test-suite/generated-src/jni/NativeTestHelpers.hpp
test-suite/generated-src/jni/NativeTestHelpers.hpp
+4
-4
test-suite/generated-src/jni/NativeToken.cpp
test-suite/generated-src/jni/NativeToken.cpp
+2
-2
test-suite/generated-src/jni/NativeToken.hpp
test-suite/generated-src/jni/NativeToken.hpp
+6
-6
test-suite/generated-src/objc/DBAssortedIntegers+Private.h
test-suite/generated-src/objc/DBAssortedIntegers+Private.h
+2
-2
test-suite/generated-src/objc/DBAssortedIntegers.mm
test-suite/generated-src/objc/DBAssortedIntegers.mm
+3
-3
test-suite/generated-src/objc/DBClientInterface+Private.h
test-suite/generated-src/objc/DBClientInterface+Private.h
+1
-1
test-suite/generated-src/objc/DBClientInterface.mm
test-suite/generated-src/objc/DBClientInterface.mm
+4
-4
test-suite/generated-src/objc/DBClientReturnedRecord+Private.h
...suite/generated-src/objc/DBClientReturnedRecord+Private.h
+2
-2
test-suite/generated-src/objc/DBClientReturnedRecord.mm
test-suite/generated-src/objc/DBClientReturnedRecord.mm
+3
-3
test-suite/generated-src/objc/DBConstants+Private.h
test-suite/generated-src/objc/DBConstants+Private.h
+2
-2
test-suite/generated-src/objc/DBConstants.mm
test-suite/generated-src/objc/DBConstants.mm
+3
-3
test-suite/generated-src/objc/DBCppException+Private.h
test-suite/generated-src/objc/DBCppException+Private.h
+1
-1
test-suite/generated-src/objc/DBCppException.mm
test-suite/generated-src/objc/DBCppException.mm
+5
-5
test-suite/generated-src/objc/DBDateRecord+Private.h
test-suite/generated-src/objc/DBDateRecord+Private.h
+2
-2
test-suite/generated-src/objc/DBDateRecord.mm
test-suite/generated-src/objc/DBDateRecord.mm
+3
-3
test-suite/generated-src/objc/DBMapDateRecord+Private.h
test-suite/generated-src/objc/DBMapDateRecord+Private.h
+2
-2
test-suite/generated-src/objc/DBMapDateRecord.mm
test-suite/generated-src/objc/DBMapDateRecord.mm
+3
-3
test-suite/generated-src/objc/DBMapListRecord+Private.h
test-suite/generated-src/objc/DBMapListRecord+Private.h
+2
-2
test-suite/generated-src/objc/DBMapListRecord.mm
test-suite/generated-src/objc/DBMapListRecord.mm
+3
-3
test-suite/generated-src/objc/DBMapRecord+Private.h
test-suite/generated-src/objc/DBMapRecord+Private.h
+2
-2
test-suite/generated-src/objc/DBMapRecord.mm
test-suite/generated-src/objc/DBMapRecord.mm
+3
-3
test-suite/generated-src/objc/DBNestedCollection+Private.h
test-suite/generated-src/objc/DBNestedCollection+Private.h
+2
-2
test-suite/generated-src/objc/DBNestedCollection.mm
test-suite/generated-src/objc/DBNestedCollection.mm
+3
-3
test-suite/generated-src/objc/DBPrimitiveList+Private.h
test-suite/generated-src/objc/DBPrimitiveList+Private.h
+2
-2
test-suite/generated-src/objc/DBPrimitiveList.mm
test-suite/generated-src/objc/DBPrimitiveList.mm
+3
-3
test-suite/generated-src/objc/DBRecordWithDerivings+Private.h
...-suite/generated-src/objc/DBRecordWithDerivings+Private.h
+2
-2
test-suite/generated-src/objc/DBRecordWithDerivings.mm
test-suite/generated-src/objc/DBRecordWithDerivings.mm
+3
-3
test-suite/generated-src/objc/DBRecordWithNestedDerivings+Private.h
.../generated-src/objc/DBRecordWithNestedDerivings+Private.h
+2
-2
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
+4
-4
test-suite/generated-src/objc/DBSetRecord+Private.h
test-suite/generated-src/objc/DBSetRecord+Private.h
+2
-2
test-suite/generated-src/objc/DBSetRecord.mm
test-suite/generated-src/objc/DBSetRecord.mm
+3
-3
test-suite/generated-src/objc/DBTestHelpers+Private.h
test-suite/generated-src/objc/DBTestHelpers+Private.h
+1
-1
test-suite/generated-src/objc/DBTestHelpers.mm
test-suite/generated-src/objc/DBTestHelpers.mm
+37
-37
test-suite/generated-src/objc/DBToken+Private.h
test-suite/generated-src/objc/DBToken+Private.h
+1
-1
test-suite/generated-src/objc/DBToken.mm
test-suite/generated-src/objc/DBToken.mm
+4
-4
No files found.
example/generated-src/cpp/sort_items.hpp
View file @
6b35e333
...
...
@@ -15,9 +15,9 @@ class SortItems {
public:
virtual
~
SortItems
()
{}
virtual
void
sort
(
::
sort_order
order
,
const
::
ItemList
&
items
)
=
0
;
virtual
void
sort
(
sort_order
order
,
const
ItemList
&
items
)
=
0
;
static
std
::
shared_ptr
<
::
SortItems
>
create_with_listener
(
const
std
::
shared_ptr
<::
TextboxListener
>
&
listener
);
static
std
::
shared_ptr
<
SortItems
>
create_with_listener
(
const
std
::
shared_ptr
<
TextboxListener
>
&
listener
);
};
}
// namespace textsort
example/generated-src/cpp/textbox_listener.hpp
View file @
6b35e333
...
...
@@ -11,7 +11,7 @@ class TextboxListener {
public:
virtual
~
TextboxListener
()
{}
virtual
void
update
(
const
::
ItemList
&
items
)
=
0
;
virtual
void
update
(
const
ItemList
&
items
)
=
0
;
};
}
// namespace textsort
src/source/Marshal.scala
View file @
6b35e333
...
...
@@ -35,5 +35,5 @@ abstract class Marshal(spec: Spec) {
protected
val
idJava
=
spec
.
javaIdentStyle
protected
val
idObjc
=
spec
.
objcIdentStyle
protected
def
withNs
(
namespace
:
Option
[
String
],
t
:
String
)
=
"::"
+
namespace
.
fold
(
t
)(
_
+
"::"
+
t
)
protected
def
withNs
(
namespace
:
Option
[
String
],
t
:
String
)
=
namespace
.
fold
(
t
)(
"::"
+
_
+
"::"
+
t
)
}
test-suite/generated-src/cpp/client_interface.hpp
View file @
6b35e333
...
...
@@ -12,5 +12,5 @@ public:
virtual
~
ClientInterface
()
{}
/** Returns record of given string */
virtual
::
ClientReturnedRecord
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
=
0
;
virtual
ClientReturnedRecord
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
=
0
;
};
test-suite/generated-src/cpp/color.hpp
View file @
6b35e333
...
...
@@ -23,8 +23,8 @@ enum class color : int {
namespace
std
{
template
<
>
struct
hash
<
::
color
>
{
size_t
operator
()(
::
color
type
)
const
{
struct
hash
<
color
>
{
size_t
operator
()(
color
type
)
const
{
return
std
::
hash
<
int
>
()(
static_cast
<
int
>
(
type
));
}
};
...
...
test-suite/generated-src/cpp/constants.cpp
View file @
6b35e333
...
...
@@ -19,6 +19,6 @@ const std::string Constants::STRING_CONSTANT = "string-constant";
const
std
::
experimental
::
optional
<
int32_t
>
Constants
::
OPTIONAL_INTEGER_CONSTANT
=
1
;
const
::
Constants
Constants
::
OBJECT_CONSTANT
=
::
Constants
(
const
Constants
Constants
::
OBJECT_CONSTANT
=
Constants
(
Constants
::
I32_CONSTANT
/* some_integer */
,
Constants
::
STRING_CONSTANT
/* some_string */
);
test-suite/generated-src/cpp/constants.hpp
View file @
6b35e333
...
...
@@ -26,7 +26,7 @@ struct Constants final {
static
const
std
::
experimental
::
optional
<
int32_t
>
OPTIONAL_INTEGER_CONSTANT
;
static
const
::
Constants
OBJECT_CONSTANT
;
static
const
Constants
OBJECT_CONSTANT
;
int32_t
some_integer
;
...
...
test-suite/generated-src/cpp/cpp_exception.hpp
View file @
6b35e333
...
...
@@ -12,5 +12,5 @@ public:
virtual
int32_t
throw_an_exception
()
=
0
;
static
std
::
shared_ptr
<
::
CppException
>
get
();
static
std
::
shared_ptr
<
CppException
>
get
();
};
test-suite/generated-src/cpp/record_with_nested_derivings.hpp
View file @
6b35e333
...
...
@@ -11,7 +11,7 @@ struct RecordWithNestedDerivings final {
int32_t
key
;
::
RecordWithDerivings
rec
;
RecordWithDerivings
rec
;
bool
operator
==
(
const
RecordWithNestedDerivings
&
other
)
const
;
bool
operator
!=
(
const
RecordWithNestedDerivings
&
other
)
const
;
...
...
@@ -22,7 +22,7 @@ struct RecordWithNestedDerivings final {
RecordWithNestedDerivings
(
int32_t
key
,
::
RecordWithDerivings
rec
)
:
RecordWithDerivings
rec
)
:
key
(
std
::
move
(
key
)),
rec
(
std
::
move
(
rec
))
{
}
...
...
test-suite/generated-src/cpp/test_helpers.hpp
View file @
6b35e333
...
...
@@ -22,17 +22,17 @@ class TestHelpers {
public:
virtual
~
TestHelpers
()
{}
static
::
SetRecord
get_set_record
();
static
SetRecord
get_set_record
();
static
bool
check_set_record
(
const
::
SetRecord
&
rec
);
static
bool
check_set_record
(
const
SetRecord
&
rec
);
static
::
PrimitiveList
get_primitive_list
();
static
PrimitiveList
get_primitive_list
();
static
bool
check_primitive_list
(
const
::
PrimitiveList
&
pl
);
static
bool
check_primitive_list
(
const
PrimitiveList
&
pl
);
static
::
NestedCollection
get_nested_collection
();
static
NestedCollection
get_nested_collection
();
static
bool
check_nested_collection
(
const
::
NestedCollection
&
nc
);
static
bool
check_nested_collection
(
const
NestedCollection
&
nc
);
static
std
::
unordered_map
<
std
::
string
,
int64_t
>
get_map
();
...
...
@@ -42,26 +42,26 @@ public:
static
bool
check_empty_map
(
const
std
::
unordered_map
<
std
::
string
,
int64_t
>
&
m
);
static
::
MapListRecord
get_map_list_record
();
static
MapListRecord
get_map_list_record
();
static
bool
check_map_list_record
(
const
::
MapListRecord
&
m
);
static
bool
check_map_list_record
(
const
MapListRecord
&
m
);
static
void
check_client_interface_ascii
(
const
std
::
shared_ptr
<
::
ClientInterface
>
&
i
);
static
void
check_client_interface_ascii
(
const
std
::
shared_ptr
<
ClientInterface
>
&
i
);
static
void
check_client_interface_nonascii
(
const
std
::
shared_ptr
<
::
ClientInterface
>
&
i
);
static
void
check_client_interface_nonascii
(
const
std
::
shared_ptr
<
ClientInterface
>
&
i
);
static
void
check_enum_map
(
const
std
::
unordered_map
<
::
color
,
std
::
string
>
&
m
);
static
void
check_enum_map
(
const
std
::
unordered_map
<
color
,
std
::
string
>
&
m
);
static
std
::
shared_ptr
<
::
Token
>
token_id
(
const
std
::
shared_ptr
<::
Token
>
&
t
);
static
std
::
shared_ptr
<
Token
>
token_id
(
const
std
::
shared_ptr
<
Token
>
&
t
);
static
std
::
shared_ptr
<
::
Token
>
create_cpp_token
();
static
std
::
shared_ptr
<
Token
>
create_cpp_token
();
static
void
check_cpp_token
(
const
std
::
shared_ptr
<
::
Token
>
&
t
);
static
void
check_cpp_token
(
const
std
::
shared_ptr
<
Token
>
&
t
);
static
int64_t
cpp_token_id
(
const
std
::
shared_ptr
<
::
Token
>
&
t
);
static
int64_t
cpp_token_id
(
const
std
::
shared_ptr
<
Token
>
&
t
);
static
std
::
experimental
::
optional
<
int32_t
>
return_none
();
/** Ensures that we generate integer translation code */
static
::
AssortedIntegers
assorted_integers_id
(
const
::
AssortedIntegers
&
i
);
static
AssortedIntegers
assorted_integers_id
(
const
AssortedIntegers
&
i
);
};
test-suite/generated-src/jni/NativeAssortedIntegers.cpp
View file @
6b35e333
...
...
@@ -10,7 +10,7 @@
namespace
djinni_generated
{
jobject
NativeAssortedIntegers
::
toJava
(
JNIEnv
*
jniEnv
,
::
AssortedIntegers
c
)
{
jobject
NativeAssortedIntegers
::
toJava
(
JNIEnv
*
jniEnv
,
AssortedIntegers
c
)
{
jbyte
j_eight
=
::
djinni
::
HI8
::
Unboxed
::
toJava
(
jniEnv
,
c
.
eight
);
jshort
j_sixteen
=
::
djinni
::
HI16
::
Unboxed
::
toJava
(
jniEnv
,
c
.
sixteen
);
jint
j_thirtytwo
=
::
djinni
::
HI32
::
Unboxed
::
toJava
(
jniEnv
,
c
.
thirtytwo
);
...
...
@@ -25,10 +25,10 @@ jobject NativeAssortedIntegers::toJava(JNIEnv* jniEnv, ::AssortedIntegers c) {
return
r
;
}
::
AssortedIntegers
NativeAssortedIntegers
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
AssortedIntegers
NativeAssortedIntegers
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeAssortedIntegers
>::
get
();
return
::
AssortedIntegers
(
return
AssortedIntegers
(
::
djinni
::
HI8
::
Unboxed
::
fromJava
(
jniEnv
,
jniEnv
->
GetByteField
(
j
,
data
.
field_mEight
)),
::
djinni
::
HI16
::
Unboxed
::
fromJava
(
jniEnv
,
jniEnv
->
GetShortField
(
j
,
data
.
field_mSixteen
)),
::
djinni
::
HI32
::
Unboxed
::
fromJava
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mThirtytwo
)),
...
...
test-suite/generated-src/jni/NativeAssortedIntegers.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeAssortedIntegers
final
{
public:
using
CppType
=
::
AssortedIntegers
;
using
CppType
=
AssortedIntegers
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
AssortedIntegers
);
static
::
AssortedIntegers
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
AssortedIntegers
);
static
AssortedIntegers
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/AssortedIntegers"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(BSIJLjava/lang/Byte;Ljava/lang/Short;Ljava/lang/Integer;Ljava/lang/Long;)V"
)
};
...
...
test-suite/generated-src/jni/NativeClientInterface.cpp
View file @
6b35e333
...
...
@@ -8,11 +8,11 @@
namespace
djinni_generated
{
NativeClientInterface
::
NativeClientInterface
()
:
djinni
::
JniInterface
<
::
ClientInterface
,
NativeClientInterface
>
()
{}
NativeClientInterface
::
NativeClientInterface
()
:
djinni
::
JniInterface
<
ClientInterface
,
NativeClientInterface
>
()
{}
NativeClientInterface
::
JavaProxy
::
JavaProxy
(
jobject
obj
)
:
JavaProxyCacheEntry
(
obj
)
{}
::
ClientReturnedRecord
NativeClientInterface
::
JavaProxy
::
JavaProxy
::
get_record
(
int64_t
c_record_id
,
const
std
::
string
&
c_utf8string
)
{
ClientReturnedRecord
NativeClientInterface
::
JavaProxy
::
JavaProxy
::
get_record
(
int64_t
c_record_id
,
const
std
::
string
&
c_utf8string
)
{
JNIEnv
*
const
jniEnv
=
djinni
::
jniGetThreadEnv
();
djinni
::
JniLocalScope
jscope
(
jniEnv
,
10
);
jlong
j_record_id
=
::
djinni
::
HI64
::
Unboxed
::
toJava
(
jniEnv
,
c_record_id
);
...
...
test-suite/generated-src/jni/NativeClientInterface.hpp
View file @
6b35e333
...
...
@@ -8,25 +8,25 @@
namespace
djinni_generated
{
class
NativeClientInterface
final
:
djinni
::
JniInterface
<
::
ClientInterface
,
NativeClientInterface
>
{
class
NativeClientInterface
final
:
djinni
::
JniInterface
<
ClientInterface
,
NativeClientInterface
>
{
public:
using
CppType
=
std
::
shared_ptr
<
::
ClientInterface
>
;
using
CppType
=
std
::
shared_ptr
<
ClientInterface
>
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
::
ClientInterface
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeClientInterface
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
::
ClientInterface
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeClientInterface
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
ClientInterface
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeClientInterface
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
ClientInterface
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeClientInterface
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/ClientInterface"
)
};
const
jmethodID
method_getRecord
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"getRecord"
,
"(JLjava/lang/String;)Lcom/dropbox/djinni/test/ClientReturnedRecord;"
)
};
class
JavaProxy
final
:
djinni
::
JavaProxyCacheEntry
,
public
::
ClientInterface
{
class
JavaProxy
final
:
djinni
::
JavaProxyCacheEntry
,
public
ClientInterface
{
public:
JavaProxy
(
jobject
obj
);
virtual
::
ClientReturnedRecord
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
override
;
virtual
ClientReturnedRecord
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
override
;
private:
using
djinni
::
JavaProxyCacheEntry
::
getGlobalRef
;
friend
class
djinni
::
JniInterface
<
::
ClientInterface
,
::
djinni_generated
::
NativeClientInterface
>
;
friend
class
djinni
::
JniInterface
<
ClientInterface
,
::
djinni_generated
::
NativeClientInterface
>
;
friend
class
djinni
::
JavaProxyCache
<
JavaProxy
>
;
};
...
...
test-suite/generated-src/jni/NativeClientReturnedRecord.cpp
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
namespace
djinni_generated
{
jobject
NativeClientReturnedRecord
::
toJava
(
JNIEnv
*
jniEnv
,
::
ClientReturnedRecord
c
)
{
jobject
NativeClientReturnedRecord
::
toJava
(
JNIEnv
*
jniEnv
,
ClientReturnedRecord
c
)
{
jlong
j_record_id
=
::
djinni
::
HI64
::
Unboxed
::
toJava
(
jniEnv
,
c
.
record_id
);
djinni
::
LocalRef
<
jstring
>
j_content
(
jniEnv
,
::
djinni
::
HString
::
toJava
(
jniEnv
,
c
.
content
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeClientReturnedRecord
>::
get
();
...
...
@@ -16,10 +16,10 @@ jobject NativeClientReturnedRecord::toJava(JNIEnv* jniEnv, ::ClientReturnedRecor
return
r
;
}
::
ClientReturnedRecord
NativeClientReturnedRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
ClientReturnedRecord
NativeClientReturnedRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeClientReturnedRecord
>::
get
();
return
::
ClientReturnedRecord
(
return
ClientReturnedRecord
(
::
djinni
::
HI64
::
Unboxed
::
fromJava
(
jniEnv
,
jniEnv
->
GetLongField
(
j
,
data
.
field_mRecordId
)),
::
djinni
::
HString
::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jstring
>
(
jniEnv
,
static_cast
<
jstring
>
(
jniEnv
->
GetObjectField
(
j
,
data
.
field_mContent
))).
get
()));
}
...
...
test-suite/generated-src/jni/NativeClientReturnedRecord.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeClientReturnedRecord
final
{
public:
using
CppType
=
::
ClientReturnedRecord
;
using
CppType
=
ClientReturnedRecord
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
ClientReturnedRecord
);
static
::
ClientReturnedRecord
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
ClientReturnedRecord
);
static
ClientReturnedRecord
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/ClientReturnedRecord"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(JLjava/lang/String;)V"
)
};
...
...
test-suite/generated-src/jni/NativeColor.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeColor
final
:
djinni
::
JniEnum
{
public:
using
CppType
=
::
color
;
using
CppType
=
color
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
::
color
c
)
{
return
djinni
::
JniClass
<
NativeColor
>::
get
().
create
(
jniEnv
,
static_cast
<
int
>
(
c
)).
release
();
}
static
::
color
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
static_cast
<::
color
>
(
djinni
::
JniClass
<
NativeColor
>::
get
().
ordinal
(
jniEnv
,
j
));
}
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
color
c
)
{
return
djinni
::
JniClass
<
NativeColor
>::
get
().
create
(
jniEnv
,
static_cast
<
int
>
(
c
)).
release
();
}
static
color
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
static_cast
<
color
>
(
djinni
::
JniClass
<
NativeColor
>::
get
().
ordinal
(
jniEnv
,
j
));
}
private:
NativeColor
()
:
JniEnum
(
"com/dropbox/djinni/test/Color"
)
{}
...
...
test-suite/generated-src/jni/NativeConstants.cpp
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
namespace
djinni_generated
{
jobject
NativeConstants
::
toJava
(
JNIEnv
*
jniEnv
,
::
Constants
c
)
{
jobject
NativeConstants
::
toJava
(
JNIEnv
*
jniEnv
,
Constants
c
)
{
jint
j_some_integer
=
::
djinni
::
HI32
::
Unboxed
::
toJava
(
jniEnv
,
c
.
some_integer
);
djinni
::
LocalRef
<
jstring
>
j_some_string
(
jniEnv
,
::
djinni
::
HString
::
toJava
(
jniEnv
,
c
.
some_string
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeConstants
>::
get
();
...
...
@@ -16,10 +16,10 @@ jobject NativeConstants::toJava(JNIEnv* jniEnv, ::Constants c) {
return
r
;
}
::
Constants
NativeConstants
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
Constants
NativeConstants
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeConstants
>::
get
();
return
::
Constants
(
return
Constants
(
::
djinni
::
HI32
::
Unboxed
::
fromJava
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mSomeInteger
)),
::
djinni
::
HString
::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jstring
>
(
jniEnv
,
static_cast
<
jstring
>
(
jniEnv
->
GetObjectField
(
j
,
data
.
field_mSomeString
))).
get
()));
}
...
...
test-suite/generated-src/jni/NativeConstants.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeConstants
final
{
public:
using
CppType
=
::
Constants
;
using
CppType
=
Constants
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
Constants
);
static
::
Constants
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
Constants
);
static
Constants
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/Constants"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(ILjava/lang/String;)V"
)
};
...
...
test-suite/generated-src/jni/NativeCppException.cpp
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
namespace
djinni_generated
{
NativeCppException
::
NativeCppException
()
:
djinni
::
JniInterface
<
::
CppException
,
NativeCppException
>
(
"com/dropbox/djinni/test/CppException$CppProxy"
)
{}
NativeCppException
::
NativeCppException
()
:
djinni
::
JniInterface
<
CppException
,
NativeCppException
>
(
"com/dropbox/djinni/test/CppException$CppProxy"
)
{}
using
namespace
::
djinni_generated
;
...
...
@@ -15,7 +15,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_
{
try
{
DJINNI_FUNCTION_PROLOGUE1
(
jniEnv
,
nativeRef
);
delete
reinterpret_cast
<
djinni
::
CppProxyHandle
<
::
CppException
>*>
(
nativeRef
);
delete
reinterpret_cast
<
djinni
::
CppProxyHandle
<
CppException
>*>
(
nativeRef
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
)
}
...
...
@@ -23,7 +23,7 @@ CJNIEXPORT jint JNICALL Java_com_dropbox_djinni_test_CppException_00024CppProxy_
{
try
{
DJINNI_FUNCTION_PROLOGUE1
(
jniEnv
,
nativeRef
);
const
std
::
shared_ptr
<
::
CppException
>
&
ref
=
djinni
::
CppProxyHandle
<::
CppException
>::
get
(
nativeRef
);
const
std
::
shared_ptr
<
CppException
>
&
ref
=
djinni
::
CppProxyHandle
<
CppException
>::
get
(
nativeRef
);
int32_t
cr
=
ref
->
throw_an_exception
();
...
...
@@ -36,7 +36,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_CppException_get(JNIEnv*
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
shared_ptr
<
::
CppException
>
cr
=
::
CppException
::
get
();
std
::
shared_ptr
<
CppException
>
cr
=
CppException
::
get
();
return
NativeCppException
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
test-suite/generated-src/jni/NativeCppException.hpp
View file @
6b35e333
...
...
@@ -8,13 +8,13 @@
namespace
djinni_generated
{
class
NativeCppException
final
:
djinni
::
JniInterface
<
::
CppException
,
NativeCppException
>
{
class
NativeCppException
final
:
djinni
::
JniInterface
<
CppException
,
NativeCppException
>
{
public:
using
CppType
=
std
::
shared_ptr
<
::
CppException
>
;
using
CppType
=
std
::
shared_ptr
<
CppException
>
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
::
CppException
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeCppException
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
::
CppException
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeCppException
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
CppException
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeCppException
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
CppException
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeCppException
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
private:
...
...
test-suite/generated-src/jni/NativeDateRecord.cpp
View file @
6b35e333
...
...
@@ -6,7 +6,7 @@
namespace
djinni_generated
{
jobject
NativeDateRecord
::
toJava
(
JNIEnv
*
jniEnv
,
::
DateRecord
c
)
{
jobject
NativeDateRecord
::
toJava
(
JNIEnv
*
jniEnv
,
DateRecord
c
)
{
djinni
::
LocalRef
<
jobject
>
j_created_at
(
jniEnv
,
::
djinni
::
HDate
::
toJava
(
jniEnv
,
c
.
created_at
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeDateRecord
>::
get
();
jobject
r
=
jniEnv
->
NewObject
(
data
.
clazz
.
get
(),
data
.
jconstructor
,
j_created_at
.
get
());
...
...
@@ -14,10 +14,10 @@ jobject NativeDateRecord::toJava(JNIEnv* jniEnv, ::DateRecord c) {
return
r
;
}
::
DateRecord
NativeDateRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
DateRecord
NativeDateRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeDateRecord
>::
get
();
return
::
DateRecord
(
return
DateRecord
(
::
djinni
::
HDate
::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mCreatedAt
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativeDateRecord.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeDateRecord
final
{
public:
using
CppType
=
::
DateRecord
;
using
CppType
=
DateRecord
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
DateRecord
);
static
::
DateRecord
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
DateRecord
);
static
DateRecord
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/DateRecord"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(Ljava/util/Date;)V"
)
};
...
...
test-suite/generated-src/jni/NativeMapDateRecord.cpp
View file @
6b35e333
...
...
@@ -8,7 +8,7 @@
namespace
djinni_generated
{
jobject
NativeMapDateRecord
::
toJava
(
JNIEnv
*
jniEnv
,
::
MapDateRecord
c
)
{
jobject
NativeMapDateRecord
::
toJava
(
JNIEnv
*
jniEnv
,
MapDateRecord
c
)
{
djinni
::
LocalRef
<
jobject
>
j_dates_by_id
(
jniEnv
,
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HDate
>::
toJava
(
jniEnv
,
c
.
dates_by_id
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeMapDateRecord
>::
get
();
jobject
r
=
jniEnv
->
NewObject
(
data
.
clazz
.
get
(),
data
.
jconstructor
,
j_dates_by_id
.
get
());
...
...
@@ -16,10 +16,10 @@ jobject NativeMapDateRecord::toJava(JNIEnv* jniEnv, ::MapDateRecord c) {
return
r
;
}
::
MapDateRecord
NativeMapDateRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
MapDateRecord
NativeMapDateRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeMapDateRecord
>::
get
();
return
::
MapDateRecord
(
return
MapDateRecord
(
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HDate
>::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mDatesById
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativeMapDateRecord.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeMapDateRecord
final
{
public:
using
CppType
=
::
MapDateRecord
;
using
CppType
=
MapDateRecord
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
MapDateRecord
);
static
::
MapDateRecord
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
MapDateRecord
);
static
MapDateRecord
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/MapDateRecord"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(Ljava/util/HashMap;)V"
)
};
...
...
test-suite/generated-src/jni/NativeMapListRecord.cpp
View file @
6b35e333
...
...
@@ -9,7 +9,7 @@
namespace
djinni_generated
{
jobject
NativeMapListRecord
::
toJava
(
JNIEnv
*
jniEnv
,
::
MapListRecord
c
)
{
jobject
NativeMapListRecord
::
toJava
(
JNIEnv
*
jniEnv
,
MapListRecord
c
)
{
djinni
::
LocalRef
<
jobject
>
j_map_list
(
jniEnv
,
::
djinni
::
HList
<::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>>::
toJava
(
jniEnv
,
c
.
map_list
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeMapListRecord
>::
get
();
jobject
r
=
jniEnv
->
NewObject
(
data
.
clazz
.
get
(),
data
.
jconstructor
,
j_map_list
.
get
());
...
...
@@ -17,10 +17,10 @@ jobject NativeMapListRecord::toJava(JNIEnv* jniEnv, ::MapListRecord c) {
return
r
;
}
::
MapListRecord
NativeMapListRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
MapListRecord
NativeMapListRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeMapListRecord
>::
get
();
return
::
MapListRecord
(
return
MapListRecord
(
::
djinni
::
HList
<::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>>::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mMapList
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativeMapListRecord.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeMapListRecord
final
{
public:
using
CppType
=
::
MapListRecord
;
using
CppType
=
MapListRecord
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
MapListRecord
);
static
::
MapListRecord
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
MapListRecord
);
static
MapListRecord
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/MapListRecord"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(Ljava/util/ArrayList;)V"
)
};
...
...
test-suite/generated-src/jni/NativeMapRecord.cpp
View file @
6b35e333
...
...
@@ -8,7 +8,7 @@
namespace
djinni_generated
{
jobject
NativeMapRecord
::
toJava
(
JNIEnv
*
jniEnv
,
::
MapRecord
c
)
{
jobject
NativeMapRecord
::
toJava
(
JNIEnv
*
jniEnv
,
MapRecord
c
)
{
djinni
::
LocalRef
<
jobject
>
j_map
(
jniEnv
,
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>::
toJava
(
jniEnv
,
c
.
map
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeMapRecord
>::
get
();
jobject
r
=
jniEnv
->
NewObject
(
data
.
clazz
.
get
(),
data
.
jconstructor
,
j_map
.
get
());
...
...
@@ -16,10 +16,10 @@ jobject NativeMapRecord::toJava(JNIEnv* jniEnv, ::MapRecord c) {
return
r
;
}
::
MapRecord
NativeMapRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
MapRecord
NativeMapRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeMapRecord
>::
get
();
return
::
MapRecord
(
return
MapRecord
(
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mMap
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativeMapRecord.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeMapRecord
final
{
public:
using
CppType
=
::
MapRecord
;
using
CppType
=
MapRecord
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
MapRecord
);
static
::
MapRecord
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
MapRecord
);
static
MapRecord
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/MapRecord"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(Ljava/util/HashMap;)V"
)
};
...
...
test-suite/generated-src/jni/NativeNestedCollection.cpp
View file @
6b35e333
...
...
@@ -8,7 +8,7 @@
namespace
djinni_generated
{
jobject
NativeNestedCollection
::
toJava
(
JNIEnv
*
jniEnv
,
::
NestedCollection
c
)
{
jobject
NativeNestedCollection
::
toJava
(
JNIEnv
*
jniEnv
,
NestedCollection
c
)
{
djinni
::
LocalRef
<
jobject
>
j_set_list
(
jniEnv
,
::
djinni
::
HList
<::
djinni
::
HSet
<::
djinni
::
HString
>>::
toJava
(
jniEnv
,
c
.
set_list
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeNestedCollection
>::
get
();
jobject
r
=
jniEnv
->
NewObject
(
data
.
clazz
.
get
(),
data
.
jconstructor
,
j_set_list
.
get
());
...
...
@@ -16,10 +16,10 @@ jobject NativeNestedCollection::toJava(JNIEnv* jniEnv, ::NestedCollection c) {
return
r
;
}
::
NestedCollection
NativeNestedCollection
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
NestedCollection
NativeNestedCollection
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeNestedCollection
>::
get
();
return
::
NestedCollection
(
return
NestedCollection
(
::
djinni
::
HList
<::
djinni
::
HSet
<::
djinni
::
HString
>>::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mSetList
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativeNestedCollection.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeNestedCollection
final
{
public:
using
CppType
=
::
NestedCollection
;
using
CppType
=
NestedCollection
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
NestedCollection
);
static
::
NestedCollection
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
NestedCollection
);
static
NestedCollection
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/NestedCollection"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(Ljava/util/ArrayList;)V"
)
};
...
...
test-suite/generated-src/jni/NativePrimitiveList.cpp
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
namespace
djinni_generated
{
jobject
NativePrimitiveList
::
toJava
(
JNIEnv
*
jniEnv
,
::
PrimitiveList
c
)
{
jobject
NativePrimitiveList
::
toJava
(
JNIEnv
*
jniEnv
,
PrimitiveList
c
)
{
djinni
::
LocalRef
<
jobject
>
j_list
(
jniEnv
,
::
djinni
::
HList
<::
djinni
::
HI64
>::
toJava
(
jniEnv
,
c
.
list
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativePrimitiveList
>::
get
();
jobject
r
=
jniEnv
->
NewObject
(
data
.
clazz
.
get
(),
data
.
jconstructor
,
j_list
.
get
());
...
...
@@ -15,10 +15,10 @@ jobject NativePrimitiveList::toJava(JNIEnv* jniEnv, ::PrimitiveList c) {
return
r
;
}
::
PrimitiveList
NativePrimitiveList
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
PrimitiveList
NativePrimitiveList
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativePrimitiveList
>::
get
();
return
::
PrimitiveList
(
return
PrimitiveList
(
::
djinni
::
HList
<::
djinni
::
HI64
>::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mList
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativePrimitiveList.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativePrimitiveList
final
{
public:
using
CppType
=
::
PrimitiveList
;
using
CppType
=
PrimitiveList
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
PrimitiveList
);
static
::
PrimitiveList
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
PrimitiveList
);
static
PrimitiveList
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/PrimitiveList"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(Ljava/util/ArrayList;)V"
)
};
...
...
test-suite/generated-src/jni/NativeRecordWithDerivings.cpp
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
namespace
djinni_generated
{
jobject
NativeRecordWithDerivings
::
toJava
(
JNIEnv
*
jniEnv
,
::
RecordWithDerivings
c
)
{
jobject
NativeRecordWithDerivings
::
toJava
(
JNIEnv
*
jniEnv
,
RecordWithDerivings
c
)
{
jint
j_key1
=
::
djinni
::
HI32
::
Unboxed
::
toJava
(
jniEnv
,
c
.
key1
);
djinni
::
LocalRef
<
jstring
>
j_key2
(
jniEnv
,
::
djinni
::
HString
::
toJava
(
jniEnv
,
c
.
key2
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeRecordWithDerivings
>::
get
();
...
...
@@ -16,10 +16,10 @@ jobject NativeRecordWithDerivings::toJava(JNIEnv* jniEnv, ::RecordWithDerivings
return
r
;
}
::
RecordWithDerivings
NativeRecordWithDerivings
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
RecordWithDerivings
NativeRecordWithDerivings
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeRecordWithDerivings
>::
get
();
return
::
RecordWithDerivings
(
return
RecordWithDerivings
(
::
djinni
::
HI32
::
Unboxed
::
fromJava
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mKey1
)),
::
djinni
::
HString
::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jstring
>
(
jniEnv
,
static_cast
<
jstring
>
(
jniEnv
->
GetObjectField
(
j
,
data
.
field_mKey2
))).
get
()));
}
...
...
test-suite/generated-src/jni/NativeRecordWithDerivings.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeRecordWithDerivings
final
{
public:
using
CppType
=
::
RecordWithDerivings
;
using
CppType
=
RecordWithDerivings
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
RecordWithDerivings
);
static
::
RecordWithDerivings
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
RecordWithDerivings
);
static
RecordWithDerivings
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/RecordWithDerivings"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(ILjava/lang/String;)V"
)
};
...
...
test-suite/generated-src/jni/NativeRecordWithNestedDerivings.cpp
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
namespace
djinni_generated
{
jobject
NativeRecordWithNestedDerivings
::
toJava
(
JNIEnv
*
jniEnv
,
::
RecordWithNestedDerivings
c
)
{
jobject
NativeRecordWithNestedDerivings
::
toJava
(
JNIEnv
*
jniEnv
,
RecordWithNestedDerivings
c
)
{
jint
j_key
=
::
djinni
::
HI32
::
Unboxed
::
toJava
(
jniEnv
,
c
.
key
);
djinni
::
LocalRef
<
jobject
>
j_rec
(
jniEnv
,
NativeRecordWithDerivings
::
toJava
(
jniEnv
,
c
.
rec
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeRecordWithNestedDerivings
>::
get
();
...
...
@@ -16,10 +16,10 @@ jobject NativeRecordWithNestedDerivings::toJava(JNIEnv* jniEnv, ::RecordWithNest
return
r
;
}
::
RecordWithNestedDerivings
NativeRecordWithNestedDerivings
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
RecordWithNestedDerivings
NativeRecordWithNestedDerivings
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeRecordWithNestedDerivings
>::
get
();
return
::
RecordWithNestedDerivings
(
return
RecordWithNestedDerivings
(
::
djinni
::
HI32
::
Unboxed
::
fromJava
(
jniEnv
,
jniEnv
->
GetIntField
(
j
,
data
.
field_mKey
)),
NativeRecordWithDerivings
::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mRec
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativeRecordWithNestedDerivings.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeRecordWithNestedDerivings
final
{
public:
using
CppType
=
::
RecordWithNestedDerivings
;
using
CppType
=
RecordWithNestedDerivings
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
RecordWithNestedDerivings
);
static
::
RecordWithNestedDerivings
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
RecordWithNestedDerivings
);
static
RecordWithNestedDerivings
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/RecordWithNestedDerivings"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(ILcom/dropbox/djinni/test/RecordWithDerivings;)V"
)
};
...
...
test-suite/generated-src/jni/NativeSetRecord.cpp
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
namespace
djinni_generated
{
jobject
NativeSetRecord
::
toJava
(
JNIEnv
*
jniEnv
,
::
SetRecord
c
)
{
jobject
NativeSetRecord
::
toJava
(
JNIEnv
*
jniEnv
,
SetRecord
c
)
{
djinni
::
LocalRef
<
jobject
>
j_set
(
jniEnv
,
::
djinni
::
HSet
<::
djinni
::
HString
>::
toJava
(
jniEnv
,
c
.
set
));
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeSetRecord
>::
get
();
jobject
r
=
jniEnv
->
NewObject
(
data
.
clazz
.
get
(),
data
.
jconstructor
,
j_set
.
get
());
...
...
@@ -15,10 +15,10 @@ jobject NativeSetRecord::toJava(JNIEnv* jniEnv, ::SetRecord c) {
return
r
;
}
::
SetRecord
NativeSetRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
SetRecord
NativeSetRecord
::
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
assert
(
j
!=
nullptr
);
const
auto
&
data
=
djinni
::
JniClass
<::
djinni_generated
::
NativeSetRecord
>::
get
();
return
::
SetRecord
(
return
SetRecord
(
::
djinni
::
HSet
<::
djinni
::
HString
>::
fromJava
(
jniEnv
,
djinni
::
LocalRef
<
jobject
>
(
jniEnv
,
jniEnv
->
GetObjectField
(
j
,
data
.
field_mSet
)).
get
()));
}
...
...
test-suite/generated-src/jni/NativeSetRecord.hpp
View file @
6b35e333
...
...
@@ -10,11 +10,11 @@ namespace djinni_generated {
class
NativeSetRecord
final
{
public:
using
CppType
=
::
SetRecord
;
using
CppType
=
SetRecord
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
,
::
SetRecord
);
static
::
SetRecord
fromJava
(
JNIEnv
*
,
jobject
);
static
jobject
toJava
(
JNIEnv
*
,
SetRecord
);
static
SetRecord
fromJava
(
JNIEnv
*
,
jobject
);
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/SetRecord"
)
};
const
jmethodID
jconstructor
{
djinni
::
jniGetMethodID
(
clazz
.
get
(),
"<init>"
,
"(Ljava/util/HashSet;)V"
)
};
...
...
test-suite/generated-src/jni/NativeTestHelpers.cpp
View file @
6b35e333
...
...
@@ -19,7 +19,7 @@
namespace
djinni_generated
{
NativeTestHelpers
::
NativeTestHelpers
()
:
djinni
::
JniInterface
<
::
TestHelpers
,
NativeTestHelpers
>
(
"com/dropbox/djinni/test/TestHelpers$CppProxy"
)
{}
NativeTestHelpers
::
NativeTestHelpers
()
:
djinni
::
JniInterface
<
TestHelpers
,
NativeTestHelpers
>
(
"com/dropbox/djinni/test/TestHelpers$CppProxy"
)
{}
using
namespace
::
djinni_generated
;
...
...
@@ -27,7 +27,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_00024CppProxy_n
{
try
{
DJINNI_FUNCTION_PROLOGUE1
(
jniEnv
,
nativeRef
);
delete
reinterpret_cast
<
djinni
::
CppProxyHandle
<
::
TestHelpers
>*>
(
nativeRef
);
delete
reinterpret_cast
<
djinni
::
CppProxyHandle
<
TestHelpers
>*>
(
nativeRef
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
)
}
...
...
@@ -36,7 +36,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getSetRecord
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
SetRecord
cr
=
::
TestHelpers
::
get_set_record
();
SetRecord
cr
=
TestHelpers
::
get_set_record
();
return
NativeSetRecord
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -46,9 +46,9 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkSetRec
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
SetRecord
c_rec
=
NativeSetRecord
::
fromJava
(
jniEnv
,
j_rec
);
SetRecord
c_rec
=
NativeSetRecord
::
fromJava
(
jniEnv
,
j_rec
);
bool
cr
=
::
TestHelpers
::
check_set_record
(
c_rec
);
bool
cr
=
TestHelpers
::
check_set_record
(
c_rec
);
return
::
djinni
::
HBool
::
Unboxed
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -59,7 +59,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getPrimitive
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
PrimitiveList
cr
=
::
TestHelpers
::
get_primitive_list
();
PrimitiveList
cr
=
TestHelpers
::
get_primitive_list
();
return
NativePrimitiveList
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -69,9 +69,9 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkPrimit
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
PrimitiveList
c_pl
=
NativePrimitiveList
::
fromJava
(
jniEnv
,
j_pl
);
PrimitiveList
c_pl
=
NativePrimitiveList
::
fromJava
(
jniEnv
,
j_pl
);
bool
cr
=
::
TestHelpers
::
check_primitive_list
(
c_pl
);
bool
cr
=
TestHelpers
::
check_primitive_list
(
c_pl
);
return
::
djinni
::
HBool
::
Unboxed
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -82,7 +82,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getNestedCol
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
NestedCollection
cr
=
::
TestHelpers
::
get_nested_collection
();
NestedCollection
cr
=
TestHelpers
::
get_nested_collection
();
return
NativeNestedCollection
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -92,9 +92,9 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkNested
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
NestedCollection
c_nc
=
NativeNestedCollection
::
fromJava
(
jniEnv
,
j_nc
);
NestedCollection
c_nc
=
NativeNestedCollection
::
fromJava
(
jniEnv
,
j_nc
);
bool
cr
=
::
TestHelpers
::
check_nested_collection
(
c_nc
);
bool
cr
=
TestHelpers
::
check_nested_collection
(
c_nc
);
return
::
djinni
::
HBool
::
Unboxed
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -105,7 +105,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getMap(JNIEn
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
unordered_map
<
std
::
string
,
int64_t
>
cr
=
::
TestHelpers
::
get_map
();
std
::
unordered_map
<
std
::
string
,
int64_t
>
cr
=
TestHelpers
::
get_map
();
return
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -117,7 +117,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkMap(JN
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
unordered_map
<
std
::
string
,
int64_t
>
c_m
=
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>::
fromJava
(
jniEnv
,
j_m
);
bool
cr
=
::
TestHelpers
::
check_map
(
c_m
);
bool
cr
=
TestHelpers
::
check_map
(
c_m
);
return
::
djinni
::
HBool
::
Unboxed
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -128,7 +128,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getEmptyMap(
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
unordered_map
<
std
::
string
,
int64_t
>
cr
=
::
TestHelpers
::
get_empty_map
();
std
::
unordered_map
<
std
::
string
,
int64_t
>
cr
=
TestHelpers
::
get_empty_map
();
return
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -140,7 +140,7 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEmptyM
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
unordered_map
<
std
::
string
,
int64_t
>
c_m
=
::
djinni
::
HMap
<::
djinni
::
HString
,
::
djinni
::
HI64
>::
fromJava
(
jniEnv
,
j_m
);
bool
cr
=
::
TestHelpers
::
check_empty_map
(
c_m
);
bool
cr
=
TestHelpers
::
check_empty_map
(
c_m
);
return
::
djinni
::
HBool
::
Unboxed
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -151,7 +151,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_getMapListRe
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
MapListRecord
cr
=
::
TestHelpers
::
get_map_list_record
();
MapListRecord
cr
=
TestHelpers
::
get_map_list_record
();
return
NativeMapListRecord
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -161,9 +161,9 @@ CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkMapLis
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
MapListRecord
c_m
=
NativeMapListRecord
::
fromJava
(
jniEnv
,
j_m
);
MapListRecord
c_m
=
NativeMapListRecord
::
fromJava
(
jniEnv
,
j_m
);
bool
cr
=
::
TestHelpers
::
check_map_list_record
(
c_m
);
bool
cr
=
TestHelpers
::
check_map_list_record
(
c_m
);
return
::
djinni
::
HBool
::
Unboxed
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -173,9 +173,9 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInte
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
shared_ptr
<
::
ClientInterface
>
c_i
=
NativeClientInterface
::
fromJava
(
jniEnv
,
j_i
);
std
::
shared_ptr
<
ClientInterface
>
c_i
=
NativeClientInterface
::
fromJava
(
jniEnv
,
j_i
);
::
TestHelpers
::
check_client_interface_ascii
(
c_i
);
TestHelpers
::
check_client_interface_ascii
(
c_i
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
)
}
...
...
@@ -183,9 +183,9 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkClientInte
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
shared_ptr
<
::
ClientInterface
>
c_i
=
NativeClientInterface
::
fromJava
(
jniEnv
,
j_i
);
std
::
shared_ptr
<
ClientInterface
>
c_i
=
NativeClientInterface
::
fromJava
(
jniEnv
,
j_i
);
::
TestHelpers
::
check_client_interface_nonascii
(
c_i
);
TestHelpers
::
check_client_interface_nonascii
(
c_i
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
)
}
...
...
@@ -193,9 +193,9 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkEnumMap(JN
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
unordered_map
<
::
color
,
std
::
string
>
c_m
=
::
djinni
::
HMap
<
NativeColor
,
::
djinni
::
HString
>::
fromJava
(
jniEnv
,
j_m
);
std
::
unordered_map
<
color
,
std
::
string
>
c_m
=
::
djinni
::
HMap
<
NativeColor
,
::
djinni
::
HString
>::
fromJava
(
jniEnv
,
j_m
);
::
TestHelpers
::
check_enum_map
(
c_m
);
TestHelpers
::
check_enum_map
(
c_m
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
)
}
...
...
@@ -203,9 +203,9 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_tokenId(JNIE
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
shared_ptr
<
::
Token
>
c_t
=
NativeToken
::
fromJava
(
jniEnv
,
j_t
);
std
::
shared_ptr
<
Token
>
c_t
=
NativeToken
::
fromJava
(
jniEnv
,
j_t
);
std
::
shared_ptr
<
::
Token
>
cr
=
::
TestHelpers
::
token_id
(
c_t
);
std
::
shared_ptr
<
Token
>
cr
=
TestHelpers
::
token_id
(
c_t
);
return
NativeToken
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -216,7 +216,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_createCppTok
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
shared_ptr
<
::
Token
>
cr
=
::
TestHelpers
::
create_cpp_token
();
std
::
shared_ptr
<
Token
>
cr
=
TestHelpers
::
create_cpp_token
();
return
NativeToken
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -226,9 +226,9 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_TestHelpers_checkCppToken(J
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
shared_ptr
<
::
Token
>
c_t
=
NativeToken
::
fromJava
(
jniEnv
,
j_t
);
std
::
shared_ptr
<
Token
>
c_t
=
NativeToken
::
fromJava
(
jniEnv
,
j_t
);
::
TestHelpers
::
check_cpp_token
(
c_t
);
TestHelpers
::
check_cpp_token
(
c_t
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
)
}
...
...
@@ -236,9 +236,9 @@ CJNIEXPORT jlong JNICALL Java_com_dropbox_djinni_test_TestHelpers_cppTokenId(JNI
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
shared_ptr
<
::
Token
>
c_t
=
NativeToken
::
fromJava
(
jniEnv
,
j_t
);
std
::
shared_ptr
<
Token
>
c_t
=
NativeToken
::
fromJava
(
jniEnv
,
j_t
);
int64_t
cr
=
::
TestHelpers
::
cpp_token_id
(
c_t
);
int64_t
cr
=
TestHelpers
::
cpp_token_id
(
c_t
);
return
::
djinni
::
HI64
::
Unboxed
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -249,7 +249,7 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_returnNone(J
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
std
::
experimental
::
optional
<
int32_t
>
cr
=
::
TestHelpers
::
return_none
();
std
::
experimental
::
optional
<
int32_t
>
cr
=
TestHelpers
::
return_none
();
return
::
djinni
::
HOptional
<
std
::
experimental
::
optional
,
::
djinni
::
HI32
>::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
@@ -259,9 +259,9 @@ CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_TestHelpers_assortedInte
{
try
{
DJINNI_FUNCTION_PROLOGUE0
(
jniEnv
);
::
AssortedIntegers
c_i
=
NativeAssortedIntegers
::
fromJava
(
jniEnv
,
j_i
);
AssortedIntegers
c_i
=
NativeAssortedIntegers
::
fromJava
(
jniEnv
,
j_i
);
::
AssortedIntegers
cr
=
::
TestHelpers
::
assorted_integers_id
(
c_i
);
AssortedIntegers
cr
=
TestHelpers
::
assorted_integers_id
(
c_i
);
return
NativeAssortedIntegers
::
toJava
(
jniEnv
,
cr
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
0
/* value doesn't matter */
)
...
...
test-suite/generated-src/jni/NativeTestHelpers.hpp
View file @
6b35e333
...
...
@@ -8,13 +8,13 @@
namespace
djinni_generated
{
class
NativeTestHelpers
final
:
djinni
::
JniInterface
<
::
TestHelpers
,
NativeTestHelpers
>
{
class
NativeTestHelpers
final
:
djinni
::
JniInterface
<
TestHelpers
,
NativeTestHelpers
>
{
public:
using
CppType
=
std
::
shared_ptr
<
::
TestHelpers
>
;
using
CppType
=
std
::
shared_ptr
<
TestHelpers
>
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
::
TestHelpers
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeTestHelpers
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
::
TestHelpers
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeTestHelpers
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
TestHelpers
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeTestHelpers
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
TestHelpers
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeTestHelpers
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
private:
...
...
test-suite/generated-src/jni/NativeToken.cpp
View file @
6b35e333
...
...
@@ -5,7 +5,7 @@
namespace
djinni_generated
{
NativeToken
::
NativeToken
()
:
djinni
::
JniInterface
<
::
Token
,
NativeToken
>
(
"com/dropbox/djinni/test/Token$CppProxy"
)
{}
NativeToken
::
NativeToken
()
:
djinni
::
JniInterface
<
Token
,
NativeToken
>
(
"com/dropbox/djinni/test/Token$CppProxy"
)
{}
NativeToken
::
JavaProxy
::
JavaProxy
(
jobject
obj
)
:
JavaProxyCacheEntry
(
obj
)
{}
using
namespace
::
djinni_generated
;
...
...
@@ -14,7 +14,7 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_Token_00024CppProxy_nativeD
{
try
{
DJINNI_FUNCTION_PROLOGUE1
(
jniEnv
,
nativeRef
);
delete
reinterpret_cast
<
djinni
::
CppProxyHandle
<
::
Token
>*>
(
nativeRef
);
delete
reinterpret_cast
<
djinni
::
CppProxyHandle
<
Token
>*>
(
nativeRef
);
}
JNI_TRANSLATE_EXCEPTIONS_RETURN
(
jniEnv
,
)
}
...
...
test-suite/generated-src/jni/NativeToken.hpp
View file @
6b35e333
...
...
@@ -8,23 +8,23 @@
namespace
djinni_generated
{
class
NativeToken
final
:
djinni
::
JniInterface
<
::
Token
,
NativeToken
>
{
class
NativeToken
final
:
djinni
::
JniInterface
<
Token
,
NativeToken
>
{
public:
using
CppType
=
std
::
shared_ptr
<
::
Token
>
;
using
CppType
=
std
::
shared_ptr
<
Token
>
;
using
JniType
=
jobject
;
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
::
Token
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeToken
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
::
Token
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeToken
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
static
jobject
toJava
(
JNIEnv
*
jniEnv
,
std
::
shared_ptr
<
Token
>
c
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeToken
>::
get
().
_toJava
(
jniEnv
,
c
);
}
static
std
::
shared_ptr
<
Token
>
fromJava
(
JNIEnv
*
jniEnv
,
jobject
j
)
{
return
djinni
::
JniClass
<::
djinni_generated
::
NativeToken
>::
get
().
_fromJava
(
jniEnv
,
j
);
}
const
djinni
::
GlobalRef
<
jclass
>
clazz
{
djinni
::
jniFindClass
(
"com/dropbox/djinni/test/Token"
)
};
class
JavaProxy
final
:
djinni
::
JavaProxyCacheEntry
,
public
::
Token
{
class
JavaProxy
final
:
djinni
::
JavaProxyCacheEntry
,
public
Token
{
public:
JavaProxy
(
jobject
obj
);
private:
using
djinni
::
JavaProxyCacheEntry
::
getGlobalRef
;
friend
class
djinni
::
JniInterface
<
::
Token
,
::
djinni_generated
::
NativeToken
>
;
friend
class
djinni
::
JniInterface
<
Token
,
::
djinni_generated
::
NativeToken
>
;
friend
class
djinni
::
JavaProxyCache
<
JavaProxy
>
;
};
...
...
test-suite/generated-src/objc/DBAssortedIntegers+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBAssortedIntegers
()
-
(
id
)
initWithCppAssortedIntegers
:(
const
::
AssortedIntegers
&
)
assortedIntegers
;
-
(
::
AssortedIntegers
)
cppAssortedIntegers
;
-
(
id
)
initWithCppAssortedIntegers
:(
const
AssortedIntegers
&
)
assortedIntegers
;
-
(
AssortedIntegers
)
cppAssortedIntegers
;
@end
test-suite/generated-src/objc/DBAssortedIntegers.mm
View file @
6b35e333
...
...
@@ -58,7 +58,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppAssortedIntegers
:(
const
::
AssortedIntegers
&
)
assortedIntegers
-
(
id
)
initWithCppAssortedIntegers
:(
const
AssortedIntegers
&
)
assortedIntegers
{
if
(
self
=
[
super
init
])
{
_eight
=
::
djinni
::
I8
::
fromCpp
(
assortedIntegers
.
eight
);
...
...
@@ -89,7 +89,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
AssortedIntegers
)
cppAssortedIntegers
-
(
AssortedIntegers
)
cppAssortedIntegers
{
int8_t
eight
=
::
djinni
::
I8
::
toCpp
(
_eight
);
int16_t
sixteen
=
::
djinni
::
I16
::
toCpp
(
_sixteen
);
...
...
@@ -115,7 +115,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
int64_t
optValue
=
::
djinni
::
I64
::
Boxed
::
toCpp
(
_oSixtyfour
);
oSixtyfour
=
optValue
;
}
return
::
AssortedIntegers
(
return
AssortedIntegers
(
std
::
move
(
eight
),
std
::
move
(
sixteen
),
std
::
move
(
thirtytwo
),
...
...
test-suite/generated-src/objc/DBClientInterface+Private.h
View file @
6b35e333
...
...
@@ -12,7 +12,7 @@ namespace djinni_generated {
struct
ClientInterface
{
using
CppType
=
std
::
shared_ptr
<
::
ClientInterface
>
;
using
CppType
=
std
::
shared_ptr
<
ClientInterface
>
;
using
ObjcType
=
id
<
DBClientInterface
>
;
static
CppType
toCpp
(
ObjcType
objc
);
...
...
test-suite/generated-src/objc/DBClientInterface.mm
View file @
6b35e333
...
...
@@ -13,12 +13,12 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
namespace
{
// anonymous namespace
class
ObjcProxy
final
:
public
::
ClientInterface
:
public
ClientInterface
,
public
::
djinni
::
DbxObjcWrapperCache
<
ObjcProxy
>::
Handle
{
public:
using
Handle
::
Handle
;
::
ClientReturnedRecord
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
override
;
ClientReturnedRecord
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
override
;
};
}
// end anonymous namespace
...
...
@@ -38,13 +38,13 @@ auto ClientInterface::fromCpp(const CppType& cpp) -> ObjcType
}
// namespace djinni_generated
::
ClientReturnedRecord
ObjcProxy
::
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
ClientReturnedRecord
ObjcProxy
::
get_record
(
int64_t
record_id
,
const
std
::
string
&
utf8string
)
{
@autoreleasepool
{
int64_t
cpp_record_id
=
::
djinni
::
I64
::
fromCpp
(
record_id
);
NSString
*
cpp_utf8string
=
::
djinni
::
String
::
fromCpp
(
utf8string
);
DBClientReturnedRecord
*
objcRet
=
[
Handle
:
:
get
()
getRecord
:
cpp_record_id
utf8string
:
cpp_utf8string
];
::
ClientReturnedRecord
cppRet
=
std
::
move
([
objcRet
cppClientReturnedRecord
]);
ClientReturnedRecord
cppRet
=
std
::
move
([
objcRet
cppClientReturnedRecord
]);
return
cppRet
;
}
}
test-suite/generated-src/objc/DBClientReturnedRecord+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBClientReturnedRecord
()
-
(
id
)
initWithCppClientReturnedRecord
:(
const
::
ClientReturnedRecord
&
)
clientReturnedRecord
;
-
(
::
ClientReturnedRecord
)
cppClientReturnedRecord
;
-
(
id
)
initWithCppClientReturnedRecord
:(
const
ClientReturnedRecord
&
)
clientReturnedRecord
;
-
(
ClientReturnedRecord
)
cppClientReturnedRecord
;
@end
test-suite/generated-src/objc/DBClientReturnedRecord.mm
View file @
6b35e333
...
...
@@ -30,7 +30,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppClientReturnedRecord
:(
const
::
ClientReturnedRecord
&
)
clientReturnedRecord
-
(
id
)
initWithCppClientReturnedRecord
:(
const
ClientReturnedRecord
&
)
clientReturnedRecord
{
if
(
self
=
[
super
init
])
{
_recordId
=
::
djinni
::
I64
::
fromCpp
(
clientReturnedRecord
.
record_id
);
...
...
@@ -39,11 +39,11 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
ClientReturnedRecord
)
cppClientReturnedRecord
-
(
ClientReturnedRecord
)
cppClientReturnedRecord
{
int64_t
recordId
=
::
djinni
::
I64
::
toCpp
(
_recordId
);
std
::
string
content
=
::
djinni
::
String
::
toCpp
(
_content
);
return
::
ClientReturnedRecord
(
return
ClientReturnedRecord
(
std
::
move
(
recordId
),
std
::
move
(
content
));
}
...
...
test-suite/generated-src/objc/DBConstants+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBConstants
()
-
(
id
)
initWithCppConstants
:(
const
::
Constants
&
)
constants
;
-
(
::
Constants
)
cppConstants
;
-
(
id
)
initWithCppConstants
:(
const
Constants
&
)
constants
;
-
(
Constants
)
cppConstants
;
@end
test-suite/generated-src/objc/DBConstants.mm
View file @
6b35e333
...
...
@@ -54,7 +54,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppConstants
:(
const
::
Constants
&
)
constants
-
(
id
)
initWithCppConstants
:(
const
Constants
&
)
constants
{
if
(
self
=
[
super
init
])
{
_someInteger
=
::
djinni
::
I32
::
fromCpp
(
constants
.
some_integer
);
...
...
@@ -63,11 +63,11 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
Constants
)
cppConstants
-
(
Constants
)
cppConstants
{
int32_t
someInteger
=
::
djinni
::
I32
::
toCpp
(
_someInteger
);
std
::
string
someString
=
::
djinni
::
String
::
toCpp
(
_someString
);
return
::
Constants
(
return
Constants
(
std
::
move
(
someInteger
),
std
::
move
(
someString
));
}
...
...
test-suite/generated-src/objc/DBCppException+Private.h
View file @
6b35e333
...
...
@@ -12,7 +12,7 @@ namespace djinni_generated {
struct
CppException
{
using
CppType
=
std
::
shared_ptr
<
::
CppException
>
;
using
CppType
=
std
::
shared_ptr
<
CppException
>
;
using
ObjcType
=
DBCppException
*
;
static
CppType
toCpp
(
ObjcType
objc
);
...
...
test-suite/generated-src/objc/DBCppException.mm
View file @
6b35e333
...
...
@@ -16,9 +16,9 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface
DBCppException
()
@property
(
nonatomic
,
readonly
)
djinni
::
DbxCppWrapperCache
<
::
CppException
>::
Handle
cppRef
;
@property
(
nonatomic
,
readonly
)
djinni
::
DbxCppWrapperCache
<
CppException
>::
Handle
cppRef
;
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
::
CppException
>&
)
cppRef
;
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
CppException
>&
)
cppRef
;
@end
...
...
@@ -31,7 +31,7 @@ auto CppException::toCpp(ObjcType objc) -> CppType
auto
CppException
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
return
!
cpp
?
nil
:
djinni
::
DbxCppWrapperCache
<
::
CppException
>::
getInstance
()
->
get
(
cpp
,
[]
(
const
auto
&
p
)
return
!
cpp
?
nil
:
djinni
::
DbxCppWrapperCache
<
CppException
>::
getInstance
()
->
get
(
cpp
,
[]
(
const
auto
&
p
)
{
return
[[
DBCppException
alloc
]
initWithCpp
:
p
];
});
...
...
@@ -41,7 +41,7 @@ auto CppException::fromCpp(const CppType& cpp) -> ObjcType
@implementation
DBCppException
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
::
CppException
>&
)
cppRef
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
CppException
>&
)
cppRef
{
if
(
self
=
[
super
init
])
{
_cppRef
.
assign
(
cppRef
);
...
...
@@ -59,7 +59,7 @@ auto CppException::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBCppException
*
)
get
{
try
{
std
::
shared_ptr
<
::
CppException
>
cppRet
=
::
CppException
::
get
();
std
::
shared_ptr
<
CppException
>
cppRet
=
CppException
::
get
();
DBCppException
*
objcRet
=
::
djinni_generated
::
CppException
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
test-suite/generated-src/objc/DBDateRecord+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBDateRecord
()
-
(
id
)
initWithCppDateRecord
:(
const
::
DateRecord
&
)
dateRecord
;
-
(
::
DateRecord
)
cppDateRecord
;
-
(
id
)
initWithCppDateRecord
:(
const
DateRecord
&
)
dateRecord
;
-
(
DateRecord
)
cppDateRecord
;
@end
test-suite/generated-src/objc/DBDateRecord.mm
View file @
6b35e333
...
...
@@ -28,7 +28,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppDateRecord
:(
const
::
DateRecord
&
)
dateRecord
-
(
id
)
initWithCppDateRecord
:(
const
DateRecord
&
)
dateRecord
{
if
(
self
=
[
super
init
])
{
_createdAt
=
[
NSDate
dateWithTimeIntervalSince1970
:
...
...
@@ -37,10 +37,10 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
DateRecord
)
cppDateRecord
-
(
DateRecord
)
cppDateRecord
{
std
::
chrono
::
system_clock
::
time_point
createdAt
=
::
djinni
::
convert_date
([
_createdAt
timeIntervalSince1970
]);
return
::
DateRecord
(
return
DateRecord
(
std
::
move
(
createdAt
));
}
...
...
test-suite/generated-src/objc/DBMapDateRecord+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBMapDateRecord
()
-
(
id
)
initWithCppMapDateRecord
:(
const
::
MapDateRecord
&
)
mapDateRecord
;
-
(
::
MapDateRecord
)
cppMapDateRecord
;
-
(
id
)
initWithCppMapDateRecord
:(
const
MapDateRecord
&
)
mapDateRecord
;
-
(
MapDateRecord
)
cppMapDateRecord
;
@end
test-suite/generated-src/objc/DBMapDateRecord.mm
View file @
6b35e333
...
...
@@ -39,7 +39,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppMapDateRecord
:(
const
::
MapDateRecord
&
)
mapDateRecord
-
(
id
)
initWithCppMapDateRecord
:(
const
MapDateRecord
&
)
mapDateRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_datesByIdTempKeyVector
;
...
...
@@ -58,7 +58,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
MapDateRecord
)
cppMapDateRecord
-
(
MapDateRecord
)
cppMapDateRecord
{
std
::
unordered_map
<
std
::
string
,
std
::
chrono
::
system_clock
::
time_point
>
datesById
;
for
(
id
objcKey_0
in
_datesById
)
{
...
...
@@ -66,7 +66,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
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
(
return
MapDateRecord
(
std
::
move
(
datesById
));
}
...
...
test-suite/generated-src/objc/DBMapListRecord+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBMapListRecord
()
-
(
id
)
initWithCppMapListRecord
:(
const
::
MapListRecord
&
)
mapListRecord
;
-
(
::
MapListRecord
)
cppMapListRecord
;
-
(
id
)
initWithCppMapListRecord
:(
const
MapListRecord
&
)
mapListRecord
;
-
(
MapListRecord
)
cppMapListRecord
;
@end
test-suite/generated-src/objc/DBMapListRecord.mm
View file @
6b35e333
...
...
@@ -46,7 +46,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppMapListRecord
:(
const
::
MapListRecord
&
)
mapListRecord
-
(
id
)
initWithCppMapListRecord
:(
const
MapListRecord
&
)
mapListRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSDictionary
*>
_mapListTempVector
;
...
...
@@ -70,7 +70,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
MapListRecord
)
cppMapListRecord
-
(
MapListRecord
)
cppMapListRecord
{
std
::
vector
<
std
::
unordered_map
<
std
::
string
,
int64_t
>>
mapList
;
mapList
.
reserve
([
_mapList
count
]);
...
...
@@ -83,7 +83,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
}
mapList
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
MapListRecord
(
return
MapListRecord
(
std
::
move
(
mapList
));
}
...
...
test-suite/generated-src/objc/DBMapRecord+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBMapRecord
()
-
(
id
)
initWithCppMapRecord
:(
const
::
MapRecord
&
)
mapRecord
;
-
(
::
MapRecord
)
cppMapRecord
;
-
(
id
)
initWithCppMapRecord
:(
const
MapRecord
&
)
mapRecord
;
-
(
MapRecord
)
cppMapRecord
;
@end
test-suite/generated-src/objc/DBMapRecord.mm
View file @
6b35e333
...
...
@@ -39,7 +39,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppMapRecord
:(
const
::
MapRecord
&
)
mapRecord
-
(
id
)
initWithCppMapRecord
:(
const
MapRecord
&
)
mapRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_mapTempKeyVector
;
...
...
@@ -57,7 +57,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
MapRecord
)
cppMapRecord
-
(
MapRecord
)
cppMapRecord
{
std
::
unordered_map
<
std
::
string
,
int64_t
>
map
;
for
(
id
objcKey_0
in
_map
)
{
...
...
@@ -65,7 +65,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
([
_map
objectForKey
:
objcKey_0
]);
map
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
return
::
MapRecord
(
return
MapRecord
(
std
::
move
(
map
));
}
...
...
test-suite/generated-src/objc/DBNestedCollection+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBNestedCollection
()
-
(
id
)
initWithCppNestedCollection
:(
const
::
NestedCollection
&
)
nestedCollection
;
-
(
::
NestedCollection
)
cppNestedCollection
;
-
(
id
)
initWithCppNestedCollection
:(
const
NestedCollection
&
)
nestedCollection
;
-
(
NestedCollection
)
cppNestedCollection
;
@end
test-suite/generated-src/objc/DBNestedCollection.mm
View file @
6b35e333
...
...
@@ -42,7 +42,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppNestedCollection
:(
const
::
NestedCollection
&
)
nestedCollection
-
(
id
)
initWithCppNestedCollection
:(
const
NestedCollection
&
)
nestedCollection
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSSet
*>
_setListTempVector
;
...
...
@@ -62,7 +62,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
NestedCollection
)
cppNestedCollection
-
(
NestedCollection
)
cppNestedCollection
{
std
::
vector
<
std
::
unordered_set
<
std
::
string
>>
setList
;
setList
.
reserve
([
_setList
count
]);
...
...
@@ -74,7 +74,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
}
setList
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
NestedCollection
(
return
NestedCollection
(
std
::
move
(
setList
));
}
...
...
test-suite/generated-src/objc/DBPrimitiveList+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBPrimitiveList
()
-
(
id
)
initWithCppPrimitiveList
:(
const
::
PrimitiveList
&
)
primitiveList
;
-
(
::
PrimitiveList
)
cppPrimitiveList
;
-
(
id
)
initWithCppPrimitiveList
:(
const
PrimitiveList
&
)
primitiveList
;
-
(
PrimitiveList
)
cppPrimitiveList
;
@end
test-suite/generated-src/objc/DBPrimitiveList.mm
View file @
6b35e333
...
...
@@ -35,7 +35,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppPrimitiveList
:(
const
::
PrimitiveList
&
)
primitiveList
-
(
id
)
initWithCppPrimitiveList
:(
const
PrimitiveList
&
)
primitiveList
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSNumber
*>
_listTempVector
;
...
...
@@ -49,7 +49,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
PrimitiveList
)
cppPrimitiveList
-
(
PrimitiveList
)
cppPrimitiveList
{
std
::
vector
<
int64_t
>
list
;
list
.
reserve
([
_list
count
]);
...
...
@@ -57,7 +57,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
(
objcValue_0
);
list
.
push_back
(
std
::
move
(
cppValue_0
));
}
return
::
PrimitiveList
(
return
PrimitiveList
(
std
::
move
(
list
));
}
...
...
test-suite/generated-src/objc/DBRecordWithDerivings+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBRecordWithDerivings
()
-
(
id
)
initWithCppRecordWithDerivings
:(
const
::
RecordWithDerivings
&
)
recordWithDerivings
;
-
(
::
RecordWithDerivings
)
cppRecordWithDerivings
;
-
(
id
)
initWithCppRecordWithDerivings
:(
const
RecordWithDerivings
&
)
recordWithDerivings
;
-
(
RecordWithDerivings
)
cppRecordWithDerivings
;
@end
test-suite/generated-src/objc/DBRecordWithDerivings.mm
View file @
6b35e333
...
...
@@ -30,7 +30,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppRecordWithDerivings
:(
const
::
RecordWithDerivings
&
)
recordWithDerivings
-
(
id
)
initWithCppRecordWithDerivings
:(
const
RecordWithDerivings
&
)
recordWithDerivings
{
if
(
self
=
[
super
init
])
{
_key1
=
::
djinni
::
I32
::
fromCpp
(
recordWithDerivings
.
key1
);
...
...
@@ -39,11 +39,11 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
RecordWithDerivings
)
cppRecordWithDerivings
-
(
RecordWithDerivings
)
cppRecordWithDerivings
{
int32_t
key1
=
::
djinni
::
I32
::
toCpp
(
_key1
);
std
::
string
key2
=
::
djinni
::
String
::
toCpp
(
_key2
);
return
::
RecordWithDerivings
(
return
RecordWithDerivings
(
std
::
move
(
key1
),
std
::
move
(
key2
));
}
...
...
test-suite/generated-src/objc/DBRecordWithNestedDerivings+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBRecordWithNestedDerivings
()
-
(
id
)
initWithCppRecordWithNestedDerivings
:(
const
::
RecordWithNestedDerivings
&
)
recordWithNestedDerivings
;
-
(
::
RecordWithNestedDerivings
)
cppRecordWithNestedDerivings
;
-
(
id
)
initWithCppRecordWithNestedDerivings
:(
const
RecordWithNestedDerivings
&
)
recordWithNestedDerivings
;
-
(
RecordWithNestedDerivings
)
cppRecordWithNestedDerivings
;
@end
test-suite/generated-src/objc/DBRecordWithNestedDerivings.mm
View file @
6b35e333
...
...
@@ -31,7 +31,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppRecordWithNestedDerivings
:(
const
::
RecordWithNestedDerivings
&
)
recordWithNestedDerivings
-
(
id
)
initWithCppRecordWithNestedDerivings
:(
const
RecordWithNestedDerivings
&
)
recordWithNestedDerivings
{
if
(
self
=
[
super
init
])
{
_key
=
::
djinni
::
I32
::
fromCpp
(
recordWithNestedDerivings
.
key
);
...
...
@@ -40,11 +40,11 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
RecordWithNestedDerivings
)
cppRecordWithNestedDerivings
-
(
RecordWithNestedDerivings
)
cppRecordWithNestedDerivings
{
int32_t
key
=
::
djinni
::
I32
::
toCpp
(
_key
);
::
RecordWithDerivings
rec
=
std
::
move
([
_rec
cppRecordWithDerivings
]);
return
::
RecordWithNestedDerivings
(
RecordWithDerivings
rec
=
std
::
move
([
_rec
cppRecordWithDerivings
]);
return
RecordWithNestedDerivings
(
std
::
move
(
key
),
std
::
move
(
rec
));
}
...
...
test-suite/generated-src/objc/DBSetRecord+Private.h
View file @
6b35e333
...
...
@@ -7,7 +7,7 @@
@interface
DBSetRecord
()
-
(
id
)
initWithCppSetRecord
:(
const
::
SetRecord
&
)
setRecord
;
-
(
::
SetRecord
)
cppSetRecord
;
-
(
id
)
initWithCppSetRecord
:(
const
SetRecord
&
)
setRecord
;
-
(
SetRecord
)
cppSetRecord
;
@end
test-suite/generated-src/objc/DBSetRecord.mm
View file @
6b35e333
...
...
@@ -35,7 +35,7 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
id
)
initWithCppSetRecord
:(
const
::
SetRecord
&
)
setRecord
-
(
id
)
initWithCppSetRecord
:(
const
SetRecord
&
)
setRecord
{
if
(
self
=
[
super
init
])
{
std
::
vector
<
NSString
*>
_setTempVector
;
...
...
@@ -49,14 +49,14 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return
self
;
}
-
(
::
SetRecord
)
cppSetRecord
-
(
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
(
return
SetRecord
(
std
::
move
(
set
));
}
...
...
test-suite/generated-src/objc/DBTestHelpers+Private.h
View file @
6b35e333
...
...
@@ -12,7 +12,7 @@ namespace djinni_generated {
struct
TestHelpers
{
using
CppType
=
std
::
shared_ptr
<
::
TestHelpers
>
;
using
CppType
=
std
::
shared_ptr
<
TestHelpers
>
;
using
ObjcType
=
DBTestHelpers
*
;
static
CppType
toCpp
(
ObjcType
objc
);
...
...
test-suite/generated-src/objc/DBTestHelpers.mm
View file @
6b35e333
...
...
@@ -22,9 +22,9 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface
DBTestHelpers
()
@property
(
nonatomic
,
readonly
)
djinni
::
DbxCppWrapperCache
<
::
TestHelpers
>::
Handle
cppRef
;
@property
(
nonatomic
,
readonly
)
djinni
::
DbxCppWrapperCache
<
TestHelpers
>::
Handle
cppRef
;
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
::
TestHelpers
>&
)
cppRef
;
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
TestHelpers
>&
)
cppRef
;
@end
...
...
@@ -37,7 +37,7 @@ auto TestHelpers::toCpp(ObjcType objc) -> CppType
auto
TestHelpers
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
return
!
cpp
?
nil
:
djinni
::
DbxCppWrapperCache
<
::
TestHelpers
>::
getInstance
()
->
get
(
cpp
,
[]
(
const
auto
&
p
)
return
!
cpp
?
nil
:
djinni
::
DbxCppWrapperCache
<
TestHelpers
>::
getInstance
()
->
get
(
cpp
,
[]
(
const
auto
&
p
)
{
return
[[
DBTestHelpers
alloc
]
initWithCpp
:
p
];
});
...
...
@@ -47,7 +47,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
@implementation
DBTestHelpers
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
::
TestHelpers
>&
)
cppRef
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
TestHelpers
>&
)
cppRef
{
if
(
self
=
[
super
init
])
{
_cppRef
.
assign
(
cppRef
);
...
...
@@ -57,7 +57,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBSetRecord
*
)
getSetRecord
{
try
{
::
SetRecord
cppRet
=
::
TestHelpers
::
get_set_record
();
SetRecord
cppRet
=
TestHelpers
::
get_set_record
();
DBSetRecord
*
objcRet
=
[[
DBSetRecord
alloc
]
initWithCppSetRecord
:
cppRet
];
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -65,8 +65,8 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
BOOL
)
checkSetRecord
:(
DBSetRecord
*
)
rec
{
try
{
::
SetRecord
cppRec
=
std
::
move
([
rec
cppSetRecord
]);
bool
cppRet
=
::
TestHelpers
::
check_set_record
(
std
::
move
(
cppRec
));
SetRecord
cppRec
=
std
::
move
([
rec
cppSetRecord
]);
bool
cppRet
=
TestHelpers
::
check_set_record
(
std
::
move
(
cppRec
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -74,7 +74,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBPrimitiveList
*
)
getPrimitiveList
{
try
{
::
PrimitiveList
cppRet
=
::
TestHelpers
::
get_primitive_list
();
PrimitiveList
cppRet
=
TestHelpers
::
get_primitive_list
();
DBPrimitiveList
*
objcRet
=
[[
DBPrimitiveList
alloc
]
initWithCppPrimitiveList
:
cppRet
];
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -82,8 +82,8 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
BOOL
)
checkPrimitiveList
:(
DBPrimitiveList
*
)
pl
{
try
{
::
PrimitiveList
cppPl
=
std
::
move
([
pl
cppPrimitiveList
]);
bool
cppRet
=
::
TestHelpers
::
check_primitive_list
(
std
::
move
(
cppPl
));
PrimitiveList
cppPl
=
std
::
move
([
pl
cppPrimitiveList
]);
bool
cppRet
=
TestHelpers
::
check_primitive_list
(
std
::
move
(
cppPl
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -91,7 +91,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBNestedCollection
*
)
getNestedCollection
{
try
{
::
NestedCollection
cppRet
=
::
TestHelpers
::
get_nested_collection
();
NestedCollection
cppRet
=
TestHelpers
::
get_nested_collection
();
DBNestedCollection
*
objcRet
=
[[
DBNestedCollection
alloc
]
initWithCppNestedCollection
:
cppRet
];
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -99,8 +99,8 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
BOOL
)
checkNestedCollection
:(
DBNestedCollection
*
)
nc
{
try
{
::
NestedCollection
cppNc
=
std
::
move
([
nc
cppNestedCollection
]);
bool
cppRet
=
::
TestHelpers
::
check_nested_collection
(
std
::
move
(
cppNc
));
NestedCollection
cppNc
=
std
::
move
([
nc
cppNestedCollection
]);
bool
cppRet
=
TestHelpers
::
check_nested_collection
(
std
::
move
(
cppNc
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -108,7 +108,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
NSDictionary
*
)
getMap
{
try
{
std
::
unordered_map
<
std
::
string
,
int64_t
>
cppRet
=
::
TestHelpers
::
get_map
();
std
::
unordered_map
<
std
::
string
,
int64_t
>
cppRet
=
TestHelpers
::
get_map
();
std
::
vector
<
NSString
*>
objcRetTempKeyVector
;
objcRetTempKeyVector
.
reserve
(
cppRet
.
size
());
std
::
vector
<
NSNumber
*>
objcRetTempValueVector
;
...
...
@@ -132,7 +132,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
([
m
objectForKey
:
objcKey_0
]);
cppM
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
bool
cppRet
=
::
TestHelpers
::
check_map
(
std
::
move
(
cppM
));
bool
cppRet
=
TestHelpers
::
check_map
(
std
::
move
(
cppM
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -140,7 +140,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
NSDictionary
*
)
getEmptyMap
{
try
{
std
::
unordered_map
<
std
::
string
,
int64_t
>
cppRet
=
::
TestHelpers
::
get_empty_map
();
std
::
unordered_map
<
std
::
string
,
int64_t
>
cppRet
=
TestHelpers
::
get_empty_map
();
std
::
vector
<
NSString
*>
objcRetTempKeyVector
;
objcRetTempKeyVector
.
reserve
(
cppRet
.
size
());
std
::
vector
<
NSNumber
*>
objcRetTempValueVector
;
...
...
@@ -164,7 +164,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
int64_t
cppValue_0
=
::
djinni
::
I64
::
Boxed
::
toCpp
([
m
objectForKey
:
objcKey_0
]);
cppM
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
bool
cppRet
=
::
TestHelpers
::
check_empty_map
(
std
::
move
(
cppM
));
bool
cppRet
=
TestHelpers
::
check_empty_map
(
std
::
move
(
cppM
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -172,7 +172,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBMapListRecord
*
)
getMapListRecord
{
try
{
::
MapListRecord
cppRet
=
::
TestHelpers
::
get_map_list_record
();
MapListRecord
cppRet
=
TestHelpers
::
get_map_list_record
();
DBMapListRecord
*
objcRet
=
[[
DBMapListRecord
alloc
]
initWithCppMapListRecord
:
cppRet
];
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -180,8 +180,8 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
BOOL
)
checkMapListRecord
:(
DBMapListRecord
*
)
m
{
try
{
::
MapListRecord
cppM
=
std
::
move
([
m
cppMapListRecord
]);
bool
cppRet
=
::
TestHelpers
::
check_map_list_record
(
std
::
move
(
cppM
));
MapListRecord
cppM
=
std
::
move
([
m
cppMapListRecord
]);
bool
cppRet
=
TestHelpers
::
check_map_list_record
(
std
::
move
(
cppM
));
BOOL
objcRet
=
::
djinni
::
Bool
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -189,34 +189,34 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
void
)
checkClientInterfaceAscii
:(
id
<
DBClientInterface
>
)
i
{
try
{
std
::
shared_ptr
<
::
ClientInterface
>
cppI
=
::
djinni_generated
::
ClientInterface
::
toCpp
(
i
);
::
TestHelpers
::
check_client_interface_ascii
(
std
::
move
(
cppI
));
std
::
shared_ptr
<
ClientInterface
>
cppI
=
::
djinni_generated
::
ClientInterface
::
toCpp
(
i
);
TestHelpers
::
check_client_interface_ascii
(
std
::
move
(
cppI
));
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
+
(
void
)
checkClientInterfaceNonascii
:(
id
<
DBClientInterface
>
)
i
{
try
{
std
::
shared_ptr
<
::
ClientInterface
>
cppI
=
::
djinni_generated
::
ClientInterface
::
toCpp
(
i
);
::
TestHelpers
::
check_client_interface_nonascii
(
std
::
move
(
cppI
));
std
::
shared_ptr
<
ClientInterface
>
cppI
=
::
djinni_generated
::
ClientInterface
::
toCpp
(
i
);
TestHelpers
::
check_client_interface_nonascii
(
std
::
move
(
cppI
));
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
+
(
void
)
checkEnumMap
:(
NSDictionary
*
)
m
{
try
{
std
::
unordered_map
<
::
color
,
std
::
string
>
cppM
;
std
::
unordered_map
<
color
,
std
::
string
>
cppM
;
for
(
id
objcKey_0
in
m
)
{
::
color
cppKey_0
=
::
djinni
::
Enum
<::
color
,
DBColor
>::
Boxed
::
toCpp
(
objcKey_0
);
color
cppKey_0
=
::
djinni
::
Enum
<
color
,
DBColor
>::
Boxed
::
toCpp
(
objcKey_0
);
std
::
string
cppValue_0
=
::
djinni
::
String
::
toCpp
([
m
objectForKey
:
objcKey_0
]);
cppM
.
emplace
(
std
::
move
(
cppKey_0
),
std
::
move
(
cppValue_0
));
}
::
TestHelpers
::
check_enum_map
(
std
::
move
(
cppM
));
TestHelpers
::
check_enum_map
(
std
::
move
(
cppM
));
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
+
(
DBToken
*
)
tokenId
:(
DBToken
*
)
t
{
try
{
std
::
shared_ptr
<
::
Token
>
cppT
=
::
djinni_generated
::
Token
::
toCpp
(
t
);
std
::
shared_ptr
<
::
Token
>
cppRet
=
::
TestHelpers
::
token_id
(
std
::
move
(
cppT
));
std
::
shared_ptr
<
Token
>
cppT
=
::
djinni_generated
::
Token
::
toCpp
(
t
);
std
::
shared_ptr
<
Token
>
cppRet
=
TestHelpers
::
token_id
(
std
::
move
(
cppT
));
DBToken
*
objcRet
=
::
djinni_generated
::
Token
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -224,7 +224,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBToken
*
)
createCppToken
{
try
{
std
::
shared_ptr
<
::
Token
>
cppRet
=
::
TestHelpers
::
create_cpp_token
();
std
::
shared_ptr
<
Token
>
cppRet
=
TestHelpers
::
create_cpp_token
();
DBToken
*
objcRet
=
::
djinni_generated
::
Token
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -232,15 +232,15 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
void
)
checkCppToken
:(
DBToken
*
)
t
{
try
{
std
::
shared_ptr
<
::
Token
>
cppT
=
::
djinni_generated
::
Token
::
toCpp
(
t
);
::
TestHelpers
::
check_cpp_token
(
std
::
move
(
cppT
));
std
::
shared_ptr
<
Token
>
cppT
=
::
djinni_generated
::
Token
::
toCpp
(
t
);
TestHelpers
::
check_cpp_token
(
std
::
move
(
cppT
));
}
DJINNI_TRANSLATE_EXCEPTIONS
()
}
+
(
int64_t
)
cppTokenId
:(
DBToken
*
)
t
{
try
{
std
::
shared_ptr
<
::
Token
>
cppT
=
::
djinni_generated
::
Token
::
toCpp
(
t
);
int64_t
cppRet
=
::
TestHelpers
::
cpp_token_id
(
std
::
move
(
cppT
));
std
::
shared_ptr
<
Token
>
cppT
=
::
djinni_generated
::
Token
::
toCpp
(
t
);
int64_t
cppRet
=
TestHelpers
::
cpp_token_id
(
std
::
move
(
cppT
));
int64_t
objcRet
=
::
djinni
::
I64
::
fromCpp
(
cppRet
);
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
@@ -248,7 +248,7 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
NSNumber
*
)
returnNone
{
try
{
std
::
experimental
::
optional
<
int32_t
>
cppRet
=
::
TestHelpers
::
return_none
();
std
::
experimental
::
optional
<
int32_t
>
cppRet
=
TestHelpers
::
return_none
();
NSNumber
*
objcRet
;
if
(
cppRet
)
{
objcRet
=
::
djinni
::
I32
::
Boxed
::
fromCpp
((
*
(
cppRet
)));
...
...
@@ -261,8 +261,8 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+
(
DBAssortedIntegers
*
)
assortedIntegersId
:(
DBAssortedIntegers
*
)
i
{
try
{
::
AssortedIntegers
cppI
=
std
::
move
([
i
cppAssortedIntegers
]);
::
AssortedIntegers
cppRet
=
::
TestHelpers
::
assorted_integers_id
(
std
::
move
(
cppI
));
AssortedIntegers
cppI
=
std
::
move
([
i
cppAssortedIntegers
]);
AssortedIntegers
cppRet
=
TestHelpers
::
assorted_integers_id
(
std
::
move
(
cppI
));
DBAssortedIntegers
*
objcRet
=
[[
DBAssortedIntegers
alloc
]
initWithCppAssortedIntegers
:
cppRet
];
return
objcRet
;
}
DJINNI_TRANSLATE_EXCEPTIONS
()
...
...
test-suite/generated-src/objc/DBToken+Private.h
View file @
6b35e333
...
...
@@ -12,7 +12,7 @@ namespace djinni_generated {
struct
Token
{
using
CppType
=
std
::
shared_ptr
<
::
Token
>
;
using
CppType
=
std
::
shared_ptr
<
Token
>
;
using
ObjcType
=
DBToken
*
;
static
CppType
toCpp
(
ObjcType
objc
);
...
...
test-suite/generated-src/objc/DBToken.mm
View file @
6b35e333
...
...
@@ -14,9 +14,9 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
@interface
DBToken
()
@property
(
nonatomic
,
readonly
)
djinni
::
DbxCppWrapperCache
<
::
Token
>::
Handle
cppRef
;
@property
(
nonatomic
,
readonly
)
djinni
::
DbxCppWrapperCache
<
Token
>::
Handle
cppRef
;
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
::
Token
>&
)
cppRef
;
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
Token
>&
)
cppRef
;
@end
...
...
@@ -29,7 +29,7 @@ auto Token::toCpp(ObjcType objc) -> CppType
auto
Token
::
fromCpp
(
const
CppType
&
cpp
)
->
ObjcType
{
return
!
cpp
?
nil
:
djinni
::
DbxCppWrapperCache
<
::
Token
>::
getInstance
()
->
get
(
cpp
,
[]
(
const
auto
&
p
)
return
!
cpp
?
nil
:
djinni
::
DbxCppWrapperCache
<
Token
>::
getInstance
()
->
get
(
cpp
,
[]
(
const
auto
&
p
)
{
return
[[
DBToken
alloc
]
initWithCpp
:
p
];
});
...
...
@@ -39,7 +39,7 @@ auto Token::fromCpp(const CppType& cpp) -> ObjcType
@implementation
DBToken
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
::
Token
>&
)
cppRef
-
(
id
)
initWithCpp
:(
const
std
::
shared_ptr
<
Token
>&
)
cppRef
{
if
(
self
=
[
super
init
])
{
_cppRef
.
assign
(
cppRef
);
...
...
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