Odil
A C++11 library for the DICOM standard
Toggle main menu visibility
Loading...
Searching...
No Matches
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
26
class
ODIL_API
Message
27
{
28
public
:
30
typedef
std::map<std::string, std::string>
Headers
;
31
37
Message
(
Headers
const
& headers={}, std::string
const
& body=
""
);
38
39
Message
(
Message
const
&) =
default
;
40
Message
(
Message
&&) =
default
;
41
Message
&
operator=
(
Message
const
&) =
default
;
42
Message
&
operator=
(
Message
&&) =
default
;
43
virtual
~Message
() =
default
;
44
46
Headers
const
&
get_headers
()
const
;
47
49
void
set_headers
(
Headers
const
& headers);
50
57
bool
has_header
(std::string
const
& name)
const
;
58
66
std::string
const
&
get_header
(std::string
const
& name)
const
;
67
69
void
set_header
(std::string
const
& name, std::string
const
& value);
70
72
std::string
const
&
get_body
()
const
;
73
75
void
set_body
(std::string
const
& body);
76
77
private
:
78
Headers
_headers;
79
std::string _body;
80
81
Headers::const_iterator _find_header(std::string
const
& name)
const
;
82
};
83
85
ODIL_API
86
std::istream &
87
operator>>
(std::istream & stream,
Message
&
message
);
88
90
ODIL_API
91
std::ostream &
92
operator<<
(std::ostream & stream,
Message
const
&
message
);
93
94
}
95
96
}
97
98
#endif
// _d7a272d7_9beb_43c1_a5a1_fce4c0245c80
odil::webservices::Message
RFC 5322 Message (i.e. headers with body).
Definition
Message.h:27
odil::webservices::Message::~Message
virtual ~Message()=default
odil::webservices::Message::set_body
void set_body(std::string const &body)
Set the body.
odil::webservices::Message::Message
Message(Message &&)=default
odil::webservices::Message::Message
Message(Headers const &headers={}, std::string const &body="")
Constructor.
odil::webservices::Message::operator=
Message & operator=(Message const &)=default
odil::webservices::Message::set_headers
void set_headers(Headers const &headers)
Set the headers.
odil::webservices::Message::has_header
bool has_header(std::string const &name) const
Test whether the given header exists.
odil::webservices::Message::get_body
std::string const & get_body() const
Return the body.
odil::webservices::Message::operator=
Message & operator=(Message &&)=default
odil::webservices::Message::Headers
std::map< std::string, std::string > Headers
Associative container for headers.
Definition
Message.h:30
odil::webservices::Message::get_header
std::string const & get_header(std::string const &name) const
Return a header value or throw an exception if the required header is missing.
odil::webservices::Message::set_header
void set_header(std::string const &name, std::string const &value)
Set a header value.
odil::webservices::Message::Message
Message(Message const &)=default
odil::webservices::Message::get_headers
Headers const & get_headers() const
Return the headers.
odil::message
Definition
Cancellation.h:21
odil::webservices
Definition
BulkData.h:20
odil::webservices::operator>>
std::istream & operator>>(std::istream &stream, HTTPRequest &request)
Input an HTTP request from a stream.
odil::webservices::operator<<
std::ostream & operator<<(std::ostream &stream, HTTPRequest const &request)
Output an HTTP request to a stream.
odil
Definition
Association.h:25
odil.h
ODIL_API
#define ODIL_API
Definition
odil.h:28
src
odil
webservices
Message.h
Generated by
1.17.0