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 25 namespace OHOS { 26 namespace AccountSA { 27 class AccountDumpHelper { 28 public: 29 AccountDumpHelper(const std::shared_ptr<OhosAccountManager>& ohosAccountMgr, 30 OsAccountManagerService *osAccountMgrService); 31 ~AccountDumpHelper() = default; 32 void Dump(const std::vector<std::string>& args, std::string& result) const; 33 34 private: 35 void ShowIllegalInformation(std::string& result) const; 36 void ShowHelp(std::string& result) const; 37 void ProcessOneParameter(const std::string& arg, std::string& result) const; 38 void ProcessTwoParameter(const std::string& arg1, const std::string& arg2, std::string& result) const; 39 std::weak_ptr<OhosAccountManager> ohosAccountMgr_; 40 OsAccountManagerService *osAccountMgrService_; 41 std::shared_ptr<IInnerOsAccount> innerMgrService_; 42 void ShowOhosAccountInfo(std::string &result) const; 43 void ShowOsAccountInfo(std::string &result) const; 44 void SetLogLevel(const std::string& levelStr, std::string& result) const; 45 }; 46 } // namespace AccountSA 47 } // namespace OHOS 48 49 #endif // OS_ACCOUNT_DFX_HIDUMPER_ADAPTER_H 50