1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "i18n_unicode_ffi.h" 17 #include <cstdlib> 18 #include "character.h" 19 20 namespace OHOS { 21 namespace Global { 22 namespace I18n { 23 extern "C" 24 { FfiI18nUnicodeGetType(char * text)25 char* FfiI18nUnicodeGetType(char* text) 26 { 27 return MallocCString(GetType(text)); 28 } 29 FfiI18nUnicodeIsUpperCase(char * text)30 bool FfiI18nUnicodeIsUpperCase(char* text) 31 { 32 return IsUpperCase(text); 33 } 34 FfiI18nUnicodeIsLowerCase(char * text)35 bool FfiI18nUnicodeIsLowerCase(char* text) 36 { 37 return IsLowerCase(text); 38 } 39 FfiI18nUnicodeIsLetter(char * text)40 bool FfiI18nUnicodeIsLetter(char* text) 41 { 42 return IsLetter(text); 43 } 44 FfiI18nUnicodeIsIdeograph(char * text)45 bool FfiI18nUnicodeIsIdeograph(char* text) 46 { 47 return IsIdeoGraphic(text); 48 } 49 FfiI18nUnicodeIsRTL(char * text)50 bool FfiI18nUnicodeIsRTL(char* text) 51 { 52 return IsRTLCharacter(text); 53 } 54 FfiI18nUnicodeIsWhitespace(char * text)55 bool FfiI18nUnicodeIsWhitespace(char* text) 56 { 57 return IsWhiteSpace(text); 58 } 59 FfiI18nUnicodeIsSpaceChar(char * text)60 bool FfiI18nUnicodeIsSpaceChar(char* text) 61 { 62 return IsSpaceChar(text); 63 } 64 FfiI18nUnicodeIsDigit(char * text)65 bool FfiI18nUnicodeIsDigit(char* text) 66 { 67 return IsDigit(text); 68 } 69 } 70 } // namespace I18n 71 } // namespace Global 72 } // namespace OHOS