1 /* 2 * Copyright (C) 2022 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 #ifndef TELEPHONY_COMMON_UTILS_H 17 #define TELEPHONY_COMMON_UTILS_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace Telephony { 23 /** 24 * @brief Get bundle name by the calling uid. 25 * 26 * @return Return bundle name of the caller. 27 */ 28 std::string GetBundleName(); 29 30 /** 31 * @brief Indicates if the input value is a decimal number. 32 * 33 * @param inputValue 34 * @return Return {@code true} if the input value is a decimal number, return {@code false} otherwise. 35 */ 36 bool IsValidDecValue(const std::string &inputValue); 37 38 /** 39 * @brief Indicates if the input value is a hexadecimal number. 40 * 41 * @param inputValue 42 * @return Return {@code true} if the input value is a hexadecimal number, return {@code false} otherwise. 43 */ 44 bool IsValidHexValue(const std::string &inputValue); 45 46 /** 47 * @brief Get calling token id. 48 * 49 * @return Return token id of the caller. 50 */ 51 int32_t GetTokenID(); 52 } // namespace Telephony 53 } // namespace OHOS 54 #endif // TELEPHONY_COMMON_UTILS_H