diff options
Diffstat (limited to 'base/android/jni_array.h')
-rw-r--r-- | base/android/jni_array.h | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/base/android/jni_array.h b/base/android/jni_array.h index 658239d..86e63c5 100644 --- a/base/android/jni_array.h +++ b/base/android/jni_array.h @@ -6,19 +6,24 @@ #define BASE_ANDROID_JNI_ARRAY_H_ #include <jni.h> +#include <stdint.h> #include <string> #include <vector> #include "base/android/scoped_java_ref.h" -#include "base/basictypes.h" #include "base/strings/string16.h" namespace base { namespace android { // Returns a new Java byte array converted from the given bytes array. +BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray(JNIEnv* env, + const uint8_t* bytes, + size_t len); + BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray( - JNIEnv* env, const uint8* bytes, size_t len); + JNIEnv* env, + const std::vector<uint8_t>& bytes); // Returns a new Java int array converted from the given int array. BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray( @@ -28,11 +33,13 @@ BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray( JNIEnv* env, const std::vector<int>& ints); // Returns a new Java long array converted from the given int64 array. -BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( - JNIEnv* env, const int64* longs, size_t len); +BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(JNIEnv* env, + const int64_t* longs, + size_t len); BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( - JNIEnv* env, const std::vector<int64>& longs); + JNIEnv* env, + const std::vector<int64_t>& longs); // Returns a array of Java byte array converted from |v|. BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( @@ -56,16 +63,14 @@ BASE_EXPORT void AppendJavaStringArrayToStringVector( std::vector<std::string>* out); // Appends the Java bytes in |bytes_array| onto the end of |out|. -BASE_EXPORT void AppendJavaByteArrayToByteVector( - JNIEnv* env, - jbyteArray byte_array, - std::vector<uint8>* out); +BASE_EXPORT void AppendJavaByteArrayToByteVector(JNIEnv* env, + jbyteArray byte_array, + std::vector<uint8_t>* out); // Replaces the content of |out| with the Java bytes in |bytes_array|. -BASE_EXPORT void JavaByteArrayToByteVector( - JNIEnv* env, - jbyteArray byte_array, - std::vector<uint8>* out); +BASE_EXPORT void JavaByteArrayToByteVector(JNIEnv* env, + jbyteArray byte_array, + std::vector<uint8_t>* out); // Replaces the content of |out| with the Java ints in |int_array|. BASE_EXPORT void JavaIntArrayToIntVector( @@ -74,10 +79,9 @@ BASE_EXPORT void JavaIntArrayToIntVector( std::vector<int>* out); // Replaces the content of |out| with the Java longs in |long_array|. -BASE_EXPORT void JavaLongArrayToInt64Vector( - JNIEnv* env, - jlongArray long_array, - std::vector<int64>* out); +BASE_EXPORT void JavaLongArrayToInt64Vector(JNIEnv* env, + jlongArray long_array, + std::vector<int64_t>* out); // Replaces the content of |out| with the Java longs in |long_array|. BASE_EXPORT void JavaLongArrayToLongVector( |