Commit fe000c8d authored by Aleksey Konovalov's avatar Aleksey Konovalov

added generated source files

parent 40b02bf6
// 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!
// This file generated by Djinni from wchar_test.djinni
#pragma once
#include <string>
#include <utility>
namespace testsuite {
struct WcharTestRec final {
std::wstring s;
WcharTestRec(std::wstring s_)
: s(std::move(s_))
{}
};
} // namespace testsuite
// 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!
// This file generated by Djinni from wchar_test.djinni
package com.dropbox.djinni.test;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
public class WcharTestRec {
/*package*/ final String mS;
public WcharTestRec(
@Nonnull String s) {
this.mS = s;
}
@Nonnull
public String getS() {
return mS;
}
@Override
public String toString() {
return "WcharTestRec{" +
"mS=" + mS +
"}";
}
}
// 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
// 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 <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 r = ::testsuite::WcharTestHelpers::get_record();
return ::djinni_generated::WcharTestRec::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (nonnull NSString *)getString {
try {
auto r = ::testsuite::WcharTestHelpers::get_string();
return ::djinni::WString::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (BOOL)checkString:(nonnull NSString *)str {
try {
auto r = ::testsuite::WcharTestHelpers::check_string(::djinni::WString::toCpp(str));
return ::djinni::Bool::fromCpp(r);
} DJINNI_TRANSLATE_EXCEPTIONS()
}
+ (BOOL)checkRecord:(nonnull DBWcharTestRec *)rec {
try {
auto r = ::testsuite::WcharTestHelpers::check_record(::djinni_generated::WcharTestRec::toCpp(rec));
return ::djinni::Bool::fromCpp(r);
} 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
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