Odil
A C++11 library for the DICOM standard
Message.h
Go to the documentation of this file.
1 /*************************************************************************
2  * odil - Copyright (C) Universite de Strasbourg
3  * Distributed under the terms of the CeCILL-B license, as published by
4  * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5  * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6  * for details.
7  ************************************************************************/
8 
9 #ifndef _d7a272d7_9beb_43c1_a5a1_fce4c0245c80
10 #define _d7a272d7_9beb_43c1_a5a1_fce4c0245c80
11 
12 #include <istream>
13 #include <map>
14 #include <ostream>
15 #include <string>
16 
17 #include "odil/odil.h"
18 
19 namespace odil
20 {
21 
22 namespace webservices
23 {
24 
27 {
28 public:
30  typedef std::map<std::string, std::string> Headers;
31 
37  Message(Headers const & headers=Headers(), std::string const & body="");
38 
40  virtual ~Message();
41 
43  Headers const & get_headers() const;
44 
46  void set_headers(Headers const & headers);
47 
54  bool has_header(std::string const & name) const;
55 
63  std::string const & get_header(std::string const & name) const;
64 
66  void set_header(std::string const & name, std::string const & value);
67 
69  std::string const & get_body() const;
70 
72  void set_body(std::string const & body);
73 
74 private:
75  Headers _headers;
76  std::string _body;
77 
78  Headers::const_iterator _find_header(std::string const & name) const;
79 };
80 
83 std::istream &
84 operator>>(std::istream & stream, Message & message);
85 
88 std::ostream &
89 operator<<(std::ostream & stream, Message const & message);
90 
91 }
92 
93 }
94 
95 #endif // _d7a272d7_9beb_43c1_a5a1_fce4c0245c80
std::ostream & operator<<(std::ostream &stream, HTTPRequest const &request)
Output an HTTP request to a stream.
RFC 5322 Message (i.e. headers with body).
Definition: Message.h:26
Definition: Association.h:24
std::map< std::string, std::string > Headers
Associative container for headers.
Definition: Message.h:30
#define ODIL_API
Definition: odil.h:28
std::istream & operator>>(std::istream &stream, HTTPRequest &request)
Input an HTTP request from a stream.