Odil
A C++11 library for the DICOM standard
multipart_related.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 _9d8fe506_1ea6_448c_8c6c_bcd7375e89de
10 #define _9d8fe506_1ea6_448c_8c6c_bcd7375e89de
11 
12 #include <ostream>
13 #include <string>
14 
16 
17 namespace odil
18 {
19 
20 namespace webservices
21 {
22 
24 ODIL_API bool is_multipart_related(Message const & message);
25 
30 ODIL_API std::size_t count_parts(Message const & message);
31 
33 ODIL_API std::string random_boundary();
34 
36 template<typename Iterator, typename UnaryFunctor>
38  Message const & message, Iterator destination, UnaryFunctor functor);
39 
40 
42 template<typename UnaryFunctor>
43 void for_each_part(Message const & message, UnaryFunctor functor);
44 
50 template<typename Iterator, typename UnaryFunction>
51 std::ostream & accumulate_parts(
52  Iterator begin, Iterator end, UnaryFunction serialize, std::ostream & stream,
53  std::string const & boundary);
54 
55 }
56 
57 }
58 
59 #include "multipart_related.txx"
60 
61 #endif // _9d8fe506_1ea6_448c_8c6c_bcd7375e89de
odil::webservices::accumulate_parts
std::ostream & accumulate_parts(Iterator begin, Iterator end, UnaryFunction serialize, std::ostream &stream, std::string const &boundary)
Serialize the (begin, end) sequence as a multipart/related message body in stream as described in the...
odil::webservices::for_each_part
void for_each_part(Message const &message, UnaryFunctor functor)
Use to call a functor for each part of a multipart/related message.
odil
Definition: Association.h:25
odil::webservices::count_parts
std::size_t count_parts(Message const &message)
Return the number of parts in the message, 0 if the message is not multipart/related.
ODIL_API
#define ODIL_API
Definition: odil.h:28
odil::webservices::random_boundary
std::string random_boundary()
Return a random multipart/related boundary.
odil::webservices::is_multipart_related
bool is_multipart_related(Message const &message)
Test whether the message is multipart/related.
Message.h
odil::webservices::Message
RFC 5322 Message (i.e. headers with body).
Definition: Message.h:27
odil::webservices::transform_parts
void transform_parts(Message const &message, Iterator destination, UnaryFunctor functor)
Transform each part of a multipart/related message.