summaryrefslogtreecommitdiff
path: root/src/experimental/httpget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/experimental/httpget.cpp')
-rw-r--r--src/experimental/httpget.cpp126
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
10Bu::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
18Bu::HttpGet::~HttpGet()
19{
20}
21
22void Bu::HttpGet::close()
23{
24}
25
26void 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
37Bu::size Bu::HttpGet::read( void * /*pBuf*/, Bu::size /*nBytes*/ )
38{
39 return 0;
40}
41
42Bu::size Bu::HttpGet::write( const void * /*pBuf*/, Bu::size /*nBytes*/ )
43{
44 return 0;
45}
46
47Bu::size Bu::HttpGet::tell()
48{
49 return 0;
50}
51
52void Bu::HttpGet::seek( Bu::size )
53{
54}
55
56void Bu::HttpGet::setPos( Bu::size )
57{
58}
59
60void Bu::HttpGet::setPosEnd( Bu::size )
61{
62}
63
64bool Bu::HttpGet::isEos()
65{
66 return false;
67}
68
69bool Bu::HttpGet::isOpen()
70{
71 return true;
72}
73
74void Bu::HttpGet::flush()
75{
76}
77
78bool Bu::HttpGet::canRead()
79{
80 return true;
81}
82
83bool Bu::HttpGet::canWrite()
84{
85 return false;
86}
87
88bool Bu::HttpGet::isReadable()
89{
90 return true;
91}
92
93bool Bu::HttpGet::isWritable()
94{
95 return false;
96}
97
98bool Bu::HttpGet::isSeekable()
99{
100 return false;
101}
102
103bool Bu::HttpGet::isBlocking()
104{
105 return true;
106}
107
108void Bu::HttpGet::setBlocking( bool /*bBlocking*/ )
109{
110}
111
112Bu::size Bu::HttpGet::getSize() const
113{
114 return 0;
115}
116
117Bu::size Bu::HttpGet::getBlockSize() const
118{
119 return 0;
120}
121
122Bu::String Bu::HttpGet::getLocation() const
123{
124 return uSrc.getUrl();
125}
126