Odil
A C++11 library for the DICOM standard
Public Types | Public Member Functions | List of all members
odil::webservices::Message Class Reference

RFC 5322 Message (i.e. headers with body). More...

#include <Message.h>

Inheritance diagram for odil::webservices::Message:
Inheritance graph
[legend]

Public Types

typedef std::map< std::string, std::string > Headers
 Associative container for headers. More...
 

Public Member Functions

 Message (Headers const &headers={}, std::string const &body="")
 Constructor. More...
 
 Message (Message const &)=default
 
 Message (Message &&)=default
 
Messageoperator= (Message const &)=default
 
Messageoperator= (Message &&)=default
 
virtual ~Message ()=default
 
Headers const & get_headers () const
 Return the headers. More...
 
void set_headers (Headers const &headers)
 Set the headers. More...
 
bool has_header (std::string const &name) const
 Test whether the given header exists. More...
 
std::string const & get_header (std::string const &name) const
 Return a header value or throw an exception if the required header is missing. More...
 
void set_header (std::string const &name, std::string const &value)
 Set a header value. More...
 
std::string const & get_body () const
 Return the body. More...
 
void set_body (std::string const &body)
 Set the body. More...
 

Detailed Description

RFC 5322 Message (i.e. headers with body).

Member Typedef Documentation

◆ Headers

typedef std::map<std::string, std::string> odil::webservices::Message::Headers

Associative container for headers.

Constructor & Destructor Documentation

◆ Message() [1/3]

odil::webservices::Message::Message ( Headers const &  headers = {},
std::string const &  body = "" 
)

Constructor.

By default, headers and body will be empty.

◆ Message() [2/3]

odil::webservices::Message::Message ( Message const &  )
default

◆ Message() [3/3]

odil::webservices::Message::Message ( Message &&  )
default

◆ ~Message()

virtual odil::webservices::Message::~Message ( )
virtualdefault

Member Function Documentation

◆ get_body()

std::string const & odil::webservices::Message::get_body ( ) const

Return the body.

◆ get_header()

std::string const & odil::webservices::Message::get_header ( std::string const &  name) const

Return a header value or throw an exception if the required header is missing.

According to RFC 5322 1.2.2 and RFC 5234 2.3, the name is case-insensitive.

◆ get_headers()

Headers const & odil::webservices::Message::get_headers ( ) const

Return the headers.

◆ has_header()

bool odil::webservices::Message::has_header ( std::string const &  name) const

Test whether the given header exists.

According to RFC 5322 1.2.2 and RFC 5234 2.3, the name is case-insensitive.

◆ operator=() [1/2]

Message & odil::webservices::Message::operator= ( Message &&  )
default

◆ operator=() [2/2]

Message & odil::webservices::Message::operator= ( Message const &  )
default

◆ set_body()

void odil::webservices::Message::set_body ( std::string const &  body)

Set the body.

◆ set_header()

void odil::webservices::Message::set_header ( std::string const &  name,
std::string const &  value 
)

Set a header value.

◆ set_headers()

void odil::webservices::Message::set_headers ( Headers const &  headers)

Set the headers.


The documentation for this class was generated from the following file: