Commit f7174584 authored by Jacob Potter's avatar Jacob Potter

Add missing files

parent 0a146261
color = enum {
red;
orange;
yellow;
green;
blue;
# "It is customary to list indigo as a color lying between blue and violet, but it has
# never seemed to me that indigo is worth the dignity of being considered a separate
# color. To my eyes it seems merely deep blue." --Isaac Asimov
indigo;
violet;
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#pragma once
#include <functional>
enum class color : int {
RED,
ORANGE,
YELLOW,
GREEN,
BLUE,
/**
* "It is customary to list indigo as a color lying between blue and violet, but it has
* never seemed to me that indigo is worth the dignity of being considered a separate
* color. To my eyes it seems merely deep blue." --Isaac Asimov
*/
INDIGO,
VIOLET,
};
namespace std {
template <>
struct hash<color> {
size_t operator()(color type) const {
return std::hash<int>()(static_cast<int>(type));
}
};
} // namespace std
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
package com.dropbox.djinni.test;
public enum Color {
RED,
ORANGE,
YELLOW,
GREEN,
BLUE,
/**
* "It is customary to list indigo as a color lying between blue and violet, but it has
* never seemed to me that indigo is worth the dignity of being considered a separate
* color. To my eyes it seems merely deep blue." --Isaac Asimov
*/
INDIGO,
VIOLET,
;
}
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#pragma once
#include "color.hpp"
#include "djinni_support.hpp"
namespace djinni_generated {
class NativeColor final : djinni::JniEnum {
public:
using CppType = color;
using JniType = jobject;
static jobject toJava(JNIEnv* jniEnv, color c) { return djinni::JniClass<NativeColor>::get().create(jniEnv, static_cast<int>(c)).release(); }
static color fromJava(JNIEnv* jniEnv, jobject j) { return static_cast<color>(djinni::JniClass<NativeColor>::get().ordinal(jniEnv, j)); }
private:
NativeColor() : JniEnum("com/dropbox/djinni/test/Color") {}
friend class djinni::JniClass<NativeColor>;
};
} // namespace djinni_generated
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSInteger, DBColor)
{
DBColorRed,
DBColorOrange,
DBColorYellow,
DBColorGreen,
DBColorBlue,
/**
* "It is customary to list indigo as a color lying between blue and violet, but it has
* never seemed to me that indigo is worth the dignity of being considered a separate
* color. To my eyes it seems merely deep blue." --Isaac Asimov
*/
DBColorIndigo,
DBColorViolet,
DBColorCount,
};
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBColor.h"
#include "color.hpp"
#import <Foundation/Foundation.h>
@interface DBColorTranslator : NSObject
+ (DBColor)cppColorToObjcColor:(color)color;
+ (color)objcColorToCppColor:(DBColor)color;
@end
// AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from enum.djinni
#import "DBColorTranslator+Private.h"
#import <Foundation/Foundation.h>
static_assert(__has_feature(objc_arc), "Djinni requires ARC to be enabled for this file");
@implementation DBColorTranslator
+ (DBColor)cppColorToObjcColor:(color)color
{
return static_cast<DBColor>(color);
}
+ (color)objcColorToCppColor:(DBColor)color
{
return static_cast<enum color>(color);
}
@end
package com.dropbox.djinni.test;
import junit.framework.TestCase;
import java.util.HashMap;
public class EnumTest extends TestCase {
public void testEnumKey() {
HashMap<Color, String> m = new HashMap<Color, String>();
m.put(Color.RED, "red");
m.put(Color.ORANGE, "orange");
m.put(Color.YELLOW, "yellow");
m.put(Color.GREEN, "green");
m.put(Color.BLUE, "blue");
m.put(Color.INDIGO, "indigo");
m.put(Color.VIOLET, "violet");
TestHelpers.checkEnumMap(m);
}
}
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