NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
载入中...
搜索中...
未找到
neforce::http::http_content结构体 参考

HTTP内容类型定义 更多...

#include <http_constants.hpp>

类 neforce::http::http_content 继承关系图:
[图例]

Public 成员函数

 http_content (http_content &&other) noexcept
 移动构造函数
http_content & operator= (http_content &&other) noexcept
 移动赋值运算符
 http_content (string content)
 字符串构造函数
http_content & operator= (const string &content)
 字符串赋值运算符
const stringcontent () const &noexcept
 获取左值内容
string content () &&noexcept
 获取右值内容
string to_string () const
 转换为字符串
http_content with_charset (string charset) const
 创建带 charset 的新 http_content
Public 成员函数 继承自 neforce::istringify< http_content >
constexpr string to_string () const
 转换为字符串

静态 Public 成员函数

static const http_content & HTML_TEXT ()
 text/html
static const http_content & XML_TEXT ()
 text/xml
static const http_content & CSS_TEXT ()
 text/css
static const http_content & PLAIN_TEXT ()
 text/plain
static const http_content & JSON_APP ()
 application/json
static const http_content & FORM_APP ()
 application/x-www-form-urlencoded
static const http_content & JPEG_IMG ()
 image/jpeg
static const http_content & PNG_IMG ()
 image/png
static const http_content & BMP_IMG ()
 image/bmp
static const http_content & WEBP_IMG ()
 image/webp
static const http_content & HTML_MSG ()
 message/html

详细描述

HTTP内容类型定义

定义了标准的HTTP Content-Type值,并提供类型判断方法。

在文件 http_constants.hpp493 行定义.

构造及析构函数说明

◆ http_content() [1/2]

neforce::http::http_content::http_content ( http_content && other)
inlinenoexcept

移动构造函数

参数
other源对象

在文件 http_constants.hpp506 行定义.

◆ http_content() [2/2]

neforce::http::http_content::http_content ( string content)
inlineexplicit

字符串构造函数

参数
content内容类型字符串

在文件 http_constants.hpp526 行定义.

引用了 content() , 以及 neforce::move().

成员函数说明

◆ content() [1/2]

string neforce::http::http_content::content ( ) &&
inlinenodiscardnoexcept

获取右值内容

返回
内容类型字符串

在文件 http_constants.hpp591 行定义.

引用了 neforce::move().

◆ content() [2/2]

const string & neforce::http::http_content::content ( ) const &
inlinenodiscardnoexcept

获取左值内容

返回
内容类型字符串

在文件 http_constants.hpp585 行定义.

被这些函数引用 http_content() , 以及 operator=().

◆ operator=() [1/2]

http_content & neforce::http::http_content::operator= ( const string & content)
inline

字符串赋值运算符

参数
content内容类型字符串
返回
自身引用

在文件 http_constants.hpp534 行定义.

引用了 content().

◆ operator=() [2/2]

http_content & neforce::http::http_content::operator= ( http_content && other)
inlinenoexcept

移动赋值运算符

参数
other源对象
返回
自身引用

在文件 http_constants.hpp514 行定义.

引用了 neforce::addressof() , 以及 neforce::move().

◆ to_string()

string neforce::http::http_content::to_string ( ) const
inlinenodiscard

转换为字符串

返回
内容类型字符串

在文件 http_constants.hpp597 行定义.

◆ with_charset()

http_content neforce::http::http_content::with_charset ( string charset) const
inlinenodiscard

创建带 charset 的新 http_content

参数
charset字符编码名称(如 "utf-8")
返回
附加了 "; charset=xxx" 后缀的新 http_content

在文件 http_constants.hpp604 行定义.

引用了 neforce::move().


该结构体的文档由以下文件生成: