1 #ifndef __HTTP_MISC_HPP__ 2 #define __HTTP_MISC_HPP__ 23 void clear() { _firstVal.clear(); _options.clear(); }
68 Header( std::initializer_list< std::pair< winux::String, winux::Mixed > > list );
83 template <
typename _Ty > _Ty
getHeader(
winux::String const & name, _Ty
const & defval = _Ty() )
const {
return _headers.has(name) ? (_Ty)_headers[name] : defval; }
94 template <
typename _HeaderField >
97 if ( _headers.has(name) )
99 field->parse( *_headers[name]._pStr );
104 template <
typename _HeaderField >
108 f.parse( (*
this)[name] );
123 void delMultiHeader(
int index );
128 void setResponseLine(
winux::String const & responseLine,
bool setStatus =
true );
173 std::vector< std::pair< winux::String, winux::String > > _multiHeaders;
176 mutable int _curHeaderIndex;
177 mutable int _curMultiHeaderIndex;
178 mutable bool _isCompleteEnum;
188 bool empty()
const {
return _vStr.empty(); }
206 Cookie() : secure(false), httpOnly(false), wantSet(false) { }
214 bool httpOnly =
false 235 std::map< winux::String, http::Cookie > _cookies;
249 bool httpOnly = false
271 bool has(
winux::String const & name )
const {
return _cookies.find(name) != _cookies.end(); }
303 template <
typename _Ty >
306 return this->has(name) ? (_Ty)_vars[name] : defval;
315 #endif // __HTTP_MISC_HPP__ XString< char > AnsiString
用来使得String能够用operator<<来赋值
std::ostream & operator<<(std::ostream &o, Cookie const &cookie)
std::map< String, String > StringStringMap
bool isset(_MAP const &m, _KEY const &k)
检测map中是否有该键的值
bool has(winux::String const &name) const
检测是否有该cookie
AnsiString StrLower(AnsiString str)
使字符串小写
XStringArray< tchar > StringArray