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