|
PACS System 0.1.0
PACS DICOM system library
|
Builder for multipart MIME responses. More...
#include <dicomweb_endpoints.h>

Classes | |
| struct | part |
Public Member Functions | |
| multipart_builder (std::string_view content_type=media_type::dicom) | |
| Construct a multipart builder. | |
| void | add_part (std::vector< uint8_t > data, std::optional< std::string_view > content_type=std::nullopt) |
| Add a part to the multipart response. | |
| void | add_part_with_location (std::vector< uint8_t > data, std::string_view location, std::optional< std::string_view > content_type=std::nullopt) |
| Add a part with location header. | |
| auto | build () const -> std::string |
| Build the complete multipart response body. | |
| auto | content_type_header () const -> std::string |
| Get the Content-Type header value for this multipart response. | |
| auto | boundary () const -> std::string_view |
| Get the boundary string. | |
| auto | empty () const noexcept -> bool |
| Check if any parts have been added. | |
| auto | size () const noexcept -> size_t |
| Get the number of parts. | |
Static Private Member Functions | |
| static auto | generate_boundary () -> std::string |
| Generate a unique boundary string. | |
Private Attributes | |
| std::string | boundary_ |
| std::string | default_content_type_ |
| std::vector< part > | parts_ |
Builder for multipart MIME responses.
Generates multipart/related responses as required by WADO-RS for returning multiple DICOM objects.
Definition at line 98 of file dicomweb_endpoints.h.
|
explicit |
Construct a multipart builder.
| content_type | The content type for parts (default: application/dicom) |
Definition at line 206 of file dicomweb_endpoints.cpp.
| void kcenon::pacs::web::dicomweb::multipart_builder::add_part | ( | std::vector< uint8_t > | data, |
| std::optional< std::string_view > | content_type = std::nullopt ) |
Add a part to the multipart response.
| data | The binary data for this part |
| content_type | Optional override content type for this part |
Definition at line 210 of file dicomweb_endpoints.cpp.
References kcenon::pacs::web::dicomweb::multipart_builder::part::content_type, kcenon::pacs::web::dicomweb::multipart_builder::part::data, default_content_type_, and parts_.
| void kcenon::pacs::web::dicomweb::multipart_builder::add_part_with_location | ( | std::vector< uint8_t > | data, |
| std::string_view | location, | ||
| std::optional< std::string_view > | content_type = std::nullopt ) |
Add a part with location header.
| data | The binary data for this part |
| location | The Content-Location header value |
| content_type | Optional override content type for this part |
Definition at line 221 of file dicomweb_endpoints.cpp.
References kcenon::pacs::web::dicomweb::multipart_builder::part::content_type, kcenon::pacs::web::dicomweb::multipart_builder::part::data, default_content_type_, kcenon::pacs::web::dicomweb::multipart_builder::part::location, and parts_.
Referenced by kcenon::pacs::web::endpoints::register_dicomweb_endpoints_impl().

|
nodiscard |
Get the boundary string.
Definition at line 263 of file dicomweb_endpoints.cpp.
References boundary_.
|
nodiscard |
Build the complete multipart response body.
Definition at line 234 of file dicomweb_endpoints.cpp.
References boundary_, and parts_.
Referenced by kcenon::pacs::web::endpoints::register_dicomweb_endpoints_impl().

|
nodiscard |
Get the Content-Type header value for this multipart response.
Definition at line 256 of file dicomweb_endpoints.cpp.
References boundary_, and default_content_type_.
Referenced by kcenon::pacs::web::endpoints::register_dicomweb_endpoints_impl().

|
nodiscardnoexcept |
Check if any parts have been added.
Definition at line 267 of file dicomweb_endpoints.cpp.
References parts_.
Referenced by kcenon::pacs::web::endpoints::register_dicomweb_endpoints_impl().

|
staticnodiscardprivate |
Generate a unique boundary string.
Definition at line 275 of file dicomweb_endpoints.cpp.
|
nodiscardnoexcept |
Get the number of parts.
Definition at line 271 of file dicomweb_endpoints.cpp.
References parts_.
Referenced by kcenon::pacs::web::endpoints::register_dicomweb_endpoints_impl().

|
private |
Definition at line 163 of file dicomweb_endpoints.h.
Referenced by boundary(), build(), and content_type_header().
|
private |
Definition at line 164 of file dicomweb_endpoints.h.
Referenced by add_part(), add_part_with_location(), and content_type_header().
|
private |
Definition at line 165 of file dicomweb_endpoints.h.
Referenced by add_part(), add_part_with_location(), build(), empty(), and size().