OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_ANDROID_JNI_ARRAY_H_ | 5 #ifndef BASE_ANDROID_JNI_ARRAY_H_ |
6 #define BASE_ANDROID_JNI_ARRAY_H_ | 6 #define BASE_ANDROID_JNI_ARRAY_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Returns a new Java long array converted from the given int64_t array. | 36 // Returns a new Java long array converted from the given int64_t array. |
37 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(JNIEnv* env, | 37 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(JNIEnv* env, |
38 const int64_t* longs, | 38 const int64_t* longs, |
39 size_t len); | 39 size_t len); |
40 | 40 |
41 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( | 41 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( |
42 JNIEnv* env, | 42 JNIEnv* env, |
43 const std::vector<int64_t>& longs); | 43 const std::vector<int64_t>& longs); |
44 | 44 |
| 45 // Returns a new Java float array converted from the given C++ float array. |
| 46 BASE_EXPORT ScopedJavaLocalRef<jfloatArray> ToJavaFloatArray( |
| 47 JNIEnv* env, const float* floats, size_t len); |
| 48 |
45 // Returns a array of Java byte array converted from |v|. | 49 // Returns a array of Java byte array converted from |v|. |
46 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( | 50 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( |
47 JNIEnv* env, const std::vector<std::string>& v); | 51 JNIEnv* env, const std::vector<std::string>& v); |
48 | 52 |
49 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 53 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
50 JNIEnv* env, const std::vector<std::string>& v); | 54 JNIEnv* env, const std::vector<std::string>& v); |
51 | 55 |
52 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 56 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
53 JNIEnv* env, const std::vector<string16>& v); | 57 JNIEnv* env, const std::vector<string16>& v); |
54 | 58 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // contents of |out| with the corresponding vectors of ints. | 112 // contents of |out| with the corresponding vectors of ints. |
109 BASE_EXPORT void JavaArrayOfIntArrayToIntVector( | 113 BASE_EXPORT void JavaArrayOfIntArrayToIntVector( |
110 JNIEnv* env, | 114 JNIEnv* env, |
111 jobjectArray array, | 115 jobjectArray array, |
112 std::vector<std::vector<int>>* out); | 116 std::vector<std::vector<int>>* out); |
113 | 117 |
114 } // namespace android | 118 } // namespace android |
115 } // namespace base | 119 } // namespace base |
116 | 120 |
117 #endif // BASE_ANDROID_JNI_ARRAY_H_ | 121 #endif // BASE_ANDROID_JNI_ARRAY_H_ |
OLD | NEW |