added support for UTF-8
now the UTF-8 is a default charset git-svn-id: svn://ttmath.org/publicrep/winix/trunk@677 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -38,9 +38,9 @@ void Request::ClearPostFileTmp()
|
||||
|
||||
while( !post_file_tab.empty() )
|
||||
{
|
||||
const std::string & tmp_filename = post_file_tab.begin()->second.tmp_filename;
|
||||
const std::wstring & tmp_filename = post_file_tab.begin()->second.tmp_filename;
|
||||
|
||||
if( unlink(tmp_filename.c_str()) == 0 )
|
||||
if( RemoveFile(tmp_filename) )
|
||||
log << log3 << "Request: deleted tmp file: " << tmp_filename << logend;
|
||||
|
||||
post_file_tab.erase(post_file_tab.begin());
|
||||
@@ -66,9 +66,9 @@ void Request::Clear()
|
||||
method = none;
|
||||
role = responder;
|
||||
|
||||
headers.str("");
|
||||
page.str("");
|
||||
debug.str("");
|
||||
headers.Clear();
|
||||
page.Clear();
|
||||
debug.Clear();
|
||||
|
||||
env_request_method = &char_empty;
|
||||
env_request_uri = &char_empty;
|
||||
@@ -133,7 +133,7 @@ void Request::SetCookie(const char * name, long value, tm * expires)
|
||||
|
||||
|
||||
|
||||
bool Request::IsPostVar(const char * var)
|
||||
bool Request::IsPostVar(const wchar_t * var)
|
||||
{
|
||||
PostTab::iterator p;
|
||||
|
||||
@@ -147,7 +147,7 @@ return true;
|
||||
|
||||
|
||||
|
||||
const std::string & Request::PostVar(const char * var)
|
||||
const std::wstring & Request::PostVar(const wchar_t * var)
|
||||
{
|
||||
PostTab::iterator p = post_tab.find(var);
|
||||
|
||||
@@ -159,7 +159,7 @@ return p->second;
|
||||
|
||||
|
||||
|
||||
bool Request::PostVar(const char * var, std::string & result)
|
||||
bool Request::PostVar(const wchar_t * var, std::wstring & result)
|
||||
{
|
||||
PostTab::iterator p = post_tab.find(var);
|
||||
|
||||
@@ -175,7 +175,7 @@ return true;
|
||||
}
|
||||
|
||||
|
||||
std::string * Request::PostVarp(const char * var)
|
||||
std::wstring * Request::PostVarp(const wchar_t * var)
|
||||
{
|
||||
PostTab::iterator p = post_tab.find(var);
|
||||
|
||||
@@ -194,7 +194,7 @@ void Request::PrintGetTab()
|
||||
for(GetTab::iterator i = get_tab.begin() ; i != get_tab.end() ; ++i)
|
||||
debug << " \"" << *i << "\"\n";
|
||||
|
||||
debug << std::endl;
|
||||
debug << '\n';
|
||||
}
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ char ** e;
|
||||
for( e = env ; *e ; ++e )
|
||||
debug << ' ' << *e << "\n";
|
||||
|
||||
debug << std::endl;
|
||||
debug << '\n';
|
||||
}
|
||||
|
||||
|
||||
@@ -225,14 +225,12 @@ return true;
|
||||
|
||||
|
||||
|
||||
bool Request::IsParam(const char * param_name)
|
||||
bool Request::IsParam(const wchar_t * param_name)
|
||||
{
|
||||
ParamTab::iterator i;
|
||||
|
||||
|
||||
for(i=param_tab.begin() ; i!=param_tab.end() ; ++i)
|
||||
{
|
||||
// !! make sure that exists std::string::operator==(const char*)
|
||||
// (optimization)
|
||||
if( i->name == param_name )
|
||||
return true;
|
||||
}
|
||||
@@ -241,16 +239,28 @@ return false;
|
||||
}
|
||||
|
||||
|
||||
const std::string & Request::ParamValue(const char * param_name)
|
||||
bool Request::IsParam(const std::wstring & param_name)
|
||||
{
|
||||
ParamTab::iterator i;
|
||||
|
||||
for(i=param_tab.begin() ; i!=param_tab.end() ; ++i)
|
||||
{
|
||||
if( i->name == param_name )
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
const std::wstring & Request::ParamValue(const wchar_t * param_name)
|
||||
{
|
||||
ParamTab::iterator i;
|
||||
|
||||
for(i=param_tab.begin() ; i!=param_tab.end() ; ++i)
|
||||
{
|
||||
if( i->name == param_name )
|
||||
{
|
||||
return i->value;
|
||||
}
|
||||
}
|
||||
|
||||
return str_empty;
|
||||
|
Reference in New Issue
Block a user