MCPcopy Create free account
hub / github.com/Snapchat/Valdi / valueTypeToInt

Function valueTypeToInt

valdi/src/valdi/android/MarshallerJNI.cpp:21–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19#include <djinni/jni/djinni_support.hpp>
20
21static int valueTypeToInt(Valdi::ValueType type) {
22 // Must match ValdiMarshaller.kt
23 switch (type) {
24 case Valdi::ValueType::Null:
25 return 0;
26 case Valdi::ValueType::Undefined:
27 return 1;
28 case Valdi::ValueType::InternedString:
29 case Valdi::ValueType::StaticString:
30 return 2;
31 case Valdi::ValueType::Int:
32 return 3;
33 case Valdi::ValueType::Long:
34 return 4;
35 case Valdi::ValueType::Double:
36 return 5;
37 case Valdi::ValueType::Bool:
38 return 6;
39 case Valdi::ValueType::Map:
40 return 7;
41 case Valdi::ValueType::Array:
42 return 8;
43 case Valdi::ValueType::TypedArray:
44 return 9;
45 case Valdi::ValueType::Function:
46 return 10;
47 case Valdi::ValueType::Error:
48 return 11;
49 case Valdi::ValueType::TypedObject:
50 return 12;
51 case Valdi::ValueType::ProxyTypedObject:
52 return 13;
53 case Valdi::ValueType::ValdiObject:
54 return 14;
55 }
56}
57
58static inline Valdi::Marshaller* unwrap(JNIEnv* env, jlong handle) {
59 return ValdiAndroid::unwrapMarshaller(env, handle);

Callers 1

nativeGetTypeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected