IODA Bundle
HttpHandle.cc
Go to the documentation of this file.
1 /*
2  * (C) Copyright 1996-2016 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation nor
8  * does it submit to any jurisdiction.
9  */
10 
11 
12 #include "odc/data/HttpHandle.h"
13 
14 using eckit::Length;
15 using eckit::Stream;
16 
17 namespace odc {
18 
19 void HttpHandle::print(std::ostream& s) const
20 {
21  s << "HttpHandle[" << url_ << ']';
22 }
23 
24 void HttpHandle::encode(Stream& s) const
25 {
26  NOTIMP;
27 }
28 
29 std::string HttpHandle::parseHost(const std::string& url)
30 {
31  // TODO:
32  return "localhost";
33 }
34 
35 int HttpHandle::parsePort(const std::string& url)
36 {
37  // TODO:
38  return 8000;
39 }
40 
41 HttpHandle::HttpHandle(const std::string &url)
42 : url_(url),
43  tcp_(parseHost(url), parsePort(url))
44 {
45 }
46 
48 {
49 }
50 
52 {
53  return 0;
54 }
55 
56 void HttpHandle::openForWrite(const Length&)
57 {
58 }
59 
60 void HttpHandle::openForAppend(const Length&)
61 {
62 }
63 
64 long HttpHandle::read(void* buffer, long length)
65 {
66  long n(0);
67  // TODO:
68  return n;
69 }
70 
71 long HttpHandle::write(const void* buffer, long length)
72 {
73  long n(0);
74  // TODO:
75  return n;
76 }
77 
79 {
80 }
81 
82 } // namespace odc
83 
const std::string url_
Definition: HttpHandle.h:43
virtual eckit::Length openForRead()
Definition: HttpHandle.cc:51
HttpHandle(const std::string &url)
Definition: HttpHandle.cc:41
virtual void encode(eckit::Stream &) const
Definition: HttpHandle.cc:24
virtual void openForAppend(const eckit::Length &)
Definition: HttpHandle.cc:60
virtual void close()
Definition: HttpHandle.cc:78
static int parsePort(const std::string &)
Definition: HttpHandle.cc:35
static std::string parseHost(const std::string &)
Definition: HttpHandle.cc:29
virtual long write(const void *, long)
Definition: HttpHandle.cc:71
virtual void print(std::ostream &) const
Definition: HttpHandle.cc:19
virtual void openForWrite(const eckit::Length &)
Definition: HttpHandle.cc:56
virtual long read(void *, long)
Definition: HttpHandle.cc:64
Definition: ColumnInfo.h:23