Crow  1.0
A C++ microframework for the web
crow::multipart::message Struct Reference

The parsed multipart request/response. More...

Inheritance diagram for crow::multipart::message:
Collaboration diagram for crow::multipart::message:

Public Member Functions

const std::string & get_header_value (const std::string &key) const
 
part get_part_by_name (const std::string &name)
 
std::string dump () const override
 Represent all parts as a string (does not include message headers) More...
 
std::string dump (int part_) const
 Represent an individual part as a string. More...
 
 message (const ci_map &headers, const std::string &boundary, const std::vector< part > &sections)
 Default constructor using default values. More...
 
 message (const request &req)
 Create a multipart message from a request data. More...
 

Public Attributes

ci_map headers
 The request/response headers. More...
 
std::string boundary
 The text boundary that separates different parts More...
 
std::vector< partparts
 The individual parts of the message. More...
 
mp_map part_map
 The individual parts of the message, organized in a map with the name header parameter being the key. More...
 
std::string content_type
 

Private Member Functions

std::string get_boundary (const std::string &header) const
 
void parse_body (std::string body, std::vector< part > &sections, mp_map &part_map)
 
part parse_section (std::string &section)
 
void parse_section_head (std::string &lines, part &part)
 
std::string trim (std::string &string, const char &excess='"') const
 
std::string pad (std::string &string, const char &padding='"') const
 

Detailed Description

The parsed multipart request/response.

Constructor & Destructor Documentation

◆ message() [1/2]

crow::multipart::message::message ( const ci_map headers,
const std::string &  boundary,
const std::vector< part > &  sections 
)
inline

Default constructor using default values.

Here is the call graph for this function:

◆ message() [2/2]

crow::multipart::message::message ( const request req)
inline

Create a multipart message from a request data.

Here is the call graph for this function:

Member Function Documentation

◆ get_header_value()

const std::string& crow::multipart::message::get_header_value ( const std::string &  key) const
inline
Here is the call graph for this function:

◆ get_part_by_name()

part crow::multipart::message::get_part_by_name ( const std::string &  name)
inline

◆ dump() [1/2]

std::string crow::multipart::message::dump ( ) const
inlineoverridevirtual

Represent all parts as a string (does not include message headers)

Implements crow::returnable.

Here is the call graph for this function:

◆ dump() [2/2]

std::string crow::multipart::message::dump ( int  part_) const
inline

Represent an individual part as a string.

Here is the call graph for this function:

◆ get_boundary()

std::string crow::multipart::message::get_boundary ( const std::string &  header) const
inlineprivate

◆ parse_body()

void crow::multipart::message::parse_body ( std::string  body,
std::vector< part > &  sections,
mp_map part_map 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_section()

part crow::multipart::message::parse_section ( std::string &  section)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ parse_section_head()

void crow::multipart::message::parse_section_head ( std::string &  lines,
part part 
)
inlineprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ trim()

std::string crow::multipart::message::trim ( std::string &  string,
const char &  excess = '"' 
) const
inlineprivate
Here is the caller graph for this function:

◆ pad()

std::string crow::multipart::message::pad ( std::string &  string,
const char &  padding = '"' 
) const
inlineprivate
Here is the caller graph for this function:

Member Data Documentation

◆ headers

ci_map crow::multipart::message::headers

The request/response headers.

◆ boundary

std::string crow::multipart::message::boundary

The text boundary that separates different parts

◆ parts

std::vector<part> crow::multipart::message::parts

The individual parts of the message.

◆ part_map

mp_map crow::multipart::message::part_map

The individual parts of the message, organized in a map with the name header parameter being the key.

◆ content_type

std::string crow::returnable::content_type
inherited

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