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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 jbyteArray byte_array, | 67 jbyteArray byte_array, |
68 std::vector<uint8>* out); | 68 std::vector<uint8>* out); |
69 | 69 |
70 // Replaces the content of |out| with the Java ints in |int_array|. | 70 // Replaces the content of |out| with the Java ints in |int_array|. |
71 BASE_EXPORT void JavaIntArrayToIntVector( | 71 BASE_EXPORT void JavaIntArrayToIntVector( |
72 JNIEnv* env, | 72 JNIEnv* env, |
73 jintArray int_array, | 73 jintArray int_array, |
74 std::vector<int>* out); | 74 std::vector<int>* out); |
75 | 75 |
76 // Replaces the content of |out| with the Java longs in |long_array|. | 76 // Replaces the content of |out| with the Java longs in |long_array|. |
| 77 BASE_EXPORT void JavaLongArrayToInt64Vector(JNIEnv* env, |
| 78 jlongArray long_array, |
| 79 std::vector<int64>* out); |
| 80 |
| 81 // Replaces the content of |out| with the Java longs in |long_array|. |
77 BASE_EXPORT void JavaLongArrayToLongVector( | 82 BASE_EXPORT void JavaLongArrayToLongVector( |
78 JNIEnv* env, | 83 JNIEnv* env, |
79 jlongArray long_array, | 84 jlongArray long_array, |
80 std::vector<jlong>* out); | 85 std::vector<jlong>* out); |
81 | 86 |
82 // Replaces the content of |out| with the Java floats in |float_array|. | 87 // Replaces the content of |out| with the Java floats in |float_array|. |
83 BASE_EXPORT void JavaFloatArrayToFloatVector( | 88 BASE_EXPORT void JavaFloatArrayToFloatVector( |
84 JNIEnv* env, | 89 JNIEnv* env, |
85 jfloatArray float_array, | 90 jfloatArray float_array, |
86 std::vector<float>* out); | 91 std::vector<float>* out); |
87 | 92 |
88 // Assuming |array| is an byte[][] (array of byte arrays), replaces the | 93 // Assuming |array| is an byte[][] (array of byte arrays), replaces the |
89 // content of |out| with the corresponding vector of strings. No UTF-8 | 94 // content of |out| with the corresponding vector of strings. No UTF-8 |
90 // conversion is performed. | 95 // conversion is performed. |
91 BASE_EXPORT void JavaArrayOfByteArrayToStringVector( | 96 BASE_EXPORT void JavaArrayOfByteArrayToStringVector( |
92 JNIEnv* env, | 97 JNIEnv* env, |
93 jobjectArray array, | 98 jobjectArray array, |
94 std::vector<std::string>* out); | 99 std::vector<std::string>* out); |
95 | 100 |
96 } // namespace android | 101 } // namespace android |
97 } // namespace base | 102 } // namespace base |
98 | 103 |
99 #endif // BASE_ANDROID_JNI_ARRAY_H_ | 104 #endif // BASE_ANDROID_JNI_ARRAY_H_ |
OLD | NEW |