diff options
Diffstat (limited to 'src/experimental/httpget.cpp')
-rw-r--r-- | src/experimental/httpget.cpp | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/src/experimental/httpget.cpp b/src/experimental/httpget.cpp new file mode 100644 index 0000000..99492a2 --- /dev/null +++ b/src/experimental/httpget.cpp | |||
@@ -0,0 +1,126 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2011 Xagasoft, All rights reserved. | ||
3 | * | ||
4 | * This file is part of the libbu++ library and is released under the | ||
5 | * terms of the license contained in the file LICENSE. | ||
6 | */ | ||
7 | |||
8 | #include "bu/httpget.h" | ||
9 | |||
10 | Bu::HttpGet::HttpGet( const Bu::Url &uSrc, const Bu::String &sMethod ) : | ||
11 | uSrc( uSrc ), | ||
12 | sMethod( sMethod ), | ||
13 | sSrv( uSrc.getHost(), uSrc.getPort() ) | ||
14 | { | ||
15 | sSrv.write( sMethod + " " + uSrc.getFullPath() + " HTTP/1.1\r\n" ); | ||
16 | } | ||
17 | |||
18 | Bu::HttpGet::~HttpGet() | ||
19 | { | ||
20 | } | ||
21 | |||
22 | void Bu::HttpGet::close() | ||
23 | { | ||
24 | } | ||
25 | |||
26 | void Bu::HttpGet::get() | ||
27 | { | ||
28 | for( MimeHash::iterator i = hMimeOut.begin(); i; i++ ) | ||
29 | { | ||
30 | sSrv.write( i.getKey() + ": " + i.getValue() + "\r\n" ); | ||
31 | } | ||
32 | sSrv.write("\r\n", 2 ); | ||
33 | |||
34 | // sSrv.read( | ||
35 | } | ||
36 | |||
37 | Bu::size Bu::HttpGet::read( void * /*pBuf*/, Bu::size /*nBytes*/ ) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | Bu::size Bu::HttpGet::write( const void * /*pBuf*/, Bu::size /*nBytes*/ ) | ||
43 | { | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | Bu::size Bu::HttpGet::tell() | ||
48 | { | ||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | void Bu::HttpGet::seek( Bu::size ) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | void Bu::HttpGet::setPos( Bu::size ) | ||
57 | { | ||
58 | } | ||
59 | |||
60 | void Bu::HttpGet::setPosEnd( Bu::size ) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | bool Bu::HttpGet::isEos() | ||
65 | { | ||
66 | return false; | ||
67 | } | ||
68 | |||
69 | bool Bu::HttpGet::isOpen() | ||
70 | { | ||
71 | return true; | ||
72 | } | ||
73 | |||
74 | void Bu::HttpGet::flush() | ||
75 | { | ||
76 | } | ||
77 | |||
78 | bool Bu::HttpGet::canRead() | ||
79 | { | ||
80 | return true; | ||
81 | } | ||
82 | |||
83 | bool Bu::HttpGet::canWrite() | ||
84 | { | ||
85 | return false; | ||
86 | } | ||
87 | |||
88 | bool Bu::HttpGet::isReadable() | ||
89 | { | ||
90 | return true; | ||
91 | } | ||
92 | |||
93 | bool Bu::HttpGet::isWritable() | ||
94 | { | ||
95 | return false; | ||
96 | } | ||
97 | |||
98 | bool Bu::HttpGet::isSeekable() | ||
99 | { | ||
100 | return false; | ||
101 | } | ||
102 | |||
103 | bool Bu::HttpGet::isBlocking() | ||
104 | { | ||
105 | return true; | ||
106 | } | ||
107 | |||
108 | void Bu::HttpGet::setBlocking( bool /*bBlocking*/ ) | ||
109 | { | ||
110 | } | ||
111 | |||
112 | Bu::size Bu::HttpGet::getSize() const | ||
113 | { | ||
114 | return 0; | ||
115 | } | ||
116 | |||
117 | Bu::size Bu::HttpGet::getBlockSize() const | ||
118 | { | ||
119 | return 0; | ||
120 | } | ||
121 | |||
122 | Bu::String Bu::HttpGet::getLocation() const | ||
123 | { | ||
124 | return uSrc.getUrl(); | ||
125 | } | ||
126 | |||