1 /* 2 * Copyright (C) 2023 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 #ifndef FRAMEWORKS_MEDIATOOLS_EXEC_ENV_H_ 16 #define FRAMEWORKS_MEDIATOOLS_EXEC_ENV_H_ 17 #include <string> 18 #include <vector> 19 20 #include "option_args.h" 21 #include "userfile_manager_types.h" 22 #include "utils/constant_utils.h" 23 24 namespace OHOS { 25 namespace Media { 26 namespace MediaTool { 27 struct SendParam { 28 bool isCreateThumbSyncInSend = false; 29 bool isRemoveOriginFileInSend = true; 30 bool isFile = true; 31 std::string sendPath; // real path for sending 32 }; 33 34 struct RecvParam { 35 bool isRecvAll = false; 36 bool isRecvPathDir = false; 37 std::string recvTarget; 38 std::string recvPath; // real path for the recvPath in optArgs 39 }; 40 41 struct ListParam { 42 bool isListAll = false; 43 std::string listUri; 44 }; 45 46 struct DeleteParam { 47 bool isDeleteAll = false; 48 bool isOnlyDeleteDb = false; 49 std::string deleteUri; 50 }; 51 struct QueryParam { 52 std::string displayName; 53 bool pathFlag = false; 54 bool uriFlag = false; 55 }; 56 57 struct ExecEnv { 58 OptionArgs optArgs; 59 std::vector<std::string> args; 60 std::vector<std::string> commandArgs; 61 SendParam sendParam; 62 RecvParam recvParam; 63 ListParam listParam; 64 DeleteParam deleteParam; 65 QueryParam queryParam; 66 std::string workPath; // current work path 67 bool isRoot = false; 68 [[nodiscard]] std::string ToStr() const; 69 }; 70 } // namespace MediaTool 71 } // namespace Media 72 } // namespace OHOS 73 #endif // FRAMEWORKS_MEDIATOOLS_EXEC_ENV_H_ 74