Commit d5dd5294 authored by Miro Knejp's avatar Miro Knejp Committed by Jacob Potter

Refactored record code generation to utilize translation types like JNI does

parent 30e73aeb
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "TXSItemList.h" #import "TXSItemList.h"
#include "item_list.hpp" #include "item_list.hpp"
#import <Foundation/Foundation.h>
@interface TXSItemList () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppItemList:(const ::textsort::ItemList &)itemList; @class TXSItemList;
- (::textsort::ItemList)cppItemList;
@end namespace djinni_generated {
struct ItemList
{
using CppType = ::textsort::ItemList;
using ObjcType = TXSItemList*;
using Boxed = ItemList;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSItemList+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto ItemList::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::vector<std::string> items;
items.reserve([obj.items count]);
for (NSString *objcValue_0 in obj.items) {
std::string cppValue_0 = ::djinni::String::toCpp(objcValue_0);
items.push_back(std::move(cppValue_0));
}
return ::textsort::ItemList(
items);
}
auto ItemList::fromCpp(const CppType& cpp) -> ObjcType
{
std::vector<NSString *> itemsTempVector;
itemsTempVector.reserve(cpp.items.size());
for (const auto & cppValue_0 : cpp.items) {
NSString *objcValue_0 = ::djinni::String::fromCpp(cppValue_0);
itemsTempVector.push_back(objcValue_0);
}
NSArray *items = [NSArray arrayWithObjects:&itemsTempVector[0] count:itemsTempVector.size()];
return [[TXSItemList alloc]
initWithItems:items];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface TXSItemList : NSObject @interface TXSItemList : NSObject
- (id)initWithItemList:(TXSItemList *)itemList; - (id)initWithItemList:(TXSItemList *)itemList;
- (id)initWithItems:(NSArray *)items; - (id)initWithItems:(NSArray *)items;
......
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSItemList.h"
@implementation TXSItemList
- (id)initWithItemList:(TXSItemList *)itemList
{
if (self = [super init]) {
NSMutableArray *_itemsTempArray = [NSMutableArray arrayWithCapacity:[itemList.items count]];
for (NSString *currentValue_0 in itemList.items) {
id copiedValue_0;
copiedValue_0 = [currentValue_0 copy];
[_itemsTempArray addObject:copiedValue_0];
}
_items = _itemsTempArray;
}
return self;
}
- (id)initWithItems:(NSArray *)items
{
if (self = [super init]) {
_items = items;
}
return self;
}
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni
#import "TXSItemList+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation TXSItemList
- (id)initWithItemList:(TXSItemList *)itemList
{
if (self = [super init]) {
std::vector<NSString *> _itemsTempVector;
_itemsTempVector.reserve([itemList.items count]);
for (NSString *currentValue_0 in itemList.items) {
NSString *copiedValue_0;
copiedValue_0 = [currentValue_0 copy];
_itemsTempVector.push_back(copiedValue_0);
}
_items = [NSArray arrayWithObjects:&_itemsTempVector[0] count:_itemsTempVector.size()];
}
return self;
}
- (id)initWithItems:(NSArray *)items
{
if (self = [super init]) {
_items = items;
}
return self;
}
- (id)initWithCppItemList:(const ::textsort::ItemList &)itemList
{
if (self = [super init]) {
std::vector<NSString *> _itemsTempVector;
_itemsTempVector.reserve(itemList.items.size());
for (const auto & cppValue_0 : itemList.items) {
NSString *objcValue_0 = ::djinni::String::fromCpp(cppValue_0);
_itemsTempVector.push_back(objcValue_0);
}
_items = [NSArray arrayWithObjects:&_itemsTempVector[0] count:_itemsTempVector.size()];
}
return self;
}
- (::textsort::ItemList)cppItemList
{
std::vector<std::string> items;
items.reserve([_items count]);
for (NSString *objcValue_0 in _items) {
std::string cppValue_0 = ::djinni::String::toCpp(objcValue_0);
items.push_back(std::move(cppValue_0));
}
return ::textsort::ItemList(
std::move(items));
}
@end
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni // This file generated by Djinni from example.djinni
#import "TXSItemList.h"
#import "TXSSortOrder.h" #import "TXSSortOrder.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class TXSItemList;
@class TXSSortItems; @class TXSSortItems;
@protocol TXSTextboxListener; @protocol TXSTextboxListener;
......
...@@ -54,7 +54,7 @@ auto SortItems::fromCpp(const CppType& cpp) -> ObjcType ...@@ -54,7 +54,7 @@ auto SortItems::fromCpp(const CppType& cpp) -> ObjcType
- (void)sort:(TXSSortOrder)order items:(TXSItemList *)items { - (void)sort:(TXSSortOrder)order items:(TXSItemList *)items {
try { try {
::textsort::sort_order cppOrder = ::djinni::Enum<::textsort::sort_order, TXSSortOrder>::toCpp(order); ::textsort::sort_order cppOrder = ::djinni::Enum<::textsort::sort_order, TXSSortOrder>::toCpp(order);
::textsort::ItemList cppItems = std::move([items cppItemList]); ::textsort::ItemList cppItems = ::djinni_generated::ItemList::toCpp(items);
_cppRef.get()->sort(std::move(cppOrder), std::move(cppItems)); _cppRef.get()->sort(std::move(cppOrder), std::move(cppItems));
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from example.djinni // This file generated by Djinni from example.djinni
#import "TXSItemList.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class TXSItemList;
@protocol TXSTextboxListener @protocol TXSTextboxListener
......
...@@ -40,7 +40,7 @@ auto TextboxListener::fromCpp(const CppType& cpp) -> ObjcType ...@@ -40,7 +40,7 @@ auto TextboxListener::fromCpp(const CppType& cpp) -> ObjcType
void ObjcProxy::update (const ::textsort::ItemList & items) void ObjcProxy::update (const ::textsort::ItemList & items)
{ {
@autoreleasepool { @autoreleasepool {
TXSItemList *cpp_items = [[TXSItemList alloc] initWithCppItemList:items]; TXSItemList *cpp_items = ::djinni_generated::ItemList::fromCpp(items);
[Handle::get() update:cpp_items]; [Handle::get() update:cpp_items];
} }
} }
...@@ -57,8 +57,7 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) { ...@@ -57,8 +57,7 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
case DRecord => case DRecord =>
val r = d.body.asInstanceOf[Record] val r = d.body.asInstanceOf[Record]
val prefix = if (r.ext.objc) "../" else "" val prefix = if (r.ext.objc) "../" else ""
header.add("@class " + marshal.typename(tm) + ";") header.add("#import " + q(spec.objcIncludePrefix + prefix + headerName(d.name)))
body.add("#import " + q(spec.objcIncludePrefix + prefix + headerName(d.name)))
} }
case p: MParam => case p: MParam =>
} }
...@@ -85,7 +84,7 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) { ...@@ -85,7 +84,7 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
} }
def headerName(ident: String): String = idObjc.ty(ident) + "." + spec.objcHeaderExt def headerName(ident: String): String = idObjc.ty(ident) + "." + spec.objcHeaderExt
def bodyName(ident: String): String = idObjc.ty(ident) + "." + spec.objcExt def bodyName(ident: String): String = idObjc.ty(ident) + ".mm" // Must be a Obj-C++ file in case the constants are not compile-time constant expressions
def writeObjcConstVariable(w: IndentWriter, c: Const, s: String): Unit = c.ty.resolved.base match { def writeObjcConstVariable(w: IndentWriter, c: Const, s: String): Unit = c.ty.resolved.base match {
// MBinary | MList | MSet | MMap are not allowed for constants. // MBinary | MList | MSet | MMap are not allowed for constants.
...@@ -205,9 +204,9 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) { ...@@ -205,9 +204,9 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
val self = marshal.typename(objcName, r) val self = marshal.typename(objcName, r)
refs.header.add("#import <Foundation/Foundation.h>") refs.header.add("#import <Foundation/Foundation.h>")
refs.body.add("!#import " + q(spec.objcIncludePrefix + (if (r.ext.objc) "../" else "") + headerName(ident)))
if (r.ext.objc) { if (r.ext.objc) {
refs.body.add("#import " + q(spec.objcIncludePrefix + "../" + headerName(ident)))
refs.header.add(s"@class $noBaseSelf;") refs.header.add(s"@class $noBaseSelf;")
} }
...@@ -220,13 +219,6 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) { ...@@ -220,13 +219,6 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
writeObjcFile(headerName(objcName), origin, refs.header, w => { writeObjcFile(headerName(objcName), origin, refs.header, w => {
writeDoc(w, doc) writeDoc(w, doc)
for (c <- r.consts) {
writeDoc(w, c.doc)
w.w(s"extern ")
writeObjcConstVariable(w, c, noBaseSelf);
w.wl(s";")
}
w.wl
w.wl(s"@interface $self : NSObject") w.wl(s"@interface $self : NSObject")
// Deep copy construtor // Deep copy construtor
...@@ -252,7 +244,201 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) { ...@@ -252,7 +244,201 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
} }
w.wl w.wl
w.wl("@end") w.wl("@end")
if (r.consts.nonEmpty) {
w.wl
for (c <- r.consts) {
writeDoc(w, c.doc)
w.w(s"extern ")
writeObjcConstVariable(w, c, noBaseSelf);
w.wl(s";")
}
}
}) })
writeObjcFile(bodyName(objcName), origin, refs.body, w => {
if (r.consts.nonEmpty) generateObjcConstants(w, r.consts, noBaseSelf)
w.wl
w.wl(s"@implementation $self")
w.wl
w.wl(s"- (id)${idObjc.method("init_with_" + ident.name)}:($noBaseSelf *)${idObjc.local(ident)}")
w.braced {
w.w("if (self = [super init])").braced {
for (f <- r.fields) {
copyObjcValue(s"_${idObjc.field(f.ident)}", s"${idObjc.local(ident)}.${idObjc.field(f.ident)}", f.ty, w)
}
}
w.wl("return self;")
}
w.wl
// Constructor from all fields (not copying)
if (!r.fields.isEmpty) {
val head = r.fields.head
val skipFirst = SkipFirst()
w.w(s"- (id)${idObjc.method("init_with_" + head.ident.name)}:(${marshal.paramType(head.ty)})${idObjc.field(head.ident)}")
for (f <- r.fields) skipFirst {
w.w(s" ${idObjc.field(f.ident.name)}:(${marshal.paramType(f.ty)})${idObjc.local(f.ident)}")
}
w.wl
w.braced {
w.w("if (self = [super init])").braced {
for (f <- r.fields) {
if (checkMutable(f.ty.resolved))
w.wl(s"_${idObjc.field(f.ident)} = [${idObjc.local(f.ident)} copy];")
else
w.wl(s"_${idObjc.field(f.ident)} = ${idObjc.local(f.ident)};")
}
}
w.wl("return self;")
}
w.wl
}
if (r.derivingTypes.contains(DerivingType.Eq)) {
w.wl("- (BOOL)isEqual:(id)other")
w.braced {
w.w(s"if (![other isKindOfClass:[$self class]])").braced {
w.wl("return NO;")
}
w.wl(s"$self *typedOther = ($self *)other;")
val skipFirst = SkipFirst()
w.w(s"return ").nestedN(2) {
for (f <- r.fields) {
skipFirst { w.wl(" &&") }
f.ty.resolved.base match {
case MBinary => w.w(s"[self.${idObjc.field(f.ident)} isEqualToData:typedOther.${idObjc.field(f.ident)}]")
case MList => w.w(s"[self.${idObjc.field(f.ident)} isEqualToArray:typedOther.${idObjc.field(f.ident)}]")
case MSet => w.w(s"[self.${idObjc.field(f.ident)} isEqualToSet:typedOther.${idObjc.field(f.ident)}]")
case MMap => w.w(s"[self.${idObjc.field(f.ident)} isEqualToDictionary:typedOther.${idObjc.field(f.ident)}]")
case MOptional =>
f.ty.resolved.args.head.base match {
case df: MDef if df.defType == DEnum =>
w.w(s"self.${idObjc.field(f.ident)} == typedOther.${idObjc.field(f.ident)}")
case _ =>
w.w(s"((self.${idObjc.field(f.ident)} == nil && typedOther.${idObjc.field(f.ident)} == nil) || ")
w.w(s"(self.${idObjc.field(f.ident)} != nil && [self.${idObjc.field(f.ident)} isEqual:typedOther.${idObjc.field(f.ident)}]))")
}
case MString => w.w(s"[self.${idObjc.field(f.ident)} isEqualToString:typedOther.${idObjc.field(f.ident)}]")
case t: MPrimitive => w.w(s"self.${idObjc.field(f.ident)} == typedOther.${idObjc.field(f.ident)}")
case df: MDef => df.defType match {
case DRecord => w.w(s"[self.${idObjc.field(f.ident)} isEqual:typedOther.${idObjc.field(f.ident)}]")
case DEnum => w.w(s"self.${idObjc.field(f.ident)} == typedOther.${idObjc.field(f.ident)}")
case _ => throw new AssertionError("Unreachable")
}
case _ => throw new AssertionError("Unreachable")
}
}
}
w.wl(";")
}
}
def generatePrimitiveOrder(ident: Ident, w: IndentWriter): Unit = {
w.wl(s"if (self.${idObjc.field(ident)} < other.${idObjc.field(ident)}) {").nested {
w.wl(s"tempResult = NSOrderedAscending;")
}
w.wl(s"} else if (self.${idObjc.field(ident)} > other.${idObjc.field(ident)}) {").nested {
w.wl(s"tempResult = NSOrderedDescending;")
}
w.wl(s"} else {").nested {
w.wl(s"tempResult = NSOrderedSame;")
}
w.wl("}")
}
if (r.derivingTypes.contains(DerivingType.Ord)) {
w.wl(s"- (NSComparisonResult)compare:($self *)other")
w.braced {
w.wl("NSComparisonResult tempResult;")
for (f <- r.fields) {
f.ty.resolved.base match {
case MString => w.wl(s"tempResult = [self.${idObjc.field(f.ident)} compare:other.${idObjc.field(f.ident)}];")
case t: MPrimitive => generatePrimitiveOrder(f.ident, w)
case df: MDef => df.defType match {
case DRecord => w.wl(s"tempResult = [self.${idObjc.field(f.ident)} compare:other.${idObjc.field(f.ident)}];")
case DEnum => generatePrimitiveOrder(f.ident, w)
case _ => throw new AssertionError("Unreachable")
}
case _ => throw new AssertionError("Unreachable")
}
w.w("if (tempResult != NSOrderedSame)").braced {
w.wl("return tempResult;")
}
}
w.wl("return NSOrderedSame;")
}
}
w.wl
w.wl("@end")
})
}
def copyObjcValue(to: String, from: String, ty: TypeRef, w: IndentWriter): Unit =
copyObjcValue(to, from, ty.resolved, w)
def copyObjcValue(to: String, from: String, tm: MExpr, w: IndentWriter): Unit = {
def f(to: String, from: String, tm: MExpr, needRef: Boolean, w: IndentWriter, valueLevel: Int): Unit = {
tm.base match {
case MOptional => {
w.wl(s"if ($from == nil) {").nested {
w.wl(s"$to = nil;")
}
w.wl("} else {").nested {
f(to, from, tm.args.head, true, w, valueLevel)
}
w.wl("}")
}
case p: MPrimitive => w.wl(s"$to = $from;") // NSNumber is immutable, so are primitive values
case MString => w.wl(s"$to = [$from copy];")
case MDate => w.wl(s"$to = [$from copy];")
case MBinary => w.wl(s"$to = [$from copy];")
case MList => {
val copyName = "copiedValue_" + valueLevel
val currentName = "currentValue_" + valueLevel
w.wl(s"NSMutableArray *${to}TempArray = [NSMutableArray arrayWithCapacity:[$from count]];")
w.w(s"for (${toObjcTypeDef(tm.args.head, true)}$currentName in $from)").braced {
w.wl(s"id $copyName;")
f(copyName, currentName, tm.args.head, true, w, valueLevel + 1)
w.wl(s"[${to}TempArray addObject:$copyName];")
}
w.wl(s"$to = ${to}TempArray;")
}
case MSet => {
val copyName = "copiedValue_" + valueLevel
val currentName = "currentValue_" + valueLevel
w.wl(s"NSMutableSet *${to}TempSet = [NSMutableSet setWithCapacity:[$from count]];")
w.w(s"for (${toObjcTypeDef(tm.args.head, true)}$currentName in $from)").braced {
w.wl(s"id $copyName;")
f(copyName, currentName, tm.args.head, true, w, valueLevel + 1)
w.wl(s"[${to}TempSet addObject:$copyName];")
}
w.wl(s"$to = ${to}TempSet;")
}
case MMap => {
w.wl(s"NSMutableDictionary *${to}TempDictionary = [NSMutableDictionary dictionaryWithCapacity:[$from count]];")
val keyName = "key_" + valueLevel
val valueName = "value_" + valueLevel
val copiedKeyName = "copiedKey_" + valueLevel
val copiedValueName = "copiedValue_" + valueLevel
w.w(s"for (id $keyName in $from)").braced {
w.wl(s"id $copiedKeyName, $copiedValueName;")
f(copiedKeyName, keyName, tm.args.apply(0), true, w, valueLevel + 1)
w.wl(s"id $valueName = [$from objectForKey:$keyName];")
f(copiedValueName, valueName, tm.args.apply(1), true, w, valueLevel + 1)
w.wl(s"[${to}TempDictionary setObject:$copiedValueName forKey:$copiedKeyName];")
}
w.wl(s"$to = ${to}TempDictionary;")
}
case d: MDef => {
val typeName = d.name
val self = idObjc.ty(typeName)
d.defType match {
case DEnum => w.wl(s"$to = $from;")
case DRecord => w.wl(s"$to = [[${idObjc.ty(d.name)} alloc] ${idObjc.method("init_with_" + d.name)}:$from];")
case DInterface => w.wl(s"$to = $from;")
}
}
case p: MParam =>
}
}
f(to, from, tm, false, w, 0)
} }
def writeObjcFile(fileName: String, origin: String, refs: Iterable[String], f: IndentWriter => Unit) { def writeObjcFile(fileName: String, origin: String, refs: Iterable[String], f: IndentWriter => Unit) {
...@@ -310,4 +496,11 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) { ...@@ -310,4 +496,11 @@ class ObjcGenerator(spec: Spec) extends Generator(spec) {
f(tm, needRef) f(tm, needRef)
} }
def toObjcTypeDef(ty: TypeRef): String = toObjcTypeDef(ty.resolved, false)
def toObjcTypeDef(ty: TypeRef, needRef: Boolean): String = toObjcTypeDef(ty.resolved, needRef)
def toObjcTypeDef(tm: MExpr): String = toObjcTypeDef(tm, false)
def toObjcTypeDef(tm: MExpr, needRef: Boolean): String = {
val (name, asterisk) = toObjcType(tm, needRef)
name + (if (asterisk) " *" else " ")
}
} }
...@@ -78,6 +78,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -78,6 +78,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
def headerName(ident: String): String = idObjc.ty(ident) + "." + spec.objcHeaderExt def headerName(ident: String): String = idObjc.ty(ident) + "." + spec.objcHeaderExt
def privateHeaderName(ident: String): String = idObjc.ty(ident) + "+Private." + spec.objcHeaderExt def privateHeaderName(ident: String): String = idObjc.ty(ident) + "+Private." + spec.objcHeaderExt
def bodyName(ident: String): String = idObjc.ty(ident) + "." + spec.objcExt def bodyName(ident: String): String = idObjc.ty(ident) + "." + spec.objcExt
def privateBodyName(ident: String): String = idObjc.ty(ident) + "+Private." + spec.objcExt
def writeObjcConstVariable(w: IndentWriter, c: Const, s: String): Unit = c.ty.resolved.base match { def writeObjcConstVariable(w: IndentWriter, c: Const, s: String): Unit = c.ty.resolved.base match {
// MBinary | MList | MSet | MMap are not allowed for constants. // MBinary | MList | MSet | MMap are not allowed for constants.
...@@ -325,11 +326,11 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -325,11 +326,11 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
refs.header.add("#import <Foundation/Foundation.h>") refs.header.add("#import <Foundation/Foundation.h>")
refs.privHeader.add("#import <Foundation/Foundation.h>")
refs.privHeader.add("!#import " + q(spec.objcIncludePrefix + headerName(objcName))) refs.privHeader.add("!#import " + q(spec.objcIncludePrefix + headerName(objcName)))
refs.privHeader.add("!#include " + q(spec.objcIncludeCppPrefix + spec.cppFileIdentStyle(ident) + "." + spec.cppHeaderExt)) refs.privHeader.add("!#include " + q(spec.objcIncludeCppPrefix + spec.cppFileIdentStyle(ident) + "." + spec.cppHeaderExt))
refs.body.add("#import <Foundation/Foundation.h>") refs.body.add("#import <Foundation/Foundation.h>")
refs.body.add("#include <cassert>")
refs.body.add("#include <utility>") refs.body.add("#include <utility>")
refs.body.add("#include <vector>") refs.body.add("#include <vector>")
refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIDate.h")) refs.body.add("#import " + q(spec.objcBaseLibIncludePrefix + "DJIDate.h"))
...@@ -337,7 +338,6 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -337,7 +338,6 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
if (r.ext.objc) { if (r.ext.objc) {
refs.body.add("#import " + q(spec.objcIncludePrefix + "../" + headerName(ident))) refs.body.add("#import " + q(spec.objcIncludePrefix + "../" + headerName(ident)))
refs.privHeader.add("#import " + q(spec.objcIncludePrefix + "../" + headerName(ident)))
refs.header.add(s"@class ${objcMarshal.typename(ident, r)};") refs.header.add(s"@class ${objcMarshal.typename(ident, r)};")
} }
...@@ -348,159 +348,72 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -348,159 +348,72 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
case _ => false case _ => false
} }
val helperClass = objcppMarshal.helperClass(ident)
val fqHelperClass = objcppMarshal.fqHelperClass(ident)
writeObjcFile(privateHeaderName(objcName), origin, refs.privHeader, w => { writeObjcFile(privateHeaderName(objcName), origin, refs.privHeader, w => {
w.wl(s"@interface $self ()") arcAssert(w)
w.wl w.wl
// Deep copy constructor w.wl(s"@class $noBaseSelf;")
w.wl(s"- (id)${idObjc.method("init_with_cpp_" + ident.name)}:(const $cppSelf &)${idObjc.local(ident)};")
w.wl(s"- ($cppSelf)${idObjc.method("cpp_" + ident.name)};")
w.wl w.wl
w.wl("@end") wrapNamespace(w, spec.objcppNamespace, w => {
w.wl(s"struct $helperClass")
w.bracedSemi {
w.wl(s"using CppType = $cppSelf;")
w.wl(s"using ObjcType = $noBaseSelf*;");
w.wl
w.wl(s"using Boxed = $helperClass;")
w.wl
w.wl(s"static CppType toCpp(ObjcType objc);")
w.wl(s"static ObjcType fromCpp(const CppType& cpp);")
}
})
}) })
writeObjcFile(bodyName(objcName), origin, refs.body, w => { writeObjcFile(privateBodyName(objcName), origin, refs.body, w => {
if (r.consts.nonEmpty) generateObjcConstants(w, r.consts, noBaseSelf) wrapNamespace(w, spec.objcppNamespace, w => {
arcAssert(w) w.wl(s"auto $helperClass::toCpp(ObjcType obj) -> CppType")
w.wl w.braced {
w.wl(s"@implementation $self") w.wl("assert(obj);")
w.wl
w.wl(s"- (id)${idObjc.method("init_with_" + ident.name)}:($noBaseSelf *)${idObjc.local(ident)}")
w.braced {
w.w("if (self = [super init])").braced {
for (f <- r.fields) { for (f <- r.fields) {
copyObjcValue(s"_${idObjc.field(f.ident)}", s"${idObjc.local(ident)}.${idObjc.field(f.ident)}", f.ty, w) translateObjcTypeToCpp(idCpp.local(f.ident), "obj." + idObjc.field(f.ident), f.ty, w)
} }
} w.w(s"return $cppSelf(")
w.wl("return self;") w.nested {
} val skipFirst = new SkipFirst
w.wl
// Constructor from all fields (not copying)
if (!r.fields.isEmpty) {
val head = r.fields.head
val skipFirst = SkipFirst()
w.w(s"- (id)${idObjc.method("init_with_" + head.ident.name)}:(${objcMarshal.paramType(head.ty)})${idObjc.field(head.ident)}")
for (f <- r.fields) skipFirst {
w.w(s" ${idObjc.field(f.ident.name)}:(${objcMarshal.paramType(f.ty)})${idObjc.local(f.ident)}")
}
w.wl
w.braced {
w.w("if (self = [super init])").braced {
for (f <- r.fields) { for (f <- r.fields) {
if (checkMutable(f.ty.resolved)) skipFirst { w.w(",") }
w.wl(s"_${idObjc.field(f.ident)} = [${idObjc.local(f.ident)} copy];") w.wl
else w.w(idCpp.local(f.ident))
w.wl(s"_${idObjc.field(f.ident)} = ${idObjc.local(f.ident)};")
} }
} }
w.wl("return self;") w.wl(");")
} }
w.wl w.wl
} w.wl(s"auto $helperClass::fromCpp(const CppType& cpp) -> ObjcType")
// Cpp -> Objc translator
w.wl(s"- (id)${idObjc.method("init_with_cpp_" + ident.name)}:(const $cppSelf &)${idObjc.local(ident)}")
w.braced {
w.w("if (self = [super init])").braced {
for (f <- r.fields) {
translateCppTypeToObjc("_" + idObjc.field(f.ident), idObjc.local(ident) + "." + idCpp.field(f.ident), f.ty, false, w)
}
}
w.wl("return self;")
}
w.wl
// Objc -> Cpp translator
w.wl(s"- ($cppSelf)${idObjc.method("cpp_" + ident.name)}")
w.braced {
for (f <- r.fields) {
translateObjcTypeToCpp(idObjc.local(f.ident), "_" + idObjc.field(f.ident), f.ty, w)
}
val skipFirst = SkipFirst()
w.wl(s"return $cppSelf(").nestedN(2) {
for (f <- r.fields)
{
skipFirst { w.wl(",") }
w.w("std::move(" + idObjc.local(f.ident) + ")")
}
}
w.wl(");")
}
if (r.derivingTypes.contains(DerivingType.Eq)) {
w.wl("- (BOOL)isEqual:(id)other")
w.braced { w.braced {
w.w(s"if (![other isKindOfClass:[$self class]])").braced { for (f <- r.fields) {
w.wl("return NO;") translateCppTypeToObjc(idObjc.local(f.ident), "cpp." + idCpp.field(f.ident), f.ty, true, w)
} }
w.wl(s"$self *typedOther = ($self *)other;") w.w(s"return [[$noBaseSelf alloc]")
val skipFirst = SkipFirst() if(!r.fields.isEmpty) {
w.w(s"return ").nestedN(2) { w.nested {
for (f <- r.fields) { w.wl
skipFirst { w.wl(" &&") } w.w("initWith" + IdentStyle.camelUpper(r.fields.head.ident) + ":" + idObjc.local(r.fields.head.ident))
f.ty.resolved.base match { for (f <- r.fields.tail) {
case MBinary => w.w(s"[self.${idObjc.field(f.ident)} isEqualToData:typedOther.${idObjc.field(f.ident)}]") w.wl
case MList => w.w(s"[self.${idObjc.field(f.ident)} isEqualToArray:typedOther.${idObjc.field(f.ident)}]") w.w(idObjc.field(f.ident) + ":" + idObjc.local(f.ident))
case MSet => w.w(s"[self.${idObjc.field(f.ident)} isEqualToSet:typedOther.${idObjc.field(f.ident)}]")
case MMap => w.w(s"[self.${idObjc.field(f.ident)} isEqualToDictionary:typedOther.${idObjc.field(f.ident)}]")
case MOptional =>
f.ty.resolved.args.head.base match {
case df: MDef if df.defType == DEnum =>
w.w(s"self.${idObjc.field(f.ident)} == typedOther.${idObjc.field(f.ident)}")
case _ =>
w.w(s"((self.${idObjc.field(f.ident)} == nil && typedOther.${idObjc.field(f.ident)} == nil) || ")
w.w(s"(self.${idObjc.field(f.ident)} != nil && [self.${idObjc.field(f.ident)} isEqual:typedOther.${idObjc.field(f.ident)}]))")
}
case MString => w.w(s"[self.${idObjc.field(f.ident)} isEqualToString:typedOther.${idObjc.field(f.ident)}]")
case t: MPrimitive => w.w(s"self.${idObjc.field(f.ident)} == typedOther.${idObjc.field(f.ident)}")
case df: MDef => df.defType match {
case DRecord => w.w(s"[self.${idObjc.field(f.ident)} isEqual:typedOther.${idObjc.field(f.ident)}]")
case DEnum => w.w(s"self.${idObjc.field(f.ident)} == typedOther.${idObjc.field(f.ident)}")
case _ => throw new AssertionError("Unreachable")
}
case _ => throw new AssertionError("Unreachable")
} }
} }
} }
w.wl(";") else {
} w.w(" init")
}
def generatePrimitiveOrder(ident: Ident, w: IndentWriter): Unit = {
w.wl(s"if (self.${idObjc.field(ident)} < other.${idObjc.field(ident)}) {").nested {
w.wl(s"tempResult = NSOrderedAscending;")
}
w.wl(s"} else if (self.${idObjc.field(ident)} > other.${idObjc.field(ident)}) {").nested {
w.wl(s"tempResult = NSOrderedDescending;")
}
w.wl(s"} else {").nested {
w.wl(s"tempResult = NSOrderedSame;")
}
w.wl("}")
}
if (r.derivingTypes.contains(DerivingType.Ord)) {
w.wl(s"- (NSComparisonResult)compare:($self *)other")
w.braced {
w.wl("NSComparisonResult tempResult;")
for (f <- r.fields) {
f.ty.resolved.base match {
case MString => w.wl(s"tempResult = [self.${idObjc.field(f.ident)} compare:other.${idObjc.field(f.ident)}];")
case t: MPrimitive => generatePrimitiveOrder(f.ident, w)
case df: MDef => df.defType match {
case DRecord => w.wl(s"tempResult = [self.${idObjc.field(f.ident)} compare:other.${idObjc.field(f.ident)}];")
case DEnum => generatePrimitiveOrder(f.ident, w)
case _ => throw new AssertionError("Unreachable")
}
case _ => throw new AssertionError("Unreachable")
}
w.w("if (tempResult != NSOrderedSame)").braced {
w.wl("return tempResult;")
}
} }
w.wl("return NSOrderedSame;") w.wl("];")
} }
} })
w.wl
w.wl("@end")
}) })
} }
def writeObjcFile(fileName: String, origin: String, refs: Iterable[String], f: IndentWriter => Unit) { def writeObjcFile(fileName: String, origin: String, refs: Iterable[String], f: IndentWriter => Unit) {
createFile(spec.objcPrivateOutFolder.get, fileName, (w: IndentWriter) => { createFile(spec.objcPrivateOutFolder.get, fileName, (w: IndentWriter) => {
...@@ -517,82 +430,6 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -517,82 +430,6 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
}) })
} }
def copyObjcValue(to: String, from: String, ty: TypeRef, w: IndentWriter): Unit =
copyObjcValue(to, from, ty.resolved, w)
def copyObjcValue(to: String, from: String, tm: MExpr, w: IndentWriter): Unit = {
def f(to: String, from: String, tm: MExpr, needRef: Boolean, w: IndentWriter, valueLevel: Int): Unit = {
tm.base match {
case MOptional => {
w.wl(s"if ($from == nil) {").nested {
w.wl(s"$to = nil;")
}
w.wl("} else {").nested {
f(to, from, tm.args.head, true, w, valueLevel)
}
w.wl("}")
}
case p: MPrimitive => w.wl(s"$to = $from;") // NSNumber is immutable, so are primitive values
case MString => w.wl(s"$to = [$from copy];")
case MDate => w.wl(s"$to = [$from copy];")
case MBinary => w.wl(s"$to = [$from copy];")
case MList => {
val copyName = "copiedValue_" + valueLevel
val currentName = "currentValue_" + valueLevel
w.wl(s"std::vector<${toObjcTypeDef(tm.args.head, true)}> ${to}TempVector;")
w.wl(s"${to}TempVector.reserve([$from count]);")
w.w(s"for (${toObjcTypeDef(tm.args.head, true)}$currentName in $from)").braced {
w.wl(s"${toObjcTypeDef(tm.args.head, true)}$copyName;")
f(copyName, currentName, tm.args.head, true, w, valueLevel + 1)
w.wl(s"${to}TempVector.push_back($copyName);")
}
w.wl(s"$to = [NSArray arrayWithObjects:&${to}TempVector[0] count:${to}TempVector.size()];")
}
case MSet => {
val copyName = "copiedValue_" + valueLevel
val currentName = "currentValue_" + valueLevel
w.wl(s"std::vector<${toObjcTypeDef(tm.args.head, true)}> ${to}TempVector;")
w.wl(s"${to}TempVector.reserve([$from count]);")
w.w(s"for (${toObjcTypeDef(tm.args.head, true)}$currentName in $from)").braced {
w.wl(s"${toObjcTypeDef(tm.args.head, true)}$copyName;")
f(copyName, currentName, tm.args.head, true, w, valueLevel + 1)
w.wl(s"${to}TempVector.push_back($copyName);")
}
w.wl(s"$to = [NSSet setWithObjects:&${to}TempVector[0] count:${to}TempVector.size()];")
}
case MMap => {
val keyType = toObjcTypeDef(tm.args.apply(0), true)
val valueType = toObjcTypeDef(tm.args.apply(1), true)
w.wl(s"std::vector<$keyType> ${to}TempKeyVector;")
w.wl(s"${to}TempKeyVector.reserve([$from count]);")
w.wl(s"std::vector<$valueType> ${to}TempValueVector;")
w.wl(s"${to}TempValueVector.reserve([$from count]);")
val keyName = "key_" + valueLevel
val valueName = "value_" + valueLevel
val copiedValueName = "copiedValue_" + valueLevel
w.w(s"for ($keyType$keyName in $from)").braced {
w.wl(s"$valueType$copiedValueName;")
w.wl(s"${to}TempKeyVector.push_back($keyName);")
w.wl(s"$valueType$valueName = [$from objectForKey:$keyName];")
f(copiedValueName, valueName, tm.args.apply(1), true, w, valueLevel + 1)
w.wl(s"${to}TempValueVector.push_back($copiedValueName);")
}
w.wl(s"$to = [NSDictionary dictionaryWithObjects:&${to}TempValueVector[0] forKeys:&${to}TempKeyVector[0] count:[$from count]];")
}
case d: MDef => {
val typeName = d.name
val self = idObjc.ty(typeName)
d.defType match {
case DEnum => w.wl(s"$to = $from;")
case DRecord => w.wl(s"$to = [[${idObjc.ty(d.name)} alloc] ${idObjc.method("init_with_" + d.name)}:$from];")
case DInterface => w.wl(s"$to = $from;")
}
}
case p: MParam =>
}
}
f(to, from, tm, false, w, 0)
}
def translateCppTypeToObjc(objcIdent: String, cppIdent: String, ty: TypeRef, withDecl: Boolean, w: IndentWriter): Unit = def translateCppTypeToObjc(objcIdent: String, cppIdent: String, ty: TypeRef, withDecl: Boolean, w: IndentWriter): Unit =
translateCppTypeToObjc(objcIdent, cppIdent, ty.resolved, withDecl, w) translateCppTypeToObjc(objcIdent, cppIdent, ty.resolved, withDecl, w)
def translateCppTypeToObjc(objcIdent: String, cppIdent: String, tm: MExpr, withDecl: Boolean, w: IndentWriter): Unit = { def translateCppTypeToObjc(objcIdent: String, cppIdent: String, tm: MExpr, withDecl: Boolean, w: IndentWriter): Unit = {
...@@ -680,6 +517,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -680,6 +517,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
case d: MDef => { case d: MDef => {
val typeName = d.name val typeName = d.name
val self = idObjc.ty(typeName) val self = idObjc.ty(typeName)
val helperClass = objcppMarshal.fqHelperClass(typeName)
d.defType match { d.defType match {
case DEnum => case DEnum =>
val cppSelf = cppMarshal.fqTypename(tm) val cppSelf = cppMarshal.fqTypename(tm)
...@@ -687,11 +525,11 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -687,11 +525,11 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
w.wl(s"$objcType$objcIdent = ::djinni::Enum<$cppSelf, $self>::Boxed::fromCpp($cppIdent);") w.wl(s"$objcType$objcIdent = ::djinni::Enum<$cppSelf, $self>::Boxed::fromCpp($cppIdent);")
else else
w.wl(s"$objcType$objcIdent = ::djinni::Enum<$cppSelf, $self>::fromCpp($cppIdent);") w.wl(s"$objcType$objcIdent = ::djinni::Enum<$cppSelf, $self>::fromCpp($cppIdent);")
case DRecord => w.wl(s"$objcType$objcIdent = [[${self} alloc] initWithCpp${IdentStyle.camelUpper(typeName)}:$cppIdent];") case DRecord =>
w.wl(s"$objcType$objcIdent = $helperClass::fromCpp($cppIdent);")
case DInterface => case DInterface =>
val ext = d.body.asInstanceOf[Interface].ext val ext = d.body.asInstanceOf[Interface].ext
val objcProxy = objcppMarshal.fqHelperClass(d.name + "_objc_proxy") val objcProxy = objcppMarshal.fqHelperClass(d.name + "_objc_proxy")
val helperClass = objcppMarshal.fqHelperClass(typeName)
(ext.cpp, ext.objc) match { (ext.cpp, ext.objc) match {
case (true, true) => throw new AssertionError("Function implemented on both sides") case (true, true) => throw new AssertionError("Function implemented on both sides")
case (false, false) => throw new AssertionError("Function not implemented") case (false, false) => throw new AssertionError("Function not implemented")
...@@ -779,6 +617,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -779,6 +617,7 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
case d: MDef => { case d: MDef => {
val typeName = d.name val typeName = d.name
val self = idObjc.ty(typeName) val self = idObjc.ty(typeName)
val helperClass = objcppMarshal.fqHelperClass(typeName)
d.defType match { d.defType match {
case DEnum => case DEnum =>
val cppSelf = cppMarshal.fqTypename(tm) val cppSelf = cppMarshal.fqTypename(tm)
...@@ -786,10 +625,10 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) { ...@@ -786,10 +625,10 @@ class ObjcppGenerator(spec: Spec) extends Generator(spec) {
w.wl(s"$cppType $cppIdent = ::djinni::Enum<$cppSelf, $self>::Boxed::toCpp($objcIdent);") w.wl(s"$cppType $cppIdent = ::djinni::Enum<$cppSelf, $self>::Boxed::toCpp($objcIdent);")
else else
w.wl(s"$cppType $cppIdent = ::djinni::Enum<$cppSelf, $self>::toCpp($objcIdent);") w.wl(s"$cppType $cppIdent = ::djinni::Enum<$cppSelf, $self>::toCpp($objcIdent);")
case DRecord => w.wl(s"$cppType $cppIdent = std::move([$objcIdent cpp${IdentStyle.camelUpper(typeName)}]);") case DRecord =>
w.wl(s"$cppType $cppIdent = $helperClass::toCpp($objcIdent);")
case DInterface => case DInterface =>
val ext = d.body.asInstanceOf[Interface].ext val ext = d.body.asInstanceOf[Interface].ext
val helperClass = objcppMarshal.fqHelperClass(typeName)
(ext.cpp, ext.objc) match { (ext.cpp, ext.objc) match {
case (true, true) => throw new AssertionError("Function implemented on both sides") case (true, true) => throw new AssertionError("Function implemented on both sides")
case (false, false) => throw new AssertionError("Function not implemented") case (false, false) => throw new AssertionError("Function not implemented")
......
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBAssortedIntegers.h" #import "DBAssortedIntegers.h"
#include "assorted_integers.hpp" #include "assorted_integers.hpp"
#import <Foundation/Foundation.h>
@interface DBAssortedIntegers () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppAssortedIntegers:(const ::AssortedIntegers &)assortedIntegers; @class DBAssortedIntegers;
- (::AssortedIntegers)cppAssortedIntegers;
@end namespace djinni_generated {
struct AssortedIntegers
{
using CppType = ::AssortedIntegers;
using ObjcType = DBAssortedIntegers*;
using Boxed = AssortedIntegers;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni
#import "DBAssortedIntegers+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto AssortedIntegers::toCpp(ObjcType obj) -> CppType
{
assert(obj);
int8_t eight = ::djinni::I8::toCpp(obj.eight);
int16_t sixteen = ::djinni::I16::toCpp(obj.sixteen);
int32_t thirtytwo = ::djinni::I32::toCpp(obj.thirtytwo);
int64_t sixtyfour = ::djinni::I64::toCpp(obj.sixtyfour);
std::experimental::optional<int8_t> o_eight;
if (obj.oEight != nil) {
int8_t optValue = ::djinni::I8::Boxed::toCpp(obj.oEight);
o_eight = optValue;
}
std::experimental::optional<int16_t> o_sixteen;
if (obj.oSixteen != nil) {
int16_t optValue = ::djinni::I16::Boxed::toCpp(obj.oSixteen);
o_sixteen = optValue;
}
std::experimental::optional<int32_t> o_thirtytwo;
if (obj.oThirtytwo != nil) {
int32_t optValue = ::djinni::I32::Boxed::toCpp(obj.oThirtytwo);
o_thirtytwo = optValue;
}
std::experimental::optional<int64_t> o_sixtyfour;
if (obj.oSixtyfour != nil) {
int64_t optValue = ::djinni::I64::Boxed::toCpp(obj.oSixtyfour);
o_sixtyfour = optValue;
}
return ::AssortedIntegers(
eight,
sixteen,
thirtytwo,
sixtyfour,
o_eight,
o_sixteen,
o_thirtytwo,
o_sixtyfour);
}
auto AssortedIntegers::fromCpp(const CppType& cpp) -> ObjcType
{
int8_t eight = ::djinni::I8::fromCpp(cpp.eight);
int16_t sixteen = ::djinni::I16::fromCpp(cpp.sixteen);
int32_t thirtytwo = ::djinni::I32::fromCpp(cpp.thirtytwo);
int64_t sixtyfour = ::djinni::I64::fromCpp(cpp.sixtyfour);
NSNumber *oEight;
if (cpp.o_eight) {
oEight = ::djinni::I8::Boxed::fromCpp((*(cpp.o_eight)));
} else {
oEight = nil;
}
NSNumber *oSixteen;
if (cpp.o_sixteen) {
oSixteen = ::djinni::I16::Boxed::fromCpp((*(cpp.o_sixteen)));
} else {
oSixteen = nil;
}
NSNumber *oThirtytwo;
if (cpp.o_thirtytwo) {
oThirtytwo = ::djinni::I32::Boxed::fromCpp((*(cpp.o_thirtytwo)));
} else {
oThirtytwo = nil;
}
NSNumber *oSixtyfour;
if (cpp.o_sixtyfour) {
oSixtyfour = ::djinni::I64::Boxed::fromCpp((*(cpp.o_sixtyfour)));
} else {
oSixtyfour = nil;
}
return [[DBAssortedIntegers alloc]
initWithEight:eight
sixteen:sixteen
thirtytwo:thirtytwo
sixtyfour:sixtyfour
oEight:oEight
oSixteen:oSixteen
oThirtytwo:oThirtytwo
oSixtyfour:oSixtyfour];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBAssortedIntegers : NSObject @interface DBAssortedIntegers : NSObject
- (id)initWithAssortedIntegers:(DBAssortedIntegers *)assortedIntegers; - (id)initWithAssortedIntegers:(DBAssortedIntegers *)assortedIntegers;
- (id)initWithEight:(int8_t)eight sixteen:(int16_t)sixteen thirtytwo:(int32_t)thirtytwo sixtyfour:(int64_t)sixtyfour oEight:(NSNumber *)oEight oSixteen:(NSNumber *)oSixteen oThirtytwo:(NSNumber *)oThirtytwo oSixtyfour:(NSNumber *)oSixtyfour; - (id)initWithEight:(int8_t)eight sixteen:(int16_t)sixteen thirtytwo:(int32_t)thirtytwo sixtyfour:(int64_t)sixtyfour oEight:(NSNumber *)oEight oSixteen:(NSNumber *)oSixteen oThirtytwo:(NSNumber *)oThirtytwo oSixtyfour:(NSNumber *)oSixtyfour;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from inttypes.djinni // This file generated by Djinni from inttypes.djinni
#import "DBAssortedIntegers+Private.h" #import "DBAssortedIntegers.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBAssortedIntegers @implementation DBAssortedIntegers
...@@ -58,73 +52,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -58,73 +52,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppAssortedIntegers:(const ::AssortedIntegers &)assortedIntegers
{
if (self = [super init]) {
_eight = ::djinni::I8::fromCpp(assortedIntegers.eight);
_sixteen = ::djinni::I16::fromCpp(assortedIntegers.sixteen);
_thirtytwo = ::djinni::I32::fromCpp(assortedIntegers.thirtytwo);
_sixtyfour = ::djinni::I64::fromCpp(assortedIntegers.sixtyfour);
if (assortedIntegers.o_eight) {
_oEight = ::djinni::I8::Boxed::fromCpp((*(assortedIntegers.o_eight)));
} else {
_oEight = nil;
}
if (assortedIntegers.o_sixteen) {
_oSixteen = ::djinni::I16::Boxed::fromCpp((*(assortedIntegers.o_sixteen)));
} else {
_oSixteen = nil;
}
if (assortedIntegers.o_thirtytwo) {
_oThirtytwo = ::djinni::I32::Boxed::fromCpp((*(assortedIntegers.o_thirtytwo)));
} else {
_oThirtytwo = nil;
}
if (assortedIntegers.o_sixtyfour) {
_oSixtyfour = ::djinni::I64::Boxed::fromCpp((*(assortedIntegers.o_sixtyfour)));
} else {
_oSixtyfour = nil;
}
}
return self;
}
- (::AssortedIntegers)cppAssortedIntegers
{
int8_t eight = ::djinni::I8::toCpp(_eight);
int16_t sixteen = ::djinni::I16::toCpp(_sixteen);
int32_t thirtytwo = ::djinni::I32::toCpp(_thirtytwo);
int64_t sixtyfour = ::djinni::I64::toCpp(_sixtyfour);
std::experimental::optional<int8_t> oEight;
if (_oEight != nil) {
int8_t optValue = ::djinni::I8::Boxed::toCpp(_oEight);
oEight = optValue;
}
std::experimental::optional<int16_t> oSixteen;
if (_oSixteen != nil) {
int16_t optValue = ::djinni::I16::Boxed::toCpp(_oSixteen);
oSixteen = optValue;
}
std::experimental::optional<int32_t> oThirtytwo;
if (_oThirtytwo != nil) {
int32_t optValue = ::djinni::I32::Boxed::toCpp(_oThirtytwo);
oThirtytwo = optValue;
}
std::experimental::optional<int64_t> oSixtyfour;
if (_oSixtyfour != nil) {
int64_t optValue = ::djinni::I64::Boxed::toCpp(_oSixtyfour);
oSixtyfour = optValue;
}
return ::AssortedIntegers(
std::move(eight),
std::move(sixteen),
std::move(thirtytwo),
std::move(sixtyfour),
std::move(oEight),
std::move(oSixteen),
std::move(oThirtytwo),
std::move(oSixtyfour));
}
- (BOOL)isEqual:(id)other - (BOOL)isEqual:(id)other
{ {
if (![other isKindOfClass:[DBAssortedIntegers class]]) { if (![other isKindOfClass:[DBAssortedIntegers class]]) {
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni // This file generated by Djinni from client_interface.djinni
#import "DBClientReturnedRecord.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class DBClientReturnedRecord;
@protocol DBClientInterface @protocol DBClientInterface
......
...@@ -44,7 +44,7 @@ auto ClientInterface::fromCpp(const CppType& cpp) -> ObjcType ...@@ -44,7 +44,7 @@ auto ClientInterface::fromCpp(const CppType& cpp) -> ObjcType
int64_t cpp_record_id = ::djinni::I64::fromCpp(record_id); int64_t cpp_record_id = ::djinni::I64::fromCpp(record_id);
NSString *cpp_utf8string = ::djinni::String::fromCpp(utf8string); NSString *cpp_utf8string = ::djinni::String::fromCpp(utf8string);
DBClientReturnedRecord * objcRet = [Handle::get() getRecord:cpp_record_id utf8string:cpp_utf8string]; DBClientReturnedRecord * objcRet = [Handle::get() getRecord:cpp_record_id utf8string:cpp_utf8string];
::ClientReturnedRecord cppRet = std::move([objcRet cppClientReturnedRecord]); ::ClientReturnedRecord cppRet = ::djinni_generated::ClientReturnedRecord::toCpp(objcRet);
return cppRet; return cppRet;
} }
} }
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBClientReturnedRecord.h" #import "DBClientReturnedRecord.h"
#include "client_returned_record.hpp" #include "client_returned_record.hpp"
#import <Foundation/Foundation.h>
@interface DBClientReturnedRecord () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppClientReturnedRecord:(const ::ClientReturnedRecord &)clientReturnedRecord; @class DBClientReturnedRecord;
- (::ClientReturnedRecord)cppClientReturnedRecord;
@end namespace djinni_generated {
struct ClientReturnedRecord
{
using CppType = ::ClientReturnedRecord;
using ObjcType = DBClientReturnedRecord*;
using Boxed = ClientReturnedRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni
#import "DBClientReturnedRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto ClientReturnedRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
int64_t record_id = ::djinni::I64::toCpp(obj.recordId);
std::string content = ::djinni::String::toCpp(obj.content);
return ::ClientReturnedRecord(
record_id,
content);
}
auto ClientReturnedRecord::fromCpp(const CppType& cpp) -> ObjcType
{
int64_t recordId = ::djinni::I64::fromCpp(cpp.record_id);
NSString *content = ::djinni::String::fromCpp(cpp.content);
return [[DBClientReturnedRecord alloc]
initWithRecordId:recordId
content:content];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBClientReturnedRecord : NSObject @interface DBClientReturnedRecord : NSObject
- (id)initWithClientReturnedRecord:(DBClientReturnedRecord *)clientReturnedRecord; - (id)initWithClientReturnedRecord:(DBClientReturnedRecord *)clientReturnedRecord;
- (id)initWithRecordId:(int64_t)recordId content:(NSString *)content; - (id)initWithRecordId:(int64_t)recordId content:(NSString *)content;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from client_interface.djinni // This file generated by Djinni from client_interface.djinni
#import "DBClientReturnedRecord+Private.h" #import "DBClientReturnedRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBClientReturnedRecord @implementation DBClientReturnedRecord
...@@ -30,22 +24,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -30,22 +24,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppClientReturnedRecord:(const ::ClientReturnedRecord &)clientReturnedRecord
{
if (self = [super init]) {
_recordId = ::djinni::I64::fromCpp(clientReturnedRecord.record_id);
_content = ::djinni::String::fromCpp(clientReturnedRecord.content);
}
return self;
}
- (::ClientReturnedRecord)cppClientReturnedRecord
{
int64_t recordId = ::djinni::I64::toCpp(_recordId);
std::string content = ::djinni::String::toCpp(_content);
return ::ClientReturnedRecord(
std::move(recordId),
std::move(content));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBConstants.h" #import "DBConstants.h"
#include "constants.hpp" #include "constants.hpp"
#import <Foundation/Foundation.h>
@interface DBConstants () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppConstants:(const ::Constants &)constants; @class DBConstants;
- (::Constants)cppConstants;
@end namespace djinni_generated {
struct Constants
{
using CppType = ::Constants;
using ObjcType = DBConstants*;
using Boxed = Constants;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from constants.djinni
#import "DBConstants+Private.h"
#import "DBConstants+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto Constants::toCpp(ObjcType obj) -> CppType
{
assert(obj);
int32_t some_integer = ::djinni::I32::toCpp(obj.someInteger);
std::string some_string = ::djinni::String::toCpp(obj.someString);
return ::Constants(
some_integer,
some_string);
}
auto Constants::fromCpp(const CppType& cpp) -> ObjcType
{
int32_t someInteger = ::djinni::I32::fromCpp(cpp.some_integer);
NSString *someString = ::djinni::String::fromCpp(cpp.some_string);
return [[DBConstants alloc]
initWithSomeInteger:someInteger
someString:someString];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from constants.djinni // This file generated by Djinni from constants.djinni
#import "DBConstants.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class DBConstants;
extern const BOOL DBConstantsBoolConstant;
extern const int8_t DBConstantsI8Constant;
extern const int16_t DBConstantsI16Constant;
extern const int32_t DBConstantsI32Constant;
extern const int64_t DBConstantsI64Constant;
extern const double DBConstantsF64Constant;
extern NSString * const DBConstantsStringConstant;
extern NSNumber * const DBConstantsOptionalIntegerConstant;
extern DBConstants * const DBConstantsObjectConstant;
@interface DBConstants : NSObject @interface DBConstants : NSObject
- (id)initWithConstants:(DBConstants *)constants; - (id)initWithConstants:(DBConstants *)constants;
...@@ -23,3 +13,13 @@ extern DBConstants * const DBConstantsObjectConstant; ...@@ -23,3 +13,13 @@ extern DBConstants * const DBConstantsObjectConstant;
@property (nonatomic, readonly) NSString * someString; @property (nonatomic, readonly) NSString * someString;
@end @end
extern const BOOL DBConstantsBoolConstant;
extern const int8_t DBConstantsI8Constant;
extern const int16_t DBConstantsI16Constant;
extern const int32_t DBConstantsI32Constant;
extern const int64_t DBConstantsI64Constant;
extern const double DBConstantsF64Constant;
extern NSString * const DBConstantsStringConstant;
extern NSNumber * const DBConstantsOptionalIntegerConstant;
extern DBConstants * const DBConstantsObjectConstant;
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from constants.djinni // This file generated by Djinni from constants.djinni
#import "DBConstants+Private.h" #import "DBConstants.h"
#import "DBConstants+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
#pragma clang diagnostic push #pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable" #pragma clang diagnostic ignored "-Wunused-variable"
...@@ -32,7 +26,6 @@ DBConstants * const DBConstantsObjectConstant = [[DBConstants alloc] initWithSom ...@@ -32,7 +26,6 @@ DBConstants * const DBConstantsObjectConstant = [[DBConstants alloc] initWithSom
someString:DBConstantsStringConstant]; someString:DBConstantsStringConstant];
#pragma clang diagnostic pop #pragma clang diagnostic pop
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBConstants @implementation DBConstants
...@@ -54,22 +47,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -54,22 +47,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppConstants:(const ::Constants &)constants
{
if (self = [super init]) {
_someInteger = ::djinni::I32::fromCpp(constants.some_integer);
_someString = ::djinni::String::fromCpp(constants.some_string);
}
return self;
}
- (::Constants)cppConstants
{
int32_t someInteger = ::djinni::I32::toCpp(_someInteger);
std::string someString = ::djinni::String::toCpp(_someString);
return ::Constants(
std::move(someInteger),
std::move(someString));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBDateRecord.h" #import "DBDateRecord.h"
#include "date_record.hpp" #include "date_record.hpp"
#import <Foundation/Foundation.h>
@interface DBDateRecord () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppDateRecord:(const ::DateRecord &)dateRecord; @class DBDateRecord;
- (::DateRecord)cppDateRecord;
@end namespace djinni_generated {
struct DateRecord
{
using CppType = ::DateRecord;
using ObjcType = DBDateRecord*;
using Boxed = DateRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni
#import "DBDateRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto DateRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::chrono::system_clock::time_point created_at = ::djinni::convert_date([obj.createdAt timeIntervalSince1970]);
return ::DateRecord(
created_at);
}
auto DateRecord::fromCpp(const CppType& cpp) -> ObjcType
{
NSDate *createdAt = [NSDate dateWithTimeIntervalSince1970:
std::chrono::duration_cast<std::chrono::duration<double>>(cpp.created_at.time_since_epoch()).count()];
return [[DBDateRecord alloc]
initWithCreatedAt:createdAt];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBDateRecord : NSObject @interface DBDateRecord : NSObject
- (id)initWithDateRecord:(DBDateRecord *)dateRecord; - (id)initWithDateRecord:(DBDateRecord *)dateRecord;
- (id)initWithCreatedAt:(NSDate *)createdAt; - (id)initWithCreatedAt:(NSDate *)createdAt;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni // This file generated by Djinni from date.djinni
#import "DBDateRecord+Private.h" #import "DBDateRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBDateRecord @implementation DBDateRecord
...@@ -28,20 +22,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -28,20 +22,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppDateRecord:(const ::DateRecord &)dateRecord
{
if (self = [super init]) {
_createdAt = [NSDate dateWithTimeIntervalSince1970:
std::chrono::duration_cast<std::chrono::duration<double>>(dateRecord.created_at.time_since_epoch()).count()];
}
return self;
}
- (::DateRecord)cppDateRecord
{
std::chrono::system_clock::time_point createdAt = ::djinni::convert_date([_createdAt timeIntervalSince1970]);
return ::DateRecord(
std::move(createdAt));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBMapDateRecord.h" #import "DBMapDateRecord.h"
#include "map_date_record.hpp" #include "map_date_record.hpp"
#import <Foundation/Foundation.h>
@interface DBMapDateRecord () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppMapDateRecord:(const ::MapDateRecord &)mapDateRecord; @class DBMapDateRecord;
- (::MapDateRecord)cppMapDateRecord;
@end namespace djinni_generated {
struct MapDateRecord
{
using CppType = ::MapDateRecord;
using ObjcType = DBMapDateRecord*;
using Boxed = MapDateRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni
#import "DBMapDateRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto MapDateRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::unordered_map<std::string, std::chrono::system_clock::time_point> dates_by_id;
for (id objcKey_0 in obj.datesById) {
std::string cppKey_0 = ::djinni::String::toCpp(objcKey_0);
std::chrono::system_clock::time_point cppValue_0 = ::djinni::convert_date([[obj.datesById objectForKey:objcKey_0] timeIntervalSince1970]);
dates_by_id.emplace(std::move(cppKey_0), std::move(cppValue_0));
}
return ::MapDateRecord(
dates_by_id);
}
auto MapDateRecord::fromCpp(const CppType& cpp) -> ObjcType
{
std::vector<NSString *> datesByIdTempKeyVector;
datesByIdTempKeyVector.reserve(cpp.dates_by_id.size());
std::vector<NSDate *> datesByIdTempValueVector;
datesByIdTempValueVector.reserve(cpp.dates_by_id.size());
for (const auto & cppPair_0 : cpp.dates_by_id) {
NSString *objcKey_0 = ::djinni::String::fromCpp(cppPair_0.first);
NSDate *objcValue_0 = [NSDate dateWithTimeIntervalSince1970:
std::chrono::duration_cast<std::chrono::duration<double>>(cppPair_0.second.time_since_epoch()).count()];
datesByIdTempKeyVector.push_back(objcKey_0);
datesByIdTempValueVector.push_back(objcValue_0);
}
NSDictionary *datesById = [NSDictionary dictionaryWithObjects:&datesByIdTempValueVector[0] forKeys:&datesByIdTempKeyVector[0] count:cpp.dates_by_id.size()];
return [[DBMapDateRecord alloc]
initWithDatesById:datesById];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBMapDateRecord : NSObject @interface DBMapDateRecord : NSObject
- (id)initWithMapDateRecord:(DBMapDateRecord *)mapDateRecord; - (id)initWithMapDateRecord:(DBMapDateRecord *)mapDateRecord;
- (id)initWithDatesById:(NSDictionary *)datesById; - (id)initWithDatesById:(NSDictionary *)datesById;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from date.djinni // This file generated by Djinni from date.djinni
#import "DBMapDateRecord+Private.h" #import "DBMapDateRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBMapDateRecord @implementation DBMapDateRecord
- (id)initWithMapDateRecord:(DBMapDateRecord *)mapDateRecord - (id)initWithMapDateRecord:(DBMapDateRecord *)mapDateRecord
{ {
if (self = [super init]) { if (self = [super init]) {
std::vector<NSString *> _datesByIdTempKeyVector; NSMutableDictionary *_datesByIdTempDictionary = [NSMutableDictionary dictionaryWithCapacity:[mapDateRecord.datesById count]];
_datesByIdTempKeyVector.reserve([mapDateRecord.datesById count]); for (id key_0 in mapDateRecord.datesById) {
std::vector<NSDate *> _datesByIdTempValueVector; id copiedKey_0, copiedValue_0;
_datesByIdTempValueVector.reserve([mapDateRecord.datesById count]); copiedKey_0 = [key_0 copy];
for (NSString *key_0 in mapDateRecord.datesById) { id value_0 = [mapDateRecord.datesById objectForKey:key_0];
NSDate *copiedValue_0;
_datesByIdTempKeyVector.push_back(key_0);
NSDate *value_0 = [mapDateRecord.datesById objectForKey:key_0];
copiedValue_0 = [value_0 copy]; copiedValue_0 = [value_0 copy];
_datesByIdTempValueVector.push_back(copiedValue_0); [_datesByIdTempDictionary setObject:copiedValue_0 forKey:copiedKey_0];
} }
_datesById = [NSDictionary dictionaryWithObjects:&_datesByIdTempValueVector[0] forKeys:&_datesByIdTempKeyVector[0] count:[mapDateRecord.datesById count]]; _datesById = _datesByIdTempDictionary;
} }
return self; return self;
} }
...@@ -39,35 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -39,35 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppMapDateRecord:(const ::MapDateRecord &)mapDateRecord
{
if (self = [super init]) {
std::vector<NSString *> _datesByIdTempKeyVector;
_datesByIdTempKeyVector.reserve(mapDateRecord.dates_by_id.size());
std::vector<NSDate *> _datesByIdTempValueVector;
_datesByIdTempValueVector.reserve(mapDateRecord.dates_by_id.size());
for (const auto & cppPair_0 : mapDateRecord.dates_by_id) {
NSString *objcKey_0 = ::djinni::String::fromCpp(cppPair_0.first);
NSDate *objcValue_0 = [NSDate dateWithTimeIntervalSince1970:
std::chrono::duration_cast<std::chrono::duration<double>>(cppPair_0.second.time_since_epoch()).count()];
_datesByIdTempKeyVector.push_back(objcKey_0);
_datesByIdTempValueVector.push_back(objcValue_0);
}
_datesById = [NSDictionary dictionaryWithObjects:&_datesByIdTempValueVector[0] forKeys:&_datesByIdTempKeyVector[0] count:mapDateRecord.dates_by_id.size()];
}
return self;
}
- (::MapDateRecord)cppMapDateRecord
{
std::unordered_map<std::string, std::chrono::system_clock::time_point> datesById;
for (id objcKey_0 in _datesById) {
std::string cppKey_0 = ::djinni::String::toCpp(objcKey_0);
std::chrono::system_clock::time_point cppValue_0 = ::djinni::convert_date([[_datesById objectForKey:objcKey_0] timeIntervalSince1970]);
datesById.emplace(std::move(cppKey_0), std::move(cppValue_0));
}
return ::MapDateRecord(
std::move(datesById));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBMapListRecord.h" #import "DBMapListRecord.h"
#include "map_list_record.hpp" #include "map_list_record.hpp"
#import <Foundation/Foundation.h>
@interface DBMapListRecord () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppMapListRecord:(const ::MapListRecord &)mapListRecord; @class DBMapListRecord;
- (::MapListRecord)cppMapListRecord;
@end namespace djinni_generated {
struct MapListRecord
{
using CppType = ::MapListRecord;
using ObjcType = DBMapListRecord*;
using Boxed = MapListRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni
#import "DBMapListRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto MapListRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::vector<std::unordered_map<std::string, int64_t>> map_list;
map_list.reserve([obj.mapList count]);
for (NSDictionary *objcValue_0 in obj.mapList) {
std::unordered_map<std::string, int64_t> cppValue_0;
for (id objcKey_1 in objcValue_0) {
std::string cppKey_1 = ::djinni::String::toCpp(objcKey_1);
int64_t cppValue_1 = ::djinni::I64::Boxed::toCpp([objcValue_0 objectForKey:objcKey_1]);
cppValue_0.emplace(std::move(cppKey_1), std::move(cppValue_1));
}
map_list.push_back(std::move(cppValue_0));
}
return ::MapListRecord(
map_list);
}
auto MapListRecord::fromCpp(const CppType& cpp) -> ObjcType
{
std::vector<NSDictionary *> mapListTempVector;
mapListTempVector.reserve(cpp.map_list.size());
for (const auto & cppValue_0 : cpp.map_list) {
std::vector<NSString *> objcValue_0TempKeyVector;
objcValue_0TempKeyVector.reserve(cppValue_0.size());
std::vector<NSNumber *> objcValue_0TempValueVector;
objcValue_0TempValueVector.reserve(cppValue_0.size());
for (const auto & cppPair_1 : cppValue_0) {
NSString *objcKey_1 = ::djinni::String::fromCpp(cppPair_1.first);
NSNumber *objcValue_1 = ::djinni::I64::Boxed::fromCpp(cppPair_1.second);
objcValue_0TempKeyVector.push_back(objcKey_1);
objcValue_0TempValueVector.push_back(objcValue_1);
}
NSDictionary *objcValue_0 = [NSDictionary dictionaryWithObjects:&objcValue_0TempValueVector[0] forKeys:&objcValue_0TempKeyVector[0] count:cppValue_0.size()];
mapListTempVector.push_back(objcValue_0);
}
NSArray *mapList = [NSArray arrayWithObjects:&mapListTempVector[0] count:mapListTempVector.size()];
return [[DBMapListRecord alloc]
initWithMapList:mapList];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBMapListRecord : NSObject @interface DBMapListRecord : NSObject
- (id)initWithMapListRecord:(DBMapListRecord *)mapListRecord; - (id)initWithMapListRecord:(DBMapListRecord *)mapListRecord;
- (id)initWithMapList:(NSArray *)mapList; - (id)initWithMapList:(NSArray *)mapList;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni // This file generated by Djinni from map.djinni
#import "DBMapListRecord+Private.h" #import "DBMapListRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBMapListRecord @implementation DBMapListRecord
- (id)initWithMapListRecord:(DBMapListRecord *)mapListRecord - (id)initWithMapListRecord:(DBMapListRecord *)mapListRecord
{ {
if (self = [super init]) { if (self = [super init]) {
std::vector<NSDictionary *> _mapListTempVector; NSMutableArray *_mapListTempArray = [NSMutableArray arrayWithCapacity:[mapListRecord.mapList count]];
_mapListTempVector.reserve([mapListRecord.mapList count]);
for (NSDictionary *currentValue_0 in mapListRecord.mapList) { for (NSDictionary *currentValue_0 in mapListRecord.mapList) {
NSDictionary *copiedValue_0; id copiedValue_0;
std::vector<NSString *> copiedValue_0TempKeyVector; NSMutableDictionary *copiedValue_0TempDictionary = [NSMutableDictionary dictionaryWithCapacity:[currentValue_0 count]];
copiedValue_0TempKeyVector.reserve([currentValue_0 count]); for (id key_1 in currentValue_0) {
std::vector<NSNumber *> copiedValue_0TempValueVector; id copiedKey_1, copiedValue_1;
copiedValue_0TempValueVector.reserve([currentValue_0 count]); copiedKey_1 = [key_1 copy];
for (NSString *key_1 in currentValue_0) { id value_1 = [currentValue_0 objectForKey:key_1];
NSNumber *copiedValue_1;
copiedValue_0TempKeyVector.push_back(key_1);
NSNumber *value_1 = [currentValue_0 objectForKey:key_1];
copiedValue_1 = value_1; copiedValue_1 = value_1;
copiedValue_0TempValueVector.push_back(copiedValue_1); [copiedValue_0TempDictionary setObject:copiedValue_1 forKey:copiedKey_1];
} }
copiedValue_0 = [NSDictionary dictionaryWithObjects:&copiedValue_0TempValueVector[0] forKeys:&copiedValue_0TempKeyVector[0] count:[currentValue_0 count]]; copiedValue_0 = copiedValue_0TempDictionary;
_mapListTempVector.push_back(copiedValue_0); [_mapListTempArray addObject:copiedValue_0];
} }
_mapList = [NSArray arrayWithObjects:&_mapListTempVector[0] count:_mapListTempVector.size()]; _mapList = _mapListTempArray;
} }
return self; return self;
} }
...@@ -46,45 +36,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -46,45 +36,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppMapListRecord:(const ::MapListRecord &)mapListRecord
{
if (self = [super init]) {
std::vector<NSDictionary *> _mapListTempVector;
_mapListTempVector.reserve(mapListRecord.map_list.size());
for (const auto & cppValue_0 : mapListRecord.map_list) {
std::vector<NSString *> objcValue_0TempKeyVector;
objcValue_0TempKeyVector.reserve(cppValue_0.size());
std::vector<NSNumber *> objcValue_0TempValueVector;
objcValue_0TempValueVector.reserve(cppValue_0.size());
for (const auto & cppPair_1 : cppValue_0) {
NSString *objcKey_1 = ::djinni::String::fromCpp(cppPair_1.first);
NSNumber *objcValue_1 = ::djinni::I64::Boxed::fromCpp(cppPair_1.second);
objcValue_0TempKeyVector.push_back(objcKey_1);
objcValue_0TempValueVector.push_back(objcValue_1);
}
NSDictionary *objcValue_0 = [NSDictionary dictionaryWithObjects:&objcValue_0TempValueVector[0] forKeys:&objcValue_0TempKeyVector[0] count:cppValue_0.size()];
_mapListTempVector.push_back(objcValue_0);
}
_mapList = [NSArray arrayWithObjects:&_mapListTempVector[0] count:_mapListTempVector.size()];
}
return self;
}
- (::MapListRecord)cppMapListRecord
{
std::vector<std::unordered_map<std::string, int64_t>> mapList;
mapList.reserve([_mapList count]);
for (NSDictionary *objcValue_0 in _mapList) {
std::unordered_map<std::string, int64_t> cppValue_0;
for (id objcKey_1 in objcValue_0) {
std::string cppKey_1 = ::djinni::String::toCpp(objcKey_1);
int64_t cppValue_1 = ::djinni::I64::Boxed::toCpp([objcValue_0 objectForKey:objcKey_1]);
cppValue_0.emplace(std::move(cppKey_1), std::move(cppValue_1));
}
mapList.push_back(std::move(cppValue_0));
}
return ::MapListRecord(
std::move(mapList));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBMapRecord.h" #import "DBMapRecord.h"
#include "map_record.hpp" #include "map_record.hpp"
#import <Foundation/Foundation.h>
@interface DBMapRecord () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppMapRecord:(const ::MapRecord &)mapRecord; @class DBMapRecord;
- (::MapRecord)cppMapRecord;
@end namespace djinni_generated {
struct MapRecord
{
using CppType = ::MapRecord;
using ObjcType = DBMapRecord*;
using Boxed = MapRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni
#import "DBMapRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto MapRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::unordered_map<std::string, int64_t> map;
for (id objcKey_0 in obj.map) {
std::string cppKey_0 = ::djinni::String::toCpp(objcKey_0);
int64_t cppValue_0 = ::djinni::I64::Boxed::toCpp([obj.map objectForKey:objcKey_0]);
map.emplace(std::move(cppKey_0), std::move(cppValue_0));
}
return ::MapRecord(
map);
}
auto MapRecord::fromCpp(const CppType& cpp) -> ObjcType
{
std::vector<NSString *> mapTempKeyVector;
mapTempKeyVector.reserve(cpp.map.size());
std::vector<NSNumber *> mapTempValueVector;
mapTempValueVector.reserve(cpp.map.size());
for (const auto & cppPair_0 : cpp.map) {
NSString *objcKey_0 = ::djinni::String::fromCpp(cppPair_0.first);
NSNumber *objcValue_0 = ::djinni::I64::Boxed::fromCpp(cppPair_0.second);
mapTempKeyVector.push_back(objcKey_0);
mapTempValueVector.push_back(objcValue_0);
}
NSDictionary *map = [NSDictionary dictionaryWithObjects:&mapTempValueVector[0] forKeys:&mapTempKeyVector[0] count:cpp.map.size()];
return [[DBMapRecord alloc]
initWithMap:map];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBMapRecord : NSObject @interface DBMapRecord : NSObject
- (id)initWithMapRecord:(DBMapRecord *)mapRecord; - (id)initWithMapRecord:(DBMapRecord *)mapRecord;
- (id)initWithMap:(NSDictionary *)map; - (id)initWithMap:(NSDictionary *)map;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from map.djinni // This file generated by Djinni from map.djinni
#import "DBMapRecord+Private.h" #import "DBMapRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBMapRecord @implementation DBMapRecord
- (id)initWithMapRecord:(DBMapRecord *)mapRecord - (id)initWithMapRecord:(DBMapRecord *)mapRecord
{ {
if (self = [super init]) { if (self = [super init]) {
std::vector<NSString *> _mapTempKeyVector; NSMutableDictionary *_mapTempDictionary = [NSMutableDictionary dictionaryWithCapacity:[mapRecord.map count]];
_mapTempKeyVector.reserve([mapRecord.map count]); for (id key_0 in mapRecord.map) {
std::vector<NSNumber *> _mapTempValueVector; id copiedKey_0, copiedValue_0;
_mapTempValueVector.reserve([mapRecord.map count]); copiedKey_0 = [key_0 copy];
for (NSString *key_0 in mapRecord.map) { id value_0 = [mapRecord.map objectForKey:key_0];
NSNumber *copiedValue_0;
_mapTempKeyVector.push_back(key_0);
NSNumber *value_0 = [mapRecord.map objectForKey:key_0];
copiedValue_0 = value_0; copiedValue_0 = value_0;
_mapTempValueVector.push_back(copiedValue_0); [_mapTempDictionary setObject:copiedValue_0 forKey:copiedKey_0];
} }
_map = [NSDictionary dictionaryWithObjects:&_mapTempValueVector[0] forKeys:&_mapTempKeyVector[0] count:[mapRecord.map count]]; _map = _mapTempDictionary;
} }
return self; return self;
} }
...@@ -39,34 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -39,34 +30,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppMapRecord:(const ::MapRecord &)mapRecord
{
if (self = [super init]) {
std::vector<NSString *> _mapTempKeyVector;
_mapTempKeyVector.reserve(mapRecord.map.size());
std::vector<NSNumber *> _mapTempValueVector;
_mapTempValueVector.reserve(mapRecord.map.size());
for (const auto & cppPair_0 : mapRecord.map) {
NSString *objcKey_0 = ::djinni::String::fromCpp(cppPair_0.first);
NSNumber *objcValue_0 = ::djinni::I64::Boxed::fromCpp(cppPair_0.second);
_mapTempKeyVector.push_back(objcKey_0);
_mapTempValueVector.push_back(objcValue_0);
}
_map = [NSDictionary dictionaryWithObjects:&_mapTempValueVector[0] forKeys:&_mapTempKeyVector[0] count:mapRecord.map.size()];
}
return self;
}
- (::MapRecord)cppMapRecord
{
std::unordered_map<std::string, int64_t> map;
for (id objcKey_0 in _map) {
std::string cppKey_0 = ::djinni::String::toCpp(objcKey_0);
int64_t cppValue_0 = ::djinni::I64::Boxed::toCpp([_map objectForKey:objcKey_0]);
map.emplace(std::move(cppKey_0), std::move(cppValue_0));
}
return ::MapRecord(
std::move(map));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBNestedCollection.h" #import "DBNestedCollection.h"
#include "nested_collection.hpp" #include "nested_collection.hpp"
#import <Foundation/Foundation.h>
@interface DBNestedCollection () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppNestedCollection:(const ::NestedCollection &)nestedCollection; @class DBNestedCollection;
- (::NestedCollection)cppNestedCollection;
@end namespace djinni_generated {
struct NestedCollection
{
using CppType = ::NestedCollection;
using ObjcType = DBNestedCollection*;
using Boxed = NestedCollection;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from nested_collection.djinni
#import "DBNestedCollection+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto NestedCollection::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::vector<std::unordered_set<std::string>> set_list;
set_list.reserve([obj.setList count]);
for (NSSet *objcValue_0 in obj.setList) {
std::unordered_set<std::string> cppValue_0;
for (NSString *objcValue_1 in objcValue_0) {
std::string cppValue_1 = ::djinni::String::toCpp(objcValue_1);
cppValue_0.insert(std::move(cppValue_1));
}
set_list.push_back(std::move(cppValue_0));
}
return ::NestedCollection(
set_list);
}
auto NestedCollection::fromCpp(const CppType& cpp) -> ObjcType
{
std::vector<NSSet *> setListTempVector;
setListTempVector.reserve(cpp.set_list.size());
for (const auto & cppValue_0 : cpp.set_list) {
std::vector<NSString *> objcValue_0TempVector;
objcValue_0TempVector.reserve(cppValue_0.size());
for (const auto & cppValue_1 : cppValue_0) {
NSString *objcValue_1 = ::djinni::String::fromCpp(cppValue_1);
objcValue_0TempVector.push_back(objcValue_1);
}
NSSet *objcValue_0 = [NSSet setWithObjects:&objcValue_0TempVector[0] count:objcValue_0TempVector.size()];
setListTempVector.push_back(objcValue_0);
}
NSArray *setList = [NSArray arrayWithObjects:&setListTempVector[0] count:setListTempVector.size()];
return [[DBNestedCollection alloc]
initWithSetList:setList];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBNestedCollection : NSObject @interface DBNestedCollection : NSObject
- (id)initWithNestedCollection:(DBNestedCollection *)nestedCollection; - (id)initWithNestedCollection:(DBNestedCollection *)nestedCollection;
- (id)initWithSetList:(NSArray *)setList; - (id)initWithSetList:(NSArray *)setList;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from nested_collection.djinni // This file generated by Djinni from nested_collection.djinni
#import "DBNestedCollection+Private.h" #import "DBNestedCollection.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBNestedCollection @implementation DBNestedCollection
- (id)initWithNestedCollection:(DBNestedCollection *)nestedCollection - (id)initWithNestedCollection:(DBNestedCollection *)nestedCollection
{ {
if (self = [super init]) { if (self = [super init]) {
std::vector<NSSet *> _setListTempVector; NSMutableArray *_setListTempArray = [NSMutableArray arrayWithCapacity:[nestedCollection.setList count]];
_setListTempVector.reserve([nestedCollection.setList count]);
for (NSSet *currentValue_0 in nestedCollection.setList) { for (NSSet *currentValue_0 in nestedCollection.setList) {
NSSet *copiedValue_0; id copiedValue_0;
std::vector<NSString *> copiedValue_0TempVector; NSMutableSet *copiedValue_0TempSet = [NSMutableSet setWithCapacity:[currentValue_0 count]];
copiedValue_0TempVector.reserve([currentValue_0 count]);
for (NSString *currentValue_1 in currentValue_0) { for (NSString *currentValue_1 in currentValue_0) {
NSString *copiedValue_1; id copiedValue_1;
copiedValue_1 = [currentValue_1 copy]; copiedValue_1 = [currentValue_1 copy];
copiedValue_0TempVector.push_back(copiedValue_1); [copiedValue_0TempSet addObject:copiedValue_1];
} }
copiedValue_0 = [NSSet setWithObjects:&copiedValue_0TempVector[0] count:copiedValue_0TempVector.size()]; copiedValue_0 = copiedValue_0TempSet;
_setListTempVector.push_back(copiedValue_0); [_setListTempArray addObject:copiedValue_0];
} }
_setList = [NSArray arrayWithObjects:&_setListTempVector[0] count:_setListTempVector.size()]; _setList = _setListTempArray;
} }
return self; return self;
} }
...@@ -42,40 +34,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -42,40 +34,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppNestedCollection:(const ::NestedCollection &)nestedCollection
{
if (self = [super init]) {
std::vector<NSSet *> _setListTempVector;
_setListTempVector.reserve(nestedCollection.set_list.size());
for (const auto & cppValue_0 : nestedCollection.set_list) {
std::vector<NSString *> objcValue_0TempVector;
objcValue_0TempVector.reserve(cppValue_0.size());
for (const auto & cppValue_1 : cppValue_0) {
NSString *objcValue_1 = ::djinni::String::fromCpp(cppValue_1);
objcValue_0TempVector.push_back(objcValue_1);
}
NSSet *objcValue_0 = [NSSet setWithObjects:&objcValue_0TempVector[0] count:objcValue_0TempVector.size()];
_setListTempVector.push_back(objcValue_0);
}
_setList = [NSArray arrayWithObjects:&_setListTempVector[0] count:_setListTempVector.size()];
}
return self;
}
- (::NestedCollection)cppNestedCollection
{
std::vector<std::unordered_set<std::string>> setList;
setList.reserve([_setList count]);
for (NSSet *objcValue_0 in _setList) {
std::unordered_set<std::string> cppValue_0;
for (NSString *objcValue_1 in objcValue_0) {
std::string cppValue_1 = ::djinni::String::toCpp(objcValue_1);
cppValue_0.insert(std::move(cppValue_1));
}
setList.push_back(std::move(cppValue_0));
}
return ::NestedCollection(
std::move(setList));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBPrimitiveList.h" #import "DBPrimitiveList.h"
#include "primitive_list.hpp" #include "primitive_list.hpp"
#import <Foundation/Foundation.h>
@interface DBPrimitiveList () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppPrimitiveList:(const ::PrimitiveList &)primitiveList; @class DBPrimitiveList;
- (::PrimitiveList)cppPrimitiveList;
@end namespace djinni_generated {
struct PrimitiveList
{
using CppType = ::PrimitiveList;
using ObjcType = DBPrimitiveList*;
using Boxed = PrimitiveList;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from primitive_list.djinni
#import "DBPrimitiveList+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto PrimitiveList::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::vector<int64_t> list;
list.reserve([obj.list count]);
for (NSNumber *objcValue_0 in obj.list) {
int64_t cppValue_0 = ::djinni::I64::Boxed::toCpp(objcValue_0);
list.push_back(std::move(cppValue_0));
}
return ::PrimitiveList(
list);
}
auto PrimitiveList::fromCpp(const CppType& cpp) -> ObjcType
{
std::vector<NSNumber *> listTempVector;
listTempVector.reserve(cpp.list.size());
for (const auto & cppValue_0 : cpp.list) {
NSNumber *objcValue_0 = ::djinni::I64::Boxed::fromCpp(cppValue_0);
listTempVector.push_back(objcValue_0);
}
NSArray *list = [NSArray arrayWithObjects:&listTempVector[0] count:listTempVector.size()];
return [[DBPrimitiveList alloc]
initWithList:list];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBPrimitiveList : NSObject @interface DBPrimitiveList : NSObject
- (id)initWithPrimitiveList:(DBPrimitiveList *)primitiveList; - (id)initWithPrimitiveList:(DBPrimitiveList *)primitiveList;
- (id)initWithList:(NSArray *)list; - (id)initWithList:(NSArray *)list;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from primitive_list.djinni // This file generated by Djinni from primitive_list.djinni
#import "DBPrimitiveList+Private.h" #import "DBPrimitiveList.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBPrimitiveList @implementation DBPrimitiveList
- (id)initWithPrimitiveList:(DBPrimitiveList *)primitiveList - (id)initWithPrimitiveList:(DBPrimitiveList *)primitiveList
{ {
if (self = [super init]) { if (self = [super init]) {
std::vector<NSNumber *> _listTempVector; NSMutableArray *_listTempArray = [NSMutableArray arrayWithCapacity:[primitiveList.list count]];
_listTempVector.reserve([primitiveList.list count]);
for (NSNumber *currentValue_0 in primitiveList.list) { for (NSNumber *currentValue_0 in primitiveList.list) {
NSNumber *copiedValue_0; id copiedValue_0;
copiedValue_0 = currentValue_0; copiedValue_0 = currentValue_0;
_listTempVector.push_back(copiedValue_0); [_listTempArray addObject:copiedValue_0];
} }
_list = [NSArray arrayWithObjects:&_listTempVector[0] count:_listTempVector.size()]; _list = _listTempArray;
} }
return self; return self;
} }
...@@ -35,30 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -35,30 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppPrimitiveList:(const ::PrimitiveList &)primitiveList
{
if (self = [super init]) {
std::vector<NSNumber *> _listTempVector;
_listTempVector.reserve(primitiveList.list.size());
for (const auto & cppValue_0 : primitiveList.list) {
NSNumber *objcValue_0 = ::djinni::I64::Boxed::fromCpp(cppValue_0);
_listTempVector.push_back(objcValue_0);
}
_list = [NSArray arrayWithObjects:&_listTempVector[0] count:_listTempVector.size()];
}
return self;
}
- (::PrimitiveList)cppPrimitiveList
{
std::vector<int64_t> list;
list.reserve([_list count]);
for (NSNumber *objcValue_0 in _list) {
int64_t cppValue_0 = ::djinni::I64::Boxed::toCpp(objcValue_0);
list.push_back(std::move(cppValue_0));
}
return ::PrimitiveList(
std::move(list));
}
@end @end
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBRecordWithDerivings.h" #import "DBRecordWithDerivings.h"
#include "record_with_derivings.hpp" #include "record_with_derivings.hpp"
#import <Foundation/Foundation.h>
@interface DBRecordWithDerivings () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppRecordWithDerivings:(const ::RecordWithDerivings &)recordWithDerivings; @class DBRecordWithDerivings;
- (::RecordWithDerivings)cppRecordWithDerivings;
@end namespace djinni_generated {
struct RecordWithDerivings
{
using CppType = ::RecordWithDerivings;
using ObjcType = DBRecordWithDerivings*;
using Boxed = RecordWithDerivings;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni
#import "DBRecordWithDerivings+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto RecordWithDerivings::toCpp(ObjcType obj) -> CppType
{
assert(obj);
int32_t key1 = ::djinni::I32::toCpp(obj.key1);
std::string key2 = ::djinni::String::toCpp(obj.key2);
return ::RecordWithDerivings(
key1,
key2);
}
auto RecordWithDerivings::fromCpp(const CppType& cpp) -> ObjcType
{
int32_t key1 = ::djinni::I32::fromCpp(cpp.key1);
NSString *key2 = ::djinni::String::fromCpp(cpp.key2);
return [[DBRecordWithDerivings alloc]
initWithKey1:key1
key2:key2];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBRecordWithDerivings : NSObject @interface DBRecordWithDerivings : NSObject
- (id)initWithRecordWithDerivings:(DBRecordWithDerivings *)recordWithDerivings; - (id)initWithRecordWithDerivings:(DBRecordWithDerivings *)recordWithDerivings;
- (id)initWithKey1:(int32_t)key1 key2:(NSString *)key2; - (id)initWithKey1:(int32_t)key1 key2:(NSString *)key2;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni // This file generated by Djinni from derivings.djinni
#import "DBRecordWithDerivings+Private.h" #import "DBRecordWithDerivings.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBRecordWithDerivings @implementation DBRecordWithDerivings
...@@ -30,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -30,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppRecordWithDerivings:(const ::RecordWithDerivings &)recordWithDerivings
{
if (self = [super init]) {
_key1 = ::djinni::I32::fromCpp(recordWithDerivings.key1);
_key2 = ::djinni::String::fromCpp(recordWithDerivings.key2);
}
return self;
}
- (::RecordWithDerivings)cppRecordWithDerivings
{
int32_t key1 = ::djinni::I32::toCpp(_key1);
std::string key2 = ::djinni::String::toCpp(_key2);
return ::RecordWithDerivings(
std::move(key1),
std::move(key2));
}
- (BOOL)isEqual:(id)other - (BOOL)isEqual:(id)other
{ {
if (![other isKindOfClass:[DBRecordWithDerivings class]]) { if (![other isKindOfClass:[DBRecordWithDerivings class]]) {
......
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBRecordWithNestedDerivings.h" #import "DBRecordWithNestedDerivings.h"
#include "record_with_nested_derivings.hpp" #include "record_with_nested_derivings.hpp"
#import <Foundation/Foundation.h>
@interface DBRecordWithNestedDerivings () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppRecordWithNestedDerivings:(const ::RecordWithNestedDerivings &)recordWithNestedDerivings; @class DBRecordWithNestedDerivings;
- (::RecordWithNestedDerivings)cppRecordWithNestedDerivings;
@end namespace djinni_generated {
struct RecordWithNestedDerivings
{
using CppType = ::RecordWithNestedDerivings;
using ObjcType = DBRecordWithNestedDerivings*;
using Boxed = RecordWithNestedDerivings;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni
#import "DBRecordWithNestedDerivings+Private.h"
#import "DBRecordWithDerivings+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto RecordWithNestedDerivings::toCpp(ObjcType obj) -> CppType
{
assert(obj);
int32_t key = ::djinni::I32::toCpp(obj.key);
::RecordWithDerivings rec = ::djinni_generated::RecordWithDerivings::toCpp(obj.rec);
return ::RecordWithNestedDerivings(
key,
rec);
}
auto RecordWithNestedDerivings::fromCpp(const CppType& cpp) -> ObjcType
{
int32_t key = ::djinni::I32::fromCpp(cpp.key);
DBRecordWithDerivings *rec = ::djinni_generated::RecordWithDerivings::fromCpp(cpp.rec);
return [[DBRecordWithNestedDerivings alloc]
initWithKey:key
rec:rec];
}
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni // This file generated by Djinni from derivings.djinni
#import "DBRecordWithDerivings.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class DBRecordWithDerivings;
@interface DBRecordWithNestedDerivings : NSObject @interface DBRecordWithNestedDerivings : NSObject
- (id)initWithRecordWithNestedDerivings:(DBRecordWithNestedDerivings *)recordWithNestedDerivings; - (id)initWithRecordWithNestedDerivings:(DBRecordWithNestedDerivings *)recordWithNestedDerivings;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from derivings.djinni // This file generated by Djinni from derivings.djinni
#import "DBRecordWithNestedDerivings+Private.h" #import "DBRecordWithNestedDerivings.h"
#import "DBRecordWithDerivings+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBRecordWithNestedDerivings @implementation DBRecordWithNestedDerivings
...@@ -31,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -31,23 +24,6 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppRecordWithNestedDerivings:(const ::RecordWithNestedDerivings &)recordWithNestedDerivings
{
if (self = [super init]) {
_key = ::djinni::I32::fromCpp(recordWithNestedDerivings.key);
_rec = [[DBRecordWithDerivings alloc] initWithCppRecordWithDerivings:recordWithNestedDerivings.rec];
}
return self;
}
- (::RecordWithNestedDerivings)cppRecordWithNestedDerivings
{
int32_t key = ::djinni::I32::toCpp(_key);
::RecordWithDerivings rec = std::move([_rec cppRecordWithDerivings]);
return ::RecordWithNestedDerivings(
std::move(key),
std::move(rec));
}
- (BOOL)isEqual:(id)other - (BOOL)isEqual:(id)other
{ {
if (![other isKindOfClass:[DBRecordWithNestedDerivings class]]) { if (![other isKindOfClass:[DBRecordWithNestedDerivings class]]) {
......
...@@ -3,11 +3,22 @@ ...@@ -3,11 +3,22 @@
#import "DBSetRecord.h" #import "DBSetRecord.h"
#include "set_record.hpp" #include "set_record.hpp"
#import <Foundation/Foundation.h>
@interface DBSetRecord () static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
- (id)initWithCppSetRecord:(const ::SetRecord &)setRecord; @class DBSetRecord;
- (::SetRecord)cppSetRecord;
@end namespace djinni_generated {
struct SetRecord
{
using CppType = ::SetRecord;
using ObjcType = DBSetRecord*;
using Boxed = SetRecord;
static CppType toCpp(ObjcType objc);
static ObjcType fromCpp(const CppType& cpp);
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from set.djinni
#import "DBSetRecord+Private.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <cassert>
#include <utility>
#include <vector>
namespace djinni_generated {
auto SetRecord::toCpp(ObjcType obj) -> CppType
{
assert(obj);
std::unordered_set<std::string> set;
for (NSString *objcValue_0 in obj.set) {
std::string cppValue_0 = ::djinni::String::toCpp(objcValue_0);
set.insert(std::move(cppValue_0));
}
return ::SetRecord(
set);
}
auto SetRecord::fromCpp(const CppType& cpp) -> ObjcType
{
std::vector<NSString *> setTempVector;
setTempVector.reserve(cpp.set.size());
for (const auto & cppValue_0 : cpp.set) {
NSString *objcValue_0 = ::djinni::String::fromCpp(cppValue_0);
setTempVector.push_back(objcValue_0);
}
NSSet *set = [NSSet setWithObjects:&setTempVector[0] count:setTempVector.size()];
return [[DBSetRecord alloc]
initWithSet:set];
}
} // namespace djinni_generated
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface DBSetRecord : NSObject @interface DBSetRecord : NSObject
- (id)initWithSetRecord:(DBSetRecord *)setRecord; - (id)initWithSetRecord:(DBSetRecord *)setRecord;
- (id)initWithSet:(NSSet *)set; - (id)initWithSet:(NSSet *)set;
......
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from set.djinni // This file generated by Djinni from set.djinni
#import "DBSetRecord+Private.h" #import "DBSetRecord.h"
#import "DJIDate.h"
#import "DJIMarshal+Private.h"
#import <Foundation/Foundation.h>
#include <utility>
#include <vector>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBSetRecord @implementation DBSetRecord
- (id)initWithSetRecord:(DBSetRecord *)setRecord - (id)initWithSetRecord:(DBSetRecord *)setRecord
{ {
if (self = [super init]) { if (self = [super init]) {
std::vector<NSString *> _setTempVector; NSMutableSet *_setTempSet = [NSMutableSet setWithCapacity:[setRecord.set count]];
_setTempVector.reserve([setRecord.set count]);
for (NSString *currentValue_0 in setRecord.set) { for (NSString *currentValue_0 in setRecord.set) {
NSString *copiedValue_0; id copiedValue_0;
copiedValue_0 = [currentValue_0 copy]; copiedValue_0 = [currentValue_0 copy];
_setTempVector.push_back(copiedValue_0); [_setTempSet addObject:copiedValue_0];
} }
_set = [NSSet setWithObjects:&_setTempVector[0] count:_setTempVector.size()]; _set = _setTempSet;
} }
return self; return self;
} }
...@@ -35,29 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th ...@@ -35,29 +28,5 @@ static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for th
return self; return self;
} }
- (id)initWithCppSetRecord:(const ::SetRecord &)setRecord
{
if (self = [super init]) {
std::vector<NSString *> _setTempVector;
_setTempVector.reserve(setRecord.set.size());
for (const auto & cppValue_0 : setRecord.set) {
NSString *objcValue_0 = ::djinni::String::fromCpp(cppValue_0);
_setTempVector.push_back(objcValue_0);
}
_set = [NSSet setWithObjects:&_setTempVector[0] count:_setTempVector.size()];
}
return self;
}
- (::SetRecord)cppSetRecord
{
std::unordered_set<std::string> set;
for (NSString *objcValue_0 in _set) {
std::string cppValue_0 = ::djinni::String::toCpp(objcValue_0);
set.insert(std::move(cppValue_0));
}
return ::SetRecord(
std::move(set));
}
@end @end
// AUTOGENERATED FILE - DO NOT MODIFY! // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from test.djinni // This file generated by Djinni from test.djinni
#import "DBAssortedIntegers.h"
#import "DBColor.h" #import "DBColor.h"
#import "DBMapListRecord.h"
#import "DBNestedCollection.h"
#import "DBPrimitiveList.h"
#import "DBSetRecord.h"
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@class DBAssortedIntegers;
@class DBMapListRecord;
@class DBNestedCollection;
@class DBPrimitiveList;
@class DBSetRecord;
@class DBToken; @class DBToken;
@protocol DBClientInterface; @protocol DBClientInterface;
......
...@@ -58,14 +58,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType ...@@ -58,14 +58,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+ (DBSetRecord *)getSetRecord { + (DBSetRecord *)getSetRecord {
try { try {
::SetRecord cppRet = ::TestHelpers::get_set_record(); ::SetRecord cppRet = ::TestHelpers::get_set_record();
DBSetRecord *objcRet = [[DBSetRecord alloc] initWithCppSetRecord:cppRet]; DBSetRecord *objcRet = ::djinni_generated::SetRecord::fromCpp(cppRet);
return objcRet; return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkSetRecord:(DBSetRecord *)rec { + (BOOL)checkSetRecord:(DBSetRecord *)rec {
try { try {
::SetRecord cppRec = std::move([rec cppSetRecord]); ::SetRecord cppRec = ::djinni_generated::SetRecord::toCpp(rec);
bool cppRet = ::TestHelpers::check_set_record(std::move(cppRec)); bool cppRet = ::TestHelpers::check_set_record(std::move(cppRec));
BOOL objcRet = ::djinni::Bool::fromCpp(cppRet); BOOL objcRet = ::djinni::Bool::fromCpp(cppRet);
return objcRet; return objcRet;
...@@ -75,14 +75,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType ...@@ -75,14 +75,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+ (DBPrimitiveList *)getPrimitiveList { + (DBPrimitiveList *)getPrimitiveList {
try { try {
::PrimitiveList cppRet = ::TestHelpers::get_primitive_list(); ::PrimitiveList cppRet = ::TestHelpers::get_primitive_list();
DBPrimitiveList *objcRet = [[DBPrimitiveList alloc] initWithCppPrimitiveList:cppRet]; DBPrimitiveList *objcRet = ::djinni_generated::PrimitiveList::fromCpp(cppRet);
return objcRet; return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkPrimitiveList:(DBPrimitiveList *)pl { + (BOOL)checkPrimitiveList:(DBPrimitiveList *)pl {
try { try {
::PrimitiveList cppPl = std::move([pl cppPrimitiveList]); ::PrimitiveList cppPl = ::djinni_generated::PrimitiveList::toCpp(pl);
bool cppRet = ::TestHelpers::check_primitive_list(std::move(cppPl)); bool cppRet = ::TestHelpers::check_primitive_list(std::move(cppPl));
BOOL objcRet = ::djinni::Bool::fromCpp(cppRet); BOOL objcRet = ::djinni::Bool::fromCpp(cppRet);
return objcRet; return objcRet;
...@@ -92,14 +92,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType ...@@ -92,14 +92,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+ (DBNestedCollection *)getNestedCollection { + (DBNestedCollection *)getNestedCollection {
try { try {
::NestedCollection cppRet = ::TestHelpers::get_nested_collection(); ::NestedCollection cppRet = ::TestHelpers::get_nested_collection();
DBNestedCollection *objcRet = [[DBNestedCollection alloc] initWithCppNestedCollection:cppRet]; DBNestedCollection *objcRet = ::djinni_generated::NestedCollection::fromCpp(cppRet);
return objcRet; return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkNestedCollection:(DBNestedCollection *)nc { + (BOOL)checkNestedCollection:(DBNestedCollection *)nc {
try { try {
::NestedCollection cppNc = std::move([nc cppNestedCollection]); ::NestedCollection cppNc = ::djinni_generated::NestedCollection::toCpp(nc);
bool cppRet = ::TestHelpers::check_nested_collection(std::move(cppNc)); bool cppRet = ::TestHelpers::check_nested_collection(std::move(cppNc));
BOOL objcRet = ::djinni::Bool::fromCpp(cppRet); BOOL objcRet = ::djinni::Bool::fromCpp(cppRet);
return objcRet; return objcRet;
...@@ -173,14 +173,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType ...@@ -173,14 +173,14 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+ (DBMapListRecord *)getMapListRecord { + (DBMapListRecord *)getMapListRecord {
try { try {
::MapListRecord cppRet = ::TestHelpers::get_map_list_record(); ::MapListRecord cppRet = ::TestHelpers::get_map_list_record();
DBMapListRecord *objcRet = [[DBMapListRecord alloc] initWithCppMapListRecord:cppRet]; DBMapListRecord *objcRet = ::djinni_generated::MapListRecord::fromCpp(cppRet);
return objcRet; return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
+ (BOOL)checkMapListRecord:(DBMapListRecord *)m { + (BOOL)checkMapListRecord:(DBMapListRecord *)m {
try { try {
::MapListRecord cppM = std::move([m cppMapListRecord]); ::MapListRecord cppM = ::djinni_generated::MapListRecord::toCpp(m);
bool cppRet = ::TestHelpers::check_map_list_record(std::move(cppM)); bool cppRet = ::TestHelpers::check_map_list_record(std::move(cppM));
BOOL objcRet = ::djinni::Bool::fromCpp(cppRet); BOOL objcRet = ::djinni::Bool::fromCpp(cppRet);
return objcRet; return objcRet;
...@@ -261,9 +261,9 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType ...@@ -261,9 +261,9 @@ auto TestHelpers::fromCpp(const CppType& cpp) -> ObjcType
+ (DBAssortedIntegers *)assortedIntegersId:(DBAssortedIntegers *)i { + (DBAssortedIntegers *)assortedIntegersId:(DBAssortedIntegers *)i {
try { try {
::AssortedIntegers cppI = std::move([i cppAssortedIntegers]); ::AssortedIntegers cppI = ::djinni_generated::AssortedIntegers::toCpp(i);
::AssortedIntegers cppRet = ::TestHelpers::assorted_integers_id(std::move(cppI)); ::AssortedIntegers cppRet = ::TestHelpers::assorted_integers_id(std::move(cppI));
DBAssortedIntegers *objcRet = [[DBAssortedIntegers alloc] initWithCppAssortedIntegers:cppRet]; DBAssortedIntegers *objcRet = ::djinni_generated::AssortedIntegers::fromCpp(cppRet);
return objcRet; return objcRet;
} DJINNI_TRANSLATE_EXCEPTIONS() } DJINNI_TRANSLATE_EXCEPTIONS()
} }
......
#import "DBMapRecord+Private.h" #import "DBMapRecord+Private.h"
#import "DBMapRecord.h"
#import "DBMapListRecord+Private.h" #import "DBMapListRecord+Private.h"
#import "DBMapListRecord.h"
#import <XCTest/XCTest.h> #import <XCTest/XCTest.h>
#include "map_record.hpp" #include "map_record.hpp"
...@@ -23,21 +25,21 @@ ...@@ -23,21 +25,21 @@
- (void)testCppToObjc - (void)testCppToObjc
{ {
MapRecord cppMapRecord([self getCppMap]); MapRecord cppMapRecord([self getCppMap]);
DBMapRecord *objcMapRecord = [[DBMapRecord alloc] initWithCppMapRecord:cppMapRecord]; DBMapRecord *objcMapRecord = djinni_generated::MapRecord::fromCpp(cppMapRecord);
[self checkObjcMap:objcMapRecord.map]; [self checkObjcMap:objcMapRecord.map];
} }
- (void)testObjcToCpp - (void)testObjcToCpp
{ {
DBMapRecord *objcMapRecord = [[DBMapRecord alloc] initWithMap:[self getObjcMap]]; DBMapRecord *objcMapRecord = [[DBMapRecord alloc] initWithMap:[self getObjcMap]];
MapRecord cppMapRecord = [objcMapRecord cppMapRecord]; MapRecord cppMapRecord = djinni_generated::MapRecord::toCpp(objcMapRecord);
[self checkCppMap:cppMapRecord.map]; [self checkCppMap:cppMapRecord.map];
} }
- (void)testCppToObjcEmpty - (void)testCppToObjcEmpty
{ {
MapRecord cppMapRecord{ {} }; MapRecord cppMapRecord{ {} };
DBMapRecord *objcMapRecord = [[DBMapRecord alloc] initWithCppMapRecord:cppMapRecord]; DBMapRecord *objcMapRecord = djinni_generated::MapRecord::fromCpp(cppMapRecord);
XCTAssertEqual([objcMapRecord.map count], (NSUInteger)0, @"Count 0 expected, actual: %lu", (unsigned long)[objcMapRecord.map count]); XCTAssertEqual([objcMapRecord.map count], (NSUInteger)0, @"Count 0 expected, actual: %lu", (unsigned long)[objcMapRecord.map count]);
} }
...@@ -45,7 +47,7 @@ ...@@ -45,7 +47,7 @@
- (void)testObjcToCppEmpty - (void)testObjcToCppEmpty
{ {
DBMapRecord *objcMapRecord = [[DBMapRecord alloc] initWithMap:[[NSDictionary alloc] init]]; DBMapRecord *objcMapRecord = [[DBMapRecord alloc] initWithMap:[[NSDictionary alloc] init]];
MapRecord cppMapRecord = [objcMapRecord cppMapRecord]; MapRecord cppMapRecord = djinni_generated::MapRecord::toCpp(objcMapRecord);
auto & cppMap = cppMapRecord.map; auto & cppMap = cppMapRecord.map;
XCTAssertEqual(cppMap.size(), (size_t)0, @"Count 0 expected, actual: %zd", cppMap.size()); XCTAssertEqual(cppMap.size(), (size_t)0, @"Count 0 expected, actual: %zd", cppMap.size());
} }
...@@ -53,7 +55,7 @@ ...@@ -53,7 +55,7 @@
- (void)testCppMapListToObjc - (void)testCppMapListToObjc
{ {
MapListRecord cppMapListRecord{ { [self getCppMap] } }; MapListRecord cppMapListRecord{ { [self getCppMap] } };
DBMapListRecord *objcMapListRecord = [[DBMapListRecord alloc] initWithCppMapListRecord:cppMapListRecord]; DBMapListRecord *objcMapListRecord = djinni_generated::MapListRecord::fromCpp(cppMapListRecord);
NSArray *objcMapList = objcMapListRecord.mapList; NSArray *objcMapList = objcMapListRecord.mapList;
XCTAssertEqual([objcMapList count], (NSUInteger)1, @"List with 1 map expected, actual no: %lu", (unsigned long)[objcMapList count]); XCTAssertEqual([objcMapList count], (NSUInteger)1, @"List with 1 map expected, actual no: %lu", (unsigned long)[objcMapList count]);
[self checkObjcMap:[objcMapList objectAtIndex:0]]; [self checkObjcMap:[objcMapList objectAtIndex:0]];
...@@ -63,7 +65,7 @@ ...@@ -63,7 +65,7 @@
{ {
NSArray *objcMapList = [[NSArray alloc] initWithObjects:[self getObjcMap], nil]; NSArray *objcMapList = [[NSArray alloc] initWithObjects:[self getObjcMap], nil];
DBMapListRecord *objcMapListRecord = [[DBMapListRecord alloc] initWithMapList:objcMapList]; DBMapListRecord *objcMapListRecord = [[DBMapListRecord alloc] initWithMapList:objcMapList];
auto cppMapListRecord = [objcMapListRecord cppMapListRecord]; auto cppMapListRecord = djinni_generated::MapListRecord::toCpp(objcMapListRecord);
auto & cppMapList = cppMapListRecord.map_list; auto & cppMapList = cppMapListRecord.map_list;
XCTAssertEqual(cppMapList.size(), (size_t)1, @"List with 1 map expected, actual no: %zd", cppMapList.size()); XCTAssertEqual(cppMapList.size(), (size_t)1, @"List with 1 map expected, actual no: %zd", cppMapList.size());
[self checkCppMap:cppMapList[0]]; [self checkCppMap:cppMapList[0]];
......
...@@ -27,13 +27,13 @@ static DBNestedCollection *objcNestedCollection = [[DBNestedCollection alloc] in ...@@ -27,13 +27,13 @@ static DBNestedCollection *objcNestedCollection = [[DBNestedCollection alloc] in
- (void)testCppNestedCollectionToObjc - (void)testCppNestedCollectionToObjc
{ {
DBNestedCollection *converted = [[DBNestedCollection alloc] initWithCppNestedCollection:cppNestedCollection]; DBNestedCollection *converted = djinni_generated::NestedCollection::fromCpp(cppNestedCollection);
XCTAssertEqualObjects(objcNestedCollection.setList, converted.setList, @"List expected to be equivalent"); XCTAssertEqualObjects(objcNestedCollection.setList, converted.setList, @"List expected to be equivalent");
} }
- (void)testObjcNestedCollectionToCpp - (void)testObjcNestedCollectionToCpp
{ {
NestedCollection converted = [objcNestedCollection cppNestedCollection]; NestedCollection converted = djinni_generated::NestedCollection::toCpp(objcNestedCollection);
XCTAssertEqual(cppNestedCollection.set_list, converted.set_list, @"List expected to be equivalent"); XCTAssertEqual(cppNestedCollection.set_list, converted.set_list, @"List expected to be equivalent");
} }
......
...@@ -35,13 +35,13 @@ static DBPrimitiveList *objcPrimitiveList = [[DBPrimitiveList alloc] initWithLis ...@@ -35,13 +35,13 @@ static DBPrimitiveList *objcPrimitiveList = [[DBPrimitiveList alloc] initWithLis
- (void)testObjcToCppConverter - (void)testObjcToCppConverter
{ {
PrimitiveList convert = [objcPrimitiveList cppPrimitiveList]; PrimitiveList convert = djinni_generated::PrimitiveList::toCpp(objcPrimitiveList);
XCTAssertEqual(convert.list, cppPrimitiveList.list, @"C++ converted list should be the same."); XCTAssertEqual(convert.list, cppPrimitiveList.list, @"C++ converted list should be the same.");
} }
- (void)testCppToObjcConverter - (void)testCppToObjcConverter
{ {
DBPrimitiveList *convert = [[DBPrimitiveList alloc] initWithCppPrimitiveList:cppPrimitiveList]; DBPrimitiveList *convert = djinni_generated::PrimitiveList::fromCpp(cppPrimitiveList);
XCTAssertEqualObjects(convert.list, objcPrimitiveList.list, @"Objective-C converted list should be the same."); XCTAssertEqualObjects(convert.list, objcPrimitiveList.list, @"Objective-C converted list should be the same.");
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
- (void)testCppToObjc - (void)testCppToObjc
{ {
SetRecord cppSetRecord = [self getCppSetRecord]; SetRecord cppSetRecord = [self getCppSetRecord];
DBSetRecord *objcSetRecord = [[DBSetRecord alloc] initWithCppSetRecord:cppSetRecord]; DBSetRecord *objcSetRecord = djinni_generated::SetRecord::fromCpp(cppSetRecord);
XCTAssertEqual([objcSetRecord.set count], (NSUInteger)3, @"Set length 3 expected, actual: %lu", (unsigned long)[objcSetRecord.set count]); XCTAssertEqual([objcSetRecord.set count], (NSUInteger)3, @"Set length 3 expected, actual: %lu", (unsigned long)[objcSetRecord.set count]);
XCTAssert([objcSetRecord.set containsObject:@"StringA"], @"\"StringA\" expected but does not exist"); XCTAssert([objcSetRecord.set containsObject:@"StringA"], @"\"StringA\" expected but does not exist");
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
-(void)testObjcToCpp -(void)testObjcToCpp
{ {
DBSetRecord *objcSetRecord = [self getObjcSetRecord]; DBSetRecord *objcSetRecord = [self getObjcSetRecord];
SetRecord cppSetRecord = [objcSetRecord cppSetRecord]; SetRecord cppSetRecord = djinni_generated::SetRecord::toCpp(objcSetRecord);
auto & cppSet = cppSetRecord.set; auto & cppSet = cppSetRecord.set;
XCTAssertEqual(cppSet.size(), (NSUInteger)3, @"Set length 3 expected, actual: %zd", cppSet.size()); XCTAssertEqual(cppSet.size(), (NSUInteger)3, @"Set length 3 expected, actual: %zd", cppSet.size());
......
...@@ -24,26 +24,38 @@ ...@@ -24,26 +24,38 @@
65868B5F1989FE4200D60EEE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65868B5E1989FE4200D60EEE /* UIKit.framework */; }; 65868B5F1989FE4200D60EEE /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65868B5E1989FE4200D60EEE /* UIKit.framework */; };
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 */; };
A238CA8C1AF84B7100CDDCE5 /* DBAssortedIntegers+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA741AF84B7100CDDCE5 /* DBAssortedIntegers+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 */; };
A238CA921AF84B7100CDDCE5 /* DBDateRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA7A1AF84B7100CDDCE5 /* DBDateRecord+Private.mm */; };
A238CA941AF84B7100CDDCE5 /* DBMapDateRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA7C1AF84B7100CDDCE5 /* DBMapDateRecord+Private.mm */; };
A238CA961AF84B7100CDDCE5 /* DBMapListRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA7E1AF84B7100CDDCE5 /* DBMapListRecord+Private.mm */; };
A238CA981AF84B7100CDDCE5 /* DBMapRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA801AF84B7100CDDCE5 /* DBMapRecord+Private.mm */; };
A238CA9A1AF84B7100CDDCE5 /* DBNestedCollection+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA821AF84B7100CDDCE5 /* DBNestedCollection+Private.mm */; };
A238CA9C1AF84B7100CDDCE5 /* DBPrimitiveList+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA841AF84B7100CDDCE5 /* DBPrimitiveList+Private.mm */; };
A238CA9E1AF84B7100CDDCE5 /* DBRecordWithDerivings+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA861AF84B7100CDDCE5 /* DBRecordWithDerivings+Private.mm */; };
A238CAA01AF84B7100CDDCE5 /* DBRecordWithNestedDerivings+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA881AF84B7100CDDCE5 /* DBRecordWithNestedDerivings+Private.mm */; };
A238CAA21AF84B7100CDDCE5 /* DBSetRecord+Private.mm in Sources */ = {isa = PBXBuildFile; fileRef = A238CA8A1AF84B7100CDDCE5 /* DBSetRecord+Private.mm */; };
A239F37A1AF400C600DF27C8 /* DJIDate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A239F3781AF400C600DF27C8 /* DJIDate.mm */; }; A239F37A1AF400C600DF27C8 /* DJIDate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A239F3781AF400C600DF27C8 /* DJIDate.mm */; };
A242494C1AF192E0003BF8F0 /* DBAssortedIntegers.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242491B1AF192E0003BF8F0 /* DBAssortedIntegers.mm */; };
A242494E1AF192E0003BF8F0 /* DBClientReturnedRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249211AF192E0003BF8F0 /* DBClientReturnedRecord.mm */; };
A24249501AF192E0003BF8F0 /* DBConstants.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249271AF192E0003BF8F0 /* DBConstants.mm */; };
A24249511AF192E0003BF8F0 /* DBCppException.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242492A1AF192E0003BF8F0 /* DBCppException.mm */; }; A24249511AF192E0003BF8F0 /* DBCppException.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242492A1AF192E0003BF8F0 /* DBCppException.mm */; };
A24249521AF192E0003BF8F0 /* DBDateRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242492D1AF192E0003BF8F0 /* DBDateRecord.mm */; };
A24249531AF192E0003BF8F0 /* DBMapDateRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249301AF192E0003BF8F0 /* DBMapDateRecord.mm */; };
A24249541AF192E0003BF8F0 /* DBMapListRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249331AF192E0003BF8F0 /* DBMapListRecord.mm */; };
A24249551AF192E0003BF8F0 /* DBMapRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249361AF192E0003BF8F0 /* DBMapRecord.mm */; };
A24249561AF192E0003BF8F0 /* DBNestedCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249391AF192E0003BF8F0 /* DBNestedCollection.mm */; };
A24249571AF192E0003BF8F0 /* DBPrimitiveList.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242493C1AF192E0003BF8F0 /* DBPrimitiveList.mm */; };
A24249581AF192E0003BF8F0 /* DBRecordWithDerivings.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242493F1AF192E0003BF8F0 /* DBRecordWithDerivings.mm */; };
A24249591AF192E0003BF8F0 /* DBRecordWithNestedDerivings.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249421AF192E0003BF8F0 /* DBRecordWithNestedDerivings.mm */; };
A242495A1AF192E0003BF8F0 /* DBSetRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249451AF192E0003BF8F0 /* DBSetRecord.mm */; };
A242495B1AF192E0003BF8F0 /* DBTestHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249481AF192E0003BF8F0 /* DBTestHelpers.mm */; }; A242495B1AF192E0003BF8F0 /* DBTestHelpers.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24249481AF192E0003BF8F0 /* DBTestHelpers.mm */; };
A242495C1AF192E0003BF8F0 /* DBToken.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242494B1AF192E0003BF8F0 /* DBToken.mm */; }; A242495C1AF192E0003BF8F0 /* DBToken.mm in Sources */ = {isa = PBXBuildFile; fileRef = A242494B1AF192E0003BF8F0 /* DBToken.mm */; };
A24249731AF192FC003BF8F0 /* assorted_integers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A242495E1AF192FC003BF8F0 /* assorted_integers.cpp */; }; A24249731AF192FC003BF8F0 /* assorted_integers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A242495E1AF192FC003BF8F0 /* assorted_integers.cpp */; };
A24249741AF192FC003BF8F0 /* constants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A24249631AF192FC003BF8F0 /* constants.cpp */; }; A24249741AF192FC003BF8F0 /* constants.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A24249631AF192FC003BF8F0 /* constants.cpp */; };
A24249751AF192FC003BF8F0 /* record_with_derivings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A242496C1AF192FC003BF8F0 /* record_with_derivings.cpp */; }; A24249751AF192FC003BF8F0 /* record_with_derivings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A242496C1AF192FC003BF8F0 /* record_with_derivings.cpp */; };
A24249761AF192FC003BF8F0 /* record_with_nested_derivings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A242496E1AF192FC003BF8F0 /* record_with_nested_derivings.cpp */; }; A24249761AF192FC003BF8F0 /* record_with_nested_derivings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A242496E1AF192FC003BF8F0 /* record_with_nested_derivings.cpp */; };
A24850261AF96EBC00AFE907 /* DBAssortedIntegers.mm in Sources */ = {isa = PBXBuildFile; fileRef = A248501A1AF96EBC00AFE907 /* DBAssortedIntegers.mm */; };
A24850271AF96EBC00AFE907 /* DBClientReturnedRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A248501B1AF96EBC00AFE907 /* DBClientReturnedRecord.mm */; };
A24850281AF96EBC00AFE907 /* DBConstants.mm in Sources */ = {isa = PBXBuildFile; fileRef = A248501C1AF96EBC00AFE907 /* DBConstants.mm */; };
A24850291AF96EBC00AFE907 /* DBDateRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A248501D1AF96EBC00AFE907 /* DBDateRecord.mm */; };
A248502A1AF96EBC00AFE907 /* DBMapDateRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A248501E1AF96EBC00AFE907 /* DBMapDateRecord.mm */; };
A248502B1AF96EBC00AFE907 /* DBMapListRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A248501F1AF96EBC00AFE907 /* DBMapListRecord.mm */; };
A248502C1AF96EBC00AFE907 /* DBMapRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24850201AF96EBC00AFE907 /* DBMapRecord.mm */; };
A248502D1AF96EBC00AFE907 /* DBNestedCollection.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24850211AF96EBC00AFE907 /* DBNestedCollection.mm */; };
A248502E1AF96EBC00AFE907 /* DBPrimitiveList.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24850221AF96EBC00AFE907 /* DBPrimitiveList.mm */; };
A248502F1AF96EBC00AFE907 /* DBRecordWithDerivings.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24850231AF96EBC00AFE907 /* DBRecordWithDerivings.mm */; };
A24850301AF96EBC00AFE907 /* DBRecordWithNestedDerivings.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24850241AF96EBC00AFE907 /* DBRecordWithNestedDerivings.mm */; };
A24850311AF96EBC00AFE907 /* DBSetRecord.mm in Sources */ = {isa = PBXBuildFile; fileRef = A24850251AF96EBC00AFE907 /* DBSetRecord.mm */; };
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 */; };
A2A162D21AF190D200C0B00A /* DJIDate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2A162D11AF190D200C0B00A /* DJIDate.mm */; }; A2A162D21AF190D200C0B00A /* DJIDate.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2A162D11AF190D200C0B00A /* DJIDate.mm */; };
A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2CB54B319BA6E6000A9E600 /* DJIError.mm */; }; A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */ = {isa = PBXBuildFile; fileRef = A2CB54B319BA6E6000A9E600 /* DJIError.mm */; };
...@@ -98,50 +110,50 @@ ...@@ -98,50 +110,50 @@
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>"; };
A238CA741AF84B7100CDDCE5 /* DBAssortedIntegers+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBAssortedIntegers+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>"; };
A238CA7A1AF84B7100CDDCE5 /* DBDateRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBDateRecord+Private.mm"; sourceTree = "<group>"; };
A238CA7C1AF84B7100CDDCE5 /* DBMapDateRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBMapDateRecord+Private.mm"; sourceTree = "<group>"; };
A238CA7E1AF84B7100CDDCE5 /* DBMapListRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBMapListRecord+Private.mm"; sourceTree = "<group>"; };
A238CA801AF84B7100CDDCE5 /* DBMapRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBMapRecord+Private.mm"; sourceTree = "<group>"; };
A238CA821AF84B7100CDDCE5 /* DBNestedCollection+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBNestedCollection+Private.mm"; sourceTree = "<group>"; };
A238CA841AF84B7100CDDCE5 /* DBPrimitiveList+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBPrimitiveList+Private.mm"; sourceTree = "<group>"; };
A238CA861AF84B7100CDDCE5 /* DBRecordWithDerivings+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBRecordWithDerivings+Private.mm"; sourceTree = "<group>"; };
A238CA881AF84B7100CDDCE5 /* DBRecordWithNestedDerivings+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBRecordWithNestedDerivings+Private.mm"; sourceTree = "<group>"; };
A238CA8A1AF84B7100CDDCE5 /* DBSetRecord+Private.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "DBSetRecord+Private.mm"; sourceTree = "<group>"; };
A239F3771AF400C600DF27C8 /* DJIDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DJIDate.h; sourceTree = "<group>"; }; A239F3771AF400C600DF27C8 /* DJIDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DJIDate.h; sourceTree = "<group>"; };
A239F3781AF400C600DF27C8 /* DJIDate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DJIDate.mm; sourceTree = "<group>"; }; A239F3781AF400C600DF27C8 /* DJIDate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DJIDate.mm; sourceTree = "<group>"; };
A239F3791AF400C600DF27C8 /* DJIMarshal+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DJIMarshal+Private.h"; sourceTree = "<group>"; }; A239F3791AF400C600DF27C8 /* DJIMarshal+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DJIMarshal+Private.h"; sourceTree = "<group>"; };
A24249191AF192E0003BF8F0 /* DBAssortedIntegers+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBAssortedIntegers+Private.h"; sourceTree = "<group>"; }; A24249191AF192E0003BF8F0 /* DBAssortedIntegers+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBAssortedIntegers+Private.h"; sourceTree = "<group>"; };
A242491A1AF192E0003BF8F0 /* DBAssortedIntegers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBAssortedIntegers.h; sourceTree = "<group>"; }; A242491A1AF192E0003BF8F0 /* DBAssortedIntegers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBAssortedIntegers.h; sourceTree = "<group>"; };
A242491B1AF192E0003BF8F0 /* DBAssortedIntegers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBAssortedIntegers.mm; sourceTree = "<group>"; };
A242491C1AF192E0003BF8F0 /* DBClientInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBClientInterface.h; sourceTree = "<group>"; }; A242491C1AF192E0003BF8F0 /* DBClientInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBClientInterface.h; sourceTree = "<group>"; };
A242491F1AF192E0003BF8F0 /* DBClientReturnedRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBClientReturnedRecord+Private.h"; sourceTree = "<group>"; }; A242491F1AF192E0003BF8F0 /* DBClientReturnedRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBClientReturnedRecord+Private.h"; sourceTree = "<group>"; };
A24249201AF192E0003BF8F0 /* DBClientReturnedRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBClientReturnedRecord.h; sourceTree = "<group>"; }; A24249201AF192E0003BF8F0 /* DBClientReturnedRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBClientReturnedRecord.h; sourceTree = "<group>"; };
A24249211AF192E0003BF8F0 /* DBClientReturnedRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBClientReturnedRecord.mm; sourceTree = "<group>"; };
A24249221AF192E0003BF8F0 /* DBColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBColor.h; sourceTree = "<group>"; }; A24249221AF192E0003BF8F0 /* DBColor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBColor.h; sourceTree = "<group>"; };
A24249251AF192E0003BF8F0 /* DBConstants+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBConstants+Private.h"; sourceTree = "<group>"; }; A24249251AF192E0003BF8F0 /* DBConstants+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBConstants+Private.h"; sourceTree = "<group>"; };
A24249261AF192E0003BF8F0 /* DBConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBConstants.h; sourceTree = "<group>"; }; A24249261AF192E0003BF8F0 /* DBConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBConstants.h; sourceTree = "<group>"; };
A24249271AF192E0003BF8F0 /* DBConstants.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBConstants.mm; sourceTree = "<group>"; };
A24249281AF192E0003BF8F0 /* DBCppException+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBCppException+Private.h"; sourceTree = "<group>"; }; A24249281AF192E0003BF8F0 /* DBCppException+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBCppException+Private.h"; sourceTree = "<group>"; };
A24249291AF192E0003BF8F0 /* DBCppException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBCppException.h; sourceTree = "<group>"; }; A24249291AF192E0003BF8F0 /* DBCppException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBCppException.h; sourceTree = "<group>"; };
A242492A1AF192E0003BF8F0 /* DBCppException.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBCppException.mm; sourceTree = "<group>"; }; A242492A1AF192E0003BF8F0 /* DBCppException.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBCppException.mm; sourceTree = "<group>"; };
A242492B1AF192E0003BF8F0 /* DBDateRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBDateRecord+Private.h"; sourceTree = "<group>"; }; A242492B1AF192E0003BF8F0 /* DBDateRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBDateRecord+Private.h"; sourceTree = "<group>"; };
A242492C1AF192E0003BF8F0 /* DBDateRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBDateRecord.h; sourceTree = "<group>"; }; A242492C1AF192E0003BF8F0 /* DBDateRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBDateRecord.h; sourceTree = "<group>"; };
A242492D1AF192E0003BF8F0 /* DBDateRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBDateRecord.mm; sourceTree = "<group>"; };
A242492E1AF192E0003BF8F0 /* DBMapDateRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBMapDateRecord+Private.h"; sourceTree = "<group>"; }; A242492E1AF192E0003BF8F0 /* DBMapDateRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBMapDateRecord+Private.h"; sourceTree = "<group>"; };
A242492F1AF192E0003BF8F0 /* DBMapDateRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBMapDateRecord.h; sourceTree = "<group>"; }; A242492F1AF192E0003BF8F0 /* DBMapDateRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBMapDateRecord.h; sourceTree = "<group>"; };
A24249301AF192E0003BF8F0 /* DBMapDateRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBMapDateRecord.mm; sourceTree = "<group>"; };
A24249311AF192E0003BF8F0 /* DBMapListRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBMapListRecord+Private.h"; sourceTree = "<group>"; }; A24249311AF192E0003BF8F0 /* DBMapListRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBMapListRecord+Private.h"; sourceTree = "<group>"; };
A24249321AF192E0003BF8F0 /* DBMapListRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBMapListRecord.h; sourceTree = "<group>"; }; A24249321AF192E0003BF8F0 /* DBMapListRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBMapListRecord.h; sourceTree = "<group>"; };
A24249331AF192E0003BF8F0 /* DBMapListRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBMapListRecord.mm; sourceTree = "<group>"; };
A24249341AF192E0003BF8F0 /* DBMapRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBMapRecord+Private.h"; sourceTree = "<group>"; }; A24249341AF192E0003BF8F0 /* DBMapRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBMapRecord+Private.h"; sourceTree = "<group>"; };
A24249351AF192E0003BF8F0 /* DBMapRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBMapRecord.h; sourceTree = "<group>"; }; A24249351AF192E0003BF8F0 /* DBMapRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBMapRecord.h; sourceTree = "<group>"; };
A24249361AF192E0003BF8F0 /* DBMapRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBMapRecord.mm; sourceTree = "<group>"; };
A24249371AF192E0003BF8F0 /* DBNestedCollection+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBNestedCollection+Private.h"; sourceTree = "<group>"; }; A24249371AF192E0003BF8F0 /* DBNestedCollection+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBNestedCollection+Private.h"; sourceTree = "<group>"; };
A24249381AF192E0003BF8F0 /* DBNestedCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBNestedCollection.h; sourceTree = "<group>"; }; A24249381AF192E0003BF8F0 /* DBNestedCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBNestedCollection.h; sourceTree = "<group>"; };
A24249391AF192E0003BF8F0 /* DBNestedCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBNestedCollection.mm; sourceTree = "<group>"; };
A242493A1AF192E0003BF8F0 /* DBPrimitiveList+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBPrimitiveList+Private.h"; sourceTree = "<group>"; }; A242493A1AF192E0003BF8F0 /* DBPrimitiveList+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBPrimitiveList+Private.h"; sourceTree = "<group>"; };
A242493B1AF192E0003BF8F0 /* DBPrimitiveList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBPrimitiveList.h; sourceTree = "<group>"; }; A242493B1AF192E0003BF8F0 /* DBPrimitiveList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBPrimitiveList.h; sourceTree = "<group>"; };
A242493C1AF192E0003BF8F0 /* DBPrimitiveList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBPrimitiveList.mm; sourceTree = "<group>"; };
A242493D1AF192E0003BF8F0 /* DBRecordWithDerivings+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBRecordWithDerivings+Private.h"; sourceTree = "<group>"; }; A242493D1AF192E0003BF8F0 /* DBRecordWithDerivings+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBRecordWithDerivings+Private.h"; sourceTree = "<group>"; };
A242493E1AF192E0003BF8F0 /* DBRecordWithDerivings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBRecordWithDerivings.h; sourceTree = "<group>"; }; A242493E1AF192E0003BF8F0 /* DBRecordWithDerivings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBRecordWithDerivings.h; sourceTree = "<group>"; };
A242493F1AF192E0003BF8F0 /* DBRecordWithDerivings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBRecordWithDerivings.mm; sourceTree = "<group>"; };
A24249401AF192E0003BF8F0 /* DBRecordWithNestedDerivings+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBRecordWithNestedDerivings+Private.h"; sourceTree = "<group>"; }; A24249401AF192E0003BF8F0 /* DBRecordWithNestedDerivings+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBRecordWithNestedDerivings+Private.h"; sourceTree = "<group>"; };
A24249411AF192E0003BF8F0 /* DBRecordWithNestedDerivings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBRecordWithNestedDerivings.h; sourceTree = "<group>"; }; A24249411AF192E0003BF8F0 /* DBRecordWithNestedDerivings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBRecordWithNestedDerivings.h; sourceTree = "<group>"; };
A24249421AF192E0003BF8F0 /* DBRecordWithNestedDerivings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBRecordWithNestedDerivings.mm; sourceTree = "<group>"; };
A24249431AF192E0003BF8F0 /* DBSetRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBSetRecord+Private.h"; sourceTree = "<group>"; }; A24249431AF192E0003BF8F0 /* DBSetRecord+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBSetRecord+Private.h"; sourceTree = "<group>"; };
A24249441AF192E0003BF8F0 /* DBSetRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBSetRecord.h; sourceTree = "<group>"; }; A24249441AF192E0003BF8F0 /* DBSetRecord.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBSetRecord.h; sourceTree = "<group>"; };
A24249451AF192E0003BF8F0 /* DBSetRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBSetRecord.mm; sourceTree = "<group>"; };
A24249461AF192E0003BF8F0 /* DBTestHelpers+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBTestHelpers+Private.h"; sourceTree = "<group>"; }; A24249461AF192E0003BF8F0 /* DBTestHelpers+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBTestHelpers+Private.h"; sourceTree = "<group>"; };
A24249471AF192E0003BF8F0 /* DBTestHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBTestHelpers.h; sourceTree = "<group>"; }; A24249471AF192E0003BF8F0 /* DBTestHelpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBTestHelpers.h; sourceTree = "<group>"; };
A24249481AF192E0003BF8F0 /* DBTestHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBTestHelpers.mm; sourceTree = "<group>"; }; A24249481AF192E0003BF8F0 /* DBTestHelpers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBTestHelpers.mm; sourceTree = "<group>"; };
...@@ -169,6 +181,18 @@ ...@@ -169,6 +181,18 @@
A24249701AF192FC003BF8F0 /* set_record.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_record.hpp; sourceTree = "<group>"; }; A24249701AF192FC003BF8F0 /* set_record.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = set_record.hpp; sourceTree = "<group>"; };
A24249711AF192FC003BF8F0 /* test_helpers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = test_helpers.hpp; sourceTree = "<group>"; }; A24249711AF192FC003BF8F0 /* test_helpers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = test_helpers.hpp; sourceTree = "<group>"; };
A24249721AF192FC003BF8F0 /* token.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = token.hpp; sourceTree = "<group>"; }; A24249721AF192FC003BF8F0 /* token.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = token.hpp; sourceTree = "<group>"; };
A248501A1AF96EBC00AFE907 /* DBAssortedIntegers.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBAssortedIntegers.mm; sourceTree = "<group>"; };
A248501B1AF96EBC00AFE907 /* DBClientReturnedRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBClientReturnedRecord.mm; sourceTree = "<group>"; };
A248501C1AF96EBC00AFE907 /* DBConstants.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBConstants.mm; sourceTree = "<group>"; };
A248501D1AF96EBC00AFE907 /* DBDateRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBDateRecord.mm; sourceTree = "<group>"; };
A248501E1AF96EBC00AFE907 /* DBMapDateRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBMapDateRecord.mm; sourceTree = "<group>"; };
A248501F1AF96EBC00AFE907 /* DBMapListRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBMapListRecord.mm; sourceTree = "<group>"; };
A24850201AF96EBC00AFE907 /* DBMapRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBMapRecord.mm; sourceTree = "<group>"; };
A24850211AF96EBC00AFE907 /* DBNestedCollection.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBNestedCollection.mm; sourceTree = "<group>"; };
A24850221AF96EBC00AFE907 /* DBPrimitiveList.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBPrimitiveList.mm; sourceTree = "<group>"; };
A24850231AF96EBC00AFE907 /* DBRecordWithDerivings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBRecordWithDerivings.mm; sourceTree = "<group>"; };
A24850241AF96EBC00AFE907 /* DBRecordWithNestedDerivings.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBRecordWithNestedDerivings.mm; sourceTree = "<group>"; };
A24850251AF96EBC00AFE907 /* DBSetRecord.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DBSetRecord.mm; sourceTree = "<group>"; };
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>"; };
A2A162D01AF190D200C0B00A /* DJIDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DJIDate.h; path = "../../../../djinni/support-lib/objc/DJIDate.h"; sourceTree = "<group>"; }; A2A162D01AF190D200C0B00A /* DJIDate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DJIDate.h; path = "../../../../djinni/support-lib/objc/DJIDate.h"; sourceTree = "<group>"; };
A2A162D11AF190D200C0B00A /* DJIDate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DJIDate.mm; path = "../../../../djinni/support-lib/objc/DJIDate.mm"; sourceTree = "<group>"; }; A2A162D11AF190D200C0B00A /* DJIDate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DJIDate.mm; path = "../../../../djinni/support-lib/objc/DJIDate.mm"; sourceTree = "<group>"; };
...@@ -295,49 +319,61 @@ ...@@ -295,49 +319,61 @@
A24249181AF192E0003BF8F0 /* generated-objc */ = { A24249181AF192E0003BF8F0 /* generated-objc */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A248501A1AF96EBC00AFE907 /* DBAssortedIntegers.mm */,
A248501B1AF96EBC00AFE907 /* DBClientReturnedRecord.mm */,
A248501C1AF96EBC00AFE907 /* DBConstants.mm */,
A248501D1AF96EBC00AFE907 /* DBDateRecord.mm */,
A248501E1AF96EBC00AFE907 /* DBMapDateRecord.mm */,
A248501F1AF96EBC00AFE907 /* DBMapListRecord.mm */,
A24850201AF96EBC00AFE907 /* DBMapRecord.mm */,
A24850211AF96EBC00AFE907 /* DBNestedCollection.mm */,
A24850221AF96EBC00AFE907 /* DBPrimitiveList.mm */,
A24850231AF96EBC00AFE907 /* DBRecordWithDerivings.mm */,
A24850241AF96EBC00AFE907 /* DBRecordWithNestedDerivings.mm */,
A24850251AF96EBC00AFE907 /* DBSetRecord.mm */,
A238CA741AF84B7100CDDCE5 /* DBAssortedIntegers+Private.mm */,
A238CA761AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm */,
A238CA781AF84B7100CDDCE5 /* DBConstants+Private.mm */,
A238CA7A1AF84B7100CDDCE5 /* DBDateRecord+Private.mm */,
A238CA7C1AF84B7100CDDCE5 /* DBMapDateRecord+Private.mm */,
A238CA7E1AF84B7100CDDCE5 /* DBMapListRecord+Private.mm */,
A238CA801AF84B7100CDDCE5 /* DBMapRecord+Private.mm */,
A238CA821AF84B7100CDDCE5 /* DBNestedCollection+Private.mm */,
A238CA841AF84B7100CDDCE5 /* DBPrimitiveList+Private.mm */,
A238CA861AF84B7100CDDCE5 /* DBRecordWithDerivings+Private.mm */,
A238CA881AF84B7100CDDCE5 /* DBRecordWithNestedDerivings+Private.mm */,
A238CA8A1AF84B7100CDDCE5 /* DBSetRecord+Private.mm */,
A2CCB9401AF80DFC00E6230A /* DBClientInterface.mm */, A2CCB9401AF80DFC00E6230A /* DBClientInterface.mm */,
A2CCB9411AF80DFC00E6230A /* DBClientInterface+Private.h */, A2CCB9411AF80DFC00E6230A /* DBClientInterface+Private.h */,
A24249191AF192E0003BF8F0 /* DBAssortedIntegers+Private.h */, A24249191AF192E0003BF8F0 /* DBAssortedIntegers+Private.h */,
A242491A1AF192E0003BF8F0 /* DBAssortedIntegers.h */, A242491A1AF192E0003BF8F0 /* DBAssortedIntegers.h */,
A242491B1AF192E0003BF8F0 /* DBAssortedIntegers.mm */,
A242491C1AF192E0003BF8F0 /* DBClientInterface.h */, A242491C1AF192E0003BF8F0 /* DBClientInterface.h */,
A242491F1AF192E0003BF8F0 /* DBClientReturnedRecord+Private.h */, A242491F1AF192E0003BF8F0 /* DBClientReturnedRecord+Private.h */,
A24249201AF192E0003BF8F0 /* DBClientReturnedRecord.h */, A24249201AF192E0003BF8F0 /* DBClientReturnedRecord.h */,
A24249211AF192E0003BF8F0 /* DBClientReturnedRecord.mm */,
A24249221AF192E0003BF8F0 /* DBColor.h */, A24249221AF192E0003BF8F0 /* DBColor.h */,
A24249251AF192E0003BF8F0 /* DBConstants+Private.h */, A24249251AF192E0003BF8F0 /* DBConstants+Private.h */,
A24249261AF192E0003BF8F0 /* DBConstants.h */, A24249261AF192E0003BF8F0 /* DBConstants.h */,
A24249271AF192E0003BF8F0 /* DBConstants.mm */,
A24249281AF192E0003BF8F0 /* DBCppException+Private.h */, A24249281AF192E0003BF8F0 /* DBCppException+Private.h */,
A24249291AF192E0003BF8F0 /* DBCppException.h */, A24249291AF192E0003BF8F0 /* DBCppException.h */,
A242492A1AF192E0003BF8F0 /* DBCppException.mm */, A242492A1AF192E0003BF8F0 /* DBCppException.mm */,
A242492B1AF192E0003BF8F0 /* DBDateRecord+Private.h */, A242492B1AF192E0003BF8F0 /* DBDateRecord+Private.h */,
A242492C1AF192E0003BF8F0 /* DBDateRecord.h */, A242492C1AF192E0003BF8F0 /* DBDateRecord.h */,
A242492D1AF192E0003BF8F0 /* DBDateRecord.mm */,
A242492E1AF192E0003BF8F0 /* DBMapDateRecord+Private.h */, A242492E1AF192E0003BF8F0 /* DBMapDateRecord+Private.h */,
A242492F1AF192E0003BF8F0 /* DBMapDateRecord.h */, A242492F1AF192E0003BF8F0 /* DBMapDateRecord.h */,
A24249301AF192E0003BF8F0 /* DBMapDateRecord.mm */,
A24249311AF192E0003BF8F0 /* DBMapListRecord+Private.h */, A24249311AF192E0003BF8F0 /* DBMapListRecord+Private.h */,
A24249321AF192E0003BF8F0 /* DBMapListRecord.h */, A24249321AF192E0003BF8F0 /* DBMapListRecord.h */,
A24249331AF192E0003BF8F0 /* DBMapListRecord.mm */,
A24249341AF192E0003BF8F0 /* DBMapRecord+Private.h */, A24249341AF192E0003BF8F0 /* DBMapRecord+Private.h */,
A24249351AF192E0003BF8F0 /* DBMapRecord.h */, A24249351AF192E0003BF8F0 /* DBMapRecord.h */,
A24249361AF192E0003BF8F0 /* DBMapRecord.mm */,
A24249371AF192E0003BF8F0 /* DBNestedCollection+Private.h */, A24249371AF192E0003BF8F0 /* DBNestedCollection+Private.h */,
A24249381AF192E0003BF8F0 /* DBNestedCollection.h */, A24249381AF192E0003BF8F0 /* DBNestedCollection.h */,
A24249391AF192E0003BF8F0 /* DBNestedCollection.mm */,
A242493A1AF192E0003BF8F0 /* DBPrimitiveList+Private.h */, A242493A1AF192E0003BF8F0 /* DBPrimitiveList+Private.h */,
A242493B1AF192E0003BF8F0 /* DBPrimitiveList.h */, A242493B1AF192E0003BF8F0 /* DBPrimitiveList.h */,
A242493C1AF192E0003BF8F0 /* DBPrimitiveList.mm */,
A242493D1AF192E0003BF8F0 /* DBRecordWithDerivings+Private.h */, A242493D1AF192E0003BF8F0 /* DBRecordWithDerivings+Private.h */,
A242493E1AF192E0003BF8F0 /* DBRecordWithDerivings.h */, A242493E1AF192E0003BF8F0 /* DBRecordWithDerivings.h */,
A242493F1AF192E0003BF8F0 /* DBRecordWithDerivings.mm */,
A24249401AF192E0003BF8F0 /* DBRecordWithNestedDerivings+Private.h */, A24249401AF192E0003BF8F0 /* DBRecordWithNestedDerivings+Private.h */,
A24249411AF192E0003BF8F0 /* DBRecordWithNestedDerivings.h */, A24249411AF192E0003BF8F0 /* DBRecordWithNestedDerivings.h */,
A24249421AF192E0003BF8F0 /* DBRecordWithNestedDerivings.mm */,
A24249431AF192E0003BF8F0 /* DBSetRecord+Private.h */, A24249431AF192E0003BF8F0 /* DBSetRecord+Private.h */,
A24249441AF192E0003BF8F0 /* DBSetRecord.h */, A24249441AF192E0003BF8F0 /* DBSetRecord.h */,
A24249451AF192E0003BF8F0 /* DBSetRecord.mm */,
A24249461AF192E0003BF8F0 /* DBTestHelpers+Private.h */, A24249461AF192E0003BF8F0 /* DBTestHelpers+Private.h */,
A24249471AF192E0003BF8F0 /* DBTestHelpers.h */, A24249471AF192E0003BF8F0 /* DBTestHelpers.h */,
A24249481AF192E0003BF8F0 /* DBTestHelpers.mm */, A24249481AF192E0003BF8F0 /* DBTestHelpers.mm */,
...@@ -459,33 +495,45 @@ ...@@ -459,33 +495,45 @@
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A238CA981AF84B7100CDDCE5 /* DBMapRecord+Private.mm in Sources */,
A24850311AF96EBC00AFE907 /* DBSetRecord.mm in Sources */,
6536CD6F19A6C82200DD7715 /* DJIWeakPtrWrapper.mm in Sources */, 6536CD6F19A6C82200DD7715 /* DJIWeakPtrWrapper.mm in Sources */,
A242495B1AF192E0003BF8F0 /* DBTestHelpers.mm in Sources */, A242495B1AF192E0003BF8F0 /* DBTestHelpers.mm in Sources */,
A24249571AF192E0003BF8F0 /* DBPrimitiveList.mm in Sources */, A24850271AF96EBC00AFE907 /* DBClientReturnedRecord.mm in Sources */,
A24249521AF192E0003BF8F0 /* DBDateRecord.mm in Sources */,
A242495A1AF192E0003BF8F0 /* DBSetRecord.mm in Sources */,
A24249511AF192E0003BF8F0 /* DBCppException.mm in Sources */, A24249511AF192E0003BF8F0 /* DBCppException.mm in Sources */,
A238CA941AF84B7100CDDCE5 /* DBMapDateRecord+Private.mm in Sources */,
A24850291AF96EBC00AFE907 /* DBDateRecord.mm in Sources */,
A278D45319BA3601006FD937 /* test_helpers.cpp in Sources */, A278D45319BA3601006FD937 /* test_helpers.cpp in Sources */,
A238CA921AF84B7100CDDCE5 /* DBDateRecord+Private.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 */,
6536CD7419A6C96C00DD7715 /* DBClientInterfaceImpl.mm in Sources */, 6536CD7419A6C96C00DD7715 /* DBClientInterfaceImpl.mm in Sources */,
A242494E1AF192E0003BF8F0 /* DBClientReturnedRecord.mm in Sources */, A24850301AF96EBC00AFE907 /* DBRecordWithNestedDerivings.mm in Sources */,
A242494C1AF192E0003BF8F0 /* DBAssortedIntegers.mm in Sources */,
A2A162D21AF190D200C0B00A /* DJIDate.mm in Sources */, A2A162D21AF190D200C0B00A /* DJIDate.mm in Sources */,
A248502F1AF96EBC00AFE907 /* DBRecordWithDerivings.mm in Sources */,
A24249741AF192FC003BF8F0 /* constants.cpp in Sources */, A24249741AF192FC003BF8F0 /* constants.cpp in Sources */,
A24249551AF192E0003BF8F0 /* DBMapRecord.mm in Sources */,
A24249581AF192E0003BF8F0 /* DBRecordWithDerivings.mm in Sources */,
A242495C1AF192E0003BF8F0 /* DBToken.mm in Sources */, A242495C1AF192E0003BF8F0 /* DBToken.mm in Sources */,
A24850281AF96EBC00AFE907 /* DBConstants.mm in Sources */,
A238CA9A1AF84B7100CDDCE5 /* DBNestedCollection+Private.mm in Sources */,
A238CA8C1AF84B7100CDDCE5 /* DBAssortedIntegers+Private.mm in Sources */,
A2CCB9421AF80DFC00E6230A /* DBClientInterface.mm in Sources */, A2CCB9421AF80DFC00E6230A /* DBClientInterface.mm in Sources */,
A24249531AF192E0003BF8F0 /* DBMapDateRecord.mm in Sources */,
A24249501AF192E0003BF8F0 /* DBConstants.mm in Sources */,
A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */, A2CB54B419BA6E6000A9E600 /* DJIError.mm in Sources */,
A238CA961AF84B7100CDDCE5 /* DBMapListRecord+Private.mm in Sources */,
A238CA9C1AF84B7100CDDCE5 /* DBPrimitiveList+Private.mm in Sources */,
A24249761AF192FC003BF8F0 /* record_with_nested_derivings.cpp in Sources */, A24249761AF192FC003BF8F0 /* record_with_nested_derivings.cpp in Sources */,
A24249591AF192E0003BF8F0 /* DBRecordWithNestedDerivings.mm in Sources */, A248502D1AF96EBC00AFE907 /* DBNestedCollection.mm in Sources */,
A238CAA21AF84B7100CDDCE5 /* DBSetRecord+Private.mm in Sources */,
A238CA9E1AF84B7100CDDCE5 /* DBRecordWithDerivings+Private.mm in Sources */,
A24249751AF192FC003BF8F0 /* record_with_derivings.cpp in Sources */, A24249751AF192FC003BF8F0 /* record_with_derivings.cpp in Sources */,
A24249541AF192E0003BF8F0 /* DBMapListRecord.mm in Sources */, A238CA901AF84B7100CDDCE5 /* DBConstants+Private.mm in Sources */,
A239F37A1AF400C600DF27C8 /* DJIDate.mm in Sources */, A239F37A1AF400C600DF27C8 /* DJIDate.mm in Sources */,
A248502A1AF96EBC00AFE907 /* DBMapDateRecord.mm in Sources */,
A238CA8E1AF84B7100CDDCE5 /* DBClientReturnedRecord+Private.mm in Sources */,
A24850261AF96EBC00AFE907 /* DBAssortedIntegers.mm in Sources */,
A248502E1AF96EBC00AFE907 /* DBPrimitiveList.mm in Sources */,
A24249731AF192FC003BF8F0 /* assorted_integers.cpp in Sources */, A24249731AF192FC003BF8F0 /* assorted_integers.cpp in Sources */,
A24249561AF192E0003BF8F0 /* DBNestedCollection.mm in Sources */, A238CAA01AF84B7100CDDCE5 /* DBRecordWithNestedDerivings+Private.mm in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
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