180922886Sopenharmony_ci/*
280922886Sopenharmony_ci * Copyright (c) 2022 Huawei Device Co., Ltd.
380922886Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
480922886Sopenharmony_ci * you may not use this file except in compliance with the License.
580922886Sopenharmony_ci * You may obtain a copy of the License at
680922886Sopenharmony_ci *
780922886Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
880922886Sopenharmony_ci *
980922886Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1080922886Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1180922886Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1280922886Sopenharmony_ci * See the License for the specific language governing permissions and
1380922886Sopenharmony_ci * limitations under the License.
1480922886Sopenharmony_ci */
1580922886Sopenharmony_ci
1680922886Sopenharmony_ci#ifndef OHOS_AVSESSION_DUMP_HELPER_H
1780922886Sopenharmony_ci#define OHOS_AVSESSION_DUMP_HELPER_H
1880922886Sopenharmony_ci
1980922886Sopenharmony_ci#include <string>
2080922886Sopenharmony_ci
2180922886Sopenharmony_ci#include "avsession_service.h"
2280922886Sopenharmony_ci
2380922886Sopenharmony_cinamespace OHOS::AVSession {
2480922886Sopenharmony_ciclass AVSessionDumper {
2580922886Sopenharmony_ci    using DumpActionType = void(*)(std::string& result, const AVSessionService& sessionService);
2680922886Sopenharmony_cipublic:
2780922886Sopenharmony_ci    AVSessionDumper() = default;
2880922886Sopenharmony_ci    ~AVSessionDumper() = default;
2980922886Sopenharmony_ci    void Dump(const std::vector<std::string>& args, std::string& result, const AVSessionService& sessionService) const;
3080922886Sopenharmony_ci    void SetErrorInfo(const std::string& inErrMsg);
3180922886Sopenharmony_ci
3280922886Sopenharmony_ciprivate:
3380922886Sopenharmony_ci    void ShowHelp(std::string& result) const;
3480922886Sopenharmony_ci    void ShowIllegalInfo(std::string& result) const;
3580922886Sopenharmony_ci    void ProcessParameter(const std::string& arg, std::string& result, const AVSessionService& sessionService) const;
3680922886Sopenharmony_ci    static void ShowMetaData(std::string& result, const AVSessionService& sessionService);
3780922886Sopenharmony_ci    static void ShowSessionInfo(std::string& result, const AVSessionService& sessionService);
3880922886Sopenharmony_ci    static void ShowControllerInfo(std::string& result, const AVSessionService& sessionService);
3980922886Sopenharmony_ci    static void ShowErrorInfo(std::string& result, const AVSessionService& sessionService);
4080922886Sopenharmony_ci    static void ShowTrustedDevicesInfo(std::string& result, const AVSessionService& sessionService);
4180922886Sopenharmony_ci
4280922886Sopenharmony_ci    static std::map<std::string, AVSessionDumper::DumpActionType> funcMap_;
4380922886Sopenharmony_ci    static std::map<int32_t, std::string> playBackStates_;
4480922886Sopenharmony_ci    static std::map<int32_t, std::string> loopMode_;
4580922886Sopenharmony_ci    static std::vector<std::string> errMessage_;
4680922886Sopenharmony_ci    static std::map<int32_t, std::string> deviceTypeId_;
4780922886Sopenharmony_ci};
4880922886Sopenharmony_ci} // namespace OHOS::AVSession
4980922886Sopenharmony_ci#endif // OHOS_AVSESSION_DUMP_HELPER_H