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 16 #ifndef REQUEST_PARCEL_HELPER_H 17 #define REQUEST_PARCEL_HELPER_H 18 19 #include "message_parcel.h" 20 #include "request_common.h" 21 #include "request_common_utils.h" 22 #include "visibility.h" 23 24 namespace OHOS { 25 namespace Request { 26 class ParcelHelper { 27 public: 28 REQUEST_API static void UnMarshal(MessageParcel &data, TaskInfo &info); 29 REQUEST_API static void UnMarshalConfig(MessageParcel &data, Config &config); 30 31 private: 32 static void UnMarshalBase(MessageParcel &data, TaskInfo &info); 33 static bool UnMarshalFormItem(MessageParcel &data, TaskInfo &info); 34 static bool UnMarshalFileSpec(MessageParcel &data, TaskInfo &info); 35 static void UnMarshalProgress(MessageParcel &data, TaskInfo &info); 36 static bool UnMarshalMapProgressExtras(MessageParcel &data, TaskInfo &info); 37 static bool UnMarshalMapExtras(MessageParcel &data, TaskInfo &info); 38 static bool UnMarshalTaskState(MessageParcel &data, TaskInfo &info); 39 static bool UnMarshalConfigHeaders(MessageParcel &data, Config &config); 40 static bool UnMarshalConfigExtras(MessageParcel &data, Config &config); 41 static bool UnMarshalConfigFormItem(MessageParcel &data, Config &config); 42 static bool UnMarshalConfigFileSpec(MessageParcel &data, Config &config); 43 static bool UnMarshalConfigBodyFileName(MessageParcel &data, Config &config); 44 }; 45 } // namespace Request 46 } // namespace OHOS 47 #endif //REQUEST_PARCEL_HELPER_H 48