Commit 3af6aaf2 authored by Kenny Kaye's avatar Kenny Kaye

Merge remote-tracking branch 'upstream/master' into kkaye/include-paths

parents d6ce6382 96d8b444
...@@ -45,7 +45,7 @@ example_ios: ./build_ios/example/libtextsort.xcodeproj ...@@ -45,7 +45,7 @@ example_ios: ./build_ios/example/libtextsort.xcodeproj
-scheme TextSort \ -scheme TextSort \
-configuration 'Debug' \ -configuration 'Debug' \
-sdk iphonesimulator \ -sdk iphonesimulator \
-destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.3' -destination 'platform=iOS Simulator,name=iPhone 6s,OS=10.1'
# this target implicitly depends on GypAndroid.mk since gradle will try to make it # this target implicitly depends on GypAndroid.mk since gradle will try to make it
example_android: GypAndroid.mk example_android: GypAndroid.mk
......
...@@ -428,7 +428,6 @@ Run `make test` to invoke the test suite, found in the test-suite subdirectory. ...@@ -428,7 +428,6 @@ Run `make test` to invoke the test suite, found in the test-suite subdirectory.
* [Slides](https://bit.ly/djinnitalk2) and [video](https://bit.ly/djinnivideo2) from the CppCon 2015 about Djinni implementatino techniques, and the addition of Python. * [Slides](https://bit.ly/djinnitalk2) and [video](https://bit.ly/djinnivideo2) from the CppCon 2015 about Djinni implementatino techniques, and the addition of Python.
* You can see a [CppCon 2014 talk](https://www.youtube.com/watch?v=5AZMEm3rZ2Y) by app developers at Dropbox about their cross-platform experiences. * You can see a [CppCon 2014 talk](https://www.youtube.com/watch?v=5AZMEm3rZ2Y) by app developers at Dropbox about their cross-platform experiences.
## Authors ## Authors
- Kannan Goundan - Kannan Goundan
- Tony Grue - Tony Grue
...@@ -439,5 +438,5 @@ Run `make test` to invoke the test suite, found in the test-suite subdirectory. ...@@ -439,5 +438,5 @@ Run `make test` to invoke the test suite, found in the test-suite subdirectory.
- Andrew Twyman - Andrew Twyman
## Contacts ## Contacts
- Jacob Potter - `djinni@j4cbo.com`
- Andrew Twyman - `atwyman@dropbox.com` - Andrew Twyman - `atwyman@dropbox.com`
- Jacob Potter - `djinni@j4cbo.com`
...@@ -7,7 +7,7 @@ import java.util.ArrayList; ...@@ -7,7 +7,7 @@ import java.util.ArrayList;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public final class ItemList { /*package*/ final class ItemList {
/*package*/ final ArrayList<String> mItems; /*package*/ final ArrayList<String> mItems;
......
...@@ -7,7 +7,7 @@ import java.util.concurrent.atomic.AtomicBoolean; ...@@ -7,7 +7,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public abstract class SortItems { /*package*/ abstract class SortItems {
/** For the iOS / Android demo */ /** For the iOS / Android demo */
public abstract void sort(@Nonnull SortOrder order, @Nonnull ItemList items); public abstract void sort(@Nonnull SortOrder order, @Nonnull ItemList items);
......
...@@ -6,7 +6,7 @@ package com.dropbox.textsort; ...@@ -6,7 +6,7 @@ package com.dropbox.textsort;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public enum SortOrder { /*package*/ enum SortOrder {
ASCENDING, ASCENDING,
DESCENDING, DESCENDING,
RANDOM, RANDOM,
......
...@@ -6,6 +6,6 @@ package com.dropbox.textsort; ...@@ -6,6 +6,6 @@ package com.dropbox.textsort;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public abstract class TextboxListener { /*package*/ abstract class TextboxListener {
public abstract void update(@Nonnull ItemList items); public abstract void update(@Nonnull ItemList items);
} }
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeSortItems.hpp" // my header #include "NativeSortItems.hpp" // my header
#include "NativeItemList.hpp" #include "NativeItemList.hpp"
#include "NativeSortItems.hpp"
#include "NativeSortOrder.hpp" #include "NativeSortOrder.hpp"
#include "NativeTextboxListener.hpp" #include "NativeTextboxListener.hpp"
......
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
#import "TXSSortItems.h" #import "TXSSortItems.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h"
#import "TXSItemList+Private.h" #import "TXSItemList+Private.h"
#import "TXSSortItems+Private.h" #import "TXSSortOrder+Private.h"
#import "TXSTextboxListener+Private.h" #import "TXSTextboxListener+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -42,15 +42,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -42,15 +42,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nullable TXSSortItems *)createWithListener:(nullable id<TXSTextboxListener>)listener { + (nullable TXSSortItems *)createWithListener:(nullable id<TXSTextboxListener>)listener {
try { try {
auto r = ::textsort::SortItems::create_with_listener(::djinni_generated::TextboxListener::toCpp(listener)); auto objcpp_result_ = ::textsort::SortItems::create_with_listener(::djinni_generated::TextboxListener::toCpp(listener));
return ::djinni_generated::SortItems::fromCpp(r); return ::djinni_generated::SortItems::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull TXSItemList *)runSort:(nonnull TXSItemList *)items { + (nonnull TXSItemList *)runSort:(nonnull TXSItemList *)items {
try { try {
auto r = ::textsort::SortItems::run_sort(::djinni_generated::ItemList::toCpp(items)); auto objcpp_result_ = ::textsort::SortItems::run_sort(::djinni_generated::ItemList::toCpp(items));
return ::djinni_generated::ItemList::fromCpp(r); return ::djinni_generated::ItemList::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#include "sort_order.hpp"
#import "DJIMarshal+Private.h"
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#import "TXSTextboxListener.h" #import "TXSTextboxListener.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#import "TXSItemList+Private.h" #import "TXSItemList+Private.h"
#include <stdexcept>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
......
...@@ -53,6 +53,7 @@ fi ...@@ -53,6 +53,7 @@ fi
"$base_dir/../src/run-assume-built" \ "$base_dir/../src/run-assume-built" \
--java-out "$temp_out/java" \ --java-out "$temp_out/java" \
--java-package $java_package \ --java-package $java_package \
--java-class-access-modifier "package" \
--java-nullable-annotation "javax.annotation.CheckForNull" \ --java-nullable-annotation "javax.annotation.CheckForNull" \
--java-nonnull-annotation "javax.annotation.Nonnull" \ --java-nonnull-annotation "javax.annotation.Nonnull" \
--ident-java-field mFooBar \ --ident-java-field mFooBar \
......
...@@ -15,12 +15,28 @@ ...@@ -15,12 +15,28 @@
--> -->
<idea-plugin version="2"> <idea-plugin version="2">
<id>com.dropbox.djinni.ideaplugin</id> <id>com.dropbox.djinni.ideaplugin</id>
<name>Djinni interface definition language file support</name> <name>Djinni IDL file support</name>
<version>0.8</version> <version>0.8</version>
<vendor email="jaetzold@dropbox.com" url="http://www.dropbox.com">Dropbox</vendor> <vendor url="https://github.com/dropbox/djinni">Dropbox Djinni Github Project</vendor>
<description><![CDATA[ <description><![CDATA[
Add some basic navigation, code-completion and error highlighting support to .djinni files. Add some basic navigation, code-completion and error highlighting support to .djinni files.
<h4>License</h4>
Copyright 2015-2016 Dropbox, Inc.<br/>
<br/>
Licensed under the Apache License, Version 2.0 (the "License");<br/>
you may not use this file except in compliance with the License.<br/>
You may obtain a copy of the License at<br/>
<br/>
&nbsp;&nbsp;<a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a><br/>
<br/>
Unless required by applicable law or agreed to in writing, software<br/>
distributed under the License is distributed on an "AS IS" BASIS,<br/>
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br/>
See the License for the specific language governing permissions and<br/>
limitations under the License.
]]></description> ]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
...@@ -29,7 +45,7 @@ ...@@ -29,7 +45,7 @@
</change-notes> </change-notes>
<!-- please see https://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description --> <!-- please see https://confluence.jetbrains.com/display/IDEADEV/Build+Number+Ranges for description -->
<idea-version since-build="131"/> <idea-version since-build="139"/>
<!-- please see https://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products <!-- please see https://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
on how to target different products --> on how to target different products -->
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="PROJECT" charset="UTF-8" />
</component>
</project> </project>
\ No newline at end of file
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
<option name="sbtVersion" value="0.13.5" /> <option name="sbtVersion" value="0.13.5" />
<option name="useAutoImport" value="true" /> <option name="useAutoImport" value="true" />
<option name="useOurOwnAutoImport" value="true" /> <option name="useOurOwnAutoImport" value="true" />
<option name="myModules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/project" />
</set>
</option>
</SbtProjectSettings> </SbtProjectSettings>
</option> </option>
</component> </component>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="VcsDirectoryMappings"> <component name="VcsDirectoryMappings">
<mapping directory="" vcs="" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" /> <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component> </component>
</project> </project>
\ No newline at end of file
...@@ -59,18 +59,18 @@ class CppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -59,18 +59,18 @@ class CppMarshal(spec: Spec) extends Marshal(spec) {
case MList => List(ImportRef("<vector>")) case MList => List(ImportRef("<vector>"))
case MSet => List(ImportRef("<unordered_set>")) case MSet => List(ImportRef("<unordered_set>"))
case MMap => List(ImportRef("<unordered_map>")) case MMap => List(ImportRef("<unordered_map>"))
case d: MDef => d.defType match { case d: MDef => d.body match {
case DRecord => case r: Record =>
if (d.name != exclude) { if (d.name != exclude) {
if (forwardDeclareOnly) { if (forwardDeclareOnly) {
List(DeclRef(s"struct ${typename(d.name, d.body)};", Some(spec.cppNamespace))) List(DeclRef(s"struct ${typename(d.name, d.body)};", Some(spec.cppNamespace)))
} else { } else {
List(ImportRef(include(d.name))) List(ImportRef(include(d.name, r.ext.cpp)))
} }
} else { } else {
List() List()
} }
case DEnum => case e: Enum =>
if (d.name != exclude) { if (d.name != exclude) {
if (forwardDeclareOnly) { if (forwardDeclareOnly) {
List(DeclRef(s"enum class ${typename(d.name, d.body)};", Some(spec.cppNamespace))) List(DeclRef(s"enum class ${typename(d.name, d.body)};", Some(spec.cppNamespace)))
...@@ -80,7 +80,7 @@ class CppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -80,7 +80,7 @@ class CppMarshal(spec: Spec) extends Marshal(spec) {
} else { } else {
List() List()
} }
case DInterface => case i: Interface =>
val base = if (d.name != exclude) { val base = if (d.name != exclude) {
List(ImportRef("<memory>"), DeclRef(s"class ${typename(d.name, d.body)};", Some(spec.cppNamespace))) List(ImportRef("<memory>"), DeclRef(s"class ${typename(d.name, d.body)};", Some(spec.cppNamespace)))
} else { } else {
...@@ -106,14 +106,14 @@ class CppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -106,14 +106,14 @@ class CppMarshal(spec: Spec) extends Marshal(spec) {
List() List()
} else { } else {
m match { m match {
case d: MDef => d.defType match { case d: MDef => d.body match {
case DRecord => case r: Record =>
if (d.name != exclude) { if (d.name != exclude) {
List(ImportRef(include(d.name))) List(ImportRef(include(d.name, r.ext.cpp)))
} else { } else {
List() List()
} }
case DEnum => case e: Enum =>
if (d.name != exclude) { if (d.name != exclude) {
List(ImportRef(include(d.name))) List(ImportRef(include(d.name)))
} else { } else {
...@@ -126,7 +126,10 @@ class CppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -126,7 +126,10 @@ class CppMarshal(spec: Spec) extends Marshal(spec) {
} }
} }
def include(ident: String): String = q(spec.cppIncludePrefix + spec.cppFileIdentStyle(ident) + "." + spec.cppHeaderExt) def include(ident: String, isExtendedRecord: Boolean = false): String = {
val prefix = if (isExtendedRecord) spec.cppExtendedRecordIncludePrefix else spec.cppIncludePrefix
q(prefix + spec.cppFileIdentStyle (ident) + "." + spec.cppHeaderExt)
}
private def toCppType(ty: TypeRef, namespace: Option[String] = None, scopeSymbols: Seq[String] = Seq()): String = private def toCppType(ty: TypeRef, namespace: Option[String] = None, scopeSymbols: Seq[String] = Seq()): String =
toCppType(ty.resolved, namespace, scopeSymbols) toCppType(ty.resolved, namespace, scopeSymbols)
...@@ -145,7 +148,7 @@ class CppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -145,7 +148,7 @@ class CppMarshal(spec: Spec) extends Marshal(spec) {
} }
def base(m: Meta): String = m match { def base(m: Meta): String = m match {
case p: MPrimitive => p.cName case p: MPrimitive => p.cName
case MString => "std::string" case MString => if (spec.cppUseWideStrings) "std::wstring" else "std::string"
case MDate => "std::chrono::system_clock::time_point" case MDate => "std::chrono::system_clock::time_point"
case MBinary => "std::vector<uint8_t>" case MBinary => "std::vector<uint8_t>"
case MOptional => spec.cppOptionalTemplate case MOptional => spec.cppOptionalTemplate
......
...@@ -35,11 +35,12 @@ class JNIGenerator(spec: Spec) extends Generator(spec) { ...@@ -35,11 +35,12 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
def writeJniHppFile(name: String, origin: String, includes: Iterable[String], fwds: Iterable[String], f: IndentWriter => Unit, f2: IndentWriter => Unit = (w => {})) = def writeJniHppFile(name: String, origin: String, includes: Iterable[String], fwds: Iterable[String], f: IndentWriter => Unit, f2: IndentWriter => Unit = (w => {})) =
writeHppFileGeneric(spec.jniHeaderOutFolder.get, spec.jniNamespace, spec.jniFileIdentStyle)(name, origin, includes, fwds, f, f2) writeHppFileGeneric(spec.jniHeaderOutFolder.get, spec.jniNamespace, spec.jniFileIdentStyle)(name, origin, includes, fwds, f, f2)
class JNIRefs(name: String) { class JNIRefs(name: String, cppPrefixOverride: Option[String]=None) {
var jniHpp = mutable.TreeSet[String]() var jniHpp = mutable.TreeSet[String]()
var jniCpp = mutable.TreeSet[String]() var jniCpp = mutable.TreeSet[String]()
jniHpp.add("#include " + q(spec.jniIncludeCppPrefix + spec.cppFileIdentStyle(name) + "." + spec.cppHeaderExt)) val cppPrefix = cppPrefixOverride.getOrElse(spec.jniIncludeCppPrefix)
jniHpp.add("#include " + q(cppPrefix + spec.cppFileIdentStyle(name) + "." + spec.cppHeaderExt))
jniHpp.add("#include " + q(spec.jniBaseLibIncludePrefix + "djinni_support.hpp")) jniHpp.add("#include " + q(spec.jniBaseLibIncludePrefix + "djinni_support.hpp"))
spec.cppNnHeader match { spec.cppNnHeader match {
case Some(nnHdr) => jniHpp.add("#include " + nnHdr) case Some(nnHdr) => jniHpp.add("#include " + nnHdr)
...@@ -82,7 +83,12 @@ class JNIGenerator(spec: Spec) extends Generator(spec) { ...@@ -82,7 +83,12 @@ class JNIGenerator(spec: Spec) extends Generator(spec) {
} }
override def generateRecord(origin: String, ident: Ident, doc: Doc, params: Seq[TypeParam], r: Record) { override def generateRecord(origin: String, ident: Ident, doc: Doc, params: Seq[TypeParam], r: Record) {
val refs = new JNIRefs(ident.name) val prefixOverride: Option[String] = if (r.ext.cpp) {
Some(spec.cppExtendedRecordIncludePrefix)
} else {
None
}
val refs = new JNIRefs(ident.name, prefixOverride)
r.fields.foreach(f => refs.find(f.ty)) r.fields.foreach(f => refs.find(f.ty))
val jniHelper = jniMarshal.helperClass(ident) val jniHelper = jniMarshal.helperClass(ident)
......
...@@ -98,7 +98,7 @@ class JNIMarshal(spec: Spec) extends Marshal(spec) { ...@@ -98,7 +98,7 @@ class JNIMarshal(spec: Spec) extends Marshal(spec) {
} }
case MOptional => "Optional" case MOptional => "Optional"
case MBinary => "Binary" case MBinary => "Binary"
case MString => "String" case MString => if (spec.cppUseWideStrings) "WString" else "String"
case MDate => "Date" case MDate => "Date"
case MList => "List" case MList => "List"
case MSet => "Set" case MSet => "Set"
......
...@@ -29,6 +29,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) { ...@@ -29,6 +29,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
val javaAnnotationHeader = spec.javaAnnotation.map(pkg => '@' + pkg.split("\\.").last) val javaAnnotationHeader = spec.javaAnnotation.map(pkg => '@' + pkg.split("\\.").last)
val javaNullableAnnotation = spec.javaNullableAnnotation.map(pkg => '@' + pkg.split("\\.").last) val javaNullableAnnotation = spec.javaNullableAnnotation.map(pkg => '@' + pkg.split("\\.").last)
val javaNonnullAnnotation = spec.javaNonnullAnnotation.map(pkg => '@' + pkg.split("\\.").last) val javaNonnullAnnotation = spec.javaNonnullAnnotation.map(pkg => '@' + pkg.split("\\.").last)
val javaClassAccessModifierString = JavaAccessModifier.getCodeGenerationString(spec.javaClassAccessModifier)
val marshal = new JavaMarshal(spec) val marshal = new JavaMarshal(spec)
class JavaRefs() { class JavaRefs() {
...@@ -109,7 +110,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) { ...@@ -109,7 +110,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
writeJavaFile(ident, origin, refs.java, w => { writeJavaFile(ident, origin, refs.java, w => {
writeDoc(w, doc) writeDoc(w, doc)
javaAnnotationHeader.foreach(w.wl) javaAnnotationHeader.foreach(w.wl)
w.w(s"public enum ${marshal.typename(ident, e)}").braced { w.w(s"${javaClassAccessModifierString}enum ${marshal.typename(ident, e)}").braced {
for (o <- e.options) { for (o <- e.options) {
writeDoc(w, o.doc) writeDoc(w, o.doc)
w.wl(idJava.enum(o.ident) + ",") w.wl(idJava.enum(o.ident) + ",")
...@@ -139,7 +140,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) { ...@@ -139,7 +140,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
writeDoc(w, doc) writeDoc(w, doc)
javaAnnotationHeader.foreach(w.wl) javaAnnotationHeader.foreach(w.wl)
w.w(s"public abstract class $javaClass$typeParamList").braced { w.w(s"${javaClassAccessModifierString}abstract class $javaClass$typeParamList").braced {
val skipFirst = SkipFirst() val skipFirst = SkipFirst()
generateJavaConstants(w, i.consts) generateJavaConstants(w, i.consts)
...@@ -212,7 +213,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) { ...@@ -212,7 +213,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
r.fields.foreach(f => refs.find(f.ty)) r.fields.foreach(f => refs.find(f.ty))
val javaName = if (r.ext.java) (ident.name + "_base") else ident.name val javaName = if (r.ext.java) (ident.name + "_base") else ident.name
val javaFinal = if (!r.ext.java && spec.javaUseFinalForRecord) " final" else "" val javaFinal = if (!r.ext.java && spec.javaUseFinalForRecord) "final " else ""
writeJavaFile(javaName, origin, refs.java, w => { writeJavaFile(javaName, origin, refs.java, w => {
writeDoc(w, doc) writeDoc(w, doc)
...@@ -225,7 +226,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) { ...@@ -225,7 +226,7 @@ class JavaGenerator(spec: Spec) extends Generator(spec) {
} else { } else {
"" ""
} }
w.w(s"public$javaFinal class ${self + javaTypeParams(params)}$comparableFlag").braced { w.w(s"${javaClassAccessModifierString}${javaFinal}class ${self + javaTypeParams(params)}$comparableFlag").braced {
w.wl w.wl
generateJavaConstants(w, r.consts) generateJavaConstants(w, r.consts)
// Field definitions. // Field definitions.
......
...@@ -36,8 +36,10 @@ object Main { ...@@ -36,8 +36,10 @@ object Main {
var cppNnHeader: Option[String] = None var cppNnHeader: Option[String] = None
var cppNnType: Option[String] = None var cppNnType: Option[String] = None
var cppNnCheckExpression: Option[String] = None var cppNnCheckExpression: Option[String] = None
var cppUseWideStrings: Boolean = false
var javaOutFolder: Option[File] = None var javaOutFolder: Option[File] = None
var javaPackage: Option[String] = None var javaPackage: Option[String] = None
var javaClassAccessModifier: JavaAccessModifier.Value = JavaAccessModifier.Public
var javaCppException: Option[String] = None var javaCppException: Option[String] = None
var javaAnnotation: Option[String] = None var javaAnnotation: Option[String] = None
var javaNullableAnnotation: Option[String] = None var javaNullableAnnotation: Option[String] = None
...@@ -101,6 +103,8 @@ object Main { ...@@ -101,6 +103,8 @@ object Main {
.text("The output for the Java files (Generator disabled if unspecified).") .text("The output for the Java files (Generator disabled if unspecified).")
opt[String]("java-package").valueName("...").foreach(x => javaPackage = Some(x)) opt[String]("java-package").valueName("...").foreach(x => javaPackage = Some(x))
.text("The package name to use for generated Java classes.") .text("The package name to use for generated Java classes.")
opt[JavaAccessModifier.Value]("java-class-access-modifier").valueName("<public/package>").foreach(x => javaClassAccessModifier = x)
.text("The access modifier to use for generated Java classes (default: public).")
opt[String]("java-cpp-exception").valueName("<exception-class>").foreach(x => javaCppException = Some(x)) opt[String]("java-cpp-exception").valueName("<exception-class>").foreach(x => javaCppException = Some(x))
.text("The type for translated C++ exceptions in Java (default: java.lang.RuntimeException that is not checked)") .text("The type for translated C++ exceptions in Java (default: java.lang.RuntimeException that is not checked)")
opt[String]("java-annotation").valueName("<annotation-class>").foreach(x => javaAnnotation = Some(x)) opt[String]("java-annotation").valueName("<annotation-class>").foreach(x => javaAnnotation = Some(x))
...@@ -136,6 +140,8 @@ object Main { ...@@ -136,6 +140,8 @@ object Main {
.text("The type to use for non-nullable pointers (as a substitute for std::shared_ptr)") .text("The type to use for non-nullable pointers (as a substitute for std::shared_ptr)")
opt[String]("cpp-nn-check-expression").valueName("<header>").foreach(x => cppNnCheckExpression = Some(x)) opt[String]("cpp-nn-check-expression").valueName("<header>").foreach(x => cppNnCheckExpression = Some(x))
.text("The expression to use for building non-nullable pointers") .text("The expression to use for building non-nullable pointers")
opt[Boolean]( "cpp-use-wide-strings").valueName("<true/false>").foreach(x => cppUseWideStrings = x)
.text("Use wide strings in C++ code (default: false)")
note("") note("")
opt[File]("jni-out").valueName("<out-folder>").foreach(x => jniOutFolder = Some(x)) opt[File]("jni-out").valueName("<out-folder>").foreach(x => jniOutFolder = Some(x))
.text("The folder for the JNI C++ output files (Generator disabled if unspecified).") .text("The folder for the JNI C++ output files (Generator disabled if unspecified).")
...@@ -238,6 +244,7 @@ object Main { ...@@ -238,6 +244,7 @@ object Main {
// Parse IDL file. // Parse IDL file.
System.out.println("Parsing...") System.out.println("Parsing...")
val inFileListWriter = if (inFileListPath.isDefined) { val inFileListWriter = if (inFileListPath.isDefined) {
if (inFileListPath.get.getParentFile != null)
createFolder("input file list", inFileListPath.get.getParentFile) createFolder("input file list", inFileListPath.get.getParentFile)
Some(new BufferedWriter(new FileWriter(inFileListPath.get))) Some(new BufferedWriter(new FileWriter(inFileListPath.get)))
} else { } else {
...@@ -268,6 +275,7 @@ object Main { ...@@ -268,6 +275,7 @@ object Main {
System.out.println("Generating...") System.out.println("Generating...")
val outFileListWriter = if (outFileListPath.isDefined) { val outFileListWriter = if (outFileListPath.isDefined) {
if (outFileListPath.get.getParentFile != null)
createFolder("output file list", outFileListPath.get.getParentFile) createFolder("output file list", outFileListPath.get.getParentFile)
Some(new BufferedWriter(new FileWriter(outFileListPath.get))) Some(new BufferedWriter(new FileWriter(outFileListPath.get)))
} else { } else {
...@@ -277,6 +285,7 @@ object Main { ...@@ -277,6 +285,7 @@ object Main {
val outSpec = Spec( val outSpec = Spec(
javaOutFolder, javaOutFolder,
javaPackage, javaPackage,
javaClassAccessModifier,
javaIdentStyle, javaIdentStyle,
javaCppException, javaCppException,
javaAnnotation, javaAnnotation,
...@@ -296,6 +305,7 @@ object Main { ...@@ -296,6 +305,7 @@ object Main {
cppNnHeader, cppNnHeader,
cppNnType, cppNnType,
cppNnCheckExpression, cppNnCheckExpression,
cppUseWideStrings,
jniOutFolder, jniOutFolder,
jniHeaderOutFolder, jniHeaderOutFolder,
jniIncludePrefix, jniIncludePrefix,
......
...@@ -58,7 +58,7 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) { ...@@ -58,7 +58,7 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
List(ImportRef(include(d.name))) List(ImportRef(include(d.name)))
case DInterface => case DInterface =>
val ext = d.body.asInstanceOf[Interface].ext val ext = d.body.asInstanceOf[Interface].ext
if (ext.cpp && !ext.objc) { if (!ext.objc) {
List(ImportRef("<Foundation/Foundation.h>"), DeclRef(s"@class ${typename(d.name, d.body)};", None)) List(ImportRef("<Foundation/Foundation.h>"), DeclRef(s"@class ${typename(d.name, d.body)};", None))
} }
else { else {
...@@ -119,7 +119,7 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) { ...@@ -119,7 +119,7 @@ class ObjcMarshal(spec: Spec) extends Marshal(spec) {
case DRecord => (idObjc.ty(d.name), true) case DRecord => (idObjc.ty(d.name), true)
case DInterface => case DInterface =>
val ext = d.body.asInstanceOf[Interface].ext val ext = d.body.asInstanceOf[Interface].ext
if (ext.cpp && !ext.objc) if (!ext.objc)
(idObjc.ty(d.name), true) (idObjc.ty(d.name), true)
else else
(s"id<${idObjc.ty(d.name)}>", false) (s"id<${idObjc.ty(d.name)}>", false)
......
...@@ -49,7 +49,11 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -49,7 +49,11 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
private def arcAssert(w: IndentWriter) = w.wl("static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");") private def arcAssert(w: IndentWriter) = w.wl("static_assert(__has_feature(objc_arc), " + q("Djinni requires ARC to be enabled for this file") + ");")
override def generateEnum(origin: String, ident: Ident, doc: Doc, e: Enum) { override def generateEnum(origin: String, ident: Ident, doc: Doc, e: Enum) {
// No generation required var imports = mutable.TreeSet[String]()
imports.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h"))
imports.add("!#include " + q(spec.objcppIncludeCppPrefix + spec.cppFileIdentStyle(ident) + "." + spec.cppHeaderExt))
writeObjcFile(objcppMarshal.privateHeaderName(ident.name), origin, imports, w => {} )
} }
def headerName(ident: String): String = idObjc.ty(ident) + "." + spec.objcHeaderExt def headerName(ident: String): String = idObjc.ty(ident) + "." + spec.objcHeaderExt
...@@ -73,6 +77,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -73,6 +77,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
refs.privHeader.add("#include <memory>") refs.privHeader.add("#include <memory>")
refs.privHeader.add("!#include " + q(spec.objcppIncludeCppPrefix + spec.cppFileIdentStyle(ident) + "." + spec.cppHeaderExt)) refs.privHeader.add("!#include " + q(spec.objcppIncludeCppPrefix + spec.cppFileIdentStyle(ident) + "." + spec.cppHeaderExt))
refs.body.add("!#import " + q(spec.objcppIncludeObjcPrefix + headerName(ident))) refs.body.add("!#import " + q(spec.objcppIncludeObjcPrefix + headerName(ident)))
refs.body.add("!#import " + q(spec.objcppIncludePrefix + objcppMarshal.privateHeaderName(ident.name)))
spec.cppNnHeader match { spec.cppNnHeader match {
case Some(nnHdr) => refs.privHeader.add("#include " + nnHdr) case Some(nnHdr) => refs.privHeader.add("#include " + nnHdr)
...@@ -120,16 +125,21 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -120,16 +125,21 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
}) })
if (i.ext.cpp) { if (i.ext.cpp) {
refs.body.add("!#import " + q(spec.objcppIncludePrefix + objcppMarshal.privateHeaderName(ident.name)))
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJICppWrapperCache+Private.h")) refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJICppWrapperCache+Private.h"))
refs.body.add("#include <utility>") refs.body.add("#include <utility>")
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIError.h")) refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIError.h"))
refs.body.add("#include <exception>") refs.body.add("#include <exception>")
} }
if (!spec.cppNnType.isEmpty || !spec.cppNnCheckExpression.nonEmpty) {
refs.body.add("#include <stdexcept>")
}
if (i.ext.objc) { if (i.ext.objc) {
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIObjcWrapperCache+Private.h")) refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIObjcWrapperCache+Private.h"))
refs.body.add("!#import " + q(spec.objcppIncludePrefix + objcppMarshal.privateHeaderName(ident.name))) }
if (!i.ext.cpp && !i.ext.objc) {
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIError.h"))
} }
writeObjcFile(privateBodyName(ident.name), origin, refs.body, w => { writeObjcFile(privateBodyName(ident.name), origin, refs.body, w => {
...@@ -177,12 +187,12 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -177,12 +187,12 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
} }
} }
}) })
val ret = m.ret.fold("")(_ => "auto r = ") val ret = m.ret.fold("")(_ => "auto objcpp_result_ = ")
val call = ret + (if (!m.static) "_cppRefHandle.get()->" else cppSelf + "::") + idCpp.method(m.ident) + "(" val call = ret + (if (!m.static) "_cppRefHandle.get()->" else cppSelf + "::") + idCpp.method(m.ident) + "("
writeAlignedCall(w, call, m.params, ")", p => objcppMarshal.toCpp(p.ty, idObjc.local(p.ident.name))) writeAlignedCall(w, call, m.params, ")", p => objcppMarshal.toCpp(p.ty, idObjc.local(p.ident.name)))
w.wl(";") w.wl(";")
m.ret.fold()(r => w.wl(s"return ${objcppMarshal.fromCpp(r, "r")};")) m.ret.fold()(r => w.wl(s"return ${objcppMarshal.fromCpp(r, "objcpp_result_")};"))
} }
} }
} }
...@@ -207,7 +217,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -207,7 +217,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
val params = m.params.map(p => cppMarshal.fqParamType(p.ty) + " c_" + idCpp.local(p.ident)) val params = m.params.map(p => cppMarshal.fqParamType(p.ty) + " c_" + idCpp.local(p.ident))
w.wl(s"$ret ${idCpp.method(m.ident)}${params.mkString("(", ", ", ")")} override").braced { w.wl(s"$ret ${idCpp.method(m.ident)}${params.mkString("(", ", ", ")")} override").braced {
w.w("@autoreleasepool").braced { w.w("@autoreleasepool").braced {
val ret = m.ret.fold("")(_ => "auto r = ") val ret = m.ret.fold("")(_ => "auto objcpp_result_ = ")
val call = s"[Handle::get() ${idObjc.method(m.ident)}" val call = s"[Handle::get() ${idObjc.method(m.ident)}"
writeAlignedObjcCall(w, ret + call, m.params, "]", p => (idObjc.field(p.ident), s"(${objcppMarshal.fromCpp(p.ty, "c_" + idCpp.local(p.ident))})")) writeAlignedObjcCall(w, ret + call, m.params, "]", p => (idObjc.field(p.ident), s"(${objcppMarshal.fromCpp(p.ty, "c_" + idCpp.local(p.ident))})"))
w.wl(";") w.wl(";")
...@@ -219,11 +229,11 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -219,11 +229,11 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
writeObjcFuncDecl(m, new IndentWriter(stringWriter)) writeObjcFuncDecl(m, new IndentWriter(stringWriter))
val singleLineFunctionDecl = stringWriter.toString.replaceAll("\n *", " ") val singleLineFunctionDecl = stringWriter.toString.replaceAll("\n *", " ")
val exceptionReason = s"Got unexpected null return value from function $objcSelf $singleLineFunctionDecl" val exceptionReason = s"Got unexpected null return value from function $objcSelf $singleLineFunctionDecl"
w.w(s"if (r == nil)").braced { w.w(s"if (objcpp_result_ == nil)").braced {
w.wl(s"""throw std::invalid_argument("$exceptionReason");""") w.wl(s"""throw std::invalid_argument("$exceptionReason");""")
} }
} }
w.wl(s"return ${objcppMarshal.toCpp(ty, "r")};") w.wl(s"return ${objcppMarshal.toCpp(ty, "objcpp_result_")};")
}) })
} }
} }
...@@ -249,7 +259,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -249,7 +259,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
// we don't have to do any casting at all, just access cppRef directly. // we don't have to do any casting at all, just access cppRef directly.
w.wl("return " + nnCheck("objc->_cppRefHandle.get()") + ";") w.wl("return " + nnCheck("objc->_cppRefHandle.get()") + ";")
//w.wl(s"return ${spec.cppNnCheckExpression.getOrElse("")}(objc->_cppRefHandle.get());") //w.wl(s"return ${spec.cppNnCheckExpression.getOrElse("")}(objc->_cppRefHandle.get());")
} else { } else if (i.ext.cpp || i.ext.objc) {
// ObjC only, or ObjC and C++. // ObjC only, or ObjC and C++.
if (i.ext.cpp) { if (i.ext.cpp) {
// If it could be implemented in C++, we might have to unwrap a proxy object. // If it could be implemented in C++, we might have to unwrap a proxy object.
...@@ -260,6 +270,9 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -260,6 +270,9 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
} }
val getProxyExpr = s"::djinni::get_objc_proxy<ObjcProxy>(objc)" val getProxyExpr = s"::djinni::get_objc_proxy<ObjcProxy>(objc)"
w.wl(s"return ${nnCheck(getProxyExpr)};") w.wl(s"return ${nnCheck(getProxyExpr)};")
} else {
// Neither ObjC nor C++. Unusable, but generate compilable code.
w.wl("DJINNI_UNIMPLEMENTED(@\"Interface not implementable in any language.\");")
} }
} }
w.wl w.wl
...@@ -272,7 +285,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -272,7 +285,7 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
// ObjC only. In this case we *must* unwrap a proxy object - the dynamic_cast will // ObjC only. In this case we *must* unwrap a proxy object - the dynamic_cast will
// throw bad_cast if we gave it something of the wrong type. // throw bad_cast if we gave it something of the wrong type.
w.wl(s"return dynamic_cast<ObjcProxy&>(*cpp).Handle::get();") w.wl(s"return dynamic_cast<ObjcProxy&>(*cpp).Handle::get();")
} else { } else if (i.ext.objc || i.ext.cpp) {
// C++ only, or C++ and ObjC. // C++ only, or C++ and ObjC.
if (i.ext.objc) { if (i.ext.objc) {
// If it could be implemented in ObjC, we might have to unwrap a proxy object. // If it could be implemented in ObjC, we might have to unwrap a proxy object.
...@@ -281,6 +294,9 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -281,6 +294,9 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
} }
} }
w.wl(s"return ::djinni::get_cpp_proxy<$objcSelf>(cpp);") w.wl(s"return ::djinni::get_cpp_proxy<$objcSelf>(cpp);")
} else {
// Neither ObjC nor C++. Unusable, but generate compilable code.
w.wl("DJINNI_UNIMPLEMENTED(@\"Interface not implementable in any language.\");")
} }
} }
}) })
...@@ -366,9 +382,16 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) { ...@@ -366,9 +382,16 @@ class ObjcppGenerator(spec: Spec) extends BaseObjcGenerator(spec) {
w.wl("// This file generated by Djinni from " + origin) w.wl("// This file generated by Djinni from " + origin)
w.wl w.wl
if (refs.nonEmpty) { if (refs.nonEmpty) {
var included = mutable.TreeSet[String]();
for (s <- refs) {
// Ignore the ! in front of each line; used to put own headers to the top // Ignore the ! in front of each line; used to put own headers to the top
// according to Objective-C style guide // according to Objective-C style guide
refs.foreach(s => w.wl(if (s.charAt(0) == '!') s.substring(1) else s)) val include = if (s.charAt(0) == '!') s.substring(1) else s
if (!included.contains(include)) {
included += include
w.wl(include)
}
}
w.wl w.wl
} }
f(w) f(w)
......
...@@ -34,9 +34,7 @@ class ObjcppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -34,9 +34,7 @@ class ObjcppMarshal(spec: Spec) extends Marshal(spec) {
case o: MOpaque => case o: MOpaque =>
List(ImportRef(q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h"))) List(ImportRef(q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h")))
case d: MDef => d.defType match { case d: MDef => d.defType match {
case DEnum => case DEnum | DInterface =>
List(ImportRef(q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h")))
case DInterface =>
List(ImportRef(include(m))) List(ImportRef(include(m)))
case DRecord => case DRecord =>
val r = d.body.asInstanceOf[Record] val r = d.body.asInstanceOf[Record]
...@@ -48,10 +46,7 @@ class ObjcppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -48,10 +46,7 @@ class ObjcppMarshal(spec: Spec) extends Marshal(spec) {
} }
def include(m: Meta) = m match { def include(m: Meta) = m match {
case d: MDef => d.defType match { case d: MDef => q(spec.objcppIncludePrefix + privateHeaderName(d.name))
case DEnum => q(spec.objcBaseLibIncludePrefix + "DJIMarshal+Private.h")
case _ => q(spec.objcppIncludePrefix + privateHeaderName(d.name))
}
case _ => throw new AssertionError("not applicable") case _ => throw new AssertionError("not applicable")
} }
...@@ -79,7 +74,7 @@ class ObjcppMarshal(spec: Spec) extends Marshal(spec) { ...@@ -79,7 +74,7 @@ class ObjcppMarshal(spec: Spec) extends Marshal(spec) {
case MOptional => "Optional" case MOptional => "Optional"
case MBinary => "Binary" case MBinary => "Binary"
case MDate => "Date" case MDate => "Date"
case MString => "String" case MString => if (spec.cppUseWideStrings) "WString" else "String"
case MList => "List" case MList => "List"
case MSet => "Set" case MSet => "Set"
case MMap => "Map" case MMap => "Map"
......
...@@ -30,6 +30,7 @@ package object generatorTools { ...@@ -30,6 +30,7 @@ package object generatorTools {
case class Spec( case class Spec(
javaOutFolder: Option[File], javaOutFolder: Option[File],
javaPackage: Option[String], javaPackage: Option[String],
javaClassAccessModifier: JavaAccessModifier.Value,
javaIdentStyle: JavaIdentStyle, javaIdentStyle: JavaIdentStyle,
javaCppException: Option[String], javaCppException: Option[String],
javaAnnotation: Option[String], javaAnnotation: Option[String],
...@@ -49,6 +50,7 @@ package object generatorTools { ...@@ -49,6 +50,7 @@ package object generatorTools {
cppNnHeader: Option[String], cppNnHeader: Option[String],
cppNnType: Option[String], cppNnType: Option[String],
cppNnCheckExpression: Option[String], cppNnCheckExpression: Option[String],
cppUseWideStrings: Boolean,
jniOutFolder: Option[File], jniOutFolder: Option[File],
jniHeaderOutFolder: Option[File], jniHeaderOutFolder: Option[File],
jniIncludePrefix: String, jniIncludePrefix: String,
...@@ -82,7 +84,7 @@ package object generatorTools { ...@@ -82,7 +84,7 @@ package object generatorTools {
if (s.isEmpty) s else ", " + s if (s.isEmpty) s else ", " + s
} }
def q(s: String) = '"' + s + '"' def q(s: String) = '"' + s + '"'
def firstUpper(token: String) = token.charAt(0).toUpper + token.substring(1) def firstUpper(token: String) = if (token.isEmpty()) token else token.charAt(0).toUpper + token.substring(1)
type IdentConverter = String => String type IdentConverter = String => String
...@@ -137,6 +139,20 @@ package object generatorTools { ...@@ -137,6 +139,20 @@ package object generatorTools {
} }
} }
object JavaAccessModifier extends Enumeration {
val Public = Value("public")
val Package = Value("package")
def getCodeGenerationString(javaAccessModifier: JavaAccessModifier.Value): String = {
javaAccessModifier match {
case Public => "public "
case Package => "/*package*/ "
}
}
}
implicit val javaAccessModifierReads: scopt.Read[JavaAccessModifier.Value] = scopt.Read.reads(JavaAccessModifier withName _)
final case class SkipFirst() { final case class SkipFirst() {
private var first = true private var first = true
...@@ -308,7 +324,9 @@ abstract class Generator(spec: Spec) ...@@ -308,7 +324,9 @@ abstract class Generator(spec: Spec)
w.wl w.wl
val myHeader = q(includePrefix + fileIdentStyle(name) + "." + spec.cppHeaderExt) val myHeader = q(includePrefix + fileIdentStyle(name) + "." + spec.cppHeaderExt)
w.wl(s"#include $myHeader // my header") w.wl(s"#include $myHeader // my header")
includes.foreach(w.wl(_)) val myHeaderInclude = s"#include $myHeader"
for (include <- includes if include != myHeaderInclude)
w.wl(include)
w.wl w.wl
wrapNamespace(w, namespace, f) wrapNamespace(w, namespace, f)
}) })
......
...@@ -285,31 +285,37 @@ def parseExternFile(externFile: File, inFileListWriter: Option[Writer]) : Seq[Ty ...@@ -285,31 +285,37 @@ def parseExternFile(externFile: File, inFileListWriter: Option[Writer]) : Seq[Ty
} }
} }
def normalizePath(path: File) : File = {
return new File(java.nio.file.Paths.get(path.toString()).normalize().toString())
}
def parseFile(idlFile: File, inFileListWriter: Option[Writer]): Seq[TypeDecl] = { def parseFile(idlFile: File, inFileListWriter: Option[Writer]): Seq[TypeDecl] = {
val normalizedIdlFile = normalizePath(idlFile)
if (inFileListWriter.isDefined) { if (inFileListWriter.isDefined) {
inFileListWriter.get.write(idlFile + "\n") inFileListWriter.get.write(normalizedIdlFile + "\n")
} }
visitedFiles.add(idlFile) visitedFiles.add(normalizedIdlFile)
fileStack.push(idlFile) fileStack.push(normalizedIdlFile)
val fin = new FileInputStream(idlFile) val fin = new FileInputStream(normalizedIdlFile)
try { try {
parse(idlFile.getName, new InputStreamReader(fin, "UTF-8")) match { parse(normalizedIdlFile.getName, new InputStreamReader(fin, "UTF-8")) match {
case Left(err) => case Left(err) =>
System.err.println(err) System.err.println(err)
System.exit(1); return null; System.exit(1); return null;
case Right(idl) => { case Right(idl) => {
var types = idl.typeDecls var types = idl.typeDecls
idl.imports.foreach(x => { idl.imports.foreach(x => {
if (fileStack.contains(x.file)) { val normalized = normalizePath(x.file)
if (fileStack.contains(normalized)) {
throw new AssertionError("Circular import detected!") throw new AssertionError("Circular import detected!")
} }
if (!visitedFiles.contains(x.file)) { if (!visitedFiles.contains(normalized)) {
x match { x match {
case IdlFileRef(file) => case IdlFileRef(file) =>
types = parseFile(file, inFileListWriter) ++ types types = parseFile(normalized, inFileListWriter) ++ types
case ExternFileRef(file) => case ExternFileRef(file) =>
types = parseExternFile(file, inFileListWriter) ++ types types = parseExternFile(normalized, inFileListWriter) ++ types
} }
} }
}) })
......
...@@ -174,7 +174,26 @@ namespace djinni ...@@ -174,7 +174,26 @@ namespace djinni
static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c) static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c)
{ {
return {jniEnv, jniStringFromUTF8(jniEnv, c.c_str())}; return {jniEnv, jniStringFromUTF8(jniEnv, c)};
}
};
struct WString
{
using CppType = std::wstring;
using JniType = jstring;
using Boxed = WString;
static CppType toCpp(JNIEnv* jniEnv, JniType j)
{
assert(j != nullptr);
return jniWStringFromString(jniEnv, j);
}
static LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c)
{
return {jniEnv, jniStringFromWString(jniEnv, c)};
} }
}; };
......
...@@ -371,6 +371,46 @@ jstring jniStringFromUTF8(JNIEnv * env, const std::string & str) { ...@@ -371,6 +371,46 @@ jstring jniStringFromUTF8(JNIEnv * env, const std::string & str) {
return res; return res;
} }
template<int wcharTypeSize>
static std::u16string implWStringToUTF16(std::wstring::const_iterator, std::wstring::const_iterator)
{
static_assert(wcharTypeSize == 2 || wcharTypeSize == 4, "wchar_t must be represented by UTF-16 or UTF-32 encoding");
return {}; // unreachable
}
template<>
inline std::u16string implWStringToUTF16<2>(std::wstring::const_iterator begin, std::wstring::const_iterator end) {
// case when wchar_t is represented by utf-16 encoding
return std::u16string(begin, end);
}
template<>
inline std::u16string implWStringToUTF16<4>(std::wstring::const_iterator begin, std::wstring::const_iterator end) {
// case when wchar_t is represented by utf-32 encoding
std::u16string utf16;
utf16.reserve(std::distance(begin, end));
for(; begin != end; ++begin)
utf16_encode(static_cast<char32_t>(*begin), utf16);
return utf16;
}
inline std::u16string wstringToUTF16(const std::wstring & str) {
// hide "defined but not used" warnings
(void)implWStringToUTF16<2>;
(void)implWStringToUTF16<4>;
// Note: The template helper operates on iterators to work around a compiler issue we saw on Mac.
// It triggered undefined symbols if wstring methods were called directly in the template function.
return implWStringToUTF16<sizeof(wchar_t)>(str.cbegin(), str.cend());
}
jstring jniStringFromWString(JNIEnv * env, const std::wstring & str) {
std::u16string utf16 = wstringToUTF16(str);
jstring res = env->NewString(
reinterpret_cast<const jchar *>(utf16.data()), utf16.length());
DJINNI_ASSERT(res, env);
return res;
}
// UTF-16 decode helpers. // UTF-16 decode helpers.
static inline bool is_high_surrogate(char16_t c) { return (c >= 0xD800) && (c < 0xDC00); } static inline bool is_high_surrogate(char16_t c) { return (c >= 0xD800) && (c < 0xDC00); }
static inline bool is_low_surrogate(char16_t c) { return (c >= 0xDC00) && (c < 0xE000); } static inline bool is_low_surrogate(char16_t c) { return (c >= 0xDC00) && (c < 0xE000); }
...@@ -378,7 +418,7 @@ static inline bool is_low_surrogate(char16_t c) { return (c >= 0xDC00) && (c < ...@@ -378,7 +418,7 @@ static inline bool is_low_surrogate(char16_t c) { return (c >= 0xDC00) && (c <
/* /*
* Like utf8_decode_check, but for UTF-16. * Like utf8_decode_check, but for UTF-16.
*/ */
static offset_pt utf16_decode_check(const std::u16string & str, std::u16string::size_type i) { static offset_pt utf16_decode_check(const char16_t * str, std::u16string::size_type i) {
if (is_high_surrogate(str[i]) && is_low_surrogate(str[i+1])) { if (is_high_surrogate(str[i]) && is_low_surrogate(str[i+1])) {
// High surrogate followed by low surrogate // High surrogate followed by low surrogate
char32_t pt = (((str[i] - 0xD800) << 10) | (str[i+1] - 0xDC00)) + 0x10000; char32_t pt = (((str[i] - 0xD800) << 10) | (str[i+1] - 0xDC00)) + 0x10000;
...@@ -391,7 +431,7 @@ static offset_pt utf16_decode_check(const std::u16string & str, std::u16string:: ...@@ -391,7 +431,7 @@ static offset_pt utf16_decode_check(const std::u16string & str, std::u16string::
} }
} }
static char32_t utf16_decode(const std::u16string & str, std::u16string::size_type & i) { static char32_t utf16_decode(const char16_t * str, std::u16string::size_type & i) {
offset_pt res = utf16_decode_check(str, i); offset_pt res = utf16_decode_check(str, i);
if (res.offset < 0) { if (res.offset < 0) {
i += 1; i += 1;
...@@ -437,10 +477,52 @@ std::string jniUTF8FromString(JNIEnv * env, const jstring jstr) { ...@@ -437,10 +477,52 @@ std::string jniUTF8FromString(JNIEnv * env, const jstring jstr) {
std::string out; std::string out;
out.reserve(str.length() * 3 / 2); // estimate out.reserve(str.length() * 3 / 2); // estimate
for (std::u16string::size_type i = 0; i < str.length(); ) for (std::u16string::size_type i = 0; i < str.length(); )
utf8_encode(utf16_decode(str, i), out); utf8_encode(utf16_decode(str.data(), i), out);
return out; return out;
} }
template<int wcharTypeSize>
static std::wstring implUTF16ToWString(const char16_t * data, size_t length)
{
static_assert(wcharTypeSize == 2 || wcharTypeSize == 4, "wchar_t must be represented by UTF-16 or UTF-32 encoding");
return {}; // unreachable
}
template<>
inline std::wstring implUTF16ToWString<2>(const char16_t * data, size_t length) {
// case when wchar_t is represented by utf-16 encoding
return std::wstring(data, data + length);
}
template<>
inline std::wstring implUTF16ToWString<4>(const char16_t * data, size_t length) {
// case when wchar_t is represented by utf-32 encoding
std::wstring result;
result.reserve(length);
for (size_t i = 0; i < length; )
result += static_cast<wchar_t>(utf16_decode(data, i));
return result;
}
inline std::wstring UTF16ToWString(const char16_t * data, size_t length) {
// hide "defined but not used" warnings
(void)implUTF16ToWString<2>;
(void)implUTF16ToWString<4>;
return implUTF16ToWString<sizeof(wchar_t)>(data, length);
}
std::wstring jniWStringFromString(JNIEnv * env, const jstring jstr) {
DJINNI_ASSERT(jstr, env);
const jsize length = env->GetStringLength(jstr);
jniExceptionCheck(env);
const auto deleter = [env, jstr] (const jchar * c) { env->ReleaseStringChars(jstr, c); };
std::unique_ptr<const jchar, decltype(deleter)> ptr(env->GetStringChars(jstr, nullptr),
deleter);
const char16_t * data = reinterpret_cast<const char16_t *>(ptr.get());
return UTF16ToWString(data, length);
}
DJINNI_WEAK_DEFINITION DJINNI_WEAK_DEFINITION
void jniSetPendingFromCurrent(JNIEnv * env, const char * ctx) noexcept { void jniSetPendingFromCurrent(JNIEnv * env, const char * ctx) noexcept {
jniDefaultSetPendingFromCurrent(env, ctx); jniDefaultSetPendingFromCurrent(env, ctx);
......
...@@ -543,6 +543,9 @@ private: ...@@ -543,6 +543,9 @@ private:
jstring jniStringFromUTF8(JNIEnv * env, const std::string & str); jstring jniStringFromUTF8(JNIEnv * env, const std::string & str);
std::string jniUTF8FromString(JNIEnv * env, const jstring jstr); std::string jniUTF8FromString(JNIEnv * env, const jstring jstr);
jstring jniStringFromWString(JNIEnv * env, const std::wstring & str);
std::wstring jniWStringFromString(JNIEnv * env, const jstring jstr);
class JniEnum { class JniEnum {
public: public:
/* /*
......
...@@ -18,11 +18,17 @@ ...@@ -18,11 +18,17 @@
namespace djinni { namespace djinni {
// Throws an exception for an unimplemented method call.
[[noreturn]] void throwUnimplemented(const char * ctx, NSString * msg);
// Helper function for exception translation. Do not call directly! // Helper function for exception translation. Do not call directly!
[[noreturn]] void throwNSExceptionFromCurrent(const char * ctx); [[noreturn]] void throwNSExceptionFromCurrent(const char * ctx);
} // namespace djinni } // namespace djinni
#define DJINNI_UNIMPLEMENTED(msg) \
::djinni::throwUnimplemented(__PRETTY_FUNCTION__, msg);
#define DJINNI_TRANSLATE_EXCEPTIONS() \ #define DJINNI_TRANSLATE_EXCEPTIONS() \
catch (const std::exception & e) { \ catch (const std::exception & e) { \
::djinni::throwNSExceptionFromCurrent(__PRETTY_FUNCTION__); \ ::djinni::throwNSExceptionFromCurrent(__PRETTY_FUNCTION__); \
......
...@@ -21,6 +21,11 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -21,6 +21,11 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
namespace djinni { namespace djinni {
[[noreturn]] __attribute__((weak)) void throwUnimplemented(const char * /*ctx*/, NSString * message) {
[NSException raise:NSInternalInconsistencyException format:@"Unimplemented: %@", message];
__builtin_unreachable();
}
[[noreturn]] __attribute__((weak)) void throwNSExceptionFromCurrent(const char * /*ctx*/) { [[noreturn]] __attribute__((weak)) void throwNSExceptionFromCurrent(const char * /*ctx*/) {
try { try {
throw; throw;
......
...@@ -118,6 +118,54 @@ struct String { ...@@ -118,6 +118,54 @@ struct String {
} }
}; };
template<int wcharTypeSize>
static CFStringEncoding getWCharEncoding()
{
static_assert(wcharTypeSize == 2 || wcharTypeSize == 4, "wchar_t must be represented by UTF-16 or UTF-32 encoding");
return {}; // unreachable
}
template<>
inline CFStringEncoding getWCharEncoding<2>() {
// case when wchar_t is represented by utf-16 encoding
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
return NSUTF16BigEndianStringEncoding;
#else
return NSUTF16LittleEndianStringEncoding;
#endif
}
template<>
inline CFStringEncoding getWCharEncoding<4>() {
// case when wchar_t is represented by utf-32 encoding
#if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
return NSUTF32BigEndianStringEncoding;
#else
return NSUTF32LittleEndianStringEncoding;
#endif
}
struct WString {
using CppType = std::wstring;
using ObjcType = NSString*;
using Boxed = WString;
static CppType toCpp(ObjcType string) {
assert(string);
NSStringEncoding encoding = CFStringConvertEncodingToNSStringEncoding(getWCharEncoding<sizeof(wchar_t)>());
NSData* data = [string dataUsingEncoding:encoding];
return std::wstring((wchar_t*)[data bytes], [data length] / sizeof (wchar_t));
}
static ObjcType fromCpp(const CppType& string) {
assert(string.size() <= std::numeric_limits<NSUInteger>::max());
return [[NSString alloc] initWithBytes:string.data()
length:string.size() * sizeof(wchar_t)
encoding:getWCharEncoding<sizeof(wchar_t)>()];
}
};
struct Date { struct Date {
using CppType = std::chrono::system_clock::time_point; using CppType = std::chrono::system_clock::time_point;
using ObjcType = NSDate*; using ObjcType = NSDate*;
......
...@@ -6,7 +6,7 @@ djinni: ...@@ -6,7 +6,7 @@ djinni:
./run_djinni.sh ./run_djinni.sh
objc: djinni objc: djinni
cd objc; xcodebuild -sdk iphonesimulator -project DjinniObjcTest.xcodeproj -scheme DjinniObjcTest test -destination 'platform=iOS Simulator,name=iPhone 6s,OS=9.3' cd objc; xcodebuild -sdk iphonesimulator -project DjinniObjcTest.xcodeproj -scheme DjinniObjcTest test -destination 'platform=iOS Simulator,name=iPhone 6s,OS=10.1'
java: djinni java: djinni
cd java && ant compile test cd java && ant compile test
......
...@@ -13,3 +13,5 @@ ...@@ -13,3 +13,5 @@
@import "multiple_inheritance.djinni" @import "multiple_inheritance.djinni"
@import "single_language_interfaces.djinni" @import "single_language_interfaces.djinni"
@import "extended_record.djinni" @import "extended_record.djinni"
@import "varnames.djinni"
@import "relative_paths.djinni"
...@@ -11,6 +11,18 @@ color = enum { ...@@ -11,6 +11,18 @@ color = enum {
violet; violet;
} }
opt_color_record = record { enum_usage_record = record {
my_color: optional<color>; e: color;
o: optional<color>;
l: list<color>;
s: set<color>;
m: map<color, color>;
}
enum_usage_interface = interface +c +j +o {
e(e: color): color;
o(o: optional<color>): optional<color>;
l(l: list<color>): list<color>;
s(s: set<color>): set<color>;
m(m: map<color, color>): map<color, color>;
} }
# Extended record # Extended record
extended_record = record +c { extended_record = record +c {
foo: bool; foo: bool;
const extended_record_const: extended_record = {foo=true}; const extended_record_const: extended_record = { foo = true };
}
record_using_extended_record = record {
er: extended_record;
const cr: record_using_extended_record = {er = { foo = false } };
}
interface_using_extended_record = interface +c {
meth(er: extended_record): extended_record;
const cr: record_using_extended_record = {er = { foo = false } };
} }
@import "./vendor/third-party/date.djinni"
@import "../djinni/vendor/third-party/date.djinni"
@extern "./vendor/third-party/date.yaml"
...@@ -5,5 +5,7 @@ java_only_listener = interface +j {} ...@@ -5,5 +5,7 @@ java_only_listener = interface +j {}
# on references to interfaces they don't need. # on references to interfaces they don't need.
uses_single_language_listeners = interface +o +j +c { uses_single_language_listeners = interface +o +j +c {
callForObjC(l: objc_only_listener); callForObjC(l: objc_only_listener);
returnForObjC(): objc_only_listener;
callForJava(l: java_only_listener); callForJava(l: java_only_listener);
returnForJava(): java_only_listener;
} }
# Underscore is used as a separator in Djinni names, so we don't really
# anticipate it to be used as a prefix/suffix. Some name styles behave
# badly when it is. However this test case ensures we at least don't crash.
_varname_record_ = record {
_field_: i8;
}
_varname_interface_ = interface +c {
_rmethod_(_r_arg_: _varname_record_): _varname_record_;
_imethod_(_i_arg_: _varname_interface_): _varname_interface_;
}
wchar_test_rec = record {
s: string;
}
wchar_test_helpers = interface +c {
static get_record() : wchar_test_rec;
static get_string() : string;
static check_string(str: string) : bool;
static check_record(rec: wchar_test_rec) : bool;
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#pragma once
#include <memory>
namespace testsuite {
struct VarnameRecord;
class VarnameInterface {
public:
virtual ~VarnameInterface() {}
virtual VarnameRecord _rmethod_(const VarnameRecord & _r_arg_) = 0;
virtual std::shared_ptr<VarnameInterface> _imethod_(const std::shared_ptr<VarnameInterface> & _i_arg_) = 0;
};
} // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#pragma once
#include <cstdint>
#include <utility>
namespace testsuite {
/**
* Underscore is used as a separator in Djinni names, so we don't really
* anticipate it to be used as a prefix/suffix. Some name styles behave
* badly when it is. However this test case ensures we at least don't crash.
*/
struct VarnameRecord final {
int8_t _field_;
VarnameRecord(int8_t _field__)
: _field_(std::move(_field__))
{}
};
} // namespace testsuite
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include <cstdint> #include <cstdint>
#include <experimental/optional>
#include <utility> #include <utility>
namespace testsuite { namespace testsuite {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include <cstdint> #include <cstdint>
#include <experimental/optional>
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector> #include <vector>
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include <cstdint> #include <cstdint>
#include <experimental/optional>
#include <string> #include <string>
#include <utility> #include <utility>
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include "constant_record.hpp" #include "constant_record.hpp"
#include <cstdint> #include <cstdint>
#include <experimental/optional>
#include <string> #include <string>
#include <utility> #include <utility>
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include <cstdint> #include <cstdint>
#include <experimental/optional>
#include <string> #include <string>
namespace testsuite { namespace testsuite {
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include <unordered_map>
#include <unordered_set>
#include <vector>
namespace testsuite {
enum class color;
class EnumUsageInterface {
public:
virtual ~EnumUsageInterface() {}
virtual color e(color e) = 0;
virtual std::experimental::optional<color> o(std::experimental::optional<color> o) = 0;
virtual std::vector<color> l(const std::vector<color> & l) = 0;
virtual std::unordered_set<color> s(const std::unordered_set<color> & s) = 0;
virtual std::unordered_map<color, color> m(const std::unordered_map<color, color> & m) = 0;
};
} // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include "color.hpp"
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
namespace testsuite {
struct EnumUsageRecord final {
color e;
std::experimental::optional<color> o;
std::vector<color> l;
std::unordered_set<color> s;
std::unordered_map<color, color> m;
EnumUsageRecord(color e_,
std::experimental::optional<color> o_,
std::vector<color> l_,
std::unordered_set<color> s_,
std::unordered_map<color, color> m_)
: e(std::move(e_))
, o(std::move(o_))
, l(std::move(l_))
, s(std::move(s_))
, m(std::move(m_))
{}
};
} // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#include "interface_using_extended_record.hpp" // my header
#include "../../handwritten-src/cpp/extended_record.hpp"
#include "record_using_extended_record.hpp"
namespace testsuite {
RecordUsingExtendedRecord const InterfaceUsingExtendedRecord::CR = RecordUsingExtendedRecord(
ExtendedRecord(
false /* foo */ ) /* er */ );
} // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#pragma once
namespace testsuite {
struct ExtendedRecord;
struct RecordUsingExtendedRecord;
class InterfaceUsingExtendedRecord {
public:
virtual ~InterfaceUsingExtendedRecord() {}
static RecordUsingExtendedRecord const CR;
virtual ExtendedRecord meth(const ExtendedRecord & er) = 0;
};
} // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#include "record_using_extended_record.hpp" // my header
namespace testsuite {
RecordUsingExtendedRecord const RecordUsingExtendedRecord::CR = RecordUsingExtendedRecord(
ExtendedRecord(
false /* foo */ ) /* er */ );
} // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#pragma once
#include "../../handwritten-src/cpp/extended_record.hpp"
#include <utility>
namespace testsuite {
struct RecordUsingExtendedRecord final {
static RecordUsingExtendedRecord const CR;
ExtendedRecord er;
RecordUsingExtendedRecord(ExtendedRecord er_)
: er(std::move(er_))
{}
};
} // namespace testsuite
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#pragma once #pragma once
#include <experimental/optional> #include "../../handwritten-src/cpp/optional.hpp"
#include <memory> #include <memory>
#include <string> #include <string>
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include <chrono> #include <chrono>
#include <cstdint> #include <cstdint>
#include <experimental/optional>
#include <string> #include <string>
namespace testsuite { namespace testsuite {
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/optional.hpp"
#include <cstdint> #include <cstdint>
#include <experimental/optional>
#include <memory> #include <memory>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>
......
...@@ -20,7 +20,11 @@ public: ...@@ -20,7 +20,11 @@ public:
virtual void callForObjC(const std::shared_ptr<ObjcOnlyListener> & l) = 0; virtual void callForObjC(const std::shared_ptr<ObjcOnlyListener> & l) = 0;
virtual std::shared_ptr<ObjcOnlyListener> returnForObjC() = 0;
virtual void callForJava(const std::shared_ptr<JavaOnlyListener> & l) = 0; virtual void callForJava(const std::shared_ptr<JavaOnlyListener> & l) = 0;
virtual std::shared_ptr<JavaOnlyListener> returnForJava() = 0;
}; };
} // namespace testsuite } // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#pragma once
#include <string>
namespace testsuite {
struct WcharTestRec;
class WcharTestHelpers {
public:
virtual ~WcharTestHelpers() {}
static WcharTestRec get_record();
static std::wstring get_string();
static bool check_string(const std::wstring & str);
static bool check_record(const WcharTestRec & rec);
};
} // namespace testsuite
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni // This file generated by Djinni from wchar_test.djinni
#pragma once #pragma once
#include "color.hpp" #include <string>
#include <experimental/optional>
#include <utility> #include <utility>
namespace testsuite { namespace testsuite {
struct OptColorRecord final { struct WcharTestRec final {
std::experimental::optional<color> my_color; std::wstring s;
OptColorRecord(std::experimental::optional<color> my_color_) WcharTestRec(std::wstring s_)
: my_color(std::move(my_color_)) : s(std::move(s_))
{} {}
}; };
......
...@@ -15,6 +15,8 @@ djinni/constants.djinni ...@@ -15,6 +15,8 @@ djinni/constants.djinni
djinni/multiple_inheritance.djinni djinni/multiple_inheritance.djinni
djinni/single_language_interfaces.djinni djinni/single_language_interfaces.djinni
djinni/extended_record.djinni djinni/extended_record.djinni
djinni/varnames.djinni
djinni/relative_paths.djinni
djinni/vendor/third-party/date.djinni djinni/vendor/third-party/date.djinni
djinni/vendor/third-party/date.yaml djinni/vendor/third-party/date.yaml
djinni/vendor/third-party/duration.djinni djinni/vendor/third-party/duration.djinni
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
package com.dropbox.djinni.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class EnumUsageInterface {
@Nonnull
public abstract Color e(@Nonnull Color e);
@CheckForNull
public abstract Color o(@CheckForNull Color o);
@Nonnull
public abstract ArrayList<Color> l(@Nonnull ArrayList<Color> l);
@Nonnull
public abstract HashSet<Color> s(@Nonnull HashSet<Color> s);
@Nonnull
public abstract HashMap<Color, Color> m(@Nonnull HashMap<Color, Color> m);
private static final class CppProxy extends EnumUsageInterface
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
private CppProxy(long nativeRef)
{
if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
this.nativeRef = nativeRef;
}
private native void nativeDestroy(long nativeRef);
public void destroy()
{
boolean destroyed = this.destroyed.getAndSet(true);
if (!destroyed) nativeDestroy(this.nativeRef);
}
protected void finalize() throws java.lang.Throwable
{
destroy();
super.finalize();
}
@Override
public Color e(Color e)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_e(this.nativeRef, e);
}
private native Color native_e(long _nativeRef, Color e);
@Override
public Color o(Color o)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_o(this.nativeRef, o);
}
private native Color native_o(long _nativeRef, Color o);
@Override
public ArrayList<Color> l(ArrayList<Color> l)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_l(this.nativeRef, l);
}
private native ArrayList<Color> native_l(long _nativeRef, ArrayList<Color> l);
@Override
public HashSet<Color> s(HashSet<Color> s)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_s(this.nativeRef, s);
}
private native HashSet<Color> native_s(long _nativeRef, HashSet<Color> s);
@Override
public HashMap<Color, Color> m(HashMap<Color, Color> m)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_m(this.nativeRef, m);
}
private native HashMap<Color, Color> native_m(long _nativeRef, HashMap<Color, Color> m);
}
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
package com.dropbox.djinni.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public class EnumUsageRecord {
/*package*/ final Color mE;
/*package*/ final Color mO;
/*package*/ final ArrayList<Color> mL;
/*package*/ final HashSet<Color> mS;
/*package*/ final HashMap<Color, Color> mM;
public EnumUsageRecord(
@Nonnull Color e,
@CheckForNull Color o,
@Nonnull ArrayList<Color> l,
@Nonnull HashSet<Color> s,
@Nonnull HashMap<Color, Color> m) {
this.mE = e;
this.mO = o;
this.mL = l;
this.mS = s;
this.mM = m;
}
@Nonnull
public Color getE() {
return mE;
}
@CheckForNull
public Color getO() {
return mO;
}
@Nonnull
public ArrayList<Color> getL() {
return mL;
}
@Nonnull
public HashSet<Color> getS() {
return mS;
}
@Nonnull
public HashMap<Color, Color> getM() {
return mM;
}
@Override
public String toString() {
return "EnumUsageRecord{" +
"mE=" + mE +
"," + "mO=" + mO +
"," + "mL=" + mL +
"," + "mS=" + mS +
"," + "mM=" + mM +
"}";
}
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
package com.dropbox.djinni.test;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class InterfaceUsingExtendedRecord {
@Nonnull
public static final RecordUsingExtendedRecord CR = new RecordUsingExtendedRecord(
new ExtendedRecord(
false /* mFoo */ ) /* mEr */ );
@Nonnull
public abstract ExtendedRecord meth(@Nonnull ExtendedRecord er);
private static final class CppProxy extends InterfaceUsingExtendedRecord
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
private CppProxy(long nativeRef)
{
if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
this.nativeRef = nativeRef;
}
private native void nativeDestroy(long nativeRef);
public void destroy()
{
boolean destroyed = this.destroyed.getAndSet(true);
if (!destroyed) nativeDestroy(this.nativeRef);
}
protected void finalize() throws java.lang.Throwable
{
destroy();
super.finalize();
}
@Override
public ExtendedRecord meth(ExtendedRecord er)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_meth(this.nativeRef, er);
}
private native ExtendedRecord native_meth(long _nativeRef, ExtendedRecord er);
}
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public class RecordUsingExtendedRecord {
@Nonnull
public static final RecordUsingExtendedRecord CR = new RecordUsingExtendedRecord(
new ExtendedRecord(
false /* mFoo */ ) /* mEr */ );
/*package*/ final ExtendedRecord mEr;
public RecordUsingExtendedRecord(
@Nonnull ExtendedRecord er) {
this.mEr = er;
}
@Nonnull
public ExtendedRecord getEr() {
return mEr;
}
@Override
public String toString() {
return "RecordUsingExtendedRecord{" +
"mEr=" + mEr +
"}";
}
}
...@@ -14,8 +14,14 @@ import javax.annotation.Nonnull; ...@@ -14,8 +14,14 @@ import javax.annotation.Nonnull;
public abstract class UsesSingleLanguageListeners { public abstract class UsesSingleLanguageListeners {
public abstract void callForObjC(@CheckForNull ObjcOnlyListener l); public abstract void callForObjC(@CheckForNull ObjcOnlyListener l);
@CheckForNull
public abstract ObjcOnlyListener returnForObjC();
public abstract void callForJava(@CheckForNull JavaOnlyListener l); public abstract void callForJava(@CheckForNull JavaOnlyListener l);
@CheckForNull
public abstract JavaOnlyListener returnForJava();
private static final class CppProxy extends UsesSingleLanguageListeners private static final class CppProxy extends UsesSingleLanguageListeners
{ {
private final long nativeRef; private final long nativeRef;
...@@ -47,6 +53,14 @@ public abstract class UsesSingleLanguageListeners { ...@@ -47,6 +53,14 @@ public abstract class UsesSingleLanguageListeners {
} }
private native void native_callForObjC(long _nativeRef, ObjcOnlyListener l); private native void native_callForObjC(long _nativeRef, ObjcOnlyListener l);
@Override
public ObjcOnlyListener returnForObjC()
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_returnForObjC(this.nativeRef);
}
private native ObjcOnlyListener native_returnForObjC(long _nativeRef);
@Override @Override
public void callForJava(JavaOnlyListener l) public void callForJava(JavaOnlyListener l)
{ {
...@@ -54,5 +68,13 @@ public abstract class UsesSingleLanguageListeners { ...@@ -54,5 +68,13 @@ public abstract class UsesSingleLanguageListeners {
native_callForJava(this.nativeRef, l); native_callForJava(this.nativeRef, l);
} }
private native void native_callForJava(long _nativeRef, JavaOnlyListener l); private native void native_callForJava(long _nativeRef, JavaOnlyListener l);
@Override
public JavaOnlyListener returnForJava()
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_returnForJava(this.nativeRef);
}
private native JavaOnlyListener native_returnForJava(long _nativeRef);
} }
} }
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
package com.dropbox.djinni.test;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class VarnameInterface {
@Nonnull
public abstract VarnameRecord Rmethod(@Nonnull VarnameRecord RArg);
@CheckForNull
public abstract VarnameInterface Imethod(@CheckForNull VarnameInterface IArg);
private static final class CppProxy extends VarnameInterface
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
private CppProxy(long nativeRef)
{
if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
this.nativeRef = nativeRef;
}
private native void nativeDestroy(long nativeRef);
public void destroy()
{
boolean destroyed = this.destroyed.getAndSet(true);
if (!destroyed) nativeDestroy(this.nativeRef);
}
protected void finalize() throws java.lang.Throwable
{
destroy();
super.finalize();
}
@Override
public VarnameRecord Rmethod(VarnameRecord RArg)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_Rmethod(this.nativeRef, RArg);
}
private native VarnameRecord native_Rmethod(long _nativeRef, VarnameRecord RArg);
@Override
public VarnameInterface Imethod(VarnameInterface IArg)
{
assert !this.destroyed.get() : "trying to use a destroyed object";
return native_Imethod(this.nativeRef, IArg);
}
private native VarnameInterface native_Imethod(long _nativeRef, VarnameInterface IArg);
}
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
/**
* Underscore is used as a separator in Djinni names, so we don't really
* anticipate it to be used as a prefix/suffix. Some name styles behave
* badly when it is. However this test case ensures we at least don't crash.
*/
public class VarnameRecord {
/*package*/ final byte mField;
public VarnameRecord(
byte Field) {
this.mField = Field;
}
public byte getField() {
return mField;
}
@Override
public String toString() {
return "VarnameRecord{" +
"mField=" + mField +
"}";
}
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
package com.dropbox.djinni.test;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public abstract class WcharTestHelpers {
@Nonnull
public static native WcharTestRec getRecord();
@Nonnull
public static native String getString();
public static native boolean checkString(@Nonnull String str);
public static native boolean checkRecord(@Nonnull WcharTestRec rec);
private static final class CppProxy extends WcharTestHelpers
{
private final long nativeRef;
private final AtomicBoolean destroyed = new AtomicBoolean(false);
private CppProxy(long nativeRef)
{
if (nativeRef == 0) throw new RuntimeException("nativeRef is zero");
this.nativeRef = nativeRef;
}
private native void nativeDestroy(long nativeRef);
public void destroy()
{
boolean destroyed = this.destroyed.getAndSet(true);
if (!destroyed) nativeDestroy(this.nativeRef);
}
protected void finalize() throws java.lang.Throwable
{
destroy();
super.finalize();
}
}
}
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni // This file generated by Djinni from wchar_test.djinni
package com.dropbox.djinni.test; package com.dropbox.djinni.test;
import javax.annotation.CheckForNull; import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
public class OptColorRecord { public class WcharTestRec {
/*package*/ final Color mMyColor; /*package*/ final String mS;
public OptColorRecord( public WcharTestRec(
@CheckForNull Color myColor) { @Nonnull String s) {
this.mMyColor = myColor; this.mS = s;
} }
@CheckForNull @Nonnull
public Color getMyColor() { public String getS() {
return mMyColor; return mS;
} }
@Override @Override
public String toString() { public String toString() {
return "OptColorRecord{" + return "WcharTestRec{" +
"mMyColor=" + mMyColor + "mS=" + mS +
"}"; "}";
} }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeClientInterface.hpp" // my header #include "NativeClientInterface.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeClientInterface.hpp"
#include "NativeClientReturnedRecord.hpp" #include "NativeClientReturnedRecord.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeCppException.hpp" // my header #include "NativeCppException.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeCppException.hpp"
namespace djinni_generated { namespace djinni_generated {
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#include "NativeEnumUsageInterface.hpp" // my header
#include "Marshal.hpp"
#include "NativeColor.hpp"
namespace djinni_generated {
NativeEnumUsageInterface::NativeEnumUsageInterface() : ::djinni::JniInterface<::testsuite::EnumUsageInterface, NativeEnumUsageInterface>("com/dropbox/djinni/test/EnumUsageInterface$CppProxy") {}
NativeEnumUsageInterface::~NativeEnumUsageInterface() = default;
NativeEnumUsageInterface::JavaProxy::JavaProxy(JniType j) : Handle(::djinni::jniGetThreadEnv(), j) { }
NativeEnumUsageInterface::JavaProxy::~JavaProxy() = default;
::testsuite::color NativeEnumUsageInterface::JavaProxy::e(::testsuite::color c_e) {
auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeEnumUsageInterface>::get();
auto jret = jniEnv->CallObjectMethod(Handle::get().get(), data.method_e,
::djinni::get(::djinni_generated::NativeColor::fromCpp(jniEnv, c_e)));
::djinni::jniExceptionCheck(jniEnv);
return ::djinni_generated::NativeColor::toCpp(jniEnv, jret);
}
std::experimental::optional<::testsuite::color> NativeEnumUsageInterface::JavaProxy::o(std::experimental::optional<::testsuite::color> c_o) {
auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeEnumUsageInterface>::get();
auto jret = jniEnv->CallObjectMethod(Handle::get().get(), data.method_o,
::djinni::get(::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::fromCpp(jniEnv, c_o)));
::djinni::jniExceptionCheck(jniEnv);
return ::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::toCpp(jniEnv, jret);
}
std::vector<::testsuite::color> NativeEnumUsageInterface::JavaProxy::l(const std::vector<::testsuite::color> & c_l) {
auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeEnumUsageInterface>::get();
auto jret = jniEnv->CallObjectMethod(Handle::get().get(), data.method_l,
::djinni::get(::djinni::List<::djinni_generated::NativeColor>::fromCpp(jniEnv, c_l)));
::djinni::jniExceptionCheck(jniEnv);
return ::djinni::List<::djinni_generated::NativeColor>::toCpp(jniEnv, jret);
}
std::unordered_set<::testsuite::color> NativeEnumUsageInterface::JavaProxy::s(const std::unordered_set<::testsuite::color> & c_s) {
auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeEnumUsageInterface>::get();
auto jret = jniEnv->CallObjectMethod(Handle::get().get(), data.method_s,
::djinni::get(::djinni::Set<::djinni_generated::NativeColor>::fromCpp(jniEnv, c_s)));
::djinni::jniExceptionCheck(jniEnv);
return ::djinni::Set<::djinni_generated::NativeColor>::toCpp(jniEnv, jret);
}
std::unordered_map<::testsuite::color, ::testsuite::color> NativeEnumUsageInterface::JavaProxy::m(const std::unordered_map<::testsuite::color, ::testsuite::color> & c_m) {
auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeEnumUsageInterface>::get();
auto jret = jniEnv->CallObjectMethod(Handle::get().get(), data.method_m,
::djinni::get(::djinni::Map<::djinni_generated::NativeColor, ::djinni_generated::NativeColor>::fromCpp(jniEnv, c_m)));
::djinni::jniExceptionCheck(jniEnv);
return ::djinni::Map<::djinni_generated::NativeColor, ::djinni_generated::NativeColor>::toCpp(jniEnv, jret);
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_EnumUsageInterface_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
delete reinterpret_cast<::djinni::CppProxyHandle<::testsuite::EnumUsageInterface>*>(nativeRef);
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_EnumUsageInterface_00024CppProxy_native_1e(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_e)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::EnumUsageInterface>(nativeRef);
auto r = ref->e(::djinni_generated::NativeColor::toCpp(jniEnv, j_e));
return ::djinni::release(::djinni_generated::NativeColor::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_EnumUsageInterface_00024CppProxy_native_1o(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_o)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::EnumUsageInterface>(nativeRef);
auto r = ref->o(::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::toCpp(jniEnv, j_o));
return ::djinni::release(::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_EnumUsageInterface_00024CppProxy_native_1l(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_l)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::EnumUsageInterface>(nativeRef);
auto r = ref->l(::djinni::List<::djinni_generated::NativeColor>::toCpp(jniEnv, j_l));
return ::djinni::release(::djinni::List<::djinni_generated::NativeColor>::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_EnumUsageInterface_00024CppProxy_native_1s(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_s)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::EnumUsageInterface>(nativeRef);
auto r = ref->s(::djinni::Set<::djinni_generated::NativeColor>::toCpp(jniEnv, j_s));
return ::djinni::release(::djinni::Set<::djinni_generated::NativeColor>::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_EnumUsageInterface_00024CppProxy_native_1m(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_m)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::EnumUsageInterface>(nativeRef);
auto r = ref->m(::djinni::Map<::djinni_generated::NativeColor, ::djinni_generated::NativeColor>::toCpp(jniEnv, j_m));
return ::djinni::release(::djinni::Map<::djinni_generated::NativeColor, ::djinni_generated::NativeColor>::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#pragma once
#include "djinni_support.hpp"
#include "enum_usage_interface.hpp"
namespace djinni_generated {
class NativeEnumUsageInterface final : ::djinni::JniInterface<::testsuite::EnumUsageInterface, NativeEnumUsageInterface> {
public:
using CppType = std::shared_ptr<::testsuite::EnumUsageInterface>;
using CppOptType = std::shared_ptr<::testsuite::EnumUsageInterface>;
using JniType = jobject;
using Boxed = NativeEnumUsageInterface;
~NativeEnumUsageInterface();
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return ::djinni::JniClass<NativeEnumUsageInterface>::get()._fromJava(jniEnv, j); }
static ::djinni::LocalRef<JniType> fromCppOpt(JNIEnv* jniEnv, const CppOptType& c) { return {jniEnv, ::djinni::JniClass<NativeEnumUsageInterface>::get()._toJava(jniEnv, c)}; }
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c) { return fromCppOpt(jniEnv, c); }
private:
NativeEnumUsageInterface();
friend ::djinni::JniClass<NativeEnumUsageInterface>;
friend ::djinni::JniInterface<::testsuite::EnumUsageInterface, NativeEnumUsageInterface>;
class JavaProxy final : ::djinni::JavaProxyHandle<JavaProxy>, public ::testsuite::EnumUsageInterface
{
public:
JavaProxy(JniType j);
~JavaProxy();
::testsuite::color e(::testsuite::color e) override;
std::experimental::optional<::testsuite::color> o(std::experimental::optional<::testsuite::color> o) override;
std::vector<::testsuite::color> l(const std::vector<::testsuite::color> & l) override;
std::unordered_set<::testsuite::color> s(const std::unordered_set<::testsuite::color> & s) override;
std::unordered_map<::testsuite::color, ::testsuite::color> m(const std::unordered_map<::testsuite::color, ::testsuite::color> & m) override;
private:
friend ::djinni::JniInterface<::testsuite::EnumUsageInterface, ::djinni_generated::NativeEnumUsageInterface>;
};
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/EnumUsageInterface") };
const jmethodID method_e { ::djinni::jniGetMethodID(clazz.get(), "e", "(Lcom/dropbox/djinni/test/Color;)Lcom/dropbox/djinni/test/Color;") };
const jmethodID method_o { ::djinni::jniGetMethodID(clazz.get(), "o", "(Lcom/dropbox/djinni/test/Color;)Lcom/dropbox/djinni/test/Color;") };
const jmethodID method_l { ::djinni::jniGetMethodID(clazz.get(), "l", "(Ljava/util/ArrayList;)Ljava/util/ArrayList;") };
const jmethodID method_s { ::djinni::jniGetMethodID(clazz.get(), "s", "(Ljava/util/HashSet;)Ljava/util/HashSet;") };
const jmethodID method_m { ::djinni::jniGetMethodID(clazz.get(), "m", "(Ljava/util/HashMap;)Ljava/util/HashMap;") };
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#include "NativeEnumUsageRecord.hpp" // my header
#include "Marshal.hpp"
#include "NativeColor.hpp"
namespace djinni_generated {
NativeEnumUsageRecord::NativeEnumUsageRecord() = default;
NativeEnumUsageRecord::~NativeEnumUsageRecord() = default;
auto NativeEnumUsageRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
const auto& data = ::djinni::JniClass<NativeEnumUsageRecord>::get();
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
::djinni::get(::djinni_generated::NativeColor::fromCpp(jniEnv, c.e)),
::djinni::get(::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::fromCpp(jniEnv, c.o)),
::djinni::get(::djinni::List<::djinni_generated::NativeColor>::fromCpp(jniEnv, c.l)),
::djinni::get(::djinni::Set<::djinni_generated::NativeColor>::fromCpp(jniEnv, c.s)),
::djinni::get(::djinni::Map<::djinni_generated::NativeColor, ::djinni_generated::NativeColor>::fromCpp(jniEnv, c.m)))};
::djinni::jniExceptionCheck(jniEnv);
return r;
}
auto NativeEnumUsageRecord::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
::djinni::JniLocalScope jscope(jniEnv, 6);
assert(j != nullptr);
const auto& data = ::djinni::JniClass<NativeEnumUsageRecord>::get();
return {::djinni_generated::NativeColor::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mE)),
::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mO)),
::djinni::List<::djinni_generated::NativeColor>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mL)),
::djinni::Set<::djinni_generated::NativeColor>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mS)),
::djinni::Map<::djinni_generated::NativeColor, ::djinni_generated::NativeColor>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mM))};
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#pragma once
#include "djinni_support.hpp"
#include "enum_usage_record.hpp"
namespace djinni_generated {
class NativeEnumUsageRecord final {
public:
using CppType = ::testsuite::EnumUsageRecord;
using JniType = jobject;
using Boxed = NativeEnumUsageRecord;
~NativeEnumUsageRecord();
static CppType toCpp(JNIEnv* jniEnv, JniType j);
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
private:
NativeEnumUsageRecord();
friend ::djinni::JniClass<NativeEnumUsageRecord>;
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/EnumUsageRecord") };
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Lcom/dropbox/djinni/test/Color;Lcom/dropbox/djinni/test/Color;Ljava/util/ArrayList;Ljava/util/HashSet;Ljava/util/HashMap;)V") };
const jfieldID field_mE { ::djinni::jniGetFieldID(clazz.get(), "mE", "Lcom/dropbox/djinni/test/Color;") };
const jfieldID field_mO { ::djinni::jniGetFieldID(clazz.get(), "mO", "Lcom/dropbox/djinni/test/Color;") };
const jfieldID field_mL { ::djinni::jniGetFieldID(clazz.get(), "mL", "Ljava/util/ArrayList;") };
const jfieldID field_mS { ::djinni::jniGetFieldID(clazz.get(), "mS", "Ljava/util/HashSet;") };
const jfieldID field_mM { ::djinni::jniGetFieldID(clazz.get(), "mM", "Ljava/util/HashMap;") };
};
} // namespace djinni_generated
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#pragma once #pragma once
#include "../../handwritten-src/cpp/extended_record.hpp"
#include "djinni_support.hpp" #include "djinni_support.hpp"
#include "extended_record.hpp"
namespace djinni_generated { namespace djinni_generated {
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#include "NativeInterfaceUsingExtendedRecord.hpp" // my header
#include "NativeExtendedRecord.hpp"
#include "NativeRecordUsingExtendedRecord.hpp"
namespace djinni_generated {
NativeInterfaceUsingExtendedRecord::NativeInterfaceUsingExtendedRecord() : ::djinni::JniInterface<::testsuite::InterfaceUsingExtendedRecord, NativeInterfaceUsingExtendedRecord>("com/dropbox/djinni/test/InterfaceUsingExtendedRecord$CppProxy") {}
NativeInterfaceUsingExtendedRecord::~NativeInterfaceUsingExtendedRecord() = default;
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_InterfaceUsingExtendedRecord_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
delete reinterpret_cast<::djinni::CppProxyHandle<::testsuite::InterfaceUsingExtendedRecord>*>(nativeRef);
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_InterfaceUsingExtendedRecord_00024CppProxy_native_1meth(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_er)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::InterfaceUsingExtendedRecord>(nativeRef);
auto r = ref->meth(::djinni_generated::NativeExtendedRecord::toCpp(jniEnv, j_er));
return ::djinni::release(::djinni_generated::NativeExtendedRecord::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#pragma once
#include "djinni_support.hpp"
#include "interface_using_extended_record.hpp"
namespace djinni_generated {
class NativeInterfaceUsingExtendedRecord final : ::djinni::JniInterface<::testsuite::InterfaceUsingExtendedRecord, NativeInterfaceUsingExtendedRecord> {
public:
using CppType = std::shared_ptr<::testsuite::InterfaceUsingExtendedRecord>;
using CppOptType = std::shared_ptr<::testsuite::InterfaceUsingExtendedRecord>;
using JniType = jobject;
using Boxed = NativeInterfaceUsingExtendedRecord;
~NativeInterfaceUsingExtendedRecord();
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return ::djinni::JniClass<NativeInterfaceUsingExtendedRecord>::get()._fromJava(jniEnv, j); }
static ::djinni::LocalRef<JniType> fromCppOpt(JNIEnv* jniEnv, const CppOptType& c) { return {jniEnv, ::djinni::JniClass<NativeInterfaceUsingExtendedRecord>::get()._toJava(jniEnv, c)}; }
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c) { return fromCppOpt(jniEnv, c); }
private:
NativeInterfaceUsingExtendedRecord();
friend ::djinni::JniClass<NativeInterfaceUsingExtendedRecord>;
friend ::djinni::JniInterface<::testsuite::InterfaceUsingExtendedRecord, NativeInterfaceUsingExtendedRecord>;
};
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeListenerCaller.hpp" // my header #include "NativeListenerCaller.hpp" // my header
#include "NativeFirstListener.hpp" #include "NativeFirstListener.hpp"
#include "NativeListenerCaller.hpp"
#include "NativeSecondListener.hpp" #include "NativeSecondListener.hpp"
namespace djinni_generated { namespace djinni_generated {
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#include "NativeRecordUsingExtendedRecord.hpp" // my header
#include "NativeExtendedRecord.hpp"
namespace djinni_generated {
NativeRecordUsingExtendedRecord::NativeRecordUsingExtendedRecord() = default;
NativeRecordUsingExtendedRecord::~NativeRecordUsingExtendedRecord() = default;
auto NativeRecordUsingExtendedRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
const auto& data = ::djinni::JniClass<NativeRecordUsingExtendedRecord>::get();
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
::djinni::get(::djinni_generated::NativeExtendedRecord::fromCpp(jniEnv, c.er)))};
::djinni::jniExceptionCheck(jniEnv);
return r;
}
auto NativeRecordUsingExtendedRecord::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
::djinni::JniLocalScope jscope(jniEnv, 2);
assert(j != nullptr);
const auto& data = ::djinni::JniClass<NativeRecordUsingExtendedRecord>::get();
return {::djinni_generated::NativeExtendedRecord::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mEr))};
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#pragma once
#include "djinni_support.hpp"
#include "record_using_extended_record.hpp"
namespace djinni_generated {
class NativeRecordUsingExtendedRecord final {
public:
using CppType = ::testsuite::RecordUsingExtendedRecord;
using JniType = jobject;
using Boxed = NativeRecordUsingExtendedRecord;
~NativeRecordUsingExtendedRecord();
static CppType toCpp(JNIEnv* jniEnv, JniType j);
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
private:
NativeRecordUsingExtendedRecord();
friend ::djinni::JniClass<NativeRecordUsingExtendedRecord>;
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/RecordUsingExtendedRecord") };
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Lcom/dropbox/djinni/test/ExtendedRecord;)V") };
const jfieldID field_mEr { ::djinni::jniGetFieldID(clazz.get(), "mEr", "Lcom/dropbox/djinni/test/ExtendedRecord;") };
};
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeReturnOne.hpp" // my header #include "NativeReturnOne.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeReturnOne.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeReturnTwo.hpp" // my header #include "NativeReturnTwo.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeReturnTwo.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#include "NativeReverseClientInterface.hpp" // my header #include "NativeReverseClientInterface.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeReverseClientInterface.hpp"
namespace djinni_generated { namespace djinni_generated {
......
...@@ -23,6 +23,14 @@ void NativeUsesSingleLanguageListeners::JavaProxy::callForObjC(const std::shared ...@@ -23,6 +23,14 @@ void NativeUsesSingleLanguageListeners::JavaProxy::callForObjC(const std::shared
::djinni::get(::djinni_generated::NativeObjcOnlyListener::fromCpp(jniEnv, c_l))); ::djinni::get(::djinni_generated::NativeObjcOnlyListener::fromCpp(jniEnv, c_l)));
::djinni::jniExceptionCheck(jniEnv); ::djinni::jniExceptionCheck(jniEnv);
} }
std::shared_ptr<::testsuite::ObjcOnlyListener> NativeUsesSingleLanguageListeners::JavaProxy::returnForObjC() {
auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeUsesSingleLanguageListeners>::get();
auto jret = jniEnv->CallObjectMethod(Handle::get().get(), data.method_returnForObjC);
::djinni::jniExceptionCheck(jniEnv);
return ::djinni_generated::NativeObjcOnlyListener::toCpp(jniEnv, jret);
}
void NativeUsesSingleLanguageListeners::JavaProxy::callForJava(const std::shared_ptr<::testsuite::JavaOnlyListener> & c_l) { void NativeUsesSingleLanguageListeners::JavaProxy::callForJava(const std::shared_ptr<::testsuite::JavaOnlyListener> & c_l) {
auto jniEnv = ::djinni::jniGetThreadEnv(); auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10); ::djinni::JniLocalScope jscope(jniEnv, 10);
...@@ -31,6 +39,14 @@ void NativeUsesSingleLanguageListeners::JavaProxy::callForJava(const std::shared ...@@ -31,6 +39,14 @@ void NativeUsesSingleLanguageListeners::JavaProxy::callForJava(const std::shared
::djinni::get(::djinni_generated::NativeJavaOnlyListener::fromCpp(jniEnv, c_l))); ::djinni::get(::djinni_generated::NativeJavaOnlyListener::fromCpp(jniEnv, c_l)));
::djinni::jniExceptionCheck(jniEnv); ::djinni::jniExceptionCheck(jniEnv);
} }
std::shared_ptr<::testsuite::JavaOnlyListener> NativeUsesSingleLanguageListeners::JavaProxy::returnForJava() {
auto jniEnv = ::djinni::jniGetThreadEnv();
::djinni::JniLocalScope jscope(jniEnv, 10);
const auto& data = ::djinni::JniClass<::djinni_generated::NativeUsesSingleLanguageListeners>::get();
auto jret = jniEnv->CallObjectMethod(Handle::get().get(), data.method_returnForJava);
::djinni::jniExceptionCheck(jniEnv);
return ::djinni_generated::NativeJavaOnlyListener::toCpp(jniEnv, jret);
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef) CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{ {
...@@ -49,6 +65,16 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners ...@@ -49,6 +65,16 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, ) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
} }
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners_00024CppProxy_native_1returnForObjC(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::UsesSingleLanguageListeners>(nativeRef);
auto r = ref->returnForObjC();
return ::djinni::release(::djinni_generated::NativeObjcOnlyListener::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners_00024CppProxy_native_1callForJava(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_l) CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners_00024CppProxy_native_1callForJava(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_l)
{ {
try { try {
...@@ -58,4 +84,14 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners ...@@ -58,4 +84,14 @@ CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, ) } JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
} }
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_UsesSingleLanguageListeners_00024CppProxy_native_1returnForJava(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::UsesSingleLanguageListeners>(nativeRef);
auto r = ref->returnForJava();
return ::djinni::release(::djinni_generated::NativeJavaOnlyListener::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
} // namespace djinni_generated } // namespace djinni_generated
...@@ -34,7 +34,9 @@ private: ...@@ -34,7 +34,9 @@ private:
~JavaProxy(); ~JavaProxy();
void callForObjC(const std::shared_ptr<::testsuite::ObjcOnlyListener> & l) override; void callForObjC(const std::shared_ptr<::testsuite::ObjcOnlyListener> & l) override;
std::shared_ptr<::testsuite::ObjcOnlyListener> returnForObjC() override;
void callForJava(const std::shared_ptr<::testsuite::JavaOnlyListener> & l) override; void callForJava(const std::shared_ptr<::testsuite::JavaOnlyListener> & l) override;
std::shared_ptr<::testsuite::JavaOnlyListener> returnForJava() override;
private: private:
friend ::djinni::JniInterface<::testsuite::UsesSingleLanguageListeners, ::djinni_generated::NativeUsesSingleLanguageListeners>; friend ::djinni::JniInterface<::testsuite::UsesSingleLanguageListeners, ::djinni_generated::NativeUsesSingleLanguageListeners>;
...@@ -42,7 +44,9 @@ private: ...@@ -42,7 +44,9 @@ private:
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/UsesSingleLanguageListeners") }; const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/UsesSingleLanguageListeners") };
const jmethodID method_callForObjC { ::djinni::jniGetMethodID(clazz.get(), "callForObjC", "(Lcom/dropbox/djinni/test/ObjcOnlyListener;)V") }; const jmethodID method_callForObjC { ::djinni::jniGetMethodID(clazz.get(), "callForObjC", "(Lcom/dropbox/djinni/test/ObjcOnlyListener;)V") };
const jmethodID method_returnForObjC { ::djinni::jniGetMethodID(clazz.get(), "returnForObjC", "()Lcom/dropbox/djinni/test/ObjcOnlyListener;") };
const jmethodID method_callForJava { ::djinni::jniGetMethodID(clazz.get(), "callForJava", "(Lcom/dropbox/djinni/test/JavaOnlyListener;)V") }; const jmethodID method_callForJava { ::djinni::jniGetMethodID(clazz.get(), "callForJava", "(Lcom/dropbox/djinni/test/JavaOnlyListener;)V") };
const jmethodID method_returnForJava { ::djinni::jniGetMethodID(clazz.get(), "returnForJava", "()Lcom/dropbox/djinni/test/JavaOnlyListener;") };
}; };
} // namespace djinni_generated } // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#include "NativeVarnameInterface.hpp" // my header
#include "NativeVarnameRecord.hpp"
namespace djinni_generated {
NativeVarnameInterface::NativeVarnameInterface() : ::djinni::JniInterface<::testsuite::VarnameInterface, NativeVarnameInterface>("com/dropbox/djinni/test/VarnameInterface$CppProxy") {}
NativeVarnameInterface::~NativeVarnameInterface() = default;
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_VarnameInterface_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
delete reinterpret_cast<::djinni::CppProxyHandle<::testsuite::VarnameInterface>*>(nativeRef);
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_VarnameInterface_00024CppProxy_native_1Rmethod(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_RArg)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::VarnameInterface>(nativeRef);
auto r = ref->_rmethod_(::djinni_generated::NativeVarnameRecord::toCpp(jniEnv, j_RArg));
return ::djinni::release(::djinni_generated::NativeVarnameRecord::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_VarnameInterface_00024CppProxy_native_1Imethod(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, jobject j_IArg)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
const auto& ref = ::djinni::objectFromHandleAddress<::testsuite::VarnameInterface>(nativeRef);
auto r = ref->_imethod_(::djinni_generated::NativeVarnameInterface::toCpp(jniEnv, j_IArg));
return ::djinni::release(::djinni_generated::NativeVarnameInterface::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#pragma once
#include "_varname_interface_.hpp"
#include "djinni_support.hpp"
namespace djinni_generated {
class NativeVarnameInterface final : ::djinni::JniInterface<::testsuite::VarnameInterface, NativeVarnameInterface> {
public:
using CppType = std::shared_ptr<::testsuite::VarnameInterface>;
using CppOptType = std::shared_ptr<::testsuite::VarnameInterface>;
using JniType = jobject;
using Boxed = NativeVarnameInterface;
~NativeVarnameInterface();
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return ::djinni::JniClass<NativeVarnameInterface>::get()._fromJava(jniEnv, j); }
static ::djinni::LocalRef<JniType> fromCppOpt(JNIEnv* jniEnv, const CppOptType& c) { return {jniEnv, ::djinni::JniClass<NativeVarnameInterface>::get()._toJava(jniEnv, c)}; }
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c) { return fromCppOpt(jniEnv, c); }
private:
NativeVarnameInterface();
friend ::djinni::JniClass<NativeVarnameInterface>;
friend ::djinni::JniInterface<::testsuite::VarnameInterface, NativeVarnameInterface>;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni // This file generated by Djinni from varnames.djinni
#include "NativeOptColorRecord.hpp" // my header #include "NativeVarnameRecord.hpp" // my header
#include "Marshal.hpp" #include "Marshal.hpp"
#include "NativeColor.hpp"
namespace djinni_generated { namespace djinni_generated {
NativeOptColorRecord::NativeOptColorRecord() = default; NativeVarnameRecord::NativeVarnameRecord() = default;
NativeOptColorRecord::~NativeOptColorRecord() = default; NativeVarnameRecord::~NativeVarnameRecord() = default;
auto NativeOptColorRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> { auto NativeVarnameRecord::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
const auto& data = ::djinni::JniClass<NativeOptColorRecord>::get(); const auto& data = ::djinni::JniClass<NativeVarnameRecord>::get();
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor, auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
::djinni::get(::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::fromCpp(jniEnv, c.my_color)))}; ::djinni::get(::djinni::I8::fromCpp(jniEnv, c._field_)))};
::djinni::jniExceptionCheck(jniEnv); ::djinni::jniExceptionCheck(jniEnv);
return r; return r;
} }
auto NativeOptColorRecord::toCpp(JNIEnv* jniEnv, JniType j) -> CppType { auto NativeVarnameRecord::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
::djinni::JniLocalScope jscope(jniEnv, 2); ::djinni::JniLocalScope jscope(jniEnv, 2);
assert(j != nullptr); assert(j != nullptr);
const auto& data = ::djinni::JniClass<NativeOptColorRecord>::get(); const auto& data = ::djinni::JniClass<NativeVarnameRecord>::get();
return {::djinni::Optional<std::experimental::optional, ::djinni_generated::NativeColor>::toCpp(jniEnv, jniEnv->GetObjectField(j, data.field_mMyColor))}; return {::djinni::I8::toCpp(jniEnv, jniEnv->GetByteField(j, data.field_mField))};
} }
} // namespace djinni_generated } // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni // This file generated by Djinni from varnames.djinni
#pragma once #pragma once
#include "_varname_record_.hpp"
#include "djinni_support.hpp" #include "djinni_support.hpp"
#include "opt_color_record.hpp"
namespace djinni_generated { namespace djinni_generated {
class NativeOptColorRecord final { class NativeVarnameRecord final {
public: public:
using CppType = ::testsuite::OptColorRecord; using CppType = ::testsuite::VarnameRecord;
using JniType = jobject; using JniType = jobject;
using Boxed = NativeOptColorRecord; using Boxed = NativeVarnameRecord;
~NativeOptColorRecord(); ~NativeVarnameRecord();
static CppType toCpp(JNIEnv* jniEnv, JniType j); static CppType toCpp(JNIEnv* jniEnv, JniType j);
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c); static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
private: private:
NativeOptColorRecord(); NativeVarnameRecord();
friend ::djinni::JniClass<NativeOptColorRecord>; friend ::djinni::JniClass<NativeVarnameRecord>;
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/OptColorRecord") }; const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/VarnameRecord") };
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Lcom/dropbox/djinni/test/Color;)V") }; const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(B)V") };
const jfieldID field_mMyColor { ::djinni::jniGetFieldID(clazz.get(), "mMyColor", "Lcom/dropbox/djinni/test/Color;") }; const jfieldID field_mField { ::djinni::jniGetFieldID(clazz.get(), "mField", "B") };
}; };
} // namespace djinni_generated } // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#include "NativeWcharTestHelpers.hpp" // my header
#include "Marshal.hpp"
#include "NativeWcharTestRec.hpp"
namespace djinni_generated {
NativeWcharTestHelpers::NativeWcharTestHelpers() : ::djinni::JniInterface<::testsuite::WcharTestHelpers, NativeWcharTestHelpers>("com/dropbox/djinni/test/WcharTestHelpers$CppProxy") {}
NativeWcharTestHelpers::~NativeWcharTestHelpers() = default;
CJNIEXPORT void JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_00024CppProxy_nativeDestroy(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef)
{
try {
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef);
delete reinterpret_cast<::djinni::CppProxyHandle<::testsuite::WcharTestHelpers>*>(nativeRef);
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, )
}
CJNIEXPORT jobject JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_getRecord(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
auto r = ::testsuite::WcharTestHelpers::get_record();
return ::djinni::release(::djinni_generated::NativeWcharTestRec::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jstring JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_getString(JNIEnv* jniEnv, jobject /*this*/)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
auto r = ::testsuite::WcharTestHelpers::get_string();
return ::djinni::release(::djinni::WString::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_checkString(JNIEnv* jniEnv, jobject /*this*/, jstring j_str)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
auto r = ::testsuite::WcharTestHelpers::check_string(::djinni::WString::toCpp(jniEnv, j_str));
return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
CJNIEXPORT jboolean JNICALL Java_com_dropbox_djinni_test_WcharTestHelpers_checkRecord(JNIEnv* jniEnv, jobject /*this*/, jobject j_rec)
{
try {
DJINNI_FUNCTION_PROLOGUE0(jniEnv);
auto r = ::testsuite::WcharTestHelpers::check_record(::djinni_generated::NativeWcharTestRec::toCpp(jniEnv, j_rec));
return ::djinni::release(::djinni::Bool::fromCpp(jniEnv, r));
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, 0 /* value doesn't matter */)
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#pragma once
#include "djinni_support.hpp"
#include "wchar_test_helpers.hpp"
namespace djinni_generated {
class NativeWcharTestHelpers final : ::djinni::JniInterface<::testsuite::WcharTestHelpers, NativeWcharTestHelpers> {
public:
using CppType = std::shared_ptr<::testsuite::WcharTestHelpers>;
using CppOptType = std::shared_ptr<::testsuite::WcharTestHelpers>;
using JniType = jobject;
using Boxed = NativeWcharTestHelpers;
~NativeWcharTestHelpers();
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return ::djinni::JniClass<NativeWcharTestHelpers>::get()._fromJava(jniEnv, j); }
static ::djinni::LocalRef<JniType> fromCppOpt(JNIEnv* jniEnv, const CppOptType& c) { return {jniEnv, ::djinni::JniClass<NativeWcharTestHelpers>::get()._toJava(jniEnv, c)}; }
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c) { return fromCppOpt(jniEnv, c); }
private:
NativeWcharTestHelpers();
friend ::djinni::JniClass<NativeWcharTestHelpers>;
friend ::djinni::JniInterface<::testsuite::WcharTestHelpers, NativeWcharTestHelpers>;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#include "NativeWcharTestRec.hpp" // my header
#include "Marshal.hpp"
namespace djinni_generated {
NativeWcharTestRec::NativeWcharTestRec() = default;
NativeWcharTestRec::~NativeWcharTestRec() = default;
auto NativeWcharTestRec::fromCpp(JNIEnv* jniEnv, const CppType& c) -> ::djinni::LocalRef<JniType> {
const auto& data = ::djinni::JniClass<NativeWcharTestRec>::get();
auto r = ::djinni::LocalRef<JniType>{jniEnv->NewObject(data.clazz.get(), data.jconstructor,
::djinni::get(::djinni::WString::fromCpp(jniEnv, c.s)))};
::djinni::jniExceptionCheck(jniEnv);
return r;
}
auto NativeWcharTestRec::toCpp(JNIEnv* jniEnv, JniType j) -> CppType {
::djinni::JniLocalScope jscope(jniEnv, 2);
assert(j != nullptr);
const auto& data = ::djinni::JniClass<NativeWcharTestRec>::get();
return {::djinni::WString::toCpp(jniEnv, (jstring)jniEnv->GetObjectField(j, data.field_mS))};
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#pragma once
#include "djinni_support.hpp"
#include "wchar_test_rec.hpp"
namespace djinni_generated {
class NativeWcharTestRec final {
public:
using CppType = ::testsuite::WcharTestRec;
using JniType = jobject;
using Boxed = NativeWcharTestRec;
~NativeWcharTestRec();
static CppType toCpp(JNIEnv* jniEnv, JniType j);
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, const CppType& c);
private:
NativeWcharTestRec();
friend ::djinni::JniClass<NativeWcharTestRec>;
const ::djinni::GlobalRef<jclass> clazz { ::djinni::jniFindClass("com/dropbox/djinni/test/WcharTestRec") };
const jmethodID jconstructor { ::djinni::jniGetMethodID(clazz.get(), "<init>", "(Ljava/lang/String;)V") };
const jfieldID field_mS { ::djinni::jniGetFieldID(clazz.get(), "mS", "Ljava/lang/String;") };
};
} // namespace djinni_generated
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
#import "DBClientInterface+Private.h" #import "DBClientInterface+Private.h"
#import "DBClientInterface.h" #import "DBClientInterface.h"
#import "DBClientInterface+Private.h"
#import "DBClientReturnedRecord+Private.h" #import "DBClientReturnedRecord+Private.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#include <stdexcept>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -21,40 +21,40 @@ public: ...@@ -21,40 +21,40 @@ public:
::testsuite::ClientReturnedRecord get_record(int64_t c_record_id, const std::string & c_utf8string, const std::experimental::optional<std::string> & c_misc) override ::testsuite::ClientReturnedRecord get_record(int64_t c_record_id, const std::string & c_utf8string, const std::experimental::optional<std::string> & c_misc) override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [Handle::get() getRecord:(::djinni::I64::fromCpp(c_record_id)) auto objcpp_result_ = [Handle::get() getRecord:(::djinni::I64::fromCpp(c_record_id))
utf8string:(::djinni::String::fromCpp(c_utf8string)) utf8string:(::djinni::String::fromCpp(c_utf8string))
misc:(::djinni::Optional<std::experimental::optional, ::djinni::String>::fromCpp(c_misc))]; misc:(::djinni::Optional<std::experimental::optional, ::djinni::String>::fromCpp(c_misc))];
return ::djinni_generated::ClientReturnedRecord::toCpp(r); return ::djinni_generated::ClientReturnedRecord::toCpp(objcpp_result_);
} }
} }
double identifier_check(const std::vector<uint8_t> & c_data, int32_t c_r, int64_t c_jret) override double identifier_check(const std::vector<uint8_t> & c_data, int32_t c_r, int64_t c_jret) override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [Handle::get() identifierCheck:(::djinni::Binary::fromCpp(c_data)) auto objcpp_result_ = [Handle::get() identifierCheck:(::djinni::Binary::fromCpp(c_data))
r:(::djinni::I32::fromCpp(c_r)) r:(::djinni::I32::fromCpp(c_r))
jret:(::djinni::I64::fromCpp(c_jret))]; jret:(::djinni::I64::fromCpp(c_jret))];
return ::djinni::F64::toCpp(r); return ::djinni::F64::toCpp(objcpp_result_);
} }
} }
std::string return_str() override std::string return_str() override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [Handle::get() returnStr]; auto objcpp_result_ = [Handle::get() returnStr];
return ::djinni::String::toCpp(r); return ::djinni::String::toCpp(objcpp_result_);
} }
} }
std::string meth_taking_interface(const std::shared_ptr<::testsuite::ClientInterface> & c_i) override std::string meth_taking_interface(const std::shared_ptr<::testsuite::ClientInterface> & c_i) override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [Handle::get() methTakingInterface:(::djinni_generated::ClientInterface::fromCpp(c_i))]; auto objcpp_result_ = [Handle::get() methTakingInterface:(::djinni_generated::ClientInterface::fromCpp(c_i))];
return ::djinni::String::toCpp(r); return ::djinni::String::toCpp(objcpp_result_);
} }
} }
std::string meth_taking_optional_interface(const std::shared_ptr<::testsuite::ClientInterface> & c_i) override std::string meth_taking_optional_interface(const std::shared_ptr<::testsuite::ClientInterface> & c_i) override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [Handle::get() methTakingOptionalInterface:(::djinni::Optional<std::experimental::optional, ::djinni_generated::ClientInterface>::fromCpp(c_i))]; auto objcpp_result_ = [Handle::get() methTakingOptionalInterface:(::djinni::Optional<std::experimental::optional, ::djinni_generated::ClientInterface>::fromCpp(c_i))];
return ::djinni::String::toCpp(r); return ::djinni::String::toCpp(objcpp_result_);
} }
} }
}; };
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#include "color.hpp"
#import "DJIMarshal+Private.h"
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,15 +33,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,15 +33,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
- (nullable DBConflict *)Conflict { - (nullable DBConflict *)Conflict {
try { try {
auto r = _cppRefHandle.get()->Conflict(); auto objcpp_result_ = _cppRefHandle.get()->Conflict();
return ::djinni_generated::Conflict::fromCpp(r); return ::djinni_generated::Conflict::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
- (BOOL)conflictArg:(nonnull NSSet<DBConflict *> *)cs { - (BOOL)conflictArg:(nonnull NSSet<DBConflict *> *)cs {
try { try {
auto r = _cppRefHandle.get()->conflict_arg(::djinni::Set<::djinni_generated::Conflict>::toCpp(cs)); auto objcpp_result_ = _cppRefHandle.get()->conflict_arg(::djinni::Set<::djinni_generated::Conflict>::toCpp(cs));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
#import "DBCppException+Private.h" #import "DBCppException+Private.h"
#import "DBCppException.h" #import "DBCppException.h"
#import "DBCppException+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,15 +32,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,15 +32,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
- (int32_t)throwAnException { - (int32_t)throwAnException {
try { try {
auto r = _cppRefHandle.get()->throw_an_exception(); auto objcpp_result_ = _cppRefHandle.get()->throw_an_exception();
return ::djinni::I32::fromCpp(r); return ::djinni::I32::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable DBCppException *)get { + (nullable DBCppException *)get {
try { try {
auto r = ::testsuite::CppException::get(); auto objcpp_result_ = ::testsuite::CppException::get();
return ::djinni_generated::CppException::fromCpp(r); return ::djinni_generated::CppException::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#include "enum_usage_interface.hpp"
#include <memory>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@protocol DBEnumUsageInterface;
namespace djinni_generated {
class EnumUsageInterface
{
public:
using CppType = std::shared_ptr<::testsuite::EnumUsageInterface>;
using CppOptType = std::shared_ptr<::testsuite::EnumUsageInterface>;
using ObjcType = id<DBEnumUsageInterface>;
using Boxed = EnumUsageInterface;
static CppType toCpp(ObjcType objc);
static ObjcType fromCppOpt(const CppOptType& cpp);
static ObjcType fromCpp(const CppType& cpp) { return fromCppOpt(cpp); }
private:
class ObjcProxy;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBEnumUsageInterface+Private.h"
#import "DBEnumUsageInterface.h"
#import "DBColor+Private.h"
#import "DJICppWrapperCache+Private.h"
#import "DJIError.h"
#import "DJIMarshal+Private.h"
#import "DJIObjcWrapperCache+Private.h"
#include <exception>
#include <stdexcept>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface DBEnumUsageInterfaceCppProxy : NSObject<DBEnumUsageInterface>
- (id)initWithCpp:(const std::shared_ptr<::testsuite::EnumUsageInterface>&)cppRef;
@end
@implementation DBEnumUsageInterfaceCppProxy {
::djinni::CppProxyCache::Handle<std::shared_ptr<::testsuite::EnumUsageInterface>> _cppRefHandle;
}
- (id)initWithCpp:(const std::shared_ptr<::testsuite::EnumUsageInterface>&)cppRef
{
if (self = [super init]) {
_cppRefHandle.assign(cppRef);
}
return self;
}
- (DBColor)e:(DBColor)e {
try {
auto objcpp_result_ = _cppRefHandle.get()->e(::djinni::Enum<::testsuite::color, DBColor>::toCpp(e));
return ::djinni::Enum<::testsuite::color, DBColor>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
- (nullable NSNumber *)o:(nullable NSNumber *)o {
try {
auto objcpp_result_ = _cppRefHandle.get()->o(::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::toCpp(o));
return ::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
- (nonnull NSArray<NSNumber *> *)l:(nonnull NSArray<NSNumber *> *)l {
try {
auto objcpp_result_ = _cppRefHandle.get()->l(::djinni::List<::djinni::Enum<::testsuite::color, DBColor>>::toCpp(l));
return ::djinni::List<::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
- (nonnull NSSet<NSNumber *> *)s:(nonnull NSSet<NSNumber *> *)s {
try {
auto objcpp_result_ = _cppRefHandle.get()->s(::djinni::Set<::djinni::Enum<::testsuite::color, DBColor>>::toCpp(s));
return ::djinni::Set<::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
- (nonnull NSDictionary<NSNumber *, NSNumber *> *)m:(nonnull NSDictionary<NSNumber *, NSNumber *> *)m {
try {
auto objcpp_result_ = _cppRefHandle.get()->m(::djinni::Map<::djinni::Enum<::testsuite::color, DBColor>, ::djinni::Enum<::testsuite::color, DBColor>>::toCpp(m));
return ::djinni::Map<::djinni::Enum<::testsuite::color, DBColor>, ::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
namespace djinni_generated {
class EnumUsageInterface::ObjcProxy final
: public ::testsuite::EnumUsageInterface
, public ::djinni::ObjcProxyCache::Handle<ObjcType>
{
public:
using Handle::Handle;
::testsuite::color e(::testsuite::color c_e) override
{
@autoreleasepool {
auto objcpp_result_ = [Handle::get() e:(::djinni::Enum<::testsuite::color, DBColor>::fromCpp(c_e))];
return ::djinni::Enum<::testsuite::color, DBColor>::toCpp(objcpp_result_);
}
}
std::experimental::optional<::testsuite::color> o(std::experimental::optional<::testsuite::color> c_o) override
{
@autoreleasepool {
auto objcpp_result_ = [Handle::get() o:(::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(c_o))];
return ::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::toCpp(objcpp_result_);
}
}
std::vector<::testsuite::color> l(const std::vector<::testsuite::color> & c_l) override
{
@autoreleasepool {
auto objcpp_result_ = [Handle::get() l:(::djinni::List<::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(c_l))];
return ::djinni::List<::djinni::Enum<::testsuite::color, DBColor>>::toCpp(objcpp_result_);
}
}
std::unordered_set<::testsuite::color> s(const std::unordered_set<::testsuite::color> & c_s) override
{
@autoreleasepool {
auto objcpp_result_ = [Handle::get() s:(::djinni::Set<::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(c_s))];
return ::djinni::Set<::djinni::Enum<::testsuite::color, DBColor>>::toCpp(objcpp_result_);
}
}
std::unordered_map<::testsuite::color, ::testsuite::color> m(const std::unordered_map<::testsuite::color, ::testsuite::color> & c_m) override
{
@autoreleasepool {
auto objcpp_result_ = [Handle::get() m:(::djinni::Map<::djinni::Enum<::testsuite::color, DBColor>, ::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(c_m))];
return ::djinni::Map<::djinni::Enum<::testsuite::color, DBColor>, ::djinni::Enum<::testsuite::color, DBColor>>::toCpp(objcpp_result_);
}
}
};
} // namespace djinni_generated
namespace djinni_generated {
auto EnumUsageInterface::toCpp(ObjcType objc) -> CppType
{
if (!objc) {
return nullptr;
}
if ([(id)objc isKindOfClass:[DBEnumUsageInterfaceCppProxy class]]) {
return ((DBEnumUsageInterfaceCppProxy*)objc)->_cppRefHandle.get();
}
return ::djinni::get_objc_proxy<ObjcProxy>(objc);
}
auto EnumUsageInterface::fromCppOpt(const CppOptType& cpp) -> ObjcType
{
if (!cpp) {
return nil;
}
if (auto cppPtr = dynamic_cast<ObjcProxy*>(cpp.get())) {
return cppPtr->Handle::get();
}
return ::djinni::get_cpp_proxy<DBEnumUsageInterfaceCppProxy>(cpp);
}
} // namespace djinni_generated
@end
...@@ -4,10 +4,17 @@ ...@@ -4,10 +4,17 @@
#import "DBColor.h" #import "DBColor.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBOptColorRecord : NSObject
- (nonnull instancetype)initWithMyColor:(nullable NSNumber *)myColor;
+ (nonnull instancetype)optColorRecordWithMyColor:(nullable NSNumber *)myColor;
@property (nonatomic, readonly, nullable) NSNumber * myColor; @protocol DBEnumUsageInterface
- (DBColor)e:(DBColor)e;
- (nullable NSNumber *)o:(nullable NSNumber *)o;
- (nonnull NSArray<NSNumber *> *)l:(nonnull NSArray<NSNumber *> *)l;
- (nonnull NSSet<NSNumber *> *)s:(nonnull NSSet<NSNumber *> *)s;
- (nonnull NSDictionary<NSNumber *, NSNumber *> *)m:(nonnull NSDictionary<NSNumber *, NSNumber *> *)m;
@end @end
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni // This file generated by Djinni from enum.djinni
#import "DBOptColorRecord.h" #import "DBEnumUsageRecord.h"
#include "opt_color_record.hpp" #include "enum_usage_record.hpp"
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBOptColorRecord; @class DBEnumUsageRecord;
namespace djinni_generated { namespace djinni_generated {
struct OptColorRecord struct EnumUsageRecord
{ {
using CppType = ::testsuite::OptColorRecord; using CppType = ::testsuite::EnumUsageRecord;
using ObjcType = DBOptColorRecord*; using ObjcType = DBEnumUsageRecord*;
using Boxed = OptColorRecord; using Boxed = EnumUsageRecord;
static CppType toCpp(ObjcType objc); static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp); static ObjcType fromCpp(const CppType& cpp);
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBEnumUsageRecord+Private.h"
#import "DBColor+Private.h"
#import "DJIMarshal+Private.h"
#include <cassert>
namespace djinni_generated {
auto EnumUsageRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
return {::djinni::Enum<::testsuite::color, DBColor>::toCpp(obj.e),
::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::toCpp(obj.o),
::djinni::List<::djinni::Enum<::testsuite::color, DBColor>>::toCpp(obj.l),
::djinni::Set<::djinni::Enum<::testsuite::color, DBColor>>::toCpp(obj.s),
::djinni::Map<::djinni::Enum<::testsuite::color, DBColor>, ::djinni::Enum<::testsuite::color, DBColor>>::toCpp(obj.m)};
}
auto EnumUsageRecord::fromCpp(const CppType& cpp) -> ObjcType
{
return [[DBEnumUsageRecord alloc] initWithE:(::djinni::Enum<::testsuite::color, DBColor>::fromCpp(cpp.e))
o:(::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(cpp.o))
l:(::djinni::List<::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(cpp.l))
s:(::djinni::Set<::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(cpp.s))
m:(::djinni::Map<::djinni::Enum<::testsuite::color, DBColor>, ::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(cpp.m))];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBColor.h"
#import <Foundation/Foundation.h>
@interface DBEnumUsageRecord : NSObject
- (nonnull instancetype)initWithE:(DBColor)e
o:(nullable NSNumber *)o
l:(nonnull NSArray<NSNumber *> *)l
s:(nonnull NSSet<NSNumber *> *)s
m:(nonnull NSDictionary<NSNumber *, NSNumber *> *)m;
+ (nonnull instancetype)enumUsageRecordWithE:(DBColor)e
o:(nullable NSNumber *)o
l:(nonnull NSArray<NSNumber *> *)l
s:(nonnull NSSet<NSNumber *> *)s
m:(nonnull NSDictionary<NSNumber *, NSNumber *> *)m;
@property (nonatomic, readonly) DBColor e;
@property (nonatomic, readonly, nullable) NSNumber * o;
@property (nonatomic, readonly, nonnull) NSArray<NSNumber *> * l;
@property (nonatomic, readonly, nonnull) NSSet<NSNumber *> * s;
@property (nonatomic, readonly, nonnull) NSDictionary<NSNumber *, NSNumber *> * m;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBEnumUsageRecord.h"
@implementation DBEnumUsageRecord
- (nonnull instancetype)initWithE:(DBColor)e
o:(nullable NSNumber *)o
l:(nonnull NSArray<NSNumber *> *)l
s:(nonnull NSSet<NSNumber *> *)s
m:(nonnull NSDictionary<NSNumber *, NSNumber *> *)m
{
if (self = [super init]) {
_e = e;
_o = o;
_l = [l copy];
_s = [s copy];
_m = [m copy];
}
return self;
}
+ (nonnull instancetype)enumUsageRecordWithE:(DBColor)e
o:(nullable NSNumber *)o
l:(nonnull NSArray<NSNumber *> *)l
s:(nonnull NSSet<NSNumber *> *)s
m:(nonnull NSDictionary<NSNumber *, NSNumber *> *)m
{
return [[self alloc] initWithE:e
o:o
l:l
s:s
m:m];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ %p e:%@ o:%@ l:%@ s:%@ m:%@>", self.class, (void *)self, @(self.e), self.o, self.l, self.s, self.m];
}
@end
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni // This file generated by Djinni from extended_record.djinni
#import "DBExtendedRecord+Private.h"
#import "DBExtendedRecord+Private.h" #import "DBExtendedRecord+Private.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <cassert> #include <cassert>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,8 +33,8 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,8 +33,8 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
- (nonnull DBClientReturnedRecord *)foo:(nullable id<DBClientInterface>)i { - (nonnull DBClientReturnedRecord *)foo:(nullable id<DBClientInterface>)i {
try { try {
auto r = _cppRefHandle.get()->foo(::djinni_generated::ClientInterface::toCpp(i)); auto objcpp_result_ = _cppRefHandle.get()->foo(::djinni_generated::ClientInterface::toCpp(i));
return ::djinni_generated::ClientReturnedRecord::fromCpp(r); return ::djinni_generated::ClientReturnedRecord::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#import "DBExternRecordWithDerivings+Private.h" #import "DBExternRecordWithDerivings+Private.h"
#import "DBTestHelpers+Private.h" #import "DBTestHelpers+Private.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#include <stdexcept>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -20,8 +21,8 @@ public: ...@@ -20,8 +21,8 @@ public:
::ExternRecordWithDerivings foo(const std::shared_ptr<::testsuite::TestHelpers> & c_i) override ::ExternRecordWithDerivings foo(const std::shared_ptr<::testsuite::TestHelpers> & c_i) override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [Handle::get() foo:(::djinni_generated::TestHelpers::fromCpp(c_i))]; auto objcpp_result_ = [Handle::get() foo:(::djinni_generated::TestHelpers::fromCpp(c_i))];
return ::djinni_generated::ExternRecordWithDerivings::toCpp(r); return ::djinni_generated::ExternRecordWithDerivings::toCpp(objcpp_result_);
} }
} }
}; };
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// This file generated by Djinni from yaml-test.djinni // This file generated by Djinni from yaml-test.djinni
#import "DBExternRecordWithDerivings+Private.h" #import "DBExternRecordWithDerivings+Private.h"
#import "DBColor+Private.h"
#import "DBRecordWithDerivings+Private.h" #import "DBRecordWithDerivings+Private.h"
#import "DJIMarshal+Private.h"
#include <cassert> #include <cassert>
namespace djinni_generated { namespace djinni_generated {
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "DBFirstListener+Private.h" #import "DBFirstListener+Private.h"
#import "DBFirstListener.h" #import "DBFirstListener.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#include <stdexcept>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#include "interface_using_extended_record.hpp"
#include <memory>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBInterfaceUsingExtendedRecord;
namespace djinni_generated {
class InterfaceUsingExtendedRecord
{
public:
using CppType = std::shared_ptr<::testsuite::InterfaceUsingExtendedRecord>;
using CppOptType = std::shared_ptr<::testsuite::InterfaceUsingExtendedRecord>;
using ObjcType = DBInterfaceUsingExtendedRecord*;
using Boxed = InterfaceUsingExtendedRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCppOpt(const CppOptType& cpp);
static ObjcType fromCpp(const CppType& cpp) { return fromCppOpt(cpp); }
private:
class ObjcProxy;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#import "DBInterfaceUsingExtendedRecord+Private.h"
#import "DBInterfaceUsingExtendedRecord.h"
#import "DBExtendedRecord+Private.h"
#import "DBRecordUsingExtendedRecord+Private.h"
#import "DJICppWrapperCache+Private.h"
#import "DJIError.h"
#include <exception>
#include <stdexcept>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface DBInterfaceUsingExtendedRecord ()
- (id)initWithCpp:(const std::shared_ptr<::testsuite::InterfaceUsingExtendedRecord>&)cppRef;
@end
@implementation DBInterfaceUsingExtendedRecord {
::djinni::CppProxyCache::Handle<std::shared_ptr<::testsuite::InterfaceUsingExtendedRecord>> _cppRefHandle;
}
- (id)initWithCpp:(const std::shared_ptr<::testsuite::InterfaceUsingExtendedRecord>&)cppRef
{
if (self = [super init]) {
_cppRefHandle.assign(cppRef);
}
return self;
}
- (nonnull DBExtendedRecord *)meth:(nonnull DBExtendedRecord *)er {
try {
auto objcpp_result_ = _cppRefHandle.get()->meth(::djinni_generated::ExtendedRecord::toCpp(er));
return ::djinni_generated::ExtendedRecord::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (DBRecordUsingExtendedRecord * __nonnull)cr
{
static DBRecordUsingExtendedRecord * const s_cr = [[DBRecordUsingExtendedRecord alloc] initWithEr:[[DBExtendedRecord alloc] initWithFoo:NO]];
return s_cr;
}
namespace djinni_generated {
auto InterfaceUsingExtendedRecord::toCpp(ObjcType objc) -> CppType
{
if (!objc) {
return nullptr;
}
return objc->_cppRefHandle.get();
}
auto InterfaceUsingExtendedRecord::fromCppOpt(const CppOptType& cpp) -> ObjcType
{
if (!cpp) {
return nil;
}
return ::djinni::get_cpp_proxy<DBInterfaceUsingExtendedRecord>(cpp);
}
} // namespace djinni_generated
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#import "DBExtendedRecord.h"
#import "DBRecordUsingExtendedRecord.h"
#import <Foundation/Foundation.h>
@interface DBInterfaceUsingExtendedRecord : NSObject
- (nonnull DBExtendedRecord *)meth:(nonnull DBExtendedRecord *)er;
+ (DBRecordUsingExtendedRecord * __nonnull)cr;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#import "DBInterfaceUsingExtendedRecord.h"
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from single_language_interfaces.djinni // This file generated by Djinni from single_language_interfaces.djinni
#import "DBJavaOnlyListener+Private.h"
#import "DBJavaOnlyListener.h" #import "DBJavaOnlyListener.h"
#import "DJIError.h"
#include <stdexcept>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -12,7 +15,7 @@ auto JavaOnlyListener::toCpp(ObjcType objc) -> CppType ...@@ -12,7 +15,7 @@ auto JavaOnlyListener::toCpp(ObjcType objc) -> CppType
if (!objc) { if (!objc) {
return nullptr; return nullptr;
} }
return ::djinni::get_objc_proxy<ObjcProxy>(objc); DJINNI_UNIMPLEMENTED(@"Interface not implementable in any language.");
} }
auto JavaOnlyListener::fromCppOpt(const CppOptType& cpp) -> ObjcType auto JavaOnlyListener::fromCppOpt(const CppOptType& cpp) -> ObjcType
...@@ -20,7 +23,7 @@ auto JavaOnlyListener::fromCppOpt(const CppOptType& cpp) -> ObjcType ...@@ -20,7 +23,7 @@ auto JavaOnlyListener::fromCppOpt(const CppOptType& cpp) -> ObjcType
if (!cpp) { if (!cpp) {
return nil; return nil;
} }
return ::djinni::get_cpp_proxy<DBJavaOnlyListener>(cpp); DJINNI_UNIMPLEMENTED(@"Interface not implementable in any language.");
} }
} // namespace djinni_generated } // namespace djinni_generated
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
#import "DBListenerCaller+Private.h" #import "DBListenerCaller+Private.h"
#import "DBListenerCaller.h" #import "DBListenerCaller.h"
#import "DBFirstListener+Private.h" #import "DBFirstListener+Private.h"
#import "DBListenerCaller+Private.h"
#import "DBSecondListener+Private.h" #import "DBSecondListener+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -34,9 +34,9 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -34,9 +34,9 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nullable DBListenerCaller *)init:(nullable id<DBFirstListener>)firstL + (nullable DBListenerCaller *)init:(nullable id<DBFirstListener>)firstL
secondL:(nullable id<DBSecondListener>)secondL { secondL:(nullable id<DBSecondListener>)secondL {
try { try {
auto r = ::testsuite::ListenerCaller::init(::djinni_generated::FirstListener::toCpp(firstL), auto objcpp_result_ = ::testsuite::ListenerCaller::init(::djinni_generated::FirstListener::toCpp(firstL),
::djinni_generated::SecondListener::toCpp(secondL)); ::djinni_generated::SecondListener::toCpp(secondL));
return ::djinni_generated::ListenerCaller::fromCpp(r); return ::djinni_generated::ListenerCaller::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "DBObjcOnlyListener+Private.h" #import "DBObjcOnlyListener+Private.h"
#import "DBObjcOnlyListener.h" #import "DBObjcOnlyListener.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#include <stdexcept>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBOptColorRecord+Private.h"
#import "DJIMarshal+Private.h"
#include <cassert>
namespace djinni_generated {
auto OptColorRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
return {::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::toCpp(obj.myColor)};
}
auto OptColorRecord::fromCpp(const CppType& cpp) -> ObjcType
{
return [[DBOptColorRecord alloc] initWithMyColor:(::djinni::Optional<std::experimental::optional, ::djinni::Enum<::testsuite::color, DBColor>>::fromCpp(cpp.my_color))];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBOptColorRecord.h"
@implementation DBOptColorRecord
- (nonnull instancetype)initWithMyColor:(nullable NSNumber *)myColor
{
if (self = [super init]) {
_myColor = myColor;
}
return self;
}
+ (nonnull instancetype)optColorRecordWithMyColor:(nullable NSNumber *)myColor
{
return [[self alloc] initWithMyColor:myColor];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ %p myColor:%@>", self.class, (void *)self, self.myColor];
}
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#import "DBRecordUsingExtendedRecord.h"
#include "record_using_extended_record.hpp"
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBRecordUsingExtendedRecord;
namespace djinni_generated {
struct RecordUsingExtendedRecord
{
using CppType = ::testsuite::RecordUsingExtendedRecord;
using ObjcType = DBRecordUsingExtendedRecord*;
using Boxed = RecordUsingExtendedRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#import "DBRecordUsingExtendedRecord+Private.h"
#import "DBExtendedRecord+Private.h"
#include <cassert>
namespace djinni_generated {
auto RecordUsingExtendedRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
return {::djinni_generated::ExtendedRecord::toCpp(obj.er)};
}
auto RecordUsingExtendedRecord::fromCpp(const CppType& cpp) -> ObjcType
{
return [[DBRecordUsingExtendedRecord alloc] initWithEr:(::djinni_generated::ExtendedRecord::fromCpp(cpp.er))];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#import "DBExtendedRecord.h"
#import "DBRecordUsingExtendedRecord.h"
#import <Foundation/Foundation.h>
@interface DBRecordUsingExtendedRecord : NSObject
- (nonnull instancetype)initWithEr:(nonnull DBExtendedRecord *)er;
+ (nonnull instancetype)recordUsingExtendedRecordWithEr:(nonnull DBExtendedRecord *)er;
+ (DBRecordUsingExtendedRecord * __nonnull)cr;
@property (nonatomic, readonly, nonnull) DBExtendedRecord * er;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from extended_record.djinni
#import "DBRecordUsingExtendedRecord.h"
@implementation DBRecordUsingExtendedRecord
- (nonnull instancetype)initWithEr:(nonnull DBExtendedRecord *)er
{
if (self = [super init]) {
_er = er;
}
return self;
}
+ (nonnull instancetype)recordUsingExtendedRecordWithEr:(nonnull DBExtendedRecord *)er
{
return [[self alloc] initWithEr:er];
}
+ (DBRecordUsingExtendedRecord * __nonnull)cr
{
static DBRecordUsingExtendedRecord * const s_cr = [[DBRecordUsingExtendedRecord alloc] initWithEr:[[DBExtendedRecord alloc] initWithFoo:NO]];
return s_cr;
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ %p er:%@>", self.class, (void *)self, self.er];
}
@end
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
#import "DBReturnOne+Private.h" #import "DBReturnOne+Private.h"
#import "DBReturnOne.h" #import "DBReturnOne.h"
#import "DBReturnOne+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,15 +32,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,15 +32,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nullable DBReturnOne *)getInstance { + (nullable DBReturnOne *)getInstance {
try { try {
auto r = ::testsuite::ReturnOne::get_instance(); auto objcpp_result_ = ::testsuite::ReturnOne::get_instance();
return ::djinni_generated::ReturnOne::fromCpp(r); return ::djinni_generated::ReturnOne::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
- (int8_t)returnOne { - (int8_t)returnOne {
try { try {
auto r = _cppRefHandle.get()->return_one(); auto objcpp_result_ = _cppRefHandle.get()->return_one();
return ::djinni::I8::fromCpp(r); return ::djinni::I8::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
#import "DBReturnTwo+Private.h" #import "DBReturnTwo+Private.h"
#import "DBReturnTwo.h" #import "DBReturnTwo.h"
#import "DBReturnTwo+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,15 +32,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,15 +32,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nullable DBReturnTwo *)getInstance { + (nullable DBReturnTwo *)getInstance {
try { try {
auto r = ::testsuite::ReturnTwo::get_instance(); auto objcpp_result_ = ::testsuite::ReturnTwo::get_instance();
return ::djinni_generated::ReturnTwo::fromCpp(r); return ::djinni_generated::ReturnTwo::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
- (int8_t)returnTwo { - (int8_t)returnTwo {
try { try {
auto r = _cppRefHandle.get()->return_two(); auto objcpp_result_ = _cppRefHandle.get()->return_two();
return ::djinni::I8::fromCpp(r); return ::djinni::I8::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
#import "DBReverseClientInterface+Private.h" #import "DBReverseClientInterface+Private.h"
#import "DBReverseClientInterface.h" #import "DBReverseClientInterface.h"
#import "DBReverseClientInterface+Private.h"
#import "DJICppWrapperCache+Private.h" #import "DJICppWrapperCache+Private.h"
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,29 +32,29 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,29 +32,29 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
- (nonnull NSString *)returnStr { - (nonnull NSString *)returnStr {
try { try {
auto r = _cppRefHandle.get()->return_str(); auto objcpp_result_ = _cppRefHandle.get()->return_str();
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
- (nonnull NSString *)methTakingInterface:(nullable DBReverseClientInterface *)i { - (nonnull NSString *)methTakingInterface:(nullable DBReverseClientInterface *)i {
try { try {
auto r = _cppRefHandle.get()->meth_taking_interface(::djinni_generated::ReverseClientInterface::toCpp(i)); auto objcpp_result_ = _cppRefHandle.get()->meth_taking_interface(::djinni_generated::ReverseClientInterface::toCpp(i));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
- (nonnull NSString *)methTakingOptionalInterface:(nullable DBReverseClientInterface *)i { - (nonnull NSString *)methTakingOptionalInterface:(nullable DBReverseClientInterface *)i {
try { try {
auto r = _cppRefHandle.get()->meth_taking_optional_interface(::djinni::Optional<std::experimental::optional, ::djinni_generated::ReverseClientInterface>::toCpp(i)); auto objcpp_result_ = _cppRefHandle.get()->meth_taking_optional_interface(::djinni::Optional<std::experimental::optional, ::djinni_generated::ReverseClientInterface>::toCpp(i));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable DBReverseClientInterface *)create { + (nullable DBReverseClientInterface *)create {
try { try {
auto r = ::testsuite::ReverseClientInterface::create(); auto objcpp_result_ = ::testsuite::ReverseClientInterface::create();
return ::djinni_generated::ReverseClientInterface::fromCpp(r); return ::djinni_generated::ReverseClientInterface::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#import "DBSecondListener+Private.h" #import "DBSecondListener+Private.h"
#import "DBSecondListener.h" #import "DBSecondListener.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#include <stdexcept>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#import "Duration-objc.hpp" #import "Duration-objc.hpp"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,141 +33,141 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,141 +33,141 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nonnull NSString *)hoursString:(NSTimeInterval)dt { + (nonnull NSString *)hoursString:(NSTimeInterval)dt {
try { try {
auto r = ::testsuite::TestDuration::hoursString(::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::toCpp(dt)); auto objcpp_result_ = ::testsuite::TestDuration::hoursString(::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)minutesString:(NSTimeInterval)dt { + (nonnull NSString *)minutesString:(NSTimeInterval)dt {
try { try {
auto r = ::testsuite::TestDuration::minutesString(::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::toCpp(dt)); auto objcpp_result_ = ::testsuite::TestDuration::minutesString(::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)secondsString:(NSTimeInterval)dt { + (nonnull NSString *)secondsString:(NSTimeInterval)dt {
try { try {
auto r = ::testsuite::TestDuration::secondsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::toCpp(dt)); auto objcpp_result_ = ::testsuite::TestDuration::secondsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)millisString:(NSTimeInterval)dt { + (nonnull NSString *)millisString:(NSTimeInterval)dt {
try { try {
auto r = ::testsuite::TestDuration::millisString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::toCpp(dt)); auto objcpp_result_ = ::testsuite::TestDuration::millisString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)microsString:(NSTimeInterval)dt { + (nonnull NSString *)microsString:(NSTimeInterval)dt {
try { try {
auto r = ::testsuite::TestDuration::microsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::toCpp(dt)); auto objcpp_result_ = ::testsuite::TestDuration::microsString(::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSString *)nanosString:(NSTimeInterval)dt { + (nonnull NSString *)nanosString:(NSTimeInterval)dt {
try { try {
auto r = ::testsuite::TestDuration::nanosString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::toCpp(dt)); auto objcpp_result_ = ::testsuite::TestDuration::nanosString(::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::toCpp(dt));
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)hours:(int32_t)count { + (NSTimeInterval)hours:(int32_t)count {
try { try {
auto r = ::testsuite::TestDuration::hours(::djinni::I32::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::hours(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_h>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)minutes:(int32_t)count { + (NSTimeInterval)minutes:(int32_t)count {
try { try {
auto r = ::testsuite::TestDuration::minutes(::djinni::I32::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::minutes(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_min>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)seconds:(int32_t)count { + (NSTimeInterval)seconds:(int32_t)count {
try { try {
auto r = ::testsuite::TestDuration::seconds(::djinni::I32::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::seconds(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_s>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)millis:(int32_t)count { + (NSTimeInterval)millis:(int32_t)count {
try { try {
auto r = ::testsuite::TestDuration::millis(::djinni::I32::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::millis(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ms>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)micros:(int32_t)count { + (NSTimeInterval)micros:(int32_t)count {
try { try {
auto r = ::testsuite::TestDuration::micros(::djinni::I32::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::micros(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_us>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)nanos:(int32_t)count { + (NSTimeInterval)nanos:(int32_t)count {
try { try {
auto r = ::testsuite::TestDuration::nanos(::djinni::I32::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::nanos(::djinni::I32::toCpp(count));
return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::fromCpp(r); return ::djinni::Duration<::djinni::I32, ::djinni::Duration_ns>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)hoursf:(double)count { + (NSTimeInterval)hoursf:(double)count {
try { try {
auto r = ::testsuite::TestDuration::hoursf(::djinni::F64::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::hoursf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_h>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_h>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)minutesf:(double)count { + (NSTimeInterval)minutesf:(double)count {
try { try {
auto r = ::testsuite::TestDuration::minutesf(::djinni::F64::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::minutesf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_min>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_min>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)secondsf:(double)count { + (NSTimeInterval)secondsf:(double)count {
try { try {
auto r = ::testsuite::TestDuration::secondsf(::djinni::F64::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::secondsf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_s>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_s>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)millisf:(double)count { + (NSTimeInterval)millisf:(double)count {
try { try {
auto r = ::testsuite::TestDuration::millisf(::djinni::F64::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::millisf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ms>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ms>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)microsf:(double)count { + (NSTimeInterval)microsf:(double)count {
try { try {
auto r = ::testsuite::TestDuration::microsf(::djinni::F64::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::microsf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_us>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_us>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (NSTimeInterval)nanosf:(double)count { + (NSTimeInterval)nanosf:(double)count {
try { try {
auto r = ::testsuite::TestDuration::nanosf(::djinni::F64::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::nanosf(::djinni::F64::toCpp(count));
return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ns>::fromCpp(r); return ::djinni::Duration<::djinni::F64, ::djinni::Duration_ns>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable NSNumber *)box:(int64_t)count { + (nullable NSNumber *)box:(int64_t)count {
try { try {
auto r = ::testsuite::TestDuration::box(::djinni::I64::toCpp(count)); auto objcpp_result_ = ::testsuite::TestDuration::box(::djinni::I64::toCpp(count));
return ::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::fromCpp(r); return ::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (int64_t)unbox:(nullable NSNumber *)dt { + (int64_t)unbox:(nullable NSNumber *)dt {
try { try {
auto r = ::testsuite::TestDuration::unbox(::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::toCpp(dt)); auto objcpp_result_ = ::testsuite::TestDuration::unbox(::djinni::Optional<std::experimental::optional, ::djinni::Duration<::djinni::I64, ::djinni::Duration_s>>::toCpp(dt));
return ::djinni::I64::fromCpp(r); return ::djinni::I64::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#import "DBTestHelpers.h" #import "DBTestHelpers.h"
#import "DBAssortedPrimitives+Private.h" #import "DBAssortedPrimitives+Private.h"
#import "DBClientInterface+Private.h" #import "DBClientInterface+Private.h"
#import "DBColor+Private.h"
#import "DBMapListRecord+Private.h" #import "DBMapListRecord+Private.h"
#import "DBNestedCollection+Private.h" #import "DBNestedCollection+Private.h"
#import "DBPrimitiveList+Private.h" #import "DBPrimitiveList+Private.h"
...@@ -14,6 +15,7 @@ ...@@ -14,6 +15,7 @@
#import "DJIError.h" #import "DJIError.h"
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -38,85 +40,85 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -38,85 +40,85 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nonnull DBSetRecord *)getSetRecord { + (nonnull DBSetRecord *)getSetRecord {
try { try {
auto r = ::testsuite::TestHelpers::get_set_record(); auto objcpp_result_ = ::testsuite::TestHelpers::get_set_record();
return ::djinni_generated::SetRecord::fromCpp(r); return ::djinni_generated::SetRecord::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkSetRecord:(nonnull DBSetRecord *)rec { + (BOOL)checkSetRecord:(nonnull DBSetRecord *)rec {
try { try {
auto r = ::testsuite::TestHelpers::check_set_record(::djinni_generated::SetRecord::toCpp(rec)); auto objcpp_result_ = ::testsuite::TestHelpers::check_set_record(::djinni_generated::SetRecord::toCpp(rec));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBPrimitiveList *)getPrimitiveList { + (nonnull DBPrimitiveList *)getPrimitiveList {
try { try {
auto r = ::testsuite::TestHelpers::get_primitive_list(); auto objcpp_result_ = ::testsuite::TestHelpers::get_primitive_list();
return ::djinni_generated::PrimitiveList::fromCpp(r); return ::djinni_generated::PrimitiveList::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkPrimitiveList:(nonnull DBPrimitiveList *)pl { + (BOOL)checkPrimitiveList:(nonnull DBPrimitiveList *)pl {
try { try {
auto r = ::testsuite::TestHelpers::check_primitive_list(::djinni_generated::PrimitiveList::toCpp(pl)); auto objcpp_result_ = ::testsuite::TestHelpers::check_primitive_list(::djinni_generated::PrimitiveList::toCpp(pl));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBNestedCollection *)getNestedCollection { + (nonnull DBNestedCollection *)getNestedCollection {
try { try {
auto r = ::testsuite::TestHelpers::get_nested_collection(); auto objcpp_result_ = ::testsuite::TestHelpers::get_nested_collection();
return ::djinni_generated::NestedCollection::fromCpp(r); return ::djinni_generated::NestedCollection::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkNestedCollection:(nonnull DBNestedCollection *)nc { + (BOOL)checkNestedCollection:(nonnull DBNestedCollection *)nc {
try { try {
auto r = ::testsuite::TestHelpers::check_nested_collection(::djinni_generated::NestedCollection::toCpp(nc)); auto objcpp_result_ = ::testsuite::TestHelpers::check_nested_collection(::djinni_generated::NestedCollection::toCpp(nc));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSDictionary<NSString *, NSNumber *> *)getMap { + (nonnull NSDictionary<NSString *, NSNumber *> *)getMap {
try { try {
auto r = ::testsuite::TestHelpers::get_map(); auto objcpp_result_ = ::testsuite::TestHelpers::get_map();
return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(r); return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkMap:(nonnull NSDictionary<NSString *, NSNumber *> *)m { + (BOOL)checkMap:(nonnull NSDictionary<NSString *, NSNumber *> *)m {
try { try {
auto r = ::testsuite::TestHelpers::check_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m)); auto objcpp_result_ = ::testsuite::TestHelpers::check_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSDictionary<NSString *, NSNumber *> *)getEmptyMap { + (nonnull NSDictionary<NSString *, NSNumber *> *)getEmptyMap {
try { try {
auto r = ::testsuite::TestHelpers::get_empty_map(); auto objcpp_result_ = ::testsuite::TestHelpers::get_empty_map();
return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(r); return ::djinni::Map<::djinni::String, ::djinni::I64>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkEmptyMap:(nonnull NSDictionary<NSString *, NSNumber *> *)m { + (BOOL)checkEmptyMap:(nonnull NSDictionary<NSString *, NSNumber *> *)m {
try { try {
auto r = ::testsuite::TestHelpers::check_empty_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m)); auto objcpp_result_ = ::testsuite::TestHelpers::check_empty_map(::djinni::Map<::djinni::String, ::djinni::I64>::toCpp(m));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBMapListRecord *)getMapListRecord { + (nonnull DBMapListRecord *)getMapListRecord {
try { try {
auto r = ::testsuite::TestHelpers::get_map_list_record(); auto objcpp_result_ = ::testsuite::TestHelpers::get_map_list_record();
return ::djinni_generated::MapListRecord::fromCpp(r); return ::djinni_generated::MapListRecord::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkMapListRecord:(nonnull DBMapListRecord *)m { + (BOOL)checkMapListRecord:(nonnull DBMapListRecord *)m {
try { try {
auto r = ::testsuite::TestHelpers::check_map_list_record(::djinni_generated::MapListRecord::toCpp(m)); auto objcpp_result_ = ::testsuite::TestHelpers::check_map_list_record(::djinni_generated::MapListRecord::toCpp(m));
return ::djinni::Bool::fromCpp(r); return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -152,15 +154,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -152,15 +154,15 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nullable id<DBUserToken>)tokenId:(nullable id<DBUserToken>)t { + (nullable id<DBUserToken>)tokenId:(nullable id<DBUserToken>)t {
try { try {
auto r = ::testsuite::TestHelpers::token_id(::djinni_generated::UserToken::toCpp(t)); auto objcpp_result_ = ::testsuite::TestHelpers::token_id(::djinni_generated::UserToken::toCpp(t));
return ::djinni_generated::UserToken::fromCpp(r); return ::djinni_generated::UserToken::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nullable id<DBUserToken>)createCppToken { + (nullable id<DBUserToken>)createCppToken {
try { try {
auto r = ::testsuite::TestHelpers::create_cpp_token(); auto objcpp_result_ = ::testsuite::TestHelpers::create_cpp_token();
return ::djinni_generated::UserToken::fromCpp(r); return ::djinni_generated::UserToken::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -172,8 +174,8 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -172,8 +174,8 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (int64_t)cppTokenId:(nullable id<DBUserToken>)t { + (int64_t)cppTokenId:(nullable id<DBUserToken>)t {
try { try {
auto r = ::testsuite::TestHelpers::cpp_token_id(::djinni_generated::UserToken::toCpp(t)); auto objcpp_result_ = ::testsuite::TestHelpers::cpp_token_id(::djinni_generated::UserToken::toCpp(t));
return ::djinni::I64::fromCpp(r); return ::djinni::I64::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -187,22 +189,22 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -187,22 +189,22 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
+ (nullable NSNumber *)returnNone { + (nullable NSNumber *)returnNone {
try { try {
auto r = ::testsuite::TestHelpers::return_none(); auto objcpp_result_ = ::testsuite::TestHelpers::return_none();
return ::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(r); return ::djinni::Optional<std::experimental::optional, ::djinni::I32>::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull DBAssortedPrimitives *)assortedPrimitivesId:(nonnull DBAssortedPrimitives *)i { + (nonnull DBAssortedPrimitives *)assortedPrimitivesId:(nonnull DBAssortedPrimitives *)i {
try { try {
auto r = ::testsuite::TestHelpers::assorted_primitives_id(::djinni_generated::AssortedPrimitives::toCpp(i)); auto objcpp_result_ = ::testsuite::TestHelpers::assorted_primitives_id(::djinni_generated::AssortedPrimitives::toCpp(i));
return ::djinni_generated::AssortedPrimitives::fromCpp(r); return ::djinni_generated::AssortedPrimitives::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (nonnull NSData *)idBinary:(nonnull NSData *)b { + (nonnull NSData *)idBinary:(nonnull NSData *)b {
try { try {
auto r = ::testsuite::TestHelpers::id_binary(::djinni::Binary::toCpp(b)); auto objcpp_result_ = ::testsuite::TestHelpers::id_binary(::djinni::Binary::toCpp(b));
return ::djinni::Binary::fromCpp(r); return ::djinni::Binary::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "DJIMarshal+Private.h" #import "DJIMarshal+Private.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -32,8 +33,8 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -32,8 +33,8 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
- (nonnull NSString *)whoami { - (nonnull NSString *)whoami {
try { try {
auto r = _cppRefHandle.get()->whoami(); auto objcpp_result_ = _cppRefHandle.get()->whoami();
return ::djinni::String::fromCpp(r); return ::djinni::String::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
...@@ -48,8 +49,8 @@ public: ...@@ -48,8 +49,8 @@ public:
std::string whoami() override std::string whoami() override
{ {
@autoreleasepool { @autoreleasepool {
auto r = [Handle::get() whoami]; auto objcpp_result_ = [Handle::get() whoami];
return ::djinni::String::toCpp(r); return ::djinni::String::toCpp(objcpp_result_);
} }
} }
}; };
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#import "DJIError.h" #import "DJIError.h"
#import "DJIObjcWrapperCache+Private.h" #import "DJIObjcWrapperCache+Private.h"
#include <exception> #include <exception>
#include <stdexcept>
#include <utility> #include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file"); static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
...@@ -37,12 +38,26 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -37,12 +38,26 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
- (void)callForJava:(nullable id<DBJavaOnlyListener>)l { - (nullable id<DBObjcOnlyListener>)returnForObjC {
try {
auto objcpp_result_ = _cppRefHandle.get()->returnForObjC();
return ::djinni_generated::ObjcOnlyListener::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
- (void)callForJava:(nullable DBJavaOnlyListener *)l {
try { try {
_cppRefHandle.get()->callForJava(::djinni_generated::JavaOnlyListener::toCpp(l)); _cppRefHandle.get()->callForJava(::djinni_generated::JavaOnlyListener::toCpp(l));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
- (nullable DBJavaOnlyListener *)returnForJava {
try {
auto objcpp_result_ = _cppRefHandle.get()->returnForJava();
return ::djinni_generated::JavaOnlyListener::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
namespace djinni_generated { namespace djinni_generated {
class UsesSingleLanguageListeners::ObjcProxy final class UsesSingleLanguageListeners::ObjcProxy final
...@@ -57,12 +72,26 @@ public: ...@@ -57,12 +72,26 @@ public:
[Handle::get() callForObjC:(::djinni_generated::ObjcOnlyListener::fromCpp(c_l))]; [Handle::get() callForObjC:(::djinni_generated::ObjcOnlyListener::fromCpp(c_l))];
} }
} }
std::shared_ptr<::testsuite::ObjcOnlyListener> returnForObjC() override
{
@autoreleasepool {
auto objcpp_result_ = [Handle::get() returnForObjC];
return ::djinni_generated::ObjcOnlyListener::toCpp(objcpp_result_);
}
}
void callForJava(const std::shared_ptr<::testsuite::JavaOnlyListener> & c_l) override void callForJava(const std::shared_ptr<::testsuite::JavaOnlyListener> & c_l) override
{ {
@autoreleasepool { @autoreleasepool {
[Handle::get() callForJava:(::djinni_generated::JavaOnlyListener::fromCpp(c_l))]; [Handle::get() callForJava:(::djinni_generated::JavaOnlyListener::fromCpp(c_l))];
} }
} }
std::shared_ptr<::testsuite::JavaOnlyListener> returnForJava() override
{
@autoreleasepool {
auto objcpp_result_ = [Handle::get() returnForJava];
return ::djinni_generated::JavaOnlyListener::toCpp(objcpp_result_);
}
}
}; };
} // namespace djinni_generated } // namespace djinni_generated
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// This file generated by Djinni from single_language_interfaces.djinni // This file generated by Djinni from single_language_interfaces.djinni
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@protocol DBJavaOnlyListener; @class DBJavaOnlyListener;
@protocol DBObjcOnlyListener; @protocol DBObjcOnlyListener;
...@@ -14,6 +14,10 @@ ...@@ -14,6 +14,10 @@
- (void)callForObjC:(nullable id<DBObjcOnlyListener>)l; - (void)callForObjC:(nullable id<DBObjcOnlyListener>)l;
- (void)callForJava:(nullable id<DBJavaOnlyListener>)l; - (nullable id<DBObjcOnlyListener>)returnForObjC;
- (void)callForJava:(nullable DBJavaOnlyListener *)l;
- (nullable DBJavaOnlyListener *)returnForJava;
@end @end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#include "_varname_interface_.hpp"
#include <memory>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBVarnameInterface;
namespace djinni_generated {
class VarnameInterface
{
public:
using CppType = std::shared_ptr<::testsuite::VarnameInterface>;
using CppOptType = std::shared_ptr<::testsuite::VarnameInterface>;
using ObjcType = DBVarnameInterface*;
using Boxed = VarnameInterface;
static CppType toCpp(ObjcType objc);
static ObjcType fromCppOpt(const CppOptType& cpp);
static ObjcType fromCpp(const CppType& cpp) { return fromCppOpt(cpp); }
private:
class ObjcProxy;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#import "DBVarnameInterface+Private.h"
#import "DBVarnameInterface.h"
#import "DBVarnameRecord+Private.h"
#import "DJICppWrapperCache+Private.h"
#import "DJIError.h"
#include <exception>
#include <stdexcept>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface DBVarnameInterface ()
- (id)initWithCpp:(const std::shared_ptr<::testsuite::VarnameInterface>&)cppRef;
@end
@implementation DBVarnameInterface {
::djinni::CppProxyCache::Handle<std::shared_ptr<::testsuite::VarnameInterface>> _cppRefHandle;
}
- (id)initWithCpp:(const std::shared_ptr<::testsuite::VarnameInterface>&)cppRef
{
if (self = [super init]) {
_cppRefHandle.assign(cppRef);
}
return self;
}
- (nonnull DBVarnameRecord *)Rmethod:(nonnull DBVarnameRecord *)RArg {
try {
auto objcpp_result_ = _cppRefHandle.get()->_rmethod_(::djinni_generated::VarnameRecord::toCpp(RArg));
return ::djinni_generated::VarnameRecord::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
- (nullable DBVarnameInterface *)Imethod:(nullable DBVarnameInterface *)IArg {
try {
auto objcpp_result_ = _cppRefHandle.get()->_imethod_(::djinni_generated::VarnameInterface::toCpp(IArg));
return ::djinni_generated::VarnameInterface::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
namespace djinni_generated {
auto VarnameInterface::toCpp(ObjcType objc) -> CppType
{
if (!objc) {
return nullptr;
}
return objc->_cppRefHandle.get();
}
auto VarnameInterface::fromCppOpt(const CppOptType& cpp) -> ObjcType
{
if (!cpp) {
return nil;
}
return ::djinni::get_cpp_proxy<DBVarnameInterface>(cpp);
}
} // namespace djinni_generated
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#import "DBVarnameRecord.h"
#import <Foundation/Foundation.h>
@class DBVarnameInterface;
@interface DBVarnameInterface : NSObject
- (nonnull DBVarnameRecord *)Rmethod:(nonnull DBVarnameRecord *)RArg;
- (nullable DBVarnameInterface *)Imethod:(nullable DBVarnameInterface *)IArg;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#import "DBVarnameRecord.h"
#include "_varname_record_.hpp"
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBVarnameRecord;
namespace djinni_generated {
struct VarnameRecord
{
using CppType = ::testsuite::VarnameRecord;
using ObjcType = DBVarnameRecord*;
using Boxed = VarnameRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#import "DBVarnameRecord+Private.h"
#import "DJIMarshal+Private.h"
#include <cassert>
namespace djinni_generated {
auto VarnameRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
return {::djinni::I8::toCpp(obj.Field)};
}
auto VarnameRecord::fromCpp(const CppType& cpp) -> ObjcType
{
return [[DBVarnameRecord alloc] initWithField:(::djinni::I8::fromCpp(cpp._field_))];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#import <Foundation/Foundation.h>
/**
* Underscore is used as a separator in Djinni names, so we don't really
* anticipate it to be used as a prefix/suffix. Some name styles behave
* badly when it is. However this test case ensures we at least don't crash.
*/
@interface DBVarnameRecord : NSObject
- (nonnull instancetype)initWithField:(int8_t)Field;
+ (nonnull instancetype)VarnameRecordWithField:(int8_t)Field;
@property (nonatomic, readonly) int8_t Field;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from varnames.djinni
#import "DBVarnameRecord.h"
@implementation DBVarnameRecord
- (nonnull instancetype)initWithField:(int8_t)Field
{
if (self = [super init]) {
_Field = Field;
}
return self;
}
+ (nonnull instancetype)VarnameRecordWithField:(int8_t)Field
{
return [[self alloc] initWithField:Field];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ %p Field:%@>", self.class, (void *)self, @(self.Field)];
}
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#include "wchar_test_helpers.hpp"
#include <memory>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBWcharTestHelpers;
namespace djinni_generated {
class WcharTestHelpers
{
public:
using CppType = std::shared_ptr<::testsuite::WcharTestHelpers>;
using CppOptType = std::shared_ptr<::testsuite::WcharTestHelpers>;
using ObjcType = DBWcharTestHelpers*;
using Boxed = WcharTestHelpers;
static CppType toCpp(ObjcType objc);
static ObjcType fromCppOpt(const CppOptType& cpp);
static ObjcType fromCpp(const CppType& cpp) { return fromCppOpt(cpp); }
private:
class ObjcProxy;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#import "DBWcharTestHelpers+Private.h"
#import "DBWcharTestHelpers.h"
#import "DBWcharTestRec+Private.h"
#import "DJICppWrapperCache+Private.h"
#import "DJIError.h"
#import "DJIMarshal+Private.h"
#include <exception>
#include <stdexcept>
#include <utility>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@interface DBWcharTestHelpers ()
- (id)initWithCpp:(const std::shared_ptr<::testsuite::WcharTestHelpers>&)cppRef;
@end
@implementation DBWcharTestHelpers {
::djinni::CppProxyCache::Handle<std::shared_ptr<::testsuite::WcharTestHelpers>> _cppRefHandle;
}
- (id)initWithCpp:(const std::shared_ptr<::testsuite::WcharTestHelpers>&)cppRef
{
if (self = [super init]) {
_cppRefHandle.assign(cppRef);
}
return self;
}
+ (nonnull DBWcharTestRec *)getRecord {
try {
auto objcpp_result_ = ::testsuite::WcharTestHelpers::get_record();
return ::djinni_generated::WcharTestRec::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (nonnull NSString *)getString {
try {
auto objcpp_result_ = ::testsuite::WcharTestHelpers::get_string();
return ::djinni::WString::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (BOOL)checkString:(nonnull NSString *)str {
try {
auto objcpp_result_ = ::testsuite::WcharTestHelpers::check_string(::djinni::WString::toCpp(str));
return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (BOOL)checkRecord:(nonnull DBWcharTestRec *)rec {
try {
auto objcpp_result_ = ::testsuite::WcharTestHelpers::check_record(::djinni_generated::WcharTestRec::toCpp(rec));
return ::djinni::Bool::fromCpp(objcpp_result_);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
namespace djinni_generated {
auto WcharTestHelpers::toCpp(ObjcType objc) -> CppType
{
if (!objc) {
return nullptr;
}
return objc->_cppRefHandle.get();
}
auto WcharTestHelpers::fromCppOpt(const CppOptType& cpp) -> ObjcType
{
if (!cpp) {
return nil;
}
return ::djinni::get_cpp_proxy<DBWcharTestHelpers>(cpp);
}
} // namespace djinni_generated
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#import "DBWcharTestRec.h"
#import <Foundation/Foundation.h>
@interface DBWcharTestHelpers : NSObject
+ (nonnull DBWcharTestRec *)getRecord;
+ (nonnull NSString *)getString;
+ (BOOL)checkString:(nonnull NSString *)str;
+ (BOOL)checkRecord:(nonnull DBWcharTestRec *)rec;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#import "DBWcharTestRec.h"
#include "wchar_test_rec.hpp"
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@class DBWcharTestRec;
namespace djinni_generated {
struct WcharTestRec
{
using CppType = ::testsuite::WcharTestRec;
using ObjcType = DBWcharTestRec*;
using Boxed = WcharTestRec;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#import "DBWcharTestRec+Private.h"
#import "DJIMarshal+Private.h"
#include <cassert>
namespace djinni_generated {
auto WcharTestRec::toCpp(ObjcType obj) -> CppType
{
assert(obj);
return {::djinni::WString::toCpp(obj.s)};
}
auto WcharTestRec::fromCpp(const CppType& cpp) -> ObjcType
{
return [[DBWcharTestRec alloc] initWithS:(::djinni::WString::fromCpp(cpp.s))];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#import <Foundation/Foundation.h>
@interface DBWcharTestRec : NSObject
- (nonnull instancetype)initWithS:(nonnull NSString *)s;
+ (nonnull instancetype)wcharTestRecWithS:(nonnull NSString *)s;
@property (nonatomic, readonly, nonnull) NSString * s;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from wchar_test.djinni
#import "DBWcharTestRec.h"
@implementation DBWcharTestRec
- (nonnull instancetype)initWithS:(nonnull NSString *)s
{
if (self = [super init]) {
_s = [s copy];
}
return self;
}
+ (nonnull instancetype)wcharTestRecWithS:(nonnull NSString *)s
{
return [[self alloc] initWithS:s];
}
- (NSString *)description
{
return [NSString stringWithFormat:@"<%@ %p s:%@>", self.class, (void *)self, self.s];
}
@end
...@@ -4,8 +4,14 @@ djinni-output-temp/cpp/record_with_duration_and_derivings.cpp ...@@ -4,8 +4,14 @@ djinni-output-temp/cpp/record_with_duration_and_derivings.cpp
djinni-output-temp/cpp/date_record.hpp djinni-output-temp/cpp/date_record.hpp
djinni-output-temp/cpp/date_record.cpp djinni-output-temp/cpp/date_record.cpp
djinni-output-temp/cpp/map_date_record.hpp djinni-output-temp/cpp/map_date_record.hpp
djinni-output-temp/cpp/_varname_record_.hpp
djinni-output-temp/cpp/_varname_interface_.hpp
djinni-output-temp/cpp/extended_record_base.hpp djinni-output-temp/cpp/extended_record_base.hpp
djinni-output-temp/cpp/extended_record_base.cpp djinni-output-temp/cpp/extended_record_base.cpp
djinni-output-temp/cpp/record_using_extended_record.hpp
djinni-output-temp/cpp/record_using_extended_record.cpp
djinni-output-temp/cpp/interface_using_extended_record.hpp
djinni-output-temp/cpp/interface_using_extended_record.cpp
djinni-output-temp/cpp/objc_only_listener.hpp djinni-output-temp/cpp/objc_only_listener.hpp
djinni-output-temp/cpp/java_only_listener.hpp djinni-output-temp/cpp/java_only_listener.hpp
djinni-output-temp/cpp/uses_single_language_listeners.hpp djinni-output-temp/cpp/uses_single_language_listeners.hpp
...@@ -27,7 +33,8 @@ djinni-output-temp/cpp/Conflict.hpp ...@@ -27,7 +33,8 @@ djinni-output-temp/cpp/Conflict.hpp
djinni-output-temp/cpp/conflict_user.hpp djinni-output-temp/cpp/conflict_user.hpp
djinni-output-temp/cpp/user_token.hpp djinni-output-temp/cpp/user_token.hpp
djinni-output-temp/cpp/color.hpp djinni-output-temp/cpp/color.hpp
djinni-output-temp/cpp/opt_color_record.hpp djinni-output-temp/cpp/enum_usage_record.hpp
djinni-output-temp/cpp/enum_usage_interface.hpp
djinni-output-temp/cpp/client_returned_record.hpp djinni-output-temp/cpp/client_returned_record.hpp
djinni-output-temp/cpp/client_interface.hpp djinni-output-temp/cpp/client_interface.hpp
djinni-output-temp/cpp/reverse_client_interface.hpp djinni-output-temp/cpp/reverse_client_interface.hpp
...@@ -45,7 +52,11 @@ djinni-output-temp/java/TestDuration.java ...@@ -45,7 +52,11 @@ djinni-output-temp/java/TestDuration.java
djinni-output-temp/java/RecordWithDurationAndDerivings.java djinni-output-temp/java/RecordWithDurationAndDerivings.java
djinni-output-temp/java/DateRecord.java djinni-output-temp/java/DateRecord.java
djinni-output-temp/java/MapDateRecord.java djinni-output-temp/java/MapDateRecord.java
djinni-output-temp/java/VarnameRecord.java
djinni-output-temp/java/VarnameInterface.java
djinni-output-temp/java/ExtendedRecord.java djinni-output-temp/java/ExtendedRecord.java
djinni-output-temp/java/RecordUsingExtendedRecord.java
djinni-output-temp/java/InterfaceUsingExtendedRecord.java
djinni-output-temp/java/ObjcOnlyListener.java djinni-output-temp/java/ObjcOnlyListener.java
djinni-output-temp/java/JavaOnlyListener.java djinni-output-temp/java/JavaOnlyListener.java
djinni-output-temp/java/UsesSingleLanguageListeners.java djinni-output-temp/java/UsesSingleLanguageListeners.java
...@@ -64,7 +75,8 @@ djinni-output-temp/java/Conflict.java ...@@ -64,7 +75,8 @@ djinni-output-temp/java/Conflict.java
djinni-output-temp/java/ConflictUser.java djinni-output-temp/java/ConflictUser.java
djinni-output-temp/java/UserToken.java djinni-output-temp/java/UserToken.java
djinni-output-temp/java/Color.java djinni-output-temp/java/Color.java
djinni-output-temp/java/OptColorRecord.java djinni-output-temp/java/EnumUsageRecord.java
djinni-output-temp/java/EnumUsageInterface.java
djinni-output-temp/java/ClientReturnedRecord.java djinni-output-temp/java/ClientReturnedRecord.java
djinni-output-temp/java/ClientInterface.java djinni-output-temp/java/ClientInterface.java
djinni-output-temp/java/ReverseClientInterface.java djinni-output-temp/java/ReverseClientInterface.java
...@@ -84,8 +96,16 @@ djinni-output-temp/jni/NativeDateRecord.hpp ...@@ -84,8 +96,16 @@ djinni-output-temp/jni/NativeDateRecord.hpp
djinni-output-temp/jni/NativeDateRecord.cpp djinni-output-temp/jni/NativeDateRecord.cpp
djinni-output-temp/jni/NativeMapDateRecord.hpp djinni-output-temp/jni/NativeMapDateRecord.hpp
djinni-output-temp/jni/NativeMapDateRecord.cpp djinni-output-temp/jni/NativeMapDateRecord.cpp
djinni-output-temp/jni/NativeVarnameRecord.hpp
djinni-output-temp/jni/NativeVarnameRecord.cpp
djinni-output-temp/jni/NativeVarnameInterface.hpp
djinni-output-temp/jni/NativeVarnameInterface.cpp
djinni-output-temp/jni/NativeExtendedRecord.hpp djinni-output-temp/jni/NativeExtendedRecord.hpp
djinni-output-temp/jni/NativeExtendedRecord.cpp djinni-output-temp/jni/NativeExtendedRecord.cpp
djinni-output-temp/jni/NativeRecordUsingExtendedRecord.hpp
djinni-output-temp/jni/NativeRecordUsingExtendedRecord.cpp
djinni-output-temp/jni/NativeInterfaceUsingExtendedRecord.hpp
djinni-output-temp/jni/NativeInterfaceUsingExtendedRecord.cpp
djinni-output-temp/jni/NativeObjcOnlyListener.hpp djinni-output-temp/jni/NativeObjcOnlyListener.hpp
djinni-output-temp/jni/NativeObjcOnlyListener.cpp djinni-output-temp/jni/NativeObjcOnlyListener.cpp
djinni-output-temp/jni/NativeJavaOnlyListener.hpp djinni-output-temp/jni/NativeJavaOnlyListener.hpp
...@@ -121,8 +141,10 @@ djinni-output-temp/jni/NativeConflictUser.cpp ...@@ -121,8 +141,10 @@ djinni-output-temp/jni/NativeConflictUser.cpp
djinni-output-temp/jni/NativeUserToken.hpp djinni-output-temp/jni/NativeUserToken.hpp
djinni-output-temp/jni/NativeUserToken.cpp djinni-output-temp/jni/NativeUserToken.cpp
djinni-output-temp/jni/NativeColor.hpp djinni-output-temp/jni/NativeColor.hpp
djinni-output-temp/jni/NativeOptColorRecord.hpp djinni-output-temp/jni/NativeEnumUsageRecord.hpp
djinni-output-temp/jni/NativeOptColorRecord.cpp djinni-output-temp/jni/NativeEnumUsageRecord.cpp
djinni-output-temp/jni/NativeEnumUsageInterface.hpp
djinni-output-temp/jni/NativeEnumUsageInterface.cpp
djinni-output-temp/jni/NativeClientReturnedRecord.hpp djinni-output-temp/jni/NativeClientReturnedRecord.hpp
djinni-output-temp/jni/NativeClientReturnedRecord.cpp djinni-output-temp/jni/NativeClientReturnedRecord.cpp
djinni-output-temp/jni/NativeClientInterface.hpp djinni-output-temp/jni/NativeClientInterface.hpp
...@@ -152,8 +174,15 @@ djinni-output-temp/objc/DBDateRecord.h ...@@ -152,8 +174,15 @@ djinni-output-temp/objc/DBDateRecord.h
djinni-output-temp/objc/DBDateRecord.mm djinni-output-temp/objc/DBDateRecord.mm
djinni-output-temp/objc/DBMapDateRecord.h djinni-output-temp/objc/DBMapDateRecord.h
djinni-output-temp/objc/DBMapDateRecord.mm djinni-output-temp/objc/DBMapDateRecord.mm
djinni-output-temp/objc/DBVarnameRecord.h
djinni-output-temp/objc/DBVarnameRecord.mm
djinni-output-temp/objc/DBVarnameInterface.h
djinni-output-temp/objc/DBExtendedRecord.h djinni-output-temp/objc/DBExtendedRecord.h
djinni-output-temp/objc/DBExtendedRecord.mm djinni-output-temp/objc/DBExtendedRecord.mm
djinni-output-temp/objc/DBRecordUsingExtendedRecord.h
djinni-output-temp/objc/DBRecordUsingExtendedRecord.mm
djinni-output-temp/objc/DBInterfaceUsingExtendedRecord.h
djinni-output-temp/objc/DBInterfaceUsingExtendedRecord.mm
djinni-output-temp/objc/DBObjcOnlyListener.h djinni-output-temp/objc/DBObjcOnlyListener.h
djinni-output-temp/objc/DBJavaOnlyListener.h djinni-output-temp/objc/DBJavaOnlyListener.h
djinni-output-temp/objc/DBUsesSingleLanguageListeners.h djinni-output-temp/objc/DBUsesSingleLanguageListeners.h
...@@ -177,8 +206,9 @@ djinni-output-temp/objc/DBConflict.h ...@@ -177,8 +206,9 @@ djinni-output-temp/objc/DBConflict.h
djinni-output-temp/objc/DBConflictUser.h djinni-output-temp/objc/DBConflictUser.h
djinni-output-temp/objc/DBUserToken.h djinni-output-temp/objc/DBUserToken.h
djinni-output-temp/objc/DBColor.h djinni-output-temp/objc/DBColor.h
djinni-output-temp/objc/DBOptColorRecord.h djinni-output-temp/objc/DBEnumUsageRecord.h
djinni-output-temp/objc/DBOptColorRecord.mm djinni-output-temp/objc/DBEnumUsageRecord.mm
djinni-output-temp/objc/DBEnumUsageInterface.h
djinni-output-temp/objc/DBClientReturnedRecord.h djinni-output-temp/objc/DBClientReturnedRecord.h
djinni-output-temp/objc/DBClientReturnedRecord.mm djinni-output-temp/objc/DBClientReturnedRecord.mm
djinni-output-temp/objc/DBClientInterface.h djinni-output-temp/objc/DBClientInterface.h
...@@ -206,8 +236,16 @@ djinni-output-temp/objc/DBDateRecord+Private.h ...@@ -206,8 +236,16 @@ djinni-output-temp/objc/DBDateRecord+Private.h
djinni-output-temp/objc/DBDateRecord+Private.mm djinni-output-temp/objc/DBDateRecord+Private.mm
djinni-output-temp/objc/DBMapDateRecord+Private.h djinni-output-temp/objc/DBMapDateRecord+Private.h
djinni-output-temp/objc/DBMapDateRecord+Private.mm djinni-output-temp/objc/DBMapDateRecord+Private.mm
djinni-output-temp/objc/DBVarnameRecord+Private.h
djinni-output-temp/objc/DBVarnameRecord+Private.mm
djinni-output-temp/objc/DBVarnameInterface+Private.h
djinni-output-temp/objc/DBVarnameInterface+Private.mm
djinni-output-temp/objc/DBExtendedRecord+Private.h djinni-output-temp/objc/DBExtendedRecord+Private.h
djinni-output-temp/objc/DBExtendedRecord+Private.mm djinni-output-temp/objc/DBExtendedRecord+Private.mm
djinni-output-temp/objc/DBRecordUsingExtendedRecord+Private.h
djinni-output-temp/objc/DBRecordUsingExtendedRecord+Private.mm
djinni-output-temp/objc/DBInterfaceUsingExtendedRecord+Private.h
djinni-output-temp/objc/DBInterfaceUsingExtendedRecord+Private.mm
djinni-output-temp/objc/DBObjcOnlyListener+Private.h djinni-output-temp/objc/DBObjcOnlyListener+Private.h
djinni-output-temp/objc/DBObjcOnlyListener+Private.mm djinni-output-temp/objc/DBObjcOnlyListener+Private.mm
djinni-output-temp/objc/DBJavaOnlyListener+Private.h djinni-output-temp/objc/DBJavaOnlyListener+Private.h
...@@ -242,8 +280,11 @@ djinni-output-temp/objc/DBConflictUser+Private.h ...@@ -242,8 +280,11 @@ djinni-output-temp/objc/DBConflictUser+Private.h
djinni-output-temp/objc/DBConflictUser+Private.mm djinni-output-temp/objc/DBConflictUser+Private.mm
djinni-output-temp/objc/DBUserToken+Private.h djinni-output-temp/objc/DBUserToken+Private.h
djinni-output-temp/objc/DBUserToken+Private.mm djinni-output-temp/objc/DBUserToken+Private.mm
djinni-output-temp/objc/DBOptColorRecord+Private.h djinni-output-temp/objc/DBColor+Private.h
djinni-output-temp/objc/DBOptColorRecord+Private.mm djinni-output-temp/objc/DBEnumUsageRecord+Private.h
djinni-output-temp/objc/DBEnumUsageRecord+Private.mm
djinni-output-temp/objc/DBEnumUsageInterface+Private.h
djinni-output-temp/objc/DBEnumUsageInterface+Private.mm
djinni-output-temp/objc/DBClientReturnedRecord+Private.h djinni-output-temp/objc/DBClientReturnedRecord+Private.h
djinni-output-temp/objc/DBClientReturnedRecord+Private.mm djinni-output-temp/objc/DBClientReturnedRecord+Private.mm
djinni-output-temp/objc/DBClientInterface+Private.h djinni-output-temp/objc/DBClientInterface+Private.h
......
#include "extended_record.hpp" #include "extended_record.hpp"
// Validate these generated headers are compilable.
#include "record_using_extended_record.hpp"
#include "interface_using_extended_record.hpp"
using namespace testsuite; using namespace testsuite;
ExtendedRecord::ExtendedRecord() : ExtendedRecordBase(true) {} ExtendedRecord::ExtendedRecord() : ExtendedRecordBase(true) {}
// Copyright (C) 2011 - 2012 Andrzej Krzemienski.
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0, as follows:
//
// Boost Software License - Version 1.0 - August 17th, 2003
//
// Permission is hereby granted, free of charge, to any person or organization
// obtaining a copy of the software and accompanying documentation covered by
// this license (the "Software") to use, reproduce, display, distribute,
// execute, and transmit the Software, and to prepare derivative works of the
// Software, and to permit third-parties to whom the Software is furnished to
// do so, all subject to the following:
//
// The copyright notices in the Software and this entire statement, including
// the above license grant, this restriction and the following disclaimer,
// must be included in all copies of the Software, in whole or in part, and
// all derivative works of the Software, unless such copies or derivative
// works are solely in the form of machine-executable object code generated by
// a source language processor.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
// SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
// FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// The idea and interface is based on Boost.Optional library
// authored by Fernando Luis Cacciola Carballal
# ifndef ___OPTIONAL_HPP___
# define ___OPTIONAL_HPP___
# include <utility>
# include <type_traits>
# include <initializer_list>
# include <cassert>
# include <functional>
# include <string>
# include <stdexcept>
# define REQUIRES(...) typename enable_if<__VA_ARGS__::value, bool>::type = false
# if defined __clang__
# if (__clang_major__ > 2) || (__clang_major__ == 2) && (__clang_minor__ >= 9)
# define OPTIONAL_HAS_THIS_RVALUE_REFS 1
# else
# define OPTIONAL_HAS_THIS_RVALUE_REFS 0
# endif
# else
# define OPTIONAL_HAS_THIS_RVALUE_REFS 0
# endif
namespace std{
namespace experimental{
// 20.5.4, optional for object types
template <class T> class optional;
// 20.5.5, optional for lvalue reference types
template <class T> class optional<T&>;
// workaround: std utility functions aren't constexpr yet
template <class T> inline constexpr T&& constexpr_forward(typename std::remove_reference<T>::type& t) noexcept
{
return static_cast<T&&>(t);
}
template <class T> inline constexpr T&& constexpr_forward(typename std::remove_reference<T>::type&& t) noexcept
{
static_assert(!std::is_lvalue_reference<T>::value, "!!");
return static_cast<T&&>(t);
}
template <class T> inline constexpr typename std::remove_reference<T>::type&& constexpr_move(T&& t) noexcept
{
return static_cast<typename std::remove_reference<T>::type&&>(t);
}
template<class _Ty> inline constexpr _Ty * constexpr_addressof(_Ty& _Val)
{
return ((_Ty *) &(char&)_Val);
}
#if defined NDEBUG
# define ASSERTED_EXPRESSION(CHECK, EXPR) (EXPR)
#else
# define ASSERTED_EXPRESSION(CHECK, EXPR) ((CHECK) ? (EXPR) : ([]{assert(#CHECK && false);}(), (EXPR)))
#endif
template <typename T>
struct has_overloaded_addressof
{
template <class X>
static constexpr bool has_overload(...) { return false; }
template <class X, size_t S = sizeof(std::declval< X&>().operator&()) >
static constexpr bool has_overload(bool) { return true; }
constexpr static bool value = has_overload<T>(true);
};
template <typename T, REQUIRES(!has_overloaded_addressof<T>)>
constexpr T* static_addressof(T& ref)
{
return &ref;
}
template <typename T, REQUIRES(has_overloaded_addressof<T>)>
T* static_addressof(T& ref)
{
return std::addressof(ref);
}
template <class U>
struct is_not_optional
{
constexpr static bool value = true;
};
template <class T>
struct is_not_optional<optional<T>>
{
constexpr static bool value = false;
};
constexpr struct trivial_init_t{} trivial_init{};
// 20.5.6, In-place construction
constexpr struct in_place_t{} in_place{};
// 20.5.7, Disengaged state indicator
struct nullopt_t
{
struct init{};
constexpr nullopt_t(init){};
};
constexpr nullopt_t nullopt{nullopt_t::init()};
// 20.5.8, class bad_optional_access
class bad_optional_access : public logic_error {
public:
explicit bad_optional_access(const string& what_arg) : logic_error{what_arg} {}
explicit bad_optional_access(const char* what_arg) : logic_error{what_arg} {}
};
template <class T>
union storage_t
{
unsigned char dummy_;
T value_;
constexpr storage_t( trivial_init_t ) noexcept : dummy_() {};
template <class... Args>
constexpr storage_t( Args&&... args ) : value_(constexpr_forward<Args>(args)...) {}
~storage_t(){}
};
template <class T>
union constexpr_storage_t
{
unsigned char dummy_;
T value_;
constexpr constexpr_storage_t( trivial_init_t ) noexcept : dummy_() {};
template <class... Args>
constexpr constexpr_storage_t( Args&&... args ) : value_(constexpr_forward<Args>(args)...) {}
~constexpr_storage_t() = default;
};
constexpr struct only_set_initialized_t{} only_set_initialized{};
template <class T>
struct optional_base
{
bool init_;
storage_t<T> storage_;
constexpr optional_base() noexcept : init_(false), storage_(trivial_init) {};
constexpr explicit optional_base(only_set_initialized_t, bool init) noexcept : init_(init), storage_(trivial_init) {};
explicit constexpr optional_base(const T& v) : init_(true), storage_(v) {}
explicit constexpr optional_base(T&& v) : init_(true), storage_(constexpr_move(v)) {}
template <class... Args> explicit optional_base(in_place_t, Args&&... args)
: init_(true), storage_(constexpr_forward<Args>(args)...) {}
template <class U, class... Args, REQUIRES(is_constructible<T, std::initializer_list<U>>)>
explicit optional_base(in_place_t, std::initializer_list<U> il, Args&&... args)
: init_(true), storage_(il, std::forward<Args>(args)...) {}
~optional_base() { if (init_) storage_.value_.T::~T(); }
};
template <class T>
struct constexpr_optional_base
{
bool init_;
constexpr_storage_t<T> storage_;
constexpr constexpr_optional_base() noexcept : init_(false), storage_(trivial_init) {};
constexpr explicit constexpr_optional_base(only_set_initialized_t, bool init) noexcept : init_(init), storage_(trivial_init) {};
explicit constexpr constexpr_optional_base(const T& v) : init_(true), storage_(v) {}
explicit constexpr constexpr_optional_base(T&& v) : init_(true), storage_(constexpr_move(v)) {}
template <class... Args> explicit constexpr constexpr_optional_base(in_place_t, Args&&... args)
: init_(true), storage_(constexpr_forward<Args>(args)...) {}
template <class U, class... Args, REQUIRES(is_constructible<T, std::initializer_list<U>>)>
explicit constexpr_optional_base(in_place_t, std::initializer_list<U> il, Args&&... args)
: init_(true), storage_(il, std::forward<Args>(args)...) {}
~constexpr_optional_base() = default;
};
template <class T>
using OptionalBase = typename std::conditional<
std::is_trivially_destructible<T>::value,
constexpr_optional_base<T>,
optional_base<T>
>::type;
template <typename T>
constexpr bool is_nothrow_swappable_() {
using std::swap;
return noexcept(swap(std::declval<T&>(), std::declval<T&>()));
}
template <class T>
class optional : private OptionalBase<T>
{
static_assert( !std::is_same<typename std::decay<T>::type, nullopt_t>::value, "bad T" );
static_assert( !std::is_same<typename std::decay<T>::type, in_place_t>::value, "bad T" );
constexpr bool initialized() const noexcept { return OptionalBase<T>::init_; }
T* dataptr() { return std::addressof(OptionalBase<T>::storage_.value_); }
constexpr const T* dataptr() const { return static_addressof(OptionalBase<T>::storage_.value_); }
# if OPTIONAL_HAS_THIS_RVALUE_REFS == 1
constexpr const T& contained_val() const& { return OptionalBase<T>::storage_.value_; }
T& contained_val() & { return OptionalBase<T>::storage_.value_; }
T&& contained_val() && { return std::move(OptionalBase<T>::storage_.value_); }
# else
constexpr const T& contained_val() const { return OptionalBase<T>::storage_.value_; }
T& contained_val() { return OptionalBase<T>::storage_.value_; }
# endif
void clear() noexcept {
if (initialized()) dataptr()->T::~T();
OptionalBase<T>::init_ = false;
}
template <class... Args>
void initialize(Args&&... args) noexcept(noexcept(T(std::forward<Args>(args)...)))
{
assert(!OptionalBase<T>::init_);
new (dataptr()) T(std::forward<Args>(args)...);
OptionalBase<T>::init_ = true;
}
template <class U, class... Args>
void initialize(std::initializer_list<U> il, Args&&... args) noexcept(noexcept(T(il, std::forward<Args>(args)...)))
{
assert(!OptionalBase<T>::init_);
new (dataptr()) T(il, std::forward<Args>(args)...);
OptionalBase<T>::init_ = true;
}
public:
typedef T value_type;
// 20.5.5.1, constructors
constexpr optional() noexcept : OptionalBase<T>() {};
constexpr optional(nullopt_t) noexcept : OptionalBase<T>() {};
optional(const optional& rhs)
: OptionalBase<T>(only_set_initialized, rhs.initialized())
{
if (rhs.initialized()) new (dataptr()) T(*rhs);
}
optional(optional&& rhs) noexcept(std::is_nothrow_move_constructible<T>::value)
: OptionalBase<T>(only_set_initialized, rhs.initialized())
{
if (rhs.initialized()) new (dataptr()) T(std::move(*rhs));
}
constexpr optional(const T& v) : OptionalBase<T>(v) {}
constexpr optional(T&& v) : OptionalBase<T>(constexpr_move(v)) {}
template <class... Args>
constexpr explicit optional(in_place_t, Args&&... args)
: OptionalBase<T>(in_place_t{}, constexpr_forward<Args>(args)...) {}
template <class U, class... Args, REQUIRES(is_constructible<T, std::initializer_list<U>>)>
explicit optional(in_place_t, std::initializer_list<U> il, Args&&... args)
: OptionalBase<T>(in_place_t{}, il, constexpr_forward<Args>(args)...) {}
// 20.5.4.2 Destructor
~optional() = default;
// 20.5.4.3, assignment
optional& operator=(nullopt_t) noexcept
{
clear();
return *this;
}
optional& operator=(const optional& rhs)
{
if (initialized() == true && rhs.initialized() == false) clear();
else if (initialized() == false && rhs.initialized() == true) initialize(*rhs);
else if (initialized() == true && rhs.initialized() == true) contained_val() = *rhs;
return *this;
}
optional& operator=(optional&& rhs)
noexcept(std::is_nothrow_move_assignable<T>::value && std::is_nothrow_move_constructible<T>::value)
{
if (initialized() == true && rhs.initialized() == false) clear();
else if (initialized() == false && rhs.initialized() == true) initialize(std::move(*rhs));
else if (initialized() == true && rhs.initialized() == true) contained_val() = std::move(*rhs);
return *this;
}
template <class U>
auto operator=(U&& v)
-> typename enable_if
<
is_same<typename remove_reference<U>::type, T>::value,
optional&
>::type
{
if (initialized()) { contained_val() = std::forward<U>(v); }
else { initialize(std::forward<U>(v)); }
return *this;
}
template <class... Args>
optional<T>& emplace(Args&&... args)
{
clear();
initialize(std::forward<Args>(args)...);
return *this;
}
template <class U, class... Args>
optional<T>& emplace(initializer_list<U> il, Args&&... args)
{
clear();
initialize<U, Args...>(il, std::forward<Args>(args)...);
return *this;
}
// 20.5.4.4 Swap
void swap(optional<T>& rhs) noexcept(is_nothrow_move_constructible<T>::value && is_nothrow_swappable_<T>())
{
if (initialized() == true && rhs.initialized() == false) { rhs.initialize(std::move(**this)); clear(); }
else if (initialized() == false && rhs.initialized() == true) { initialize(std::move(*rhs)); rhs.clear(); }
else if (initialized() == true && rhs.initialized() == true) { using std::swap; swap(**this, *rhs); }
}
// 20.5.4.5 Observers
constexpr T const* operator ->() const {
return ASSERTED_EXPRESSION(initialized(), dataptr());
}
T* operator ->() {
assert (initialized());
return dataptr();
}
constexpr T const& operator *() const {
return ASSERTED_EXPRESSION(initialized(), contained_val());
}
T& operator *() {
assert (initialized());
return contained_val();
}
constexpr T const& value() const {
return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
}
T& value() {
return initialized() ? contained_val() : (throw bad_optional_access("bad optional access"), contained_val());
}
constexpr explicit operator bool() const noexcept { return initialized(); }
# if OPTIONAL_HAS_THIS_RVALUE_REFS == 1
template <class V>
constexpr T value_or(V&& v) const&
{
return *this ? **this : static_cast<T>(constexpr_forward<V>(v));
}
template <class V>
T value_or(V&& v) &&
{
return *this ? std::move(const_cast<optional<T>&>(*this).contained_val()) : static_cast<T>(constexpr_forward<V>(v));
}
# else
template <class V>
constexpr T value_or(V&& v) const
{
return *this ? **this : static_cast<T>(constexpr_forward<V>(v));
}
# endif
};
template <class T>
class optional<T&>
{
static_assert( !std::is_same<T, nullopt_t>::value, "bad T" );
static_assert( !std::is_same<T, in_place_t>::value, "bad T" );
T* ref;
public:
// 20.5.5.1, construction/destruction
constexpr optional() noexcept : ref(nullptr) {}
constexpr optional(nullopt_t) noexcept : ref(nullptr) {}
constexpr optional(T& v) noexcept : ref(static_addressof(v)) {}
optional(T&&) = delete;
constexpr optional(const optional& rhs) noexcept : ref(rhs.ref) {}
explicit constexpr optional(in_place_t, T& v) noexcept : ref(static_addressof(v)) {}
explicit optional(in_place_t, T&&) = delete;
~optional() = default;
// 20.5.5.2, mutation
optional& operator=(nullopt_t) noexcept {
ref = nullptr;
return *this;
}
// optional& operator=(const optional& rhs) noexcept {
// ref = rhs.ref;
// return *this;
// }
// optional& operator=(optional&& rhs) noexcept {
// ref = rhs.ref;
// return *this;
// }
template <typename U>
auto operator=(U&& rhs) noexcept
-> typename enable_if
<
is_same<typename decay<U>::type, optional<T&>>::value,
optional&
>::type
{
ref = rhs.ref;
return *this;
}
template <typename U>
auto operator=(U&& rhs) noexcept
-> typename enable_if
<
!is_same<typename decay<U>::type, optional<T&>>::value,
optional&
>::type
= delete;
optional& emplace(T& v) noexcept {
ref = static_addressof(v);
return *this;
}
optional& emplace(T&&) = delete;
void swap(optional<T&>& rhs) noexcept
{
std::swap(ref, rhs.ref);
}
// 20.5.5.3, observers
constexpr T* operator->() const {
return ASSERTED_EXPRESSION(ref, ref);
}
constexpr T& operator*() const {
return ASSERTED_EXPRESSION(ref, *ref);
}
constexpr T& value() const {
return ref ? *ref : (throw bad_optional_access("bad optional access"), *ref);
}
explicit constexpr operator bool() const noexcept {
return ref != nullptr;
}
template <class V>
constexpr typename decay<T>::type value_or(V&& v) const
{
return *this ? **this : static_cast<typename decay<T>::type>(constexpr_forward<V>(v));
}
};
template <class T>
class optional<T&&>
{
static_assert( sizeof(T) == 0, "optional rvalue referencs disallowed" );
};
// 20.5.8, Relational operators
template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y)
{
return bool(x) != bool(y) ? false : bool(x) == false ? true : *x == *y;
}
template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y)
{
return !(x == y);
}
template <class T> constexpr bool operator<(const optional<T>& x, const optional<T>& y)
{
return (!y) ? false : (!x) ? true : *x < *y;
}
template <class T> constexpr bool operator>(const optional<T>& x, const optional<T>& y)
{
return (y < x);
}
template <class T> constexpr bool operator<=(const optional<T>& x, const optional<T>& y)
{
return !(y < x);
}
template <class T> constexpr bool operator>=(const optional<T>& x, const optional<T>& y)
{
return !(x < y);
}
// 20.5.9 Comparison with nullopt
template <class T> constexpr bool operator==(const optional<T>& x, nullopt_t) noexcept
{
return (!x);
}
template <class T> constexpr bool operator==(nullopt_t, const optional<T>& x) noexcept
{
return (!x);
}
template <class T> constexpr bool operator!=(const optional<T>& x, nullopt_t) noexcept
{
return bool(x);
}
template <class T> constexpr bool operator!=(nullopt_t, const optional<T>& x) noexcept
{
return bool(x);
}
template <class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept
{
return false;
}
template <class T> constexpr bool operator<(nullopt_t, const optional<T>& x) noexcept
{
return bool(x);
}
template <class T> constexpr bool operator<=(const optional<T>& x, nullopt_t) noexcept
{
return (!x);
}
template <class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept
{
return true;
}
template <class T> constexpr bool operator>(const optional<T>& x, nullopt_t) noexcept
{
return bool(x);
}
template <class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept
{
return false;
}
template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept
{
return true;
}
template <class T> constexpr bool operator>=(nullopt_t, const optional<T>& x) noexcept
{
return (!x);
}
// 20.5.10, Comparison with T
template <class T> constexpr bool operator==(const optional<T>& x, const T& v)
{
return bool(x) ? *x == v : false;
}
template <class T> constexpr bool operator==(const T& v, const optional<T>& x)
{
return bool(x) ? v == *x : false;
}
template <class T> constexpr bool operator!=(const optional<T>& x, const T& v)
{
return bool(x) ? *x != v : true;
}
template <class T> constexpr bool operator!=(const T& v, const optional<T>& x)
{
return bool(x) ? v != *x : true;
}
template <class T> constexpr bool operator<(const optional<T>& x, const T& v)
{
return bool(x) ? *x < v : true;
}
template <class T> constexpr bool operator>(const T& v, const optional<T>& x)
{
return bool(x) ? v > *x : true;
}
template <class T> constexpr bool operator>(const optional<T>& x, const T& v)
{
return bool(x) ? *x > v : false;
}
template <class T> constexpr bool operator<(const T& v, const optional<T>& x)
{
return bool(x) ? v < *x : false;
}
template <class T> constexpr bool operator>=(const optional<T>& x, const T& v)
{
return bool(x) ? *x >= v : false;
}
template <class T> constexpr bool operator<=(const T& v, const optional<T>& x)
{
return bool(x) ? v <= *x : false;
}
template <class T> constexpr bool operator<=(const optional<T>& x, const T& v)
{
return bool(x) ? *x <= v : true;
}
template <class T> constexpr bool operator>=(const T& v, const optional<T>& x)
{
return bool(x) ? v >= *x : true;
}
// Comparison of optionsl<T&> with T
template <class T> constexpr bool operator==(const optional<T&>& x, const T& v)
{
return bool(x) ? *x == v : false;
}
template <class T> constexpr bool operator==(const T& v, const optional<T&>& x)
{
return bool(x) ? v == *x : false;
}
template <class T> constexpr bool operator!=(const optional<T&>& x, const T& v)
{
return bool(x) ? *x != v : true;
}
template <class T> constexpr bool operator!=(const T& v, const optional<T&>& x)
{
return bool(x) ? v != *x : true;
}
template <class T> constexpr bool operator<(const optional<T&>& x, const T& v)
{
return bool(x) ? *x < v : true;
}
template <class T> constexpr bool operator>(const T& v, const optional<T&>& x)
{
return bool(x) ? v > *x : true;
}
template <class T> constexpr bool operator>(const optional<T&>& x, const T& v)
{
return bool(x) ? *x > v : false;
}
template <class T> constexpr bool operator<(const T& v, const optional<T&>& x)
{
return bool(x) ? v < *x : false;
}
template <class T> constexpr bool operator>=(const optional<T&>& x, const T& v)
{
return bool(x) ? *x >= v : false;
}
template <class T> constexpr bool operator<=(const T& v, const optional<T&>& x)
{
return bool(x) ? v <= *x : false;
}
template <class T> constexpr bool operator<=(const optional<T&>& x, const T& v)
{
return bool(x) ? *x <= v : true;
}
template <class T> constexpr bool operator>=(const T& v, const optional<T&>& x)
{
return bool(x) ? v >= *x : true;
}
// Comparison of optionsl<T const&> with T
template <class T> constexpr bool operator==(const optional<const T&>& x, const T& v)
{
return bool(x) ? *x == v : false;
}
template <class T> constexpr bool operator==(const T& v, const optional<const T&>& x)
{
return bool(x) ? v == *x : false;
}
template <class T> constexpr bool operator!=(const optional<const T&>& x, const T& v)
{
return bool(x) ? *x != v : true;
}
template <class T> constexpr bool operator!=(const T& v, const optional<const T&>& x)
{
return bool(x) ? v != *x : true;
}
template <class T> constexpr bool operator<(const optional<const T&>& x, const T& v)
{
return bool(x) ? *x < v : true;
}
template <class T> constexpr bool operator>(const T& v, const optional<const T&>& x)
{
return bool(x) ? v > *x : true;
}
template <class T> constexpr bool operator>(const optional<const T&>& x, const T& v)
{
return bool(x) ? *x > v : false;
}
template <class T> constexpr bool operator<(const T& v, const optional<const T&>& x)
{
return bool(x) ? v < *x : false;
}
template <class T> constexpr bool operator>=(const optional<const T&>& x, const T& v)
{
return bool(x) ? *x >= v : false;
}
template <class T> constexpr bool operator<=(const T& v, const optional<const T&>& x)
{
return bool(x) ? v <= *x : false;
}
template <class T> constexpr bool operator<=(const optional<const T&>& x, const T& v)
{
return bool(x) ? *x <= v : true;
}
template <class T> constexpr bool operator>=(const T& v, const optional<const T&>& x)
{
return bool(x) ? v >= *x : true;
}
// 20.5.12 Specialized algorithms
template <class T>
void swap(optional<T>& x, optional<T>& y) noexcept(noexcept(x.swap(y)))
{
x.swap(y);
}
template <class T>
constexpr optional<typename decay<T>::type> make_optional(T&& v)
{
return optional<typename decay<T>::type>(constexpr_forward<T>(v));
}
template <class X>
constexpr optional<X&> make_optional(reference_wrapper<X> v)
{
return optional<X&>(v.get());
}
} // namespace experimental
} // namespace std
namespace std
{
template <typename T>
struct hash<std::experimental::optional<T>>
{
typedef typename hash<T>::result_type result_type;
typedef std::experimental::optional<T> argument_type;
constexpr result_type operator()(argument_type const& arg) const {
return arg ? std::hash<T>{}(*arg) : result_type{};
}
};
template <typename T>
struct hash<std::experimental::optional<T&>>
{
typedef typename hash<T>::result_type result_type;
typedef std::experimental::optional<T&> argument_type;
constexpr result_type operator()(argument_type const& arg) const {
return arg ? std::hash<T>{}(*arg) : result_type{};
}
};
}
# endif //___OPTIONAL_HPP___
...@@ -76,7 +76,8 @@ bool TestHelpers::check_map_list_record(const MapListRecord & rec) { ...@@ -76,7 +76,8 @@ bool TestHelpers::check_map_list_record(const MapListRecord & rec) {
} }
static const std::string HELLO_WORLD = "Hello World!"; static const std::string HELLO_WORLD = "Hello World!";
static const std::string NON_ASCII = "Non-ASCII / 非 ASCII 字符"; static const std::string NON_ASCII("Non-ASCII /\0 非 ASCII 字符",
sizeof("Non-ASCII /\0 非 ASCII 字符")-1);
void TestHelpers::check_client_interface_ascii(const std::shared_ptr<ClientInterface> & i) { void TestHelpers::check_client_interface_ascii(const std::shared_ptr<ClientInterface> & i) {
ClientReturnedRecord cReturnedRecord = i->get_record(5, HELLO_WORLD, {}); ClientReturnedRecord cReturnedRecord = i->get_record(5, HELLO_WORLD, {});
......
#include "wchar_test_helpers.hpp"
#include "wchar_test_rec.hpp"
namespace testsuite {
static const wchar_t s1[] = L"some string with unicode \u0000, \u263A, \U0001F4A9 symbols";
static const std::wstring str1(s1, sizeof(s1) / sizeof(*s1) - 1);
static const std::wstring str2 = L"another string with unicode \u263B, \U0001F4A8 symbols";
WcharTestRec WcharTestHelpers::get_record()
{
return WcharTestRec(str1);
}
std::wstring WcharTestHelpers::get_string()
{
return str2;
}
bool WcharTestHelpers::check_string(const std::wstring & s)
{
return s == str2;
}
bool WcharTestHelpers::check_record(const WcharTestRec & r)
{
return r.s == str1;
}
} // namespace testsuite
...@@ -22,6 +22,7 @@ public class AllTests extends TestSuite { ...@@ -22,6 +22,7 @@ public class AllTests extends TestSuite {
mySuite.addTestSuite(TokenTest.class); mySuite.addTestSuite(TokenTest.class);
mySuite.addTestSuite(DurationTest.class); mySuite.addTestSuite(DurationTest.class);
mySuite.addTestSuite(MockRecordTest.class); mySuite.addTestSuite(MockRecordTest.class);
mySuite.addTestSuite(WcharTest.class);
return mySuite; return mySuite;
} }
......
...@@ -5,7 +5,7 @@ import javax.annotation.CheckForNull; ...@@ -5,7 +5,7 @@ import javax.annotation.CheckForNull;
public class ClientInterfaceImpl extends ClientInterface { public class ClientInterfaceImpl extends ClientInterface {
@Override @Override
public ClientReturnedRecord getRecord(long id, String utf8string, String misc) { public ClientReturnedRecord getRecord(long id, String utf8string, String misc) {
if (!utf8string.equals("Non-ASCII / 非 ASCII 字符") && !utf8string.equals("Hello World!")) { if (!utf8string.equals("Non-ASCII /\0 非 ASCII 字符") && !utf8string.equals("Hello World!")) {
throw new RuntimeException("Unexpected string. Check UTF-8?"); throw new RuntimeException("Unexpected string. Check UTF-8?");
} }
return new ClientReturnedRecord(id, utf8string, misc); return new ClientReturnedRecord(id, utf8string, misc);
......
package com.dropbox.djinni.test;
import junit.framework.TestCase;
public class WcharTest extends TestCase {
private static final String STR1 = "some string with unicode \u0000, \u263A, \uD83D\uDCA9 symbols";
private static final String STR2 = "another string with unicode \u263B, \uD83D\uDCA8 symbols";
public void test() {
assertEquals(WcharTestHelpers.getRecord().getS(), STR1);
assertEquals(WcharTestHelpers.getString(), STR2);
assertEquals(WcharTestHelpers.checkString(STR2), true);
assertEquals(WcharTestHelpers.checkRecord(new WcharTestRec(STR1)), true);
}
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#import "DBClientReturnedRecord+Private.h" #import "DBClientReturnedRecord+Private.h"
static NSString *DBHelloWorld = @"Hello World!"; static NSString *DBHelloWorld = @"Hello World!";
static NSString *DBNonAscii = @"Non-ASCII / 非 ASCII 字符"; static NSString *DBNonAscii = @"Non-ASCII /\0 非 ASCII 字符";
@implementation DBClientInterfaceImpl @implementation DBClientInterfaceImpl
......
#import <Foundation/Foundation.h>
#import "DBWcharTestHelpers.h"
#import "DBWcharTestRec.h"
#import <XCTest/XCTest.h>
@interface DBWcharTests : XCTestCase
@end
@implementation DBWcharTests
- (void)setUp
{
[super setUp];
}
- (void)tearDown
{
[super tearDown];
}
- (void)test
{
NSString *str1 = @"some string with unicode \0, \u263A, \U0001F4A9 symbols";
NSString *str2 = @"another string with unicode \u263B, \U0001F4A8 symbols";
XCTAssertEqualObjects([[DBWcharTestHelpers getRecord] s], str1);
XCTAssertEqualObjects([DBWcharTestHelpers getString], str2);
XCTAssertTrue([DBWcharTestHelpers checkString:str2]);
XCTAssertTrue([DBWcharTestHelpers checkRecord:[[DBWcharTestRec alloc] initWithS:str1]]);
}
@end
...@@ -37,7 +37,7 @@ file( ...@@ -37,7 +37,7 @@ file(
../generated-src/cpp/*.cpp ../generated-src/cpp/*.cpp
../handwritten-src/cpp/*.cpp) ../handwritten-src/cpp/*.cpp)
set(test_suite_common_flags "-g -Wall -Werror -std=c++1y") set(test_suite_common_flags "-g -Wall -Werror -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${test_suite_common_flags}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${test_suite_common_flags}")
if(UNIX OR APPLE) if(UNIX OR APPLE)
......
FROM fedora:24
# Get Java 8 (64-bit)
RUN dnf install -y java-1.8.0-openjdk-devel
# Get other build utils
RUN dnf install -y cmake wget tar make gcc-c++
# Select Java 8
RUN echo 1 | update-alternatives --config java
RUN echo 1 | update-alternatives --config javac
# Get modern ant
RUN yum install -y ant
ENV JAVA_HOME /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.92-5.b14.fc24.x86_64
VOLUME /opt/djinni
CMD /opt/djinni/test-suite/java/docker/build_and_run_tests.sh
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
5AEA68151D38F4A40083D770 /* DBWcharTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 728E11201D37DE27005A554D /* DBWcharTests.m */; };
650CA05A1C2AB48E007ADDDB /* DBListenerCaller+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = 650CA0571C2AB48E007ADDDB /* DBListenerCaller+Private.mm */; }; 650CA05A1C2AB48E007ADDDB /* DBListenerCaller+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = 650CA0571C2AB48E007ADDDB /* DBListenerCaller+Private.mm */; };
650CA05E1C2AB5AB007ADDDB /* ListenerCaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 650CA05D1C2AB5AB007ADDDB /* ListenerCaller.cpp */; }; 650CA05E1C2AB5AB007ADDDB /* ListenerCaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 650CA05D1C2AB5AB007ADDDB /* ListenerCaller.cpp */; };
650CA0601C2AB6DB007ADDDB /* DBMultipleInheritanceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 650CA05B1C2AB524007ADDDB /* DBMultipleInheritanceTests.m */; }; 650CA0601C2AB6DB007ADDDB /* DBMultipleInheritanceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 650CA05B1C2AB524007ADDDB /* DBMultipleInheritanceTests.m */; };
...@@ -32,8 +33,6 @@ ...@@ -32,8 +33,6 @@
65868B621989FE4200D60EEE /* libDjinniObjcTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65868B4A1989FE4200D60EEE /* libDjinniObjcTest.a */; }; 65868B621989FE4200D60EEE /* libDjinniObjcTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65868B4A1989FE4200D60EEE /* libDjinniObjcTest.a */; };
6D66A8A91A3B09F000B312E8 /* DBConstantTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6D66A8A81A3B09F000B312E8 /* DBConstantTests.mm */; }; 6D66A8A91A3B09F000B312E8 /* DBConstantTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6D66A8A81A3B09F000B312E8 /* DBConstantTests.mm */; };
A20094101B06982F00EF8D9B /* DBTokenTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = A200940E1B0697D300EF8D9B /* DBTokenTests.mm */; }; A20094101B06982F00EF8D9B /* DBTokenTests.mm in Sources */ = {isa = PBXBuildFile; fileRef = A200940E1B0697D300EF8D9B /* DBTokenTests.mm */; };
A209B5791BBA2A0A0070C310 /* DBOptColorRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A209B5761BBA2A0A0070C310 /* DBOptColorRecord.mm */; };
A209B57A1BBA2A0A0070C310 /* DBOptColorRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A209B5781BBA2A0A0070C310 /* DBOptColorRecord+Private.mm */; };
A238CA8E1AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA761AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm */; }; A238CA8E1AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA761AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm */; };
A238CA901AF84B7100CDDCE5 /* DBConstants+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA781AF84B7100CDDCE5 /* DBConstants+Private.mm */; }; A238CA901AF84B7100CDDCE5 /* DBConstants+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA781AF84B7100CDDCE5 /* DBConstants+Private.mm */; };
A238CA921AF84B7100CDDCE5 /* DBDateRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA7A1AF84B7100CDDCE5 /* DBDateRecord+Private.mm */; }; A238CA921AF84B7100CDDCE5 /* DBDateRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA7A1AF84B7100CDDCE5 /* DBDateRecord+Private.mm */; };
...@@ -62,16 +61,41 @@ ...@@ -62,16 +61,41 @@
A278D45319BA3601006FD937 /* test_helpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A278D45219BA3601006FD937 /* test_helpers.cpp */; }; A278D45319BA3601006FD937 /* test_helpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A278D45219BA3601006FD937 /* test_helpers.cpp */; };
A2AE38491BB3074800B7A0C9 /* DJIProxyCaches.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6536CD6C19A6C82200DD7715 /* DJIProxyCaches.mm */; }; A2AE38491BB3074800B7A0C9 /* DJIProxyCaches.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6536CD6C19A6C82200DD7715 /* DJIProxyCaches.mm */; };
A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2CB54B319BA6E6000A9E600 /* DJIError.mm */; }; A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2CB54B319BA6E6000A9E600 /* DJIError.mm */; };
B5153F931D54283700012654 /* DBWcharTestRec+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5153F891D54283700012654 /* DBWcharTestRec+Private.mm */; };
B5153F941D54283700012654 /* DBWcharTestRec.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5153F8B1D54283700012654 /* DBWcharTestRec.mm */; };
B5153F961D54283700012654 /* DBUsesSingleLanguageListeners+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5153F901D54283700012654 /* DBUsesSingleLanguageListeners+Private.mm */; };
B5153F9A1D54284100012654 /* DBJavaOnlyListener+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5153F971D54284100012654 /* DBJavaOnlyListener+Private.mm */; };
B51911181D542A7000772DFE /* DBWcharTestHelpers+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B51911151D542A7000772DFE /* DBWcharTestHelpers+Private.mm */; };
B519111B1D542B0700772DFE /* wchar_test_helpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B519111A1D542B0700772DFE /* wchar_test_helpers.cpp */; };
B51911501D555EE900772DFE /* DBVarnameRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B51911491D555EE900772DFE /* DBVarnameRecord+Private.mm */; };
B51911511D555EE900772DFE /* DBVarnameRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = B519114B1D555EE900772DFE /* DBVarnameRecord.mm */; };
B51911521D555EE900772DFE /* DBVarnameInterface+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B519114D1D555EE900772DFE /* DBVarnameInterface+Private.mm */; };
B52DA5681B103F72005CE75F /* DBAssortedPrimitives.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */; }; B52DA5681B103F72005CE75F /* DBAssortedPrimitives.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */; };
B52DA5691B103F72005CE75F /* DBAssortedPrimitives.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */; }; B52DA5691B103F72005CE75F /* DBAssortedPrimitives.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */; };
B52DA56A1B103F75005CE75F /* DBAssortedPrimitives+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5671B103F6D005CE75F /* DBAssortedPrimitives+Private.mm */; }; B52DA56A1B103F75005CE75F /* DBAssortedPrimitives+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5671B103F6D005CE75F /* DBAssortedPrimitives+Private.mm */; };
B52DA56B1B103F75005CE75F /* DBAssortedPrimitives+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5671B103F6D005CE75F /* DBAssortedPrimitives+Private.mm */; }; B52DA56B1B103F75005CE75F /* DBAssortedPrimitives+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B52DA5671B103F6D005CE75F /* DBAssortedPrimitives+Private.mm */; };
B52DA56E1B103FC5005CE75F /* assorted_primitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B52DA56C1B103FBE005CE75F /* assorted_primitives.cpp */; }; B52DA56E1B103FC5005CE75F /* assorted_primitives.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B52DA56C1B103FBE005CE75F /* assorted_primitives.cpp */; };
B52DA5701B104025005CE75F /* DBPrimitivesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B52DA56F1B104025005CE75F /* DBPrimitivesTests.m */; }; B52DA5701B104025005CE75F /* DBPrimitivesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B52DA56F1B104025005CE75F /* DBPrimitivesTests.m */; };
B58B16AF1D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B58B16A81D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord+Private.mm */; };
B58B16B01D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = B58B16AA1D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord.mm */; };
B58B16B11D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B58B16AC1D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord+Private.mm */; };
B58B16B41D5AD55B00EF92B5 /* record_using_extended_record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B58B16B21D5AD55B00EF92B5 /* record_using_extended_record.cpp */; };
B58B16B51D5AD55B00EF92B5 /* interface_using_extended_record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B58B16B31D5AD55B00EF92B5 /* interface_using_extended_record.cpp */; };
B58B16B71D5AD56600EF92B5 /* DBInterfaceUsingExtendedRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = B58B16B61D5AD56600EF92B5 /* DBInterfaceUsingExtendedRecord.mm */; };
B5D8FC361C23E2F40045ADCF /* DBConstantRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5D8FC331C23E2F40045ADCF /* DBConstantRecord.mm */; }; B5D8FC361C23E2F40045ADCF /* DBConstantRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5D8FC331C23E2F40045ADCF /* DBConstantRecord.mm */; };
B5D8FC371C23E2F40045ADCF /* DBConstantRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5D8FC351C23E2F40045ADCF /* DBConstantRecord+Private.mm */; }; B5D8FC371C23E2F40045ADCF /* DBConstantRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5D8FC351C23E2F40045ADCF /* DBConstantRecord+Private.mm */; };
B5E9C93B1C1F9D9D0073C123 /* reverse_client_interface_impl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5E9C9391C1F9D9D0073C123 /* reverse_client_interface_impl.cpp */; }; B5E9C93B1C1F9D9D0073C123 /* reverse_client_interface_impl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5E9C9391C1F9D9D0073C123 /* reverse_client_interface_impl.cpp */; };
B5E9C9401C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5E9C93F1C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm */; }; B5E9C9401C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5E9C93F1C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm */; };
B5F06A6D1D497396005BE736 /* extended_record_base.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5F06A681D497396005BE736 /* extended_record_base.cpp */; };
B5F06A851D4973BD005BE736 /* DBConflict+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06A701D4973BD005BE736 /* DBConflict+Private.mm */; };
B5F06A861D4973BD005BE736 /* DBConflictUser+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06A731D4973BD005BE736 /* DBConflictUser+Private.mm */; };
B5F06A891D4973BD005BE736 /* DBExtendedRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06A791D4973BD005BE736 /* DBExtendedRecord.mm */; };
B5F06A8A1D4973BD005BE736 /* DBExtendedRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06A7B1D4973BD005BE736 /* DBExtendedRecord+Private.mm */; };
B5F06A8C1D4973BD005BE736 /* DBObjcOnlyListener+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06A811D4973BD005BE736 /* DBObjcOnlyListener+Private.mm */; };
B5F06A9A1D497A66005BE736 /* extended_record.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5F06A971D497A66005BE736 /* extended_record.cpp */; };
B5F06AA51D4987EF005BE736 /* DBEnumUsageInterface+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06AA01D4987EF005BE736 /* DBEnumUsageInterface+Private.mm */; };
B5F06AA61D4987EF005BE736 /* DBEnumUsageRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06AA21D4987EF005BE736 /* DBEnumUsageRecord.mm */; };
B5F06AA71D4987EF005BE736 /* DBEnumUsageRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = B5F06AA41D4987EF005BE736 /* DBEnumUsageRecord+Private.mm */; };
CFAED8751B54291900E3B8A3 /* DBEmptyRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = CFAED8721B54291900E3B8A3 /* DBEmptyRecord.mm */; }; CFAED8751B54291900E3B8A3 /* DBEmptyRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = CFAED8721B54291900E3B8A3 /* DBEmptyRecord.mm */; };
CFAED8761B54291900E3B8A3 /* DBEmptyRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = CFAED8741B54291900E3B8A3 /* DBEmptyRecord+Private.mm */; }; CFAED8761B54291900E3B8A3 /* DBEmptyRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = CFAED8741B54291900E3B8A3 /* DBEmptyRecord+Private.mm */; };
CFC5D9D01B15105100BF2DF8 /* extern_record_with_derivings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CFC5D9CE1B15105100BF2DF8 /* extern_record_with_derivings.cpp */; }; CFC5D9D01B15105100BF2DF8 /* extern_record_with_derivings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CFC5D9CE1B15105100BF2DF8 /* extern_record_with_derivings.cpp */; };
...@@ -182,12 +206,8 @@ ...@@ -182,12 +206,8 @@
65868B5B1989FE4200D60EEE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 65868B5B1989FE4200D60EEE /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
65868B5E1989FE4200D60EEE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; }; 65868B5E1989FE4200D60EEE /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = Library/Frameworks/UIKit.framework; sourceTree = DEVELOPER_DIR; };
6D66A8A81A3B09F000B312E8 /* DBConstantTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBConstantTests.mm; sourceTree = "<group>"; }; 6D66A8A81A3B09F000B312E8 /* DBConstantTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBConstantTests.mm; sourceTree = "<group>"; };
728E11201D37DE27005A554D /* DBWcharTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBWcharTests.m; sourceTree = "<group>"; };
A200940E1B0697D300EF8D9B /* DBTokenTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBTokenTests.mm; sourceTree = "<group>"; }; A200940E1B0697D300EF8D9B /* DBTokenTests.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBTokenTests.mm; sourceTree = "<group>"; };
A209B5751BBA2A0A0070C310 /* DBOptColorRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBOptColorRecord.h; sourceTree = "<group>"; };
A209B5761BBA2A0A0070C310 /* DBOptColorRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBOptColorRecord.mm; sourceTree = "<group>"; };
A209B5771BBA2A0A0070C310 /* DBOptColorRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBOptColorRecord+Private.h"; sourceTree = "<group>"; };
A209B5781BBA2A0A0070C310 /* DBOptColorRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBOptColorRecord+Private.mm"; sourceTree = "<group>"; };
A209B57B1BBA2A180070C310 /* opt_color_record.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = opt_color_record.hpp; sourceTree = "<group>"; };
A238CA761AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBClientReturnedRecord+Private.mm"; sourceTree = "<group>"; }; A238CA761AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBClientReturnedRecord+Private.mm"; sourceTree = "<group>"; };
A238CA781AF84B7100CDDCE5 /* DBConstants+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBConstants+Private.mm"; sourceTree = "<group>"; }; A238CA781AF84B7100CDDCE5 /* DBConstants+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBConstants+Private.mm"; sourceTree = "<group>"; };
A238CA7A1AF84B7100CDDCE5 /* DBDateRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBDateRecord+Private.mm"; sourceTree = "<group>"; }; A238CA7A1AF84B7100CDDCE5 /* DBDateRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBDateRecord+Private.mm"; sourceTree = "<group>"; };
...@@ -263,6 +283,31 @@ ...@@ -263,6 +283,31 @@
A278D45219BA3601006FD937 /* test_helpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_helpers.cpp; sourceTree = "<group>"; }; A278D45219BA3601006FD937 /* test_helpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test_helpers.cpp; sourceTree = "<group>"; };
A2CB54B319BA6E6000A9E600 /* DJIError.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DJIError.mm; sourceTree = "<group>"; }; A2CB54B319BA6E6000A9E600 /* DJIError.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DJIError.mm; sourceTree = "<group>"; };
A2CCB9411AF80DFC00E6230A /* DBClientInterface+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBClientInterface+Private.h"; sourceTree = "<group>"; }; A2CCB9411AF80DFC00E6230A /* DBClientInterface+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBClientInterface+Private.h"; sourceTree = "<group>"; };
B5153F871D54282C00012654 /* wchar_test_rec.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = wchar_test_rec.hpp; sourceTree = "<group>"; };
B5153F891D54283700012654 /* DBWcharTestRec+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBWcharTestRec+Private.mm"; sourceTree = "<group>"; };
B5153F8A1D54283700012654 /* DBWcharTestRec+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBWcharTestRec+Private.h"; sourceTree = "<group>"; };
B5153F8B1D54283700012654 /* DBWcharTestRec.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBWcharTestRec.mm; sourceTree = "<group>"; };
B5153F8C1D54283700012654 /* DBWcharTestRec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBWcharTestRec.h; sourceTree = "<group>"; };
B5153F901D54283700012654 /* DBUsesSingleLanguageListeners+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBUsesSingleLanguageListeners+Private.mm"; sourceTree = "<group>"; };
B5153F911D54283700012654 /* DBUsesSingleLanguageListeners+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBUsesSingleLanguageListeners+Private.h"; sourceTree = "<group>"; };
B5153F921D54283700012654 /* DBUsesSingleLanguageListeners.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBUsesSingleLanguageListeners.h; sourceTree = "<group>"; };
B5153F971D54284100012654 /* DBJavaOnlyListener+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBJavaOnlyListener+Private.mm"; sourceTree = "<group>"; };
B5153F981D54284100012654 /* DBJavaOnlyListener+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBJavaOnlyListener+Private.h"; sourceTree = "<group>"; };
B5153F991D54284100012654 /* DBJavaOnlyListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBJavaOnlyListener.h; sourceTree = "<group>"; };
B51911151D542A7000772DFE /* DBWcharTestHelpers+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBWcharTestHelpers+Private.mm"; sourceTree = "<group>"; };
B51911161D542A7000772DFE /* DBWcharTestHelpers+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBWcharTestHelpers+Private.h"; sourceTree = "<group>"; };
B51911171D542A7000772DFE /* DBWcharTestHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBWcharTestHelpers.h; sourceTree = "<group>"; };
B51911191D542AEC00772DFE /* wchar_test_helpers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = wchar_test_helpers.hpp; sourceTree = "<group>"; };
B519111A1D542B0700772DFE /* wchar_test_helpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wchar_test_helpers.cpp; sourceTree = "<group>"; };
B51911471D555EDC00772DFE /* _varname_record_.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = _varname_record_.hpp; sourceTree = "<group>"; };
B51911481D555EDC00772DFE /* _varname_interface_.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = _varname_interface_.hpp; sourceTree = "<group>"; };
B51911491D555EE900772DFE /* DBVarnameRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBVarnameRecord+Private.mm"; sourceTree = "<group>"; };
B519114A1D555EE900772DFE /* DBVarnameRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBVarnameRecord+Private.h"; sourceTree = "<group>"; };
B519114B1D555EE900772DFE /* DBVarnameRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBVarnameRecord.mm; sourceTree = "<group>"; };
B519114C1D555EE900772DFE /* DBVarnameRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBVarnameRecord.h; sourceTree = "<group>"; };
B519114D1D555EE900772DFE /* DBVarnameInterface+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBVarnameInterface+Private.mm"; sourceTree = "<group>"; };
B519114E1D555EE900772DFE /* DBVarnameInterface+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBVarnameInterface+Private.h"; sourceTree = "<group>"; };
B519114F1D555EE900772DFE /* DBVarnameInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBVarnameInterface.h; sourceTree = "<group>"; };
B52DA5641B103F6D005CE75F /* DBAssortedPrimitives.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBAssortedPrimitives.h; sourceTree = "<group>"; }; B52DA5641B103F6D005CE75F /* DBAssortedPrimitives.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBAssortedPrimitives.h; sourceTree = "<group>"; };
B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DBAssortedPrimitives.mm; sourceTree = "<group>"; }; B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = DBAssortedPrimitives.mm; sourceTree = "<group>"; };
B52DA5661B103F6D005CE75F /* DBAssortedPrimitives+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DBAssortedPrimitives+Private.h"; sourceTree = "<group>"; }; B52DA5661B103F6D005CE75F /* DBAssortedPrimitives+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DBAssortedPrimitives+Private.h"; sourceTree = "<group>"; };
...@@ -270,6 +315,18 @@ ...@@ -270,6 +315,18 @@
B52DA56C1B103FBE005CE75F /* assorted_primitives.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = assorted_primitives.cpp; sourceTree = "<group>"; }; B52DA56C1B103FBE005CE75F /* assorted_primitives.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = assorted_primitives.cpp; sourceTree = "<group>"; };
B52DA56D1B103FBE005CE75F /* assorted_primitives.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = assorted_primitives.hpp; sourceTree = "<group>"; }; B52DA56D1B103FBE005CE75F /* assorted_primitives.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = assorted_primitives.hpp; sourceTree = "<group>"; };
B52DA56F1B104025005CE75F /* DBPrimitivesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBPrimitivesTests.m; sourceTree = "<group>"; }; B52DA56F1B104025005CE75F /* DBPrimitivesTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBPrimitivesTests.m; sourceTree = "<group>"; };
B58B16A61D5AC9AD00EF92B5 /* record_using_extended_record.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = record_using_extended_record.hpp; sourceTree = "<group>"; };
B58B16A71D5AC9AD00EF92B5 /* interface_using_extended_record.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = interface_using_extended_record.hpp; sourceTree = "<group>"; };
B58B16A81D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBRecordUsingExtendedRecord+Private.mm"; sourceTree = "<group>"; };
B58B16A91D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBRecordUsingExtendedRecord+Private.h"; sourceTree = "<group>"; };
B58B16AA1D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBRecordUsingExtendedRecord.mm; sourceTree = "<group>"; };
B58B16AB1D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBRecordUsingExtendedRecord.h; sourceTree = "<group>"; };
B58B16AC1D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBInterfaceUsingExtendedRecord+Private.mm"; sourceTree = "<group>"; };
B58B16AD1D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBInterfaceUsingExtendedRecord+Private.h"; sourceTree = "<group>"; };
B58B16AE1D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBInterfaceUsingExtendedRecord.h; sourceTree = "<group>"; };
B58B16B21D5AD55B00EF92B5 /* record_using_extended_record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = record_using_extended_record.cpp; sourceTree = "<group>"; };
B58B16B31D5AD55B00EF92B5 /* interface_using_extended_record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = interface_using_extended_record.cpp; sourceTree = "<group>"; };
B58B16B61D5AD56600EF92B5 /* DBInterfaceUsingExtendedRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBInterfaceUsingExtendedRecord.mm; sourceTree = "<group>"; };
B5D8FC321C23E2F40045ADCF /* DBConstantRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBConstantRecord.h; sourceTree = "<group>"; }; B5D8FC321C23E2F40045ADCF /* DBConstantRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBConstantRecord.h; sourceTree = "<group>"; };
B5D8FC331C23E2F40045ADCF /* DBConstantRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBConstantRecord.mm; sourceTree = "<group>"; }; B5D8FC331C23E2F40045ADCF /* DBConstantRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBConstantRecord.mm; sourceTree = "<group>"; };
B5D8FC341C23E2F40045ADCF /* DBConstantRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBConstantRecord+Private.h"; sourceTree = "<group>"; }; B5D8FC341C23E2F40045ADCF /* DBConstantRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBConstantRecord+Private.h"; sourceTree = "<group>"; };
...@@ -281,6 +338,39 @@ ...@@ -281,6 +338,39 @@
B5E9C93D1C1F9E9E0073C123 /* DBReverseClientInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBReverseClientInterface.h; sourceTree = "<group>"; }; B5E9C93D1C1F9E9E0073C123 /* DBReverseClientInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBReverseClientInterface.h; sourceTree = "<group>"; };
B5E9C93E1C1F9E9E0073C123 /* DBReverseClientInterface+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBReverseClientInterface+Private.h"; sourceTree = "<group>"; }; B5E9C93E1C1F9E9E0073C123 /* DBReverseClientInterface+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBReverseClientInterface+Private.h"; sourceTree = "<group>"; };
B5E9C93F1C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBReverseClientInterface+Private.mm"; sourceTree = "<group>"; }; B5E9C93F1C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBReverseClientInterface+Private.mm"; sourceTree = "<group>"; };
B5F06A651D497396005BE736 /* conflict_user.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = conflict_user.hpp; sourceTree = "<group>"; };
B5F06A661D497396005BE736 /* Conflict.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Conflict.hpp; sourceTree = "<group>"; };
B5F06A681D497396005BE736 /* extended_record_base.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extended_record_base.cpp; sourceTree = "<group>"; };
B5F06A691D497396005BE736 /* extended_record_base.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = extended_record_base.hpp; sourceTree = "<group>"; };
B5F06A6A1D497396005BE736 /* java_only_listener.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = java_only_listener.hpp; sourceTree = "<group>"; };
B5F06A6B1D497396005BE736 /* objc_only_listener.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = objc_only_listener.hpp; sourceTree = "<group>"; };
B5F06A6C1D497396005BE736 /* uses_single_language_listeners.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = uses_single_language_listeners.hpp; sourceTree = "<group>"; };
B5F06A6E1D4973BD005BE736 /* DBConflict.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBConflict.h; sourceTree = "<group>"; };
B5F06A6F1D4973BD005BE736 /* DBConflict+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBConflict+Private.h"; sourceTree = "<group>"; };
B5F06A701D4973BD005BE736 /* DBConflict+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBConflict+Private.mm"; sourceTree = "<group>"; };
B5F06A711D4973BD005BE736 /* DBConflictUser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBConflictUser.h; sourceTree = "<group>"; };
B5F06A721D4973BD005BE736 /* DBConflictUser+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBConflictUser+Private.h"; sourceTree = "<group>"; };
B5F06A731D4973BD005BE736 /* DBConflictUser+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBConflictUser+Private.mm"; sourceTree = "<group>"; };
B5F06A781D4973BD005BE736 /* DBExtendedRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBExtendedRecord.h; sourceTree = "<group>"; };
B5F06A791D4973BD005BE736 /* DBExtendedRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBExtendedRecord.mm; sourceTree = "<group>"; };
B5F06A7A1D4973BD005BE736 /* DBExtendedRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBExtendedRecord+Private.h"; sourceTree = "<group>"; };
B5F06A7B1D4973BD005BE736 /* DBExtendedRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBExtendedRecord+Private.mm"; sourceTree = "<group>"; };
B5F06A7F1D4973BD005BE736 /* DBObjcOnlyListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBObjcOnlyListener.h; sourceTree = "<group>"; };
B5F06A801D4973BD005BE736 /* DBObjcOnlyListener+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBObjcOnlyListener+Private.h"; sourceTree = "<group>"; };
B5F06A811D4973BD005BE736 /* DBObjcOnlyListener+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBObjcOnlyListener+Private.mm"; sourceTree = "<group>"; };
B5F06A971D497A66005BE736 /* extended_record.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extended_record.cpp; sourceTree = "<group>"; };
B5F06A981D497A66005BE736 /* extended_record.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = extended_record.hpp; sourceTree = "<group>"; };
B5F06A991D497A66005BE736 /* optional.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = optional.hpp; sourceTree = "<group>"; };
B5F06A9B1D4987C7005BE736 /* enum_usage_interface.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_usage_interface.hpp; sourceTree = "<group>"; };
B5F06A9C1D4987C7005BE736 /* enum_usage_record.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = enum_usage_record.hpp; sourceTree = "<group>"; };
B5F06A9D1D4987EF005BE736 /* DBColor+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBColor+Private.h"; sourceTree = "<group>"; };
B5F06A9E1D4987EF005BE736 /* DBEnumUsageInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBEnumUsageInterface.h; sourceTree = "<group>"; };
B5F06A9F1D4987EF005BE736 /* DBEnumUsageInterface+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBEnumUsageInterface+Private.h"; sourceTree = "<group>"; };
B5F06AA01D4987EF005BE736 /* DBEnumUsageInterface+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBEnumUsageInterface+Private.mm"; sourceTree = "<group>"; };
B5F06AA11D4987EF005BE736 /* DBEnumUsageRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBEnumUsageRecord.h; sourceTree = "<group>"; };
B5F06AA21D4987EF005BE736 /* DBEnumUsageRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBEnumUsageRecord.mm; sourceTree = "<group>"; };
B5F06AA31D4987EF005BE736 /* DBEnumUsageRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBEnumUsageRecord+Private.h"; sourceTree = "<group>"; };
B5F06AA41D4987EF005BE736 /* DBEnumUsageRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBEnumUsageRecord+Private.mm"; sourceTree = "<group>"; };
CFAED8711B54291900E3B8A3 /* DBEmptyRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBEmptyRecord.h; sourceTree = "<group>"; }; CFAED8711B54291900E3B8A3 /* DBEmptyRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBEmptyRecord.h; sourceTree = "<group>"; };
CFAED8721B54291900E3B8A3 /* DBEmptyRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBEmptyRecord.mm; sourceTree = "<group>"; }; CFAED8721B54291900E3B8A3 /* DBEmptyRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBEmptyRecord.mm; sourceTree = "<group>"; };
CFAED8731B54291900E3B8A3 /* DBEmptyRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBEmptyRecord+Private.h"; sourceTree = "<group>"; }; CFAED8731B54291900E3B8A3 /* DBEmptyRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBEmptyRecord+Private.h"; sourceTree = "<group>"; };
...@@ -378,6 +468,10 @@ ...@@ -378,6 +468,10 @@
6536CD7519A6C98800DD7715 /* handwritten-cpp */ = { 6536CD7519A6C98800DD7715 /* handwritten-cpp */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B519111A1D542B0700772DFE /* wchar_test_helpers.cpp */,
B5F06A971D497A66005BE736 /* extended_record.cpp */,
B5F06A981D497A66005BE736 /* extended_record.hpp */,
B5F06A991D497A66005BE736 /* optional.hpp */,
B5E9C9391C1F9D9D0073C123 /* reverse_client_interface_impl.cpp */, B5E9C9391C1F9D9D0073C123 /* reverse_client_interface_impl.cpp */,
B5E9C93A1C1F9D9D0073C123 /* reverse_client_interface_impl.hpp */, B5E9C93A1C1F9D9D0073C123 /* reverse_client_interface_impl.hpp */,
6536CD7619A6C98800DD7715 /* cpp_exception_impl.cpp */, 6536CD7619A6C98800DD7715 /* cpp_exception_impl.cpp */,
...@@ -396,6 +490,7 @@ ...@@ -396,6 +490,7 @@
6536CD7919A6C99800DD7715 /* Tests */ = { 6536CD7919A6C99800DD7715 /* Tests */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
728E11201D37DE27005A554D /* DBWcharTests.m */,
6536CD7A19A6C99800DD7715 /* DBClientInterfaceTests.mm */, 6536CD7A19A6C99800DD7715 /* DBClientInterfaceTests.mm */,
6D66A8A81A3B09F000B312E8 /* DBConstantTests.mm */, 6D66A8A81A3B09F000B312E8 /* DBConstantTests.mm */,
6536CD7B19A6C99800DD7715 /* DBCppExceptionTests.mm */, 6536CD7B19A6C99800DD7715 /* DBCppExceptionTests.mm */,
...@@ -453,6 +548,55 @@ ...@@ -453,6 +548,55 @@
A24249181AF192E0003BF8F0 /* generated-objc */ = { A24249181AF192E0003BF8F0 /* generated-objc */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B58B16B61D5AD56600EF92B5 /* DBInterfaceUsingExtendedRecord.mm */,
B58B16A81D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord+Private.mm */,
B58B16A91D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord+Private.h */,
B58B16AA1D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord.mm */,
B58B16AB1D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord.h */,
B58B16AC1D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord+Private.mm */,
B58B16AD1D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord+Private.h */,
B58B16AE1D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord.h */,
B51911491D555EE900772DFE /* DBVarnameRecord+Private.mm */,
B519114A1D555EE900772DFE /* DBVarnameRecord+Private.h */,
B519114B1D555EE900772DFE /* DBVarnameRecord.mm */,
B519114C1D555EE900772DFE /* DBVarnameRecord.h */,
B519114D1D555EE900772DFE /* DBVarnameInterface+Private.mm */,
B519114E1D555EE900772DFE /* DBVarnameInterface+Private.h */,
B519114F1D555EE900772DFE /* DBVarnameInterface.h */,
B51911151D542A7000772DFE /* DBWcharTestHelpers+Private.mm */,
B51911161D542A7000772DFE /* DBWcharTestHelpers+Private.h */,
B51911171D542A7000772DFE /* DBWcharTestHelpers.h */,
B5153F971D54284100012654 /* DBJavaOnlyListener+Private.mm */,
B5153F981D54284100012654 /* DBJavaOnlyListener+Private.h */,
B5153F991D54284100012654 /* DBJavaOnlyListener.h */,
B5153F891D54283700012654 /* DBWcharTestRec+Private.mm */,
B5153F8A1D54283700012654 /* DBWcharTestRec+Private.h */,
B5153F8B1D54283700012654 /* DBWcharTestRec.mm */,
B5153F8C1D54283700012654 /* DBWcharTestRec.h */,
B5153F901D54283700012654 /* DBUsesSingleLanguageListeners+Private.mm */,
B5153F911D54283700012654 /* DBUsesSingleLanguageListeners+Private.h */,
B5153F921D54283700012654 /* DBUsesSingleLanguageListeners.h */,
B5F06A9D1D4987EF005BE736 /* DBColor+Private.h */,
B5F06A9E1D4987EF005BE736 /* DBEnumUsageInterface.h */,
B5F06A9F1D4987EF005BE736 /* DBEnumUsageInterface+Private.h */,
B5F06AA01D4987EF005BE736 /* DBEnumUsageInterface+Private.mm */,
B5F06AA11D4987EF005BE736 /* DBEnumUsageRecord.h */,
B5F06AA21D4987EF005BE736 /* DBEnumUsageRecord.mm */,
B5F06AA31D4987EF005BE736 /* DBEnumUsageRecord+Private.h */,
B5F06AA41D4987EF005BE736 /* DBEnumUsageRecord+Private.mm */,
B5F06A6E1D4973BD005BE736 /* DBConflict.h */,
B5F06A6F1D4973BD005BE736 /* DBConflict+Private.h */,
B5F06A701D4973BD005BE736 /* DBConflict+Private.mm */,
B5F06A711D4973BD005BE736 /* DBConflictUser.h */,
B5F06A721D4973BD005BE736 /* DBConflictUser+Private.h */,
B5F06A731D4973BD005BE736 /* DBConflictUser+Private.mm */,
B5F06A781D4973BD005BE736 /* DBExtendedRecord.h */,
B5F06A791D4973BD005BE736 /* DBExtendedRecord.mm */,
B5F06A7A1D4973BD005BE736 /* DBExtendedRecord+Private.h */,
B5F06A7B1D4973BD005BE736 /* DBExtendedRecord+Private.mm */,
B5F06A7F1D4973BD005BE736 /* DBObjcOnlyListener.h */,
B5F06A801D4973BD005BE736 /* DBObjcOnlyListener+Private.h */,
B5F06A811D4973BD005BE736 /* DBObjcOnlyListener+Private.mm */,
B5D8FC321C23E2F40045ADCF /* DBConstantRecord.h */, B5D8FC321C23E2F40045ADCF /* DBConstantRecord.h */,
B5D8FC331C23E2F40045ADCF /* DBConstantRecord.mm */, B5D8FC331C23E2F40045ADCF /* DBConstantRecord.mm */,
B5D8FC341C23E2F40045ADCF /* DBConstantRecord+Private.h */, B5D8FC341C23E2F40045ADCF /* DBConstantRecord+Private.h */,
...@@ -460,10 +604,6 @@ ...@@ -460,10 +604,6 @@
B5E9C93D1C1F9E9E0073C123 /* DBReverseClientInterface.h */, B5E9C93D1C1F9E9E0073C123 /* DBReverseClientInterface.h */,
B5E9C93E1C1F9E9E0073C123 /* DBReverseClientInterface+Private.h */, B5E9C93E1C1F9E9E0073C123 /* DBReverseClientInterface+Private.h */,
B5E9C93F1C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm */, B5E9C93F1C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm */,
A209B5751BBA2A0A0070C310 /* DBOptColorRecord.h */,
A209B5761BBA2A0A0070C310 /* DBOptColorRecord.mm */,
A209B5771BBA2A0A0070C310 /* DBOptColorRecord+Private.h */,
A209B5781BBA2A0A0070C310 /* DBOptColorRecord+Private.mm */,
B52DA5641B103F6D005CE75F /* DBAssortedPrimitives.h */, B52DA5641B103F6D005CE75F /* DBAssortedPrimitives.h */,
B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */, B52DA5651B103F6D005CE75F /* DBAssortedPrimitives.mm */,
B52DA5661B103F6D005CE75F /* DBAssortedPrimitives+Private.h */, B52DA5661B103F6D005CE75F /* DBAssortedPrimitives+Private.h */,
...@@ -573,9 +713,25 @@ ...@@ -573,9 +713,25 @@
A242495D1AF192FC003BF8F0 /* generated-cpp */ = { A242495D1AF192FC003BF8F0 /* generated-cpp */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
B58B16B21D5AD55B00EF92B5 /* record_using_extended_record.cpp */,
B58B16B31D5AD55B00EF92B5 /* interface_using_extended_record.cpp */,
B58B16A61D5AC9AD00EF92B5 /* record_using_extended_record.hpp */,
B58B16A71D5AC9AD00EF92B5 /* interface_using_extended_record.hpp */,
B51911471D555EDC00772DFE /* _varname_record_.hpp */,
B51911481D555EDC00772DFE /* _varname_interface_.hpp */,
B51911191D542AEC00772DFE /* wchar_test_helpers.hpp */,
B5153F871D54282C00012654 /* wchar_test_rec.hpp */,
B5F06A9B1D4987C7005BE736 /* enum_usage_interface.hpp */,
B5F06A9C1D4987C7005BE736 /* enum_usage_record.hpp */,
B5F06A651D497396005BE736 /* conflict_user.hpp */,
B5F06A661D497396005BE736 /* Conflict.hpp */,
B5F06A681D497396005BE736 /* extended_record_base.cpp */,
B5F06A691D497396005BE736 /* extended_record_base.hpp */,
B5F06A6A1D497396005BE736 /* java_only_listener.hpp */,
B5F06A6B1D497396005BE736 /* objc_only_listener.hpp */,
B5F06A6C1D497396005BE736 /* uses_single_language_listeners.hpp */,
B5D8FC381C23E30D0045ADCF /* constant_record.hpp */, B5D8FC381C23E30D0045ADCF /* constant_record.hpp */,
B5E9C93C1C1F9DCA0073C123 /* reverse_client_interface.hpp */, B5E9C93C1C1F9DCA0073C123 /* reverse_client_interface.hpp */,
A209B57B1BBA2A180070C310 /* opt_color_record.hpp */,
B52DA56C1B103FBE005CE75F /* assorted_primitives.cpp */, B52DA56C1B103FBE005CE75F /* assorted_primitives.cpp */,
B52DA56D1B103FBE005CE75F /* assorted_primitives.hpp */, B52DA56D1B103FBE005CE75F /* assorted_primitives.hpp */,
A24249601AF192FC003BF8F0 /* client_interface.hpp */, A24249601AF192FC003BF8F0 /* client_interface.hpp */,
...@@ -699,6 +855,7 @@ ...@@ -699,6 +855,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
B5F06AA61D4987EF005BE736 /* DBEnumUsageRecord.mm in Sources */,
A238CA981AF84B7100CDDCE5 /* DBMapRecord+Private.mm in Sources */, A238CA981AF84B7100CDDCE5 /* DBMapRecord+Private.mm in Sources */,
CFC5D9E81B1513E800BF2DF8 /* DBExternInterface1+Private.mm in Sources */, CFC5D9E81B1513E800BF2DF8 /* DBExternInterface1+Private.mm in Sources */,
B5D8FC361C23E2F40045ADCF /* DBConstantRecord.mm in Sources */, B5D8FC361C23E2F40045ADCF /* DBConstantRecord.mm in Sources */,
...@@ -713,8 +870,11 @@ ...@@ -713,8 +870,11 @@
A24850291AF96EBC00AFE907 /* DBDateRecord.mm in Sources */, A24850291AF96EBC00AFE907 /* DBDateRecord.mm in Sources */,
A278D45319BA3601006FD937 /* test_helpers.cpp in Sources */, A278D45319BA3601006FD937 /* test_helpers.cpp in Sources */,
6551684C1C4050A4003682A4 /* DBReturnOne+Private.mm in Sources */, 6551684C1C4050A4003682A4 /* DBReturnOne+Private.mm in Sources */,
B51911501D555EE900772DFE /* DBVarnameRecord+Private.mm in Sources */,
B5F06AA51D4987EF005BE736 /* DBEnumUsageInterface+Private.mm in Sources */,
CFFD588D1B019E79001E10B6 /* DBCppException+Private.mm in Sources */, CFFD588D1B019E79001E10B6 /* DBCppException+Private.mm in Sources */,
A238CA921AF84B7100CDDCE5 /* DBDateRecord+Private.mm in Sources */, A238CA921AF84B7100CDDCE5 /* DBDateRecord+Private.mm in Sources */,
B58B16AF1D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord+Private.mm in Sources */,
A248502B1AF96EBC00AFE907 /* DBMapListRecord.mm in Sources */, A248502B1AF96EBC00AFE907 /* DBMapListRecord.mm in Sources */,
6536CD7819A6C98800DD7715 /* cpp_exception_impl.cpp in Sources */, 6536CD7819A6C98800DD7715 /* cpp_exception_impl.cpp in Sources */,
A248502C1AF96EBC00AFE907 /* DBMapRecord.mm in Sources */, A248502C1AF96EBC00AFE907 /* DBMapRecord.mm in Sources */,
...@@ -722,11 +882,13 @@ ...@@ -722,11 +882,13 @@
CFF89B931B5D2CC7007F6EC2 /* date_record.cpp in Sources */, CFF89B931B5D2CC7007F6EC2 /* date_record.cpp in Sources */,
A24850301AF96EBC00AFE907 /* DBRecordWithNestedDerivings.mm in Sources */, A24850301AF96EBC00AFE907 /* DBRecordWithNestedDerivings.mm in Sources */,
CFFD58B11B041BD9001E10B6 /* DBConstantsInterface.mm in Sources */, CFFD58B11B041BD9001E10B6 /* DBConstantsInterface.mm in Sources */,
A209B5791BBA2A0A0070C310 /* DBOptColorRecord.mm in Sources */,
B52DA56E1B103FC5005CE75F /* assorted_primitives.cpp in Sources */, B52DA56E1B103FC5005CE75F /* assorted_primitives.cpp in Sources */,
CFFD58B31B041BD9001E10B6 /* DBConstantsInterface+Private.mm in Sources */, CFFD58B31B041BD9001E10B6 /* DBConstantsInterface+Private.mm in Sources */,
CFC5D9FC1B152E4300BF2DF8 /* TranslateDuration.cpp in Sources */, CFC5D9FC1B152E4300BF2DF8 /* TranslateDuration.cpp in Sources */,
B51911511D555EE900772DFE /* DBVarnameRecord.mm in Sources */,
A248502F1AF96EBC00AFE907 /* DBRecordWithDerivings.mm in Sources */, A248502F1AF96EBC00AFE907 /* DBRecordWithDerivings.mm in Sources */,
B58B16B51D5AD55B00EF92B5 /* interface_using_extended_record.cpp in Sources */,
B5F06A851D4973BD005BE736 /* DBConflict+Private.mm in Sources */,
A24249741AF192FC003BF8F0 /* constants.cpp in Sources */, A24249741AF192FC003BF8F0 /* constants.cpp in Sources */,
CFFD588B1B019E79001E10B6 /* DBClientInterface+Private.mm in Sources */, CFFD588B1B019E79001E10B6 /* DBClientInterface+Private.mm in Sources */,
B52DA5691B103F72005CE75F /* DBAssortedPrimitives.mm in Sources */, B52DA5691B103F72005CE75F /* DBAssortedPrimitives.mm in Sources */,
...@@ -736,14 +898,20 @@ ...@@ -736,14 +898,20 @@
CFAED8751B54291900E3B8A3 /* DBEmptyRecord.mm in Sources */, CFAED8751B54291900E3B8A3 /* DBEmptyRecord.mm in Sources */,
A238CA9A1AF84B7100CDDCE5 /* DBNestedCollection+Private.mm in Sources */, A238CA9A1AF84B7100CDDCE5 /* DBNestedCollection+Private.mm in Sources */,
CFFD58911B019E79001E10B6 /* DBUserToken+Private.mm in Sources */, CFFD58911B019E79001E10B6 /* DBUserToken+Private.mm in Sources */,
B5153F9A1D54284100012654 /* DBJavaOnlyListener+Private.mm in Sources */,
B5F06A9A1D497A66005BE736 /* extended_record.cpp in Sources */,
A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */, A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */,
B5E9C9401C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm in Sources */, B5E9C9401C1F9E9E0073C123 /* DBReverseClientInterface+Private.mm in Sources */,
B58B16B41D5AD55B00EF92B5 /* record_using_extended_record.cpp in Sources */,
B58B16B11D5AC9BC00EF92B5 /* DBInterfaceUsingExtendedRecord+Private.mm in Sources */,
B5F06A891D4973BD005BE736 /* DBExtendedRecord.mm in Sources */,
A238CA961AF84B7100CDDCE5 /* DBMapListRecord+Private.mm in Sources */, A238CA961AF84B7100CDDCE5 /* DBMapListRecord+Private.mm in Sources */,
A238CA9C1AF84B7100CDDCE5 /* DBPrimitiveList+Private.mm in Sources */, A238CA9C1AF84B7100CDDCE5 /* DBPrimitiveList+Private.mm in Sources */,
650CA05A1C2AB48E007ADDDB /* DBListenerCaller+Private.mm in Sources */, 650CA05A1C2AB48E007ADDDB /* DBListenerCaller+Private.mm in Sources */,
A24249761AF192FC003BF8F0 /* record_with_nested_derivings.cpp in Sources */, A24249761AF192FC003BF8F0 /* record_with_nested_derivings.cpp in Sources */,
CFC5DA081B1532F600BF2DF8 /* DBRecordWithDurationAndDerivings.mm in Sources */, CFC5DA081B1532F600BF2DF8 /* DBRecordWithDurationAndDerivings.mm in Sources */,
A248502D1AF96EBC00AFE907 /* DBNestedCollection.mm in Sources */, A248502D1AF96EBC00AFE907 /* DBNestedCollection.mm in Sources */,
B5F06A861D4973BD005BE736 /* DBConflictUser+Private.mm in Sources */,
B5E9C93B1C1F9D9D0073C123 /* reverse_client_interface_impl.cpp in Sources */, B5E9C93B1C1F9D9D0073C123 /* reverse_client_interface_impl.cpp in Sources */,
CFC5D9D81B15106400BF2DF8 /* DBExternRecordWithDerivings+Private.mm in Sources */, CFC5D9D81B15106400BF2DF8 /* DBExternRecordWithDerivings+Private.mm in Sources */,
A238CAA21AF84B7100CDDCE5 /* DBSetRecord+Private.mm in Sources */, A238CAA21AF84B7100CDDCE5 /* DBSetRecord+Private.mm in Sources */,
...@@ -752,17 +920,28 @@ ...@@ -752,17 +920,28 @@
6551684F1C40511C003682A4 /* return_one_two.cpp in Sources */, 6551684F1C40511C003682A4 /* return_one_two.cpp in Sources */,
A24249751AF192FC003BF8F0 /* record_with_derivings.cpp in Sources */, A24249751AF192FC003BF8F0 /* record_with_derivings.cpp in Sources */,
CFC5D9D01B15105100BF2DF8 /* extern_record_with_derivings.cpp in Sources */, CFC5D9D01B15105100BF2DF8 /* extern_record_with_derivings.cpp in Sources */,
B58B16B71D5AD56600EF92B5 /* DBInterfaceUsingExtendedRecord.mm in Sources */,
B51911181D542A7000772DFE /* DBWcharTestHelpers+Private.mm in Sources */,
A238CA901AF84B7100CDDCE5 /* DBConstants+Private.mm in Sources */, A238CA901AF84B7100CDDCE5 /* DBConstants+Private.mm in Sources */,
B51911521D555EE900772DFE /* DBVarnameInterface+Private.mm in Sources */,
CFC5D9EA1B1513E800BF2DF8 /* DBExternInterface2+Private.mm in Sources */, CFC5D9EA1B1513E800BF2DF8 /* DBExternInterface2+Private.mm in Sources */,
CFC5DA011B15318B00BF2DF8 /* DBTestDuration+Private.mm in Sources */, CFC5DA011B15318B00BF2DF8 /* DBTestDuration+Private.mm in Sources */,
650CA05E1C2AB5AB007ADDDB /* ListenerCaller.cpp in Sources */, 650CA05E1C2AB5AB007ADDDB /* ListenerCaller.cpp in Sources */,
A248502A1AF96EBC00AFE907 /* DBMapDateRecord.mm in Sources */, A248502A1AF96EBC00AFE907 /* DBMapDateRecord.mm in Sources */,
B5F06A6D1D497396005BE736 /* extended_record_base.cpp in Sources */,
A238CA8E1AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm in Sources */, A238CA8E1AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm in Sources */,
B5F06A8A1D4973BD005BE736 /* DBExtendedRecord+Private.mm in Sources */,
6551684D1C4050A4003682A4 /* DBReturnTwo+Private.mm in Sources */, 6551684D1C4050A4003682A4 /* DBReturnTwo+Private.mm in Sources */,
B5F06AA71D4987EF005BE736 /* DBEnumUsageRecord+Private.mm in Sources */,
B52DA56B1B103F75005CE75F /* DBAssortedPrimitives+Private.mm in Sources */, B52DA56B1B103F75005CE75F /* DBAssortedPrimitives+Private.mm in Sources */,
B5153F941D54283700012654 /* DBWcharTestRec.mm in Sources */,
B5153F931D54283700012654 /* DBWcharTestRec+Private.mm in Sources */,
A248502E1AF96EBC00AFE907 /* DBPrimitiveList.mm in Sources */, A248502E1AF96EBC00AFE907 /* DBPrimitiveList.mm in Sources */,
A209B57A1BBA2A0A0070C310 /* DBOptColorRecord+Private.mm in Sources */, B5F06A8C1D4973BD005BE736 /* DBObjcOnlyListener+Private.mm in Sources */,
B5153F961D54283700012654 /* DBUsesSingleLanguageListeners+Private.mm in Sources */,
B58B16B01D5AC9BC00EF92B5 /* DBRecordUsingExtendedRecord.mm in Sources */,
B5D8FC371C23E2F40045ADCF /* DBConstantRecord+Private.mm in Sources */, B5D8FC371C23E2F40045ADCF /* DBConstantRecord+Private.mm in Sources */,
B519111B1D542B0700772DFE /* wchar_test_helpers.cpp in Sources */,
A238CAA01AF84B7100CDDCE5 /* DBRecordWithNestedDerivings+Private.mm in Sources */, A238CAA01AF84B7100CDDCE5 /* DBRecordWithNestedDerivings+Private.mm in Sources */,
CFC5DA0A1B1532F600BF2DF8 /* DBRecordWithDurationAndDerivings+Private.mm in Sources */, CFC5DA0A1B1532F600BF2DF8 /* DBRecordWithDurationAndDerivings+Private.mm in Sources */,
); );
...@@ -772,6 +951,7 @@ ...@@ -772,6 +951,7 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5AEA68151D38F4A40083D770 /* DBWcharTests.m in Sources */,
CFC5D9D11B15105100BF2DF8 /* extern_record_with_derivings.cpp in Sources */, CFC5D9D11B15105100BF2DF8 /* extern_record_with_derivings.cpp in Sources */,
6D66A8A91A3B09F000B312E8 /* DBConstantTests.mm in Sources */, 6D66A8A91A3B09F000B312E8 /* DBConstantTests.mm in Sources */,
6536CD9219A6C9A800DD7715 /* DBRecordWithDerivingsCppTests.mm in Sources */, 6536CD9219A6C9A800DD7715 /* DBRecordWithDerivingsCppTests.mm in Sources */,
...@@ -833,7 +1013,7 @@ ...@@ -833,7 +1013,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_ARC = YES;
...@@ -877,7 +1057,7 @@ ...@@ -877,7 +1057,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++"; CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_ARC = YES;
......
...@@ -17,12 +17,14 @@ base_dir=$(cd "`dirname "$loc"`" && pwd) ...@@ -17,12 +17,14 @@ base_dir=$(cd "`dirname "$loc"`" && pwd)
temp_out="$base_dir/djinni-output-temp" temp_out="$base_dir/djinni-output-temp"
in="$base_dir/djinni/all.djinni" in="$base_dir/djinni/all.djinni"
wchar_in="$base_dir/djinni/wchar_test.djinni"
# Relative version of in and temp_out are used for Djinni call below so that # Relative version of in and temp_out are used for Djinni call below so that
# generated lists of infiles/outfiles are not machine-dependent. This # generated lists of infiles/outfiles are not machine-dependent. This
# is an artifact of the test suite, where we want the genereated files # is an artifact of the test suite, where we want the genereated files
# to be in git for examination. # to be in git for examination.
in_relative="djinni/all.djinni" in_relative="djinni/all.djinni"
wchar_in_relative="djinni/wchar_test.djinni"
temp_out_relative="djinni-output-temp" temp_out_relative="djinni-output-temp"
cpp_out="$base_dir/generated-src/cpp" cpp_out="$base_dir/generated-src/cpp"
...@@ -55,8 +57,10 @@ elif [ $# -eq 1 ]; then ...@@ -55,8 +57,10 @@ elif [ $# -eq 1 ]; then
exit exit
fi fi
# Build Djinni. # Build Djinni
"$base_dir/../src/build" "$base_dir/../src/build"
# Run Djinni generation
[ ! -e "$temp_out" ] || rm -r "$temp_out" [ ! -e "$temp_out" ] || rm -r "$temp_out"
(cd "$base_dir" && \ (cd "$base_dir" && \
"$base_dir/../src/run-assume-built" \ "$base_dir/../src/run-assume-built" \
...@@ -71,7 +75,36 @@ fi ...@@ -71,7 +75,36 @@ fi
--cpp-namespace testsuite \ --cpp-namespace testsuite \
--ident-cpp-enum-type foo_bar \ --ident-cpp-enum-type foo_bar \
--cpp-optional-template "std::experimental::optional" \ --cpp-optional-template "std::experimental::optional" \
--cpp-optional-header "<experimental/optional>" \ --cpp-optional-header "\"../../handwritten-src/cpp/optional.hpp\"" \
--cpp-extended-record-include-prefix "../../handwritten-src/cpp/" \
--cpp-use-wide-strings true \
\
--jni-out "$temp_out_relative/jni" \
--ident-jni-class NativeFooBar \
--ident-jni-file NativeFooBar \
\
--objc-out "$temp_out_relative/objc" \
--objcpp-out "$temp_out_relative/objc" \
--objc-type-prefix DB \
\
--yaml-out "$temp_out_relative/yaml" \
--yaml-out-file "yaml-test.yaml" \
--yaml-prefix "test_" \
\
--idl "$wchar_in_relative" && \
"$base_dir/../src/run-assume-built" \
--java-out "$temp_out_relative/java" \
--java-package $java_package \
--java-nullable-annotation "javax.annotation.CheckForNull" \
--java-nonnull-annotation "javax.annotation.Nonnull" \
--java-use-final-for-record false \
--ident-java-field mFooBar \
\
--cpp-out "$temp_out_relative/cpp" \
--cpp-namespace testsuite \
--ident-cpp-enum-type foo_bar \
--cpp-optional-template "std::experimental::optional" \
--cpp-optional-header "\"../../handwritten-src/cpp/optional.hpp\"" \
--cpp-extended-record-include-prefix "../../handwritten-src/cpp/" \ --cpp-extended-record-include-prefix "../../handwritten-src/cpp/" \
\ \
--jni-out "$temp_out_relative/jni" \ --jni-out "$temp_out_relative/jni" \
...@@ -95,27 +128,29 @@ fi ...@@ -95,27 +128,29 @@ fi
# Make sure we can parse back our own generated YAML file # Make sure we can parse back our own generated YAML file
cp "$base_dir/djinni/yaml-test.djinni" "$temp_out/yaml" cp "$base_dir/djinni/yaml-test.djinni" "$temp_out/yaml"
(cd "$base_dir" && \
"$base_dir/../src/run-assume-built" \ "$base_dir/../src/run-assume-built" \
--java-out "$temp_out/java" \ --java-out "$temp_out_relative/java" \
--java-package $java_package \ --java-package $java_package \
--ident-java-field mFooBar \ --ident-java-field mFooBar \
\ \
--cpp-out "$temp_out/cpp" \ --cpp-out "$temp_out_relative/cpp" \
--ident-cpp-enum-type foo_bar \ --ident-cpp-enum-type foo_bar \
--cpp-optional-template "std::experimental::optional" \ --cpp-optional-template "std::experimental::optional" \
--cpp-optional-header "<experimental/optional>" \ --cpp-optional-header "\"../../handwritten-src/cpp/optional.hpp\"" \
\ \
--jni-out "$temp_out/jni" \ --jni-out "$temp_out_relative/jni" \
--ident-jni-class NativeFooBar \ --ident-jni-class NativeFooBar \
--ident-jni-file NativeFooBar \ --ident-jni-file NativeFooBar \
\ \
--objc-out "$temp_out/objc" \ --objc-out "$temp_out_relative/objc" \
--objcpp-out "$temp_out/objc" \ --objcpp-out "$temp_out_relative/objc" \
--objc-type-prefix DB \ --objc-type-prefix DB \
\ \
--idl "$temp_out/yaml/yaml-test.djinni" --idl "$temp_out_relative/yaml/yaml-test.djinni" \
)
# Copy changes from "$temp_output" to final dir. # Copy changes from "$temp_out" to final dir.
mirror() { mirror() {
local prefix="$1" ; shift local prefix="$1" ; shift
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment