106f6ba60Sopenharmony_ci/*
206f6ba60Sopenharmony_ci * Copyright (C) 2021 Huawei Device Co., Ltd.
306f6ba60Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
406f6ba60Sopenharmony_ci * you may not use this file except in compliance with the License.
506f6ba60Sopenharmony_ci * You may obtain a copy of the License at
606f6ba60Sopenharmony_ci *
706f6ba60Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
806f6ba60Sopenharmony_ci *
906f6ba60Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1006f6ba60Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1106f6ba60Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1206f6ba60Sopenharmony_ci * See the License for the specific language governing permissions and
1306f6ba60Sopenharmony_ci * limitations under the License.
1406f6ba60Sopenharmony_ci */
1506f6ba60Sopenharmony_ci#ifndef PARSE_RADAR_H
1606f6ba60Sopenharmony_ci#define PARSE_RADAR_H
1706f6ba60Sopenharmony_ci#include <iostream>
1806f6ba60Sopenharmony_ci#include <fstream>
1906f6ba60Sopenharmony_ci#include <string>
2006f6ba60Sopenharmony_ci#include <vector>
2106f6ba60Sopenharmony_cinamespace OHOS {
2206f6ba60Sopenharmony_cinamespace SmartPerf {
2306f6ba60Sopenharmony_ciclass ParseRadar {
2406f6ba60Sopenharmony_cipublic:
2506f6ba60Sopenharmony_ci    double ParseRadarStart(const std::string &string) const;
2606f6ba60Sopenharmony_ci    double ParseRadarStartResponse(const std::string &string) const;
2706f6ba60Sopenharmony_ci    double ParseRadarResponse(const std::string &string) const;
2806f6ba60Sopenharmony_ci    double ParseRadarDelayTime(const std::string &string, const std::string &target, const int &delayTime) const;
2906f6ba60Sopenharmony_ci    std::string ParseRadarAppStrart(const std::string &string) const;
3006f6ba60Sopenharmony_ci    double ParseRadarComplete(const std::string &string) const;
3106f6ba60Sopenharmony_ci    std::string ExtractString(const std::string &str, const std::string &target) const;
3206f6ba60Sopenharmony_ci    std::string ParseRadarFrame(const std::string &string) const;
3306f6ba60Sopenharmony_ci    std::string ParseRadarMaxFrame(const std::string &string) const;
3406f6ba60Sopenharmony_ci    int GetMaxDelayTime(const int &delayTime, std::vector<std::string> &delayTimeVec) const;
3506f6ba60Sopenharmony_ciprivate:
3606f6ba60Sopenharmony_ci    const int delayTimeResponse = 2000;
3706f6ba60Sopenharmony_ci    const int delayTimeComplete = 2500;
3806f6ba60Sopenharmony_ci    const std::string targetResponse = "\"RESPONSE_LATENCY\"";
3906f6ba60Sopenharmony_ci    const std::string targetComplete = "\"E2E_LATENCY\"";
4006f6ba60Sopenharmony_ci};
4106f6ba60Sopenharmony_ci}
4206f6ba60Sopenharmony_ci}
4306f6ba60Sopenharmony_ci#endif // PARSE_RADAR_H