-
-
[原创]发些个人库之string_cc.cc
-
发表于:
2013-10-7 13:04
5762
-
主要用来格式化HTTP协议的,代码写的很烂,比不上string和CString,还望被批斗。
版权问题:Author: root的意思是Linux Root账户
用法:
bool setResponse::content_type(const char* str) {
const char* mime = http::matchMime::getInstance().find_ext_name_mime(str);
setResponse::str_.format("Content-Type: %s\r\n", mime);
return true;
}
bool setResponse::content_encode() {
setResponse::str_.append("Content-Encoding: deflate\r\n");
return true;
}
bool setResponse::content_length(size_t len) {
setResponse::str_.format("Content-Length: %ld\r\n", len);
return true;
}
void setResponse::cache_control() {
setResponse::str_.append("Cache-Control: no-cache\r\n");
}
bool setResponse::transfer_encoding() {
setResponse::str_.append("Transfer-Encoding: chunked\r\n");
return true;
}
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)