xref: /haiku/headers/private/netservices/GopherRequest.h (revision acdafb571df692fab7ad89836e39590dd8d415e2)
1 /*
2  * Copyright 2014 Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef _B_GOPHER_REQUEST_H_
6 #define _B_GOPHER_REQUEST_H_
7 
8 
9 #include <deque>
10 
11 #include <NetworkRequest.h>
12 #include <UrlProtocolRoster.h>
13 
14 
15 #ifndef LIBNETAPI_DEPRECATED
16 namespace BPrivate {
17 
18 namespace Network {
19 #endif
20 
21 class BGopherRequest : public BNetworkRequest {
22 public:
23 	virtual						~BGopherRequest();
24 
25 			status_t			Stop();
26 	const 	BUrlResult&			Result() const;
27             void                SetDisableListener(bool disable);
28 
29 private:
30 			friend class BUrlProtocolRoster;
31 
32 								BGopherRequest(const BUrl& url,
33 									BUrlProtocolListener* listener = NULL,
34 									BUrlContext* context = NULL);
35 
36 			status_t			_ProtocolLoop();
37 			void				_SendRequest();
38 
39 			bool				_NeedsParsing();
40 			bool				_NeedsLastDotStrip();
41 			void				_ParseInput(bool last);
42 
43 			BString&			_HTMLEscapeString(BString &str);
44 
45 private:
46 			char				fItemType;
47 			BString				fPath;
48 
49 			ssize_t				fPosition;
50 
51 			BUrlResult			fResult;
52 };
53 
54 #ifndef LIBNETAPI_DEPRECATED
55 } // namespace Network
56 
57 } // namespace BPrivate
58 #endif
59 
60 #endif // _B_GOPHER_REQUEST_H_
61