MCPcopy Create free account
hub / github.com/acl-dev/acl / get_pipe

Method get_pipe

lib_acl_cpp/src/http/http_response.cpp:76–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76http_pipe* http_response::get_pipe(const char* to_charset)
77{
78 if (to_charset == NULL || *to_charset == 0) {
79 return NULL;
80 }
81
82 // ��Ҫ�����Ӧͷ�ַ�����Ϣ
83 const char* ptr = client_->header_value("Content-Type");
84 if (ptr == NULL || *ptr == 0) {
85 return NULL;
86 }
87
88#if !defined(ACL_MIME_DISABLE)
89
90 http_ctype ctype;
91 ctype.parse(ptr);
92
93 const char* from_charset = ctype.get_charset();
94
95 if (from_charset && strcasecmp(from_charset, to_charset) != 0) {
96 http_pipe* hp = NEW http_pipe();
97 hp->set_charset(from_charset, to_charset);
98 return hp;
99 } else {
100 return NULL;
101 }
102#else
103 return NULL;
104#endif // !defined(ACL_MIME_DISABLE)
105}
106
107bool http_response::get_body(xml& out, const char* to_charset /* = NULL */)
108{

Callers

nothing calls this directly

Calls 5

get_charsetMethod · 0.80
http_pipeClass · 0.50
header_valueMethod · 0.45
parseMethod · 0.45
set_charsetMethod · 0.45

Tested by

no test coverage detected