/* * Copyright (c) 2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef NETMANAGER_BASE_HTTP_PROXY_H #define NETMANAGER_BASE_HTTP_PROXY_H #include #include #include "parcel.h" namespace OHOS { namespace NetManagerStandard { #define NET_SYMBOL_VISIBLE __attribute__ ((visibility("default"))) class NET_SYMBOL_VISIBLE HttpProxy final : public Parcelable { public: HttpProxy(); HttpProxy(std::string host, uint16_t port, const std::list &exclusionList); [[nodiscard]] std::string GetHost() const; [[nodiscard]] uint16_t GetPort() const; [[nodiscard]] std::list GetExclusionList() const; [[nodiscard]] std::string ToString() const; void inline SetHost(std::string &&host) { host_ = host; } void inline SetPort(uint16_t port) { port_ = port; } void inline SetExclusionList(const std::list &list) { exclusionList_ = list; } bool operator==(const HttpProxy &httpProxy) const; bool operator!=(const HttpProxy &httpProxy) const; bool Marshalling(Parcel &parcel) const override; static bool Unmarshalling(Parcel &parcel, HttpProxy &httpProxy); private: std::string host_; uint16_t port_; std::list exclusionList_; }; } // namespace NetManagerStandard } // namespace OHOS #endif /* NETMANAGER_BASE_HTTP_PROXY_H */