1f857971dSopenharmony_ci/*
2f857971dSopenharmony_ci * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3f857971dSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4f857971dSopenharmony_ci * you may not use this file except in compliance with the License.
5f857971dSopenharmony_ci * You may obtain a copy of the License at
6f857971dSopenharmony_ci *
7f857971dSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8f857971dSopenharmony_ci *
9f857971dSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10f857971dSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11f857971dSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12f857971dSopenharmony_ci * See the License for the specific language governing permissions and
13f857971dSopenharmony_ci * limitations under the License.
14f857971dSopenharmony_ci */
15f857971dSopenharmony_ci
16f857971dSopenharmony_ci#ifndef DEVICESTATUS_DATA_PARSE_H
17f857971dSopenharmony_ci#define DEVICESTATUS_DATA_PARSE_H
18f857971dSopenharmony_ci
19f857971dSopenharmony_ci#include <string>
20f857971dSopenharmony_ci#include <vector>
21f857971dSopenharmony_ci
22f857971dSopenharmony_ci#include "stationary_data.h"
23f857971dSopenharmony_ci
24f857971dSopenharmony_cinamespace OHOS {
25f857971dSopenharmony_cinamespace Msdp {
26f857971dSopenharmony_cinamespace DeviceStatus {
27f857971dSopenharmony_ciclass DeviceStatusDataParse {
28f857971dSopenharmony_cipublic:
29f857971dSopenharmony_ci    DeviceStatusDataParse() = default;
30f857971dSopenharmony_ci    ~DeviceStatusDataParse() = default;
31f857971dSopenharmony_ci    bool ParseDeviceStatusData(Type type, Data &data);
32f857971dSopenharmony_ci    bool DisableCount(const Type type);
33f857971dSopenharmony_ci    bool DeviceStatusDataInit(const std::string &fileData, bool logStatus, Type &type, Data &data);
34f857971dSopenharmony_ci    int32_t CreateJsonFile();
35f857971dSopenharmony_ci
36f857971dSopenharmony_ciprivate:
37f857971dSopenharmony_ci    bool CheckFileDir(const std::string &filePath, const std::string &dir);
38f857971dSopenharmony_ci    bool CheckFileSize(const std::string &filePath);
39f857971dSopenharmony_ci    bool CheckFileExtendName(const std::string &filePath, const std::string &checkExtension);
40f857971dSopenharmony_ci    std::string ReadFile(const std::string &filePath);
41f857971dSopenharmony_ci    std::string ReadJsonFile(const std::string &filePath);
42f857971dSopenharmony_ci    static std::vector<int32_t> tempcount_;
43f857971dSopenharmony_ci};
44f857971dSopenharmony_ci} // namespace DeviceStatus
45f857971dSopenharmony_ci} // namespace Msdp
46f857971dSopenharmony_ci} // namespace OHOS
47f857971dSopenharmony_ci#endif // DEVICESTATUS_DATA_PARSE_H
48