return strValue.substr(0, strValue.find(';'));
}
+std::string CHttpHeader::GetCharset(void) const
+{
+ std::string strValue(GetValueRaw("content-type"));
+ if (strValue.empty())
+ return strValue;
+
+ const size_t semicolonPos = strValue.find(';');
+ if (semicolonPos == std::string::npos)
+ return "";
+
+ StringUtils::ToUpper(strValue);
+ size_t posCharset;
+ if ((posCharset = strValue.find("; CHARSET=", semicolonPos)) != std::string::npos)
+ posCharset += 10;
+ else if ((posCharset = strValue.find(";CHARSET=", semicolonPos)) != std::string::npos)
+ posCharset += 9;
+ else
+ return "";
+
+ return strValue.substr(posCharset, strValue.find(';', posCharset) - posCharset);
+}
+
void CHttpHeader::Clear()
{
m_params.clear();
std::string GetHeader(void) const;
std::string GetMimeType(void) const;
+ std::string GetCharset(void) const;
std::string GetProtoLine() { return m_protoLine; }
inline bool IsHeaderDone(void) const