GopherRequest.h revision 295ded8c
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
13
14class BGopherRequest : public BNetworkRequest {
15public:
16								BGopherRequest(const BUrl& url,
17									BUrlProtocolListener* listener = NULL,
18									BUrlContext* context = NULL);
19	virtual						~BGopherRequest();
20
21			status_t			Stop();
22	const 	BUrlResult&			Result() const;
23            void                SetDisableListener(bool disable);
24
25private:
26			status_t			_ProtocolLoop();
27			void				_SendRequest();
28
29			bool				_NeedsParsing();
30			bool				_NeedsLastDotStrip();
31			void				_ParseInput(bool last);
32
33			BString&			_HTMLEscapeString(BString &str);
34
35private:
36			char				fItemType;
37			BString				fPath;
38
39			ssize_t				fPosition;
40
41			BUrlResult			fResult;
42};
43
44
45#endif // _B_GOPHER_REQUEST_H_
46