1 /* 2 * Copyright 2013 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _B_FILE_REQUEST_H_ 6 #define _B_FILE_REQUEST_H_ 7 8 9 #include <deque> 10 11 12 #include <UrlRequest.h> 13 #include <UrlProtocolRoster.h> 14 15 16 #ifndef LIBNETAPI_DEPRECATED 17 namespace BPrivate { 18 19 namespace Network { 20 #endif 21 22 class BFileRequest : public BUrlRequest { 23 public: 24 virtual ~BFileRequest(); 25 26 const BUrlResult& Result() const; 27 void SetDisableListener(bool disable); 28 29 private: 30 friend class BUrlProtocolRoster; 31 32 #ifdef LIBNETAPI_DEPRECATED 33 BFileRequest(const BUrl& url, 34 BUrlProtocolListener* listener = NULL, 35 BUrlContext* context = NULL); 36 #else 37 BFileRequest(const BUrl& url, 38 BDataIO* output, 39 BUrlProtocolListener* listener = NULL, 40 BUrlContext* context = NULL); 41 #endif 42 43 status_t _ProtocolLoop(); 44 private: 45 BUrlResult fResult; 46 }; 47 48 #ifndef LIBNETAPI_DEPRECATED 49 } // namespace Network 50 51 } // namespace BPrivate 52 #endif 53 54 #endif // _B_FILE_REQUEST_H_ 55