Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: base/android/jni_string.h

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/android/jni_registrar.cc ('k') | base/android/jni_string.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef BASE_ANDROID_JNI_STRING_H_
6 #define BASE_ANDROID_JNI_STRING_H_
7
8 #include <jni.h>
9 #include <string>
10
11 #include "base/android/scoped_java_ref.h"
12 #include "base/base_export.h"
13 #include "base/strings/string_piece.h"
14
15 namespace base {
16 namespace android {
17
18 // Convert a Java string to UTF8. Returns a std string.
19 BASE_EXPORT void ConvertJavaStringToUTF8(JNIEnv* env,
20 jstring str,
21 std::string* result);
22 BASE_EXPORT std::string ConvertJavaStringToUTF8(JNIEnv* env, jstring str);
23 BASE_EXPORT std::string ConvertJavaStringToUTF8(const JavaRef<jstring>& str);
24
25 // Convert a std string to Java string.
26 BASE_EXPORT ScopedJavaLocalRef<jstring> ConvertUTF8ToJavaString(
27 JNIEnv* env,
28 const base::StringPiece& str);
29
30 // Convert a Java string to UTF16. Returns a string16.
31 BASE_EXPORT void ConvertJavaStringToUTF16(JNIEnv* env,
32 jstring str,
33 string16* result);
34 BASE_EXPORT string16 ConvertJavaStringToUTF16(JNIEnv* env, jstring str);
35 BASE_EXPORT string16 ConvertJavaStringToUTF16(const JavaRef<jstring>& str);
36
37 // Convert a string16 to a Java string.
38 BASE_EXPORT ScopedJavaLocalRef<jstring> ConvertUTF16ToJavaString(
39 JNIEnv* env,
40 const base::StringPiece16& str);
41
42 } // namespace android
43 } // namespace base
44
45 #endif // BASE_ANDROID_JNI_STRING_H_
OLDNEW
« no previous file with comments | « base/android/jni_registrar.cc ('k') | base/android/jni_string.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698