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 28 struct SendParam { 29 bool isCreateThumbSyncInSend = false; 30 bool isRemoveOriginFileInSend = true; 31 bool isFile = true; 32 std::string sendPath; // real path for sending 33 }; 34 35 struct RecvParam { 36 bool isRecvAll = false; 37 bool isRecvPathDir = false; 38 std::string recvUri; 39 std::string recvPath; // real path for the recvPath in optArgs 40 }; 41 42 struct ListParam { 43 bool isListAll = false; 44 std::string listUri; 45 }; 46 47 struct DeleteParam { 48 bool isDeleteAll = false; 49 bool isOnlyDeleteDb = false; 50 std::string deleteUri; 51 }; 52 struct QueryParam { 53 std::string displayName; 54 }; 55 56 struct ExecEnv { 57 OptionArgs optArgs; 58 std::vector<std::string> args; 59 SendParam sendParam; 60 RecvParam recvParam; 61 ListParam listParam; 62 DeleteParam deleteParam; 63 QueryParam queryParam; 64 std::string workPath; // current work path 65 bool isRoot = false; 66 [[nodiscard]] std::string ToStr() const; 67 }; 68 } // namespace MediaTool 69 } // namespace Media 70 } // namespace OHOS 71 #endif // FRAMEWORKS_MEDIATOOLS_EXEC_ENV_H_ 72