1/*
2 * Copyright (c) 2021-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 OS_ACCOUNT_DFX_HIDUMPER_ADAPTER_H
17#define OS_ACCOUNT_DFX_HIDUMPER_ADAPTER_H
18
19#include <string>
20#include <vector>
21#include "iinner_os_account_manager.h"
22#include "ohos_account_manager.h"
23#include "os_account_manager_service.h"
24
25namespace OHOS {
26namespace AccountSA {
27class AccountDumpHelper {
28public:
29    explicit AccountDumpHelper(OsAccountManagerService* osAccountMgrService);
30    ~AccountDumpHelper() = default;
31    void Dump(const std::vector<std::string>& args, std::string& result) const;
32
33private:
34    void ShowIllegalInformation(std::string& result) const;
35    void ShowHelp(std::string& result) const;
36    void ProcessOneParameter(const std::string& arg, std::string& result) const;
37    void ProcessTwoParameter(const std::string& arg1, const std::string& arg2, std::string& result) const;
38    OsAccountManagerService *osAccountMgrService_;
39    void ShowOhosAccountInfo(std::string &result) const;
40    void ShowOsAccountInfo(std::string &result) const;
41    void SetLogLevel(const std::string& levelStr, std::string& result) const;
42    std::string AnonymizeNameStr(const std::string& nameStr) const;
43    std::string AnonymizeUidStr(const std::string& uidStr) const;
44};
45}  // namespace AccountSA
46}  // namespace OHOS
47
48#endif  // OS_ACCOUNT_DFX_HIDUMPER_ADAPTER_H
49