CppCMS
|
Class that represents parsed Content-Type header, this is immutable class. Once it is created its values does not change. More...
#include <cppcms/http_content_type.h>
Public Member Functions | |
std::string | type () const |
std::string | subtype () const |
std::string | media_type () const |
std::string | charset () const |
std::map< std::string, std::string > | parameters () const |
std::string | parameter_by_key (std::string const &key) const |
bool | parameter_is_set (std::string const &key) const |
bool | is_form_urlencoded () const |
bool | is_multipart_form_data () const |
content_type (std::string const &ct) | |
content_type (char const *ct) | |
content_type (char const *begin, char const *end) | |
content_type () | |
content_type (content_type const &) | |
content_type const & | operator= (content_type const &) |
~content_type () | |
Class that represents parsed Content-Type header, this is immutable class. Once it is created its values does not change.
cppcms::http::content_type::content_type | ( | std::string const & | ct | ) |
Parse content type ct and create the class
cppcms::http::content_type::content_type | ( | char const * | ct | ) |
Parse content type ct and create the class
cppcms::http::content_type::content_type | ( | char const * | begin, |
char const * | end | ||
) |
Parse content type in range [begin,end) and create the class
cppcms::http::content_type::content_type | ( | ) |
Empty one...
cppcms::http::content_type::content_type | ( | content_type const & | ) |
Copy constructor
cppcms::http::content_type::~content_type | ( | ) |
Destructor
std::string cppcms::http::content_type::charset | ( | ) | const |
Charset parameter, if given, for example, for "text/html; charset=UTF-8" it would be "UTF-8". If charset is not specified, it would return an empty string
bool cppcms::http::content_type::is_form_urlencoded | ( | ) | const |
Check if media type application/x-www-form-urlencoded content_type
bool cppcms::http::content_type::is_multipart_form_data | ( | ) | const |
Check if media type is multipart/form-data content_type
std::string cppcms::http::content_type::media_type | ( | ) | const |
The full media type of content type, for example, for "text/html; charset=UTF-8" it would be "text/html" in lower case
content_type const& cppcms::http::content_type::operator= | ( | content_type const & | ) |
Assignment operator
std::string cppcms::http::content_type::parameter_by_key | ( | std::string const & | key | ) | const |
Get parameter's value by key (should be in lowercase), returns empty string if not set
bool cppcms::http::content_type::parameter_is_set | ( | std::string const & | key | ) | const |
Check if the parameter is set using key (should be in lowercase)
std::map<std::string,std::string> cppcms::http::content_type::parameters | ( | ) | const |
All parameters, all parameter keys are in lower case, the values are given as is.
std::string cppcms::http::content_type::subtype | ( | ) | const |
The subtype part of content type, for example, for "text/html; charset=UTF-8" it would be "html" in lower case
std::string cppcms::http::content_type::type | ( | ) | const |
The type part of content type, for example, for "text/html; charset=UTF-8" it would be "text" in lower case