1f7a47986Sopenharmony_ci/*
2f7a47986Sopenharmony_ci * Copyright (c) 2023 Huawei Device Co., Ltd.
3f7a47986Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4f7a47986Sopenharmony_ci * you may not use this file except in compliance with the License.
5f7a47986Sopenharmony_ci * You may obtain a copy of the License at
6f7a47986Sopenharmony_ci *
7f7a47986Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8f7a47986Sopenharmony_ci *
9f7a47986Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10f7a47986Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11f7a47986Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f7a47986Sopenharmony_ci * See the License for the specific language governing permissions and
13f7a47986Sopenharmony_ci * limitations under the License.
14f7a47986Sopenharmony_ci */
15f7a47986Sopenharmony_ci
16f7a47986Sopenharmony_ci#ifndef COMMON_NATIVE_INCLUDE_EDM_UTILS_H
17f7a47986Sopenharmony_ci#define COMMON_NATIVE_INCLUDE_EDM_UTILS_H
18f7a47986Sopenharmony_ci
19f7a47986Sopenharmony_ci#include <iostream>
20f7a47986Sopenharmony_ci#include <string>
21f7a47986Sopenharmony_ci
22f7a47986Sopenharmony_ci#include "edm_errors.h"
23f7a47986Sopenharmony_ci
24f7a47986Sopenharmony_cinamespace OHOS {
25f7a47986Sopenharmony_cinamespace EDM {
26f7a47986Sopenharmony_ciclass EdmUtils {
27f7a47986Sopenharmony_cipublic:
28f7a47986Sopenharmony_ci    static ErrCode ParseStringToInt(const std::string &str, int32_t &result);
29f7a47986Sopenharmony_ci    static ErrCode ParseStringToLong(const std::string &str, int64_t &result);
30f7a47986Sopenharmony_ci    static std::string Utf16ToUtf8(const std::u16string &str16);
31f7a47986Sopenharmony_ci    static void ClearString(std::string &str);
32f7a47986Sopenharmony_ci    static void ClearCharArray(char* &str, size_t size);
33f7a47986Sopenharmony_ci};
34f7a47986Sopenharmony_ci} // namespace EDM
35f7a47986Sopenharmony_ci} // namespace OHOS
36f7a47986Sopenharmony_ci
37f7a47986Sopenharmony_ci#endif // COMMON_NATIVE_INCLUDE_EDM_UTILS_H
38