diff options
Diffstat (limited to 'src/httpget.cpp')
-rw-r--r-- | src/httpget.cpp | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/src/httpget.cpp b/src/httpget.cpp new file mode 100644 index 0000000..c5aa16d --- /dev/null +++ b/src/httpget.cpp | |||
@@ -0,0 +1,103 @@ | |||
1 | #include "bu/httpget.h" | ||
2 | |||
3 | Bu::HttpGet::HttpGet( const Bu::Url &uSrc, const Bu::FString &sMethod ) : | ||
4 | uSrc( uSrc ), | ||
5 | sMethod( sMethod ), | ||
6 | sSrv( uSrc.getHost(), uSrc.getPort() ) | ||
7 | { | ||
8 | sSrv.write( sMethod + " " + uSrc.getFullPath() + " HTTP/1.1\r\n" ); | ||
9 | } | ||
10 | |||
11 | Bu::HttpGet::~HttpGet() | ||
12 | { | ||
13 | } | ||
14 | |||
15 | void Bu::HttpGet::close() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | void Bu::HttpGet::get() | ||
20 | { | ||
21 | for( MimeHash::iterator i = hMimeOut.begin(); i; i++ ) | ||
22 | { | ||
23 | sSrv.write( i.getKey() + ": " + i.getValue() + "\r\n" ); | ||
24 | } | ||
25 | sSrv.write("\r\n", 2 ); | ||
26 | |||
27 | // sSrv.read( | ||
28 | } | ||
29 | |||
30 | size_t Bu::HttpGet::read( void *pBuf, size_t nBytes ) | ||
31 | { | ||
32 | } | ||
33 | |||
34 | size_t Bu::HttpGet::write( const void *pBuf, size_t nBytes ) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
38 | |||
39 | long Bu::HttpGet::tell() | ||
40 | { | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | void Bu::HttpGet::seek( long ) | ||
45 | { | ||
46 | } | ||
47 | |||
48 | void Bu::HttpGet::setPos( long ) | ||
49 | { | ||
50 | } | ||
51 | |||
52 | void Bu::HttpGet::setPosEnd( long ) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | bool Bu::HttpGet::isEOS() | ||
57 | { | ||
58 | return false; | ||
59 | } | ||
60 | |||
61 | bool Bu::HttpGet::isOpen() | ||
62 | { | ||
63 | return true; | ||
64 | } | ||
65 | |||
66 | void Bu::HttpGet::flush() | ||
67 | { | ||
68 | } | ||
69 | |||
70 | bool Bu::HttpGet::canRead() | ||
71 | { | ||
72 | return true; | ||
73 | } | ||
74 | |||
75 | bool Bu::HttpGet::canWrite() | ||
76 | { | ||
77 | return false; | ||
78 | } | ||
79 | |||
80 | bool Bu::HttpGet::isReadable() | ||
81 | { | ||
82 | return true; | ||
83 | } | ||
84 | |||
85 | bool Bu::HttpGet::isWritable() | ||
86 | { | ||
87 | return false; | ||
88 | } | ||
89 | |||
90 | bool Bu::HttpGet::isSeekable() | ||
91 | { | ||
92 | return false; | ||
93 | } | ||
94 | |||
95 | bool Bu::HttpGet::isBlocking() | ||
96 | { | ||
97 | return true; | ||
98 | } | ||
99 | |||
100 | void Bu::HttpGet::setBlocking( bool /*bBlocking*/ ) | ||
101 | { | ||
102 | } | ||
103 | |||