1/*
2 * Copyright 2010 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _B_URL_RESULT_H_
6#define _B_URL_RESULT_H_
7
8
9#include <iostream>
10
11#include <DataIO.h>
12#include <HttpHeaders.h>
13#include <String.h>
14#include <Url.h>
15
16
17class BUrlProtocol;
18
19
20class BUrlResult {
21			friend class 		BUrlProtocol;
22
23public:
24								BUrlResult(const BUrl& url);
25								BUrlResult(const BUrlResult& other);
26
27	// Result parameters modifications
28			void				SetUrl(const BUrl& url);
29
30	// Result parameters access
31			const BUrl&			Url() const;
32			const BMallocIO&	RawData() const;
33			const BHttpHeaders&	Headers() const;
34			const BString&		StatusText() const;
35			int32				StatusCode() const;
36
37	// Result tests
38			bool				HasHeaders() const;
39
40	// Overloaded members
41			BUrlResult&			operator=(const BUrlResult& other);
42	friend 	std::ostream& 		operator<<(std::ostream& out,
43									const BUrlResult& result);
44
45private:
46			BUrl				fUrl;
47			BMallocIO			fRawData;
48			BHttpHeaders 		fHeaders;
49				// TODO: HTTP specific stuff should not live here.
50
51			int32				fStatusCode;
52			BString				fStatusString;
53};
54
55
56#endif // _B_URL_RESULT_H_
57