Chromium Code Reviews| Index: base/android/jni_string.h |
| diff --git a/base/android/jni_string.h b/base/android/jni_string.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7e451543cafe9a45ca0ddaee78810d9fd28a5669 |
| --- /dev/null |
| +++ b/base/android/jni_string.h |
| @@ -0,0 +1,31 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef BASE_ANDROID_JNI_STRING_H_ |
| +#define BASE_ANDROID_JNI_STRING_H_ |
| + |
| +#include <jni.h> |
| +#include <string> |
| + |
| +#include "base/string16.h" |
| + |
| +namespace base { |
| +namespace android { |
| + |
| +// Convert a Java string to UTF8. Returns a std string. |
|
M-A Ruel
2011/11/11 13:09:07
Verb tense usage is inconsistent in every files.
|
| +std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str); |
| + |
| +// Convert a std string to Java string. |
| +jstring ConvertUTF8ToJavaString(JNIEnv* env, const std::string& str); |
| + |
| +// Convert a Java string to UTF16. Returns a string16. |
| +string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str); |
| + |
| +// Convert a string16 to a Java string. |
| +jstring ConvertUTF16ToJavaString(JNIEnv* env, const string16& str); |
| + |
| +} // namespace android |
| +} // namespace base |
| + |
| +#endif // BASE_ANDROID_JNI_STRING_H_ |