Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
djinni
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
djinni
Commits
f7174584
Commit
f7174584
authored
Oct 10, 2014
by
Jacob Potter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing files
parent
0a146261
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
163 additions
and
0 deletions
+163
-0
test-suite/djinni/enum.djinni
test-suite/djinni/enum.djinni
+12
-0
test-suite/generated-src/cpp/color.hpp
test-suite/generated-src/cpp/color.hpp
+32
-0
test-suite/generated-src/java/com/dropbox/djinni/test/Color.java
...ite/generated-src/java/com/dropbox/djinni/test/Color.java
+20
-0
test-suite/generated-src/jni/NativeColor.hpp
test-suite/generated-src/jni/NativeColor.hpp
+24
-0
test-suite/generated-src/objc/DBColor.h
test-suite/generated-src/objc/DBColor.h
+21
-0
test-suite/generated-src/objc/DBColorTranslator+Private.h
test-suite/generated-src/objc/DBColorTranslator+Private.h
+13
-0
test-suite/generated-src/objc/DBColorTranslator.mm
test-suite/generated-src/objc/DBColorTranslator.mm
+21
-0
test-suite/handwritten-src/java/com/dropbox/djinni/test/EnumTest.java
...andwritten-src/java/com/dropbox/djinni/test/EnumTest.java
+20
-0
No files found.
test-suite/djinni/enum.djinni
0 → 100644
View file @
f7174584
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;
}
test-suite/generated-src/cpp/color.hpp
0 → 100644
View file @
f7174584
// 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
test-suite/generated-src/java/com/dropbox/djinni/test/Color.java
0 → 100644
View file @
f7174584
// 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
,
;
}
test-suite/generated-src/jni/NativeColor.hpp
0 → 100644
View file @
f7174584
// 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
test-suite/generated-src/objc/DBColor.h
0 → 100644
View file @
f7174584
// 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
,
};
test-suite/generated-src/objc/DBColorTranslator+Private.h
0 → 100644
View file @
f7174584
// 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
test-suite/generated-src/objc/DBColorTranslator.mm
0 → 100644
View file @
f7174584
// 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
test-suite/handwritten-src/java/com/dropbox/djinni/test/EnumTest.java
0 → 100644
View file @
f7174584
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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment