blob: e4f2bd8fcf61cd8cb3356a7d7922b19608bb2d7b [file] [log] [blame]
Lukas Zilkab23e2122018-02-09 10:25:19 +01001/*
Tony Mak6c4cc672018-09-17 11:48:50 +01002 * Copyright (C) 2018 The Android Open Source Project
Lukas Zilkab23e2122018-02-09 10:25:19 +01003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Tony Mak6c4cc672018-09-17 11:48:50 +010017#ifndef LIBTEXTCLASSIFIER_UTILS_JAVA_STRING_UTILS_H_
18#define LIBTEXTCLASSIFIER_UTILS_JAVA_STRING_UTILS_H_
Lukas Zilkab23e2122018-02-09 10:25:19 +010019
20#include <jni.h>
21#include <string>
22
Tony Mak6c4cc672018-09-17 11:48:50 +010023namespace libtextclassifier3 {
Lukas Zilkab23e2122018-02-09 10:25:19 +010024
Tony Mak51a9e542018-11-02 13:36:22 +000025bool JByteArrayToString(JNIEnv* env, const jbyteArray& array,
26 std::string* result);
Lukas Zilkab23e2122018-02-09 10:25:19 +010027bool JStringToUtf8String(JNIEnv* env, const jstring& jstr, std::string* result);
28
Tony Mak6c4cc672018-09-17 11:48:50 +010029} // namespace libtextclassifier3
Lukas Zilkab23e2122018-02-09 10:25:19 +010030
Tony Mak6c4cc672018-09-17 11:48:50 +010031#endif // LIBTEXTCLASSIFIER_UTILS_JAVA_STRING_UTILS_H_