namespace PT renamed to pt

master
Tomasz Sowa 2 years ago
parent d66a36cf21
commit e48a28a5c8

@ -815,7 +815,7 @@ void App::Make()
if( cur.session->ip_ban && cur.session->ip_ban->IsIPBanned() )
{
PT::Date date(cur.session->ip_ban->expires);
pt::Date date(cur.session->ip_ban->expires);
// IMPROVE ME there is no slog now
//slog << logerror << T("this_ip_is_banned_until") << ' ' << date << " UTC" << logend;
@ -878,7 +878,7 @@ void App::LogEnvironmentHTTPVariables()
{
if( cur.request->headers_in.is_object() )
{
PT::Space::ObjectType::iterator i = cur.request->headers_in.value.value_object.begin();
pt::Space::ObjectType::iterator i = cur.request->headers_in.value.value_object.begin();
for( ; i != cur.request->headers_in.value.value_object.end() ; ++i)
{
@ -934,7 +934,7 @@ void App::SetEnv(const char * name, std::wstring & env)
if( v )
{
PT::UTF8ToWide(v, env);
pt::UTF8ToWide(v, env);
}
}
@ -967,12 +967,12 @@ void App::ReadEnvHTTPVariables()
{
char * env = *e;
if( PT::is_substr_nc("HTTP_", env) )
if( pt::is_substr_nc("HTTP_", env) )
{
env += http_prefix_len;
// cookies we have in a different table
if( !PT::is_substr_nc("COOKIE=", env) )
if( !pt::is_substr_nc("COOKIE=", env) )
{
if( SaveEnvHTTPVariable(env) )
{
@ -1002,7 +1002,7 @@ bool App::SaveEnvHTTPVariable(const char * env)
for( ; env[i] != 0 && env[i] != '=' && i < Request::INPUT_HEADER_NAME_MAX_LENGTH ; ++i)
{
header_name[i] = PT::to_lower(env[i]);
header_name[i] = pt::to_lower(env[i]);
}
header_name[i] = 0;
@ -1031,8 +1031,8 @@ bool App::SaveEnvHTTPVariable(const char * env)
return false;
}
PT::UTF8ToWide(header_name, http_header_name);
PT::UTF8ToWide(header_value, http_header_value);
pt::UTF8ToWide(header_name, http_header_name);
pt::UTF8ToWide(header_value, http_header_value);
cur.request->headers_in.add(http_header_name, http_header_value);
http_header_name.clear();
@ -1050,9 +1050,9 @@ void App::ReadEnvRemoteIP()
{
http_header_name = L"HTTP_";
http_header_name += config.proxy_ip_header;
PT::to_upper_emplace(http_header_name);
pt::to_upper_emplace(http_header_name);
PT::WideToUTF8(http_header_name, http_header_8bit);
pt::WideToUTF8(http_header_name, http_header_8bit);
v = FCGX_GetParam(http_header_8bit.c_str(), fcgi_request.envp);
}
else
@ -1063,7 +1063,7 @@ void App::ReadEnvRemoteIP()
if( v )
{
cur.request->ip = (int)inet_addr(v);
PT::UTF8ToWide(v, cur.request->ip_str);
pt::UTF8ToWide(v, cur.request->ip_str);
}
}
@ -1076,16 +1076,16 @@ void App::CheckRequestMethod()
if( !cur.request->env_request_method.empty() )
{
if( PT::to_lower(cur.request->env_request_method[0]) == 'g' )
if( pt::to_lower(cur.request->env_request_method[0]) == 'g' )
cur.request->method = Request::get;
else
if( PT::to_lower(cur.request->env_request_method[0]) == 'p' )
if( pt::to_lower(cur.request->env_request_method[0]) == 'p' )
cur.request->method = Request::post;
else
if( PT::to_lower(cur.request->env_request_method[0]) == 'h' )
if( pt::to_lower(cur.request->env_request_method[0]) == 'h' )
cur.request->method = Request::head;
else
if( PT::to_lower(cur.request->env_request_method[0]) == 'd' )
if( pt::to_lower(cur.request->env_request_method[0]) == 'd' )
cur.request->method = Request::delete_;
}
}
@ -1101,7 +1101,7 @@ void App::CheckSSL()
if( config.assume_connection_is_through_ssl )
cur.request->using_ssl = true;
else
if( PT::is_equal_nc(cur.request->env_https.c_str(), L"on") )
if( pt::is_equal_nc(cur.request->env_https.c_str(), L"on") )
cur.request->using_ssl = true;
}
@ -1145,7 +1145,7 @@ void App::ReadPostJson()
do
{
// IMPROVE ME
// we can read to PT::TextBuffer and make a PT::JSONToSpaceParser::Parse(PT::TextBuffer &) method
// we can read to pt::TextBuffer and make a pt::JSONToSpaceParser::Parse(pt::TextBuffer &) method
read_len = FCGX_GetStr(buffer, buffer_len, fcgi_request.in);
if( read_len > 0 )
@ -1155,14 +1155,14 @@ void App::ReadPostJson()
if( !post_buffer.empty() )
{
PT::SpaceParser::Status status = space_parser.ParseJSON(post_buffer.c_str());
pt::SpaceParser::Status status = space_parser.ParseJSON(post_buffer.c_str());
post_buffer.clear();
if( status != PT::SpaceParser::ok )
if( status != pt::SpaceParser::ok )
{
log << log1 << "App: cannot parse the input stream as an JSON object";
if( status == PT::SpaceParser::syntax_error )
if( status == pt::SpaceParser::syntax_error )
log << ", syntax error in line: " << space_parser.get_last_parsed_line() << logend;
cur.request->post_in.clear();
@ -1184,13 +1184,13 @@ void App::ReadPostVars()
if( cur.request->method == Request::post || cur.request->method == Request::delete_ )
{
if( PT::is_substr_nc(L"multipart/form-data", cur.request->env_content_type.c_str()) )
if( pt::is_substr_nc(L"multipart/form-data", cur.request->env_content_type.c_str()) )
{
log << log3 << "App: post content type: multipart/form-data" << logend;
post_multi_parser.Parse(fcgi_request.in, cur.request->post_tab, cur.request->post_file_tab);
}
else
if( PT::is_substr_nc(L"application/json", cur.request->env_content_type.c_str()) )
if( pt::is_substr_nc(L"application/json", cur.request->env_content_type.c_str()) )
{
log << log3 << "App: post content type: application/json" << logend;
ReadPostJson();
@ -1246,7 +1246,7 @@ void App::PrepareSessionCookie()
}
else
{
PT::Date expires = cur.request->start_time + config.session_remember_max_idle;
pt::Date expires = cur.request->start_time + config.session_remember_max_idle;
cur.request->AddCookie(config.http_session_id_name, cookie_id_string, expires);
}
}
@ -1277,7 +1277,7 @@ return false;
}
bool App::AddHeader(const wchar_t * name, const PT::WTextStream & value)
bool App::AddHeader(const wchar_t * name, const pt::WTextStream & value)
{
if( !cur.request->out_headers.has_key(name) )
{
@ -1289,7 +1289,7 @@ return false;
}
bool App::AddHeader(const std::wstring & name, const PT::WTextStream & value)
bool App::AddHeader(const std::wstring & name, const pt::WTextStream & value)
{
if( !cur.request->out_headers.has_key(name) )
{
@ -1301,7 +1301,7 @@ return false;
}
bool App::PrepareHeadersStaticCreateResource(PT::WTextStream & out_path)
bool App::PrepareHeadersStaticCreateResource(pt::WTextStream & out_path)
{
size_t i = 0;
Item * dir = system.dirs.GetDir(system.mounts.pmount->dir_id);
@ -1348,7 +1348,7 @@ void App::PrepareHeadersStatic()
return;
}
PT::WTextStream path;
pt::WTextStream path;
path << config.static_dirs[index] << L"/";
if( !PrepareHeadersStaticCreateResource(path) )
@ -1470,7 +1470,7 @@ void App::PrepareHeadersNormal(Header header, size_t output_size)
if( output_size != static_cast<size_t>(-1) )
{
PT::WTextStream buf;
pt::WTextStream buf;
buf << output_size;
AddHeader(L"Content-Length", buf);
}
@ -1483,8 +1483,8 @@ void App::PrepareHeadersNormal(Header header, size_t output_size)
// and if compression is enabled the client's browser will not be able to decompress the stream
void App::SendHeaders()
{
PT::Space::ObjectType::iterator i;
PT::Space & headers = cur.request->out_headers;
pt::Space::ObjectType::iterator i;
pt::Space & headers = cur.request->out_headers;
if( headers.is_object() )
{
@ -1494,8 +1494,8 @@ void App::SendHeaders()
{
if( i->second->is_wstr() )
{
PT::WideToUTF8(i->first, aheader_name);
PT::WideToUTF8(*i->second->get_wstr(), aheader_value);
pt::WideToUTF8(i->first, aheader_name);
pt::WideToUTF8(*i->second->get_wstr(), aheader_value);
FCGX_PutS(aheader_name.c_str(), fcgi_request.out);
FCGX_PutS(": ", fcgi_request.out);
@ -1517,8 +1517,8 @@ void App::SendHeaders()
void App::SendCookies()
{
PT::Space::ObjectType::iterator i;
PT::Space & cookies = cur.request->out_cookies;
pt::Space::ObjectType::iterator i;
pt::Space & cookies = cur.request->out_cookies;
if( cookies.is_object() )
{
@ -1528,8 +1528,8 @@ void App::SendCookies()
{
if( i->second->is_wstr() )
{
PT::WideToUTF8(i->first, aheader_name);
PT::WideToUTF8(*i->second->get_wstr(), aheader_value);
pt::WideToUTF8(i->first, aheader_name);
pt::WideToUTF8(*i->second->get_wstr(), aheader_value);
FCGX_PutS("Set-Cookie: ", fcgi_request.out);
FCGX_PutS(aheader_name.c_str(), fcgi_request.out);
@ -1582,7 +1582,7 @@ void App::PrepareHeaders(bool compressing, int compress_encoding, Header header,
void App::PrepareStandardJSONFields()
{
PT::Space & info = cur.request->info;
pt::Space & info = cur.request->info;
if( !info.has_key(L"status") )
{
@ -1788,7 +1788,7 @@ size_t output_size = 0;
SelectCompression(source->length(), compressing, compress_encoding);
PT::WideToUTF8(*source, output_8bit);
pt::WideToUTF8(*source, output_8bit);
// !! IMPROVE ME add to log the binary stream as well
if( config.log_server_answer )
@ -2270,7 +2270,7 @@ int sig;
app->synchro.was_stop_signal = true;
FCGX_ShutdownPending();
PT::WideToUTF8(app->config.fcgi_socket, app->socket_to_send_on_exit);
pt::WideToUTF8(app->config.fcgi_socket, app->socket_to_send_on_exit);
app->Unlock();
app->SendEmptyFastCGIPacket();

@ -143,7 +143,7 @@ private:
PostParser post_parser;
PostMultiParser post_multi_parser;
PT::SpaceParser space_parser;
pt::SpaceParser space_parser;
std::string post_buffer;
CookieParser cookie_parser;
@ -181,7 +181,7 @@ private:
//////////////////////////
// log_buffer for the main thread
PT::WTextStream log_buffer;
pt::WTextStream log_buffer;
// logger only for App object
Log log;
@ -238,9 +238,9 @@ private:
void SendCookies();
bool AddHeader(const wchar_t * name, const wchar_t * value);
bool AddHeader(const std::wstring & name, const std::wstring & value);
bool AddHeader(const wchar_t * name, const PT::WTextStream & value);
bool AddHeader(const std::wstring & name, const PT::WTextStream & value);
bool PrepareHeadersStaticCreateResource(PT::WTextStream & out_path);
bool AddHeader(const wchar_t * name, const pt::WTextStream & value);
bool AddHeader(const std::wstring & name, const pt::WTextStream & value);
bool PrepareHeadersStaticCreateResource(pt::WTextStream & out_path);
void PrepareHeadersStatic();
void PrepareHeaderContentType();
void PrepareHeadersForbidden();

@ -54,13 +54,13 @@ BaseThread::~BaseThread()
}
void BaseThread::set_main_log_buffer(PT::WTextStream * log_buffer)
void BaseThread::set_main_log_buffer(pt::WTextStream * log_buffer)
{
main_log.SetLogBuffer(log_buffer);
}
void BaseThread::set_main_file_log(PT::FileLog * file_log)
void BaseThread::set_main_file_log(pt::FileLog * file_log)
{
main_log.SetFileLog(file_log);
}

@ -54,8 +54,8 @@ public:
BaseThread();
virtual ~BaseThread();
void set_main_log_buffer(PT::WTextStream * log_buffer);
void set_main_file_log(PT::FileLog * file_log);
void set_main_log_buffer(pt::WTextStream * log_buffer);
void set_main_file_log(pt::FileLog * file_log);
// work mode

@ -55,7 +55,7 @@ void Config::SetFileLog(FileLog * file_log)
}
void Config::SetLogBuffer(PT::WTextStream * log_buffer)
void Config::SetLogBuffer(pt::WTextStream * log_buffer)
{
log.SetLogBuffer(log_buffer);
}
@ -66,22 +66,22 @@ void Config::ShowError()
switch( parser.status )
{
case PT::SpaceParser::no_space:
case pt::SpaceParser::no_space:
log << log2 << "Config: space not set" << logend;
break;
case PT::SpaceParser::ok:
case pt::SpaceParser::ok:
log << log2 << "Config: syntax ok" << logend;
break;
case PT::SpaceParser::cant_open_file:
case pt::SpaceParser::cant_open_file:
if( errors_to_stdout )
std::wcout << L"Config: I cannot open a config file: " << config_file << std::endl;
log << log1 << "Config: cant open a config file: " << config_file << logend;
break;
case PT::SpaceParser::syntax_error:
case pt::SpaceParser::syntax_error:
if( errors_to_stdout )
std::wcout << "Config: syntax error, line: " << parser.get_last_parsed_line() << std::endl;
@ -108,9 +108,9 @@ bool Config::ReadConfig(bool errors_to_stdout_, bool stdout_is_closed)
log << log2 << "Config: reading a config file" << logend;
parser.SetSpace(space);
PT::SpaceParser::Status status = parser.ParseSpaceFile(config_file);
pt::SpaceParser::Status status = parser.ParseSpaceFile(config_file);
if( status == PT::SpaceParser::ok )
if( status == pt::SpaceParser::ok )
{
AssignValues(stdout_is_closed);
SetAdditionalVariables();

@ -817,16 +817,16 @@ public:
//void Print(std::wostream & out);
// raw access to the config
PT::Space space;
pt::Space space;
void SetFileLog(FileLog * file_log);
void SetLogBuffer(PT::WTextStream * log_buffer);
void SetLogBuffer(pt::WTextStream * log_buffer);
private:
PT::SpaceParser parser;
pt::SpaceParser parser;
bool errors_to_stdout;
Log log;

@ -78,7 +78,7 @@ bool Crypt::HashBin(int hash, const char * in, size_t inlen, std::string & out)
run.Clear();
run.set_dependency(this);
PT::WideToUTF8(config->opensll_path, command);
pt::WideToUTF8(config->opensll_path, command);
run.Cmd(command);
run.Par("dgst");
run.Par("-binary");
@ -119,7 +119,7 @@ bool Crypt::HashBin(int hash, const std::string & in, std::string & out)
bool Crypt::HashBin(int hash, const wchar_t * in, size_t inlen, std::string & out)
{
PT::WideToUTF8(in, inlen, bufina);
pt::WideToUTF8(in, inlen, bufina);
int res = HashBin(hash, bufina.c_str(), bufina.size(), out);
bufina.clear();
@ -211,7 +211,7 @@ bool Crypt::RSA(bool encrypt, const char * keypath, const char * in, size_t inle
return false;
run.Clear();
PT::WideToUTF8(config->opensll_path, command);
pt::WideToUTF8(config->opensll_path, command);
run.Cmd(command);
run.Par("rsautl");
@ -243,7 +243,7 @@ bool Crypt::RSA(bool encrypt, const std::string & keypath, const std::string & i
bool Crypt::RSA(bool encrypt, const wchar_t * keypath, const char * in, size_t inlen, std::string & out)
{
PT::WideToUTF8(keypath, keypatha);
pt::WideToUTF8(keypath, keypatha);
return RSA(encrypt, keypatha.c_str(), in, inlen, out);
}
@ -308,7 +308,7 @@ bool Crypt::PassCrypt(const std::wstring & path_to_rsa_private_key, User & user)
if( !path_to_rsa_private_key.empty() )
{
PT::WideToUTF8(user.password, passa);
pt::WideToUTF8(user.password, passa);
if( RSA(true, path_to_rsa_private_key, passa, user.pass_encrypted) )
{

@ -66,7 +66,7 @@ void FileLog::set_synchro(Synchro * synchro)
void FileLog::init(const std::wstring & log_file, bool log_stdout, int log_level, bool save_each_line, size_t log_time_zone_id)
{
PT::FileLog::init(log_file, log_stdout, log_level, save_each_line);
pt::FileLog::init(log_file, log_stdout, log_level, save_each_line);
this->log_time_zone_id = log_time_zone_id;
}
@ -91,7 +91,7 @@ bool FileLog::should_save_each_line()
PT::Date FileLog::get_local_date(const PT::Date & date)
pt::Date FileLog::get_local_date(const pt::Date & date)
{
if( time_zones )
{
@ -100,7 +100,7 @@ PT::Date FileLog::get_local_date(const PT::Date & date)
if( tz )
{
PT::Date local_date = tz->ToLocal(date);
pt::Date local_date = tz->ToLocal(date);
return local_date;
}
else

@ -49,7 +49,7 @@ namespace Winix
class TimeZones;
class FileLog : public PT::FileLog
class FileLog : public pt::FileLog
{
public:
@ -58,14 +58,14 @@ public:
void set_synchro(Synchro * synchro);
// using PT::FileLog::init to suppress clang warning:
// using pt::FileLog::init to suppress clang warning:
// warning: 'Winix::FileLog::init' hides overloaded virtual function [-Woverloaded-virtual]
using PT::FileLog::init;
using pt::FileLog::init;
void init(const std::wstring & log_file, bool log_stdout, int log_level, bool save_each_line, size_t log_time_zone_id);
void set_time_zones(TimeZones * time_zones);
PT::Date get_local_date(const PT::Date & date);
pt::Date get_local_date(const pt::Date & date);
int get_log_level();
bool should_save_each_line();

@ -143,7 +143,7 @@ void HttpSimpleParser::ReadName()
}
if( getchar_returns_utf8_chars )
PT::UTF8ToWide(utf8_token, last_name);
pt::UTF8ToWide(utf8_token, last_name);
if( last_c == '=' )
last_c = GetChar();
@ -173,7 +173,7 @@ void HttpSimpleParser::ReadQuotedValue()
}
if( getchar_returns_utf8_chars )
PT::UTF8ToWide(utf8_token, last_value);
pt::UTF8ToWide(utf8_token, last_value);
if( last_c == '"' )
last_c = GetChar();
@ -204,7 +204,7 @@ void HttpSimpleParser::ReadNormalValue()
}
if( getchar_returns_utf8_chars )
PT::UTF8ToWide(utf8_token, last_value);
pt::UTF8ToWide(utf8_token, last_value);
}

@ -294,7 +294,7 @@ bool end;
void Image::Add(const std::wstring & in, TextStream<std::string> & out)
{
PT::WideToUTF8(in, add_tempa);
pt::WideToUTF8(in, add_tempa);
out << add_tempa;
}
@ -387,7 +387,7 @@ bool Image::CreateInputFileName()
if( system->MakeFilePath(file_work, src_path, thumb) )
{
PT::WideToUTF8(src_path, input_file_name);
pt::WideToUTF8(src_path, input_file_name);
return true;
}
else
@ -404,7 +404,7 @@ void Image::CreateTmpFileName()
{
stream_tmp_path.Clear();
stream_tmp_path << config->upload_dir << L"/tmp/image_" << std::time(0);
PT::WideToUTF8(stream_tmp_path.Str(), tmp_file_name);
pt::WideToUTF8(stream_tmp_path.Str(), tmp_file_name);
}
@ -612,8 +612,8 @@ void Image::CreateImage()
void Image::CreateThumbnail()
{
PT::WideToUTF8(item_work.source, sourcea);
PT::WideToUTF8(item_work.dst, dsta);
pt::WideToUTF8(item_work.source, sourcea);
pt::WideToUTF8(item_work.dst, dsta);
MagickWandGenesis();

@ -148,7 +148,7 @@ void IPBanContainer::PrintTab()
{
log << log4 << i << ": ip: " << ipban_tab[i].ip << ", flags: " << ipban_tab[i].flags << ", last_used: ";
PT::Date date(ipban_tab[i].last_used);
pt::Date date(ipban_tab[i].last_used);
log << date << ", expires: ";
date = ipban_tab[i].expires;
@ -168,7 +168,7 @@ void IPBanContainer::PrintTab2()
log << log4 << i << ": ip: " << ipban.ip << ", flags: " << ipban.flags << ", last_used: ";
PT::Date date(ipban.last_used);
pt::Date date(ipban.last_used);
log << date << ", expires: ";
date = ipban.expires;

@ -60,7 +60,7 @@ void Job::CheckPriority(int & priority) const
// first thread (objects locked)
void Job::Add(PT::Space & job, int priority)
void Job::Add(pt::Space & job, int priority)
{
CheckPriority(priority);
jobs_queue_tab[priority].push(job);
@ -150,7 +150,7 @@ bool is_empty;
Lock();
// references will not be invalidated after insertion to jobs_queue
// (jobs_queue is std::queue and it uses std::deque by default)
PT::Space & job = jobs_queue.front();
pt::Space & job = jobs_queue.front();
Unlock();
DoJob(job);
@ -165,7 +165,7 @@ bool is_empty;
// second thread (objects not locked)
void Job::DoJob(PT::Space & job)
void Job::DoJob(pt::Space & job)
{
try
{
@ -181,7 +181,7 @@ void Job::DoJob(PT::Space & job)
// second thread (objects not locked)
void Job::DoWinixJob(PT::Space & job)
void Job::DoWinixJob(pt::Space & job)
{
//log << log1 << "standard winix job: " << job.Text(L"type") << logend;
}

@ -61,7 +61,7 @@ public:
add a new job to the queue
priority: 0-31 (0 - the lowest priority, 31 - the highest priority)
*/
void Add(PT::Space & job, int priority = 0);
void Add(pt::Space & job, int priority = 0);
/*
@ -81,7 +81,7 @@ public:
private:
typedef std::queue<PT::Space> JobsQueue;
typedef std::queue<pt::Space> JobsQueue;
typedef std::vector<JobsQueue> JobsQueueTab;
JobsQueueTab jobs_queue_tab;
@ -102,8 +102,8 @@ private:
bool SignalReceived();
void Do();
void DoQueue(JobsQueue & jobs_queue);
void DoJob(PT::Space & job);
void DoWinixJob(PT::Space & job);
void DoJob(pt::Space & job);
void DoWinixJob(pt::Space & job);
};

@ -69,8 +69,8 @@ struct LastItem
long session_id;
// start logging and end logging
PT::Date start;
PT::Date end;
pt::Date start;
pt::Date end;
LastItem();

@ -72,7 +72,7 @@ void Log::SetMaxRequests(int max_requests)
void Log::PrintDate(const PT::Date & date)
void Log::PrintDate(const pt::Date & date)
{
FileLog * winix_file_log = dynamic_cast<FileLog*>(file_log);
@ -86,7 +86,7 @@ void Log::PrintDate(const PT::Date & date)
Log & Log::operator<<(const void * s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -94,7 +94,7 @@ Log & Log::operator<<(const void * s)
Log & Log::operator<<(const char * s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -102,7 +102,7 @@ Log & Log::operator<<(const char * s)
Log & Log::operator<<(const std::string & s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -110,7 +110,7 @@ Log & Log::operator<<(const std::string & s)
Log & Log::operator<<(const std::string * s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -121,7 +121,7 @@ Log & Log::operator<<(const std::string * s)
Log & Log::operator<<(const wchar_t * s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -129,7 +129,7 @@ Log & Log::operator<<(const wchar_t * s)
Log & Log::operator<<(const std::wstring & s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -137,7 +137,7 @@ Log & Log::operator<<(const std::wstring & s)
Log & Log::operator<<(const std::wstring * s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -145,7 +145,7 @@ Log & Log::operator<<(const std::wstring * s)
Log & Log::operator<<(int s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -153,7 +153,7 @@ Log & Log::operator<<(int s)
Log & Log::operator<<(long s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -162,21 +162,21 @@ Log & Log::operator<<(long s)
Log & Log::operator<<(char s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(wchar_t s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(size_t s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
@ -184,30 +184,30 @@ Log & Log::operator<<(size_t s)
Log & Log::operator<<(double s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(const PT::Space & s)
Log & Log::operator<<(const pt::Space & s)
{
PT::Log::operator<<(s);
pt::Log::operator<<(s);
return *this;
}
Log & Log::operator<<(const PT::Date & date)
Log & Log::operator<<(const pt::Date & date)
{
PT::Log::operator<<(date);
pt::Log::operator<<(date);
return *this;
}
Log & Log::operator<<(morm::Model & model)
{
PT::Log::operator<<(model);
pt::Log::operator<<(model);
return *this;
}
@ -217,27 +217,27 @@ Log & Log::operator<<(LogManipulators m)
switch(m)
{
case LogManipulators::log1:
PT::Log::operator<<(PT::Log::log1);
pt::Log::operator<<(pt::Log::log1);
break;
case LogManipulators::log2:
PT::Log::operator<<(PT::Log::log2);
pt::Log::operator<<(pt::Log::log2);
break;
case LogManipulators::log3:
PT::Log::operator<<(PT::Log::log3);
pt::Log::operator<<(pt::Log::log3);
break;
case LogManipulators::log4:
PT::Log::operator<<(PT::Log::log4);
pt::Log::operator<<(pt::Log::log4);
break;
case LogManipulators::logend:
PT::Log::operator<<(PT::Log::logend);
pt::Log::operator<<(pt::Log::logend);
break;
case LogManipulators::logsave:
PT::Log::operator<<(PT::Log::logsave);
pt::Log::operator<<(pt::Log::logsave);
break;
case LogManipulators::logendrequest:
@ -274,27 +274,27 @@ return *this;
Log & Log::LogString(const std::string & value, size_t max_size)
{
PT::Log::LogString(value, max_size);
pt::Log::LogString(value, max_size);
return *this;
}
Log & Log::LogString(const std::wstring & value, size_t max_size)
{
PT::Log::LogString(value, max_size);
pt::Log::LogString(value, max_size);
return *this;
}
Log & Log::LogBinary(const char * blob, size_t blob_len)
{
PT::Log::LogBinary(blob, blob_len);
pt::Log::LogBinary(blob, blob_len);
return *this;
}
Log & Log::LogBinary(const std::string & blob)
{
PT::Log::LogBinary(blob);
pt::Log::LogBinary(blob);
return *this;
}

@ -51,7 +51,7 @@ namespace Winix
class Log : public PT::Log
class Log : public pt::Log
{
public:
@ -75,15 +75,15 @@ public:
virtual Log & operator<<(wchar_t s);
virtual Log & operator<<(size_t s);
virtual Log & operator<<(double s);
virtual Log & operator<<(const PT::Space & space);
virtual Log & operator<<(const pt::Space & space);
virtual Log & operator<<(LogManipulators m);
virtual Log & operator<<(const PT::Date & date);
virtual Log & operator<<(const pt::Date & date);
virtual Log & operator<<(morm::Model & model);
virtual void PrintDate(const PT::Date & date);
virtual void PrintDate(const pt::Date & date);
template<typename char_type, size_t stack_size, size_t heap_block_size>
Log & operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf);
Log & operator<<(const pt::TextStreamBase<char_type, stack_size, heap_block_size> & buf);
virtual Log & LogString(const std::string & value, size_t max_size);
@ -112,9 +112,9 @@ private:
template<typename char_type, size_t stack_size, size_t heap_block_size>
Log & Log::operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf)
Log & Log::operator<<(const pt::TextStreamBase<char_type, stack_size, heap_block_size> & buf)
{
PT::Log::operator<<(buf);
pt::Log::operator<<(buf);
return *this;
}

@ -57,7 +57,7 @@ namespace misc_private
0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028,
0x2029, 0x202F, 0x205F, 0x3000 };
PT::WTextStream tmp_qencode;
pt::WTextStream tmp_qencode;
}
@ -331,7 +331,7 @@ void CorrectUrlOnlyAllowedChar(std::wstring & url)
{
CorrectUrlDots(url);
CorrectUrlChars(url);
PT::to_lower_emplace(url);
pt::to_lower_emplace(url);
Trim(url, '_');
if( url.empty() || url == L"." )
@ -408,7 +408,7 @@ static wchar_t buffer[100];
const wchar_t * DateToStr(const PT::Date & d)
const wchar_t * DateToStr(const pt::Date & d)
{
return DateToStr(d.year, d.month, d.day, d.hour, d.min, d.sec);
}
@ -416,14 +416,14 @@ const wchar_t * DateToStr(const PT::Date & d)
const wchar_t * DateToStr(time_t t)
{
PT::Date date = t;
pt::Date date = t;
return DateToStr(date);
}
const wchar_t * DateToStrWithoutHours(const PT::Date & d)
const wchar_t * DateToStrWithoutHours(const pt::Date & d)
{
return DateToStr(d.year, d.month, d.day);
}
@ -431,7 +431,7 @@ const wchar_t * DateToStrWithoutHours(const PT::Date & d)
const wchar_t * DateToStrWithoutHours(time_t t)
{
PT::Date date = t;
pt::Date date = t;
return DateToStrWithoutHours(date);
}
@ -460,7 +460,7 @@ return buffer;
const char * DateToStrCookie(const PT::Date & d)
const char * DateToStrCookie(const pt::Date & d)
{
return DateToStrCookie(d.year, d.month, d.day, d.hour, d.min, d.sec);
}
@ -468,7 +468,7 @@ const char * DateToStrCookie(const PT::Date & d)
const char * DateToStrCookie(time_t t)
{
PT::Date date = t;
pt::Date date = t;
return DateToStrCookie(date);
}
@ -493,9 +493,9 @@ return buffer;
PT::WTextStream IPToStr(unsigned int ip)
pt::WTextStream IPToStr(unsigned int ip)
{
PT::WTextStream buf;
pt::WTextStream buf;
for(int i=0 ; i<4 ; ++i, ip >>= 8)
{
@ -509,7 +509,7 @@ return buf;
}
PT::WTextStream IPToStr(int ip)
pt::WTextStream IPToStr(int ip)
{
return IPToStr(static_cast<unsigned int>(ip));
}
@ -1148,7 +1148,7 @@ std::ifstream get_file_content;
/*
* we don't report any errors when converting from UTF8 to wide characters here
*/
PT::UTF8ToWide(get_file_content, content);
pt::UTF8ToWide(get_file_content, content);
get_file_content.close();
return true;
@ -1219,31 +1219,31 @@ int SelectFileType(const wchar_t * file_name)
// as an image we're using only those types which can be rendered
// by a web browser
if( PT::is_equal_nc(ext, L"jpg") ||
PT::is_equal_nc(ext, L"jpeg") ||
PT::is_equal_nc(ext, L"jpe") ||
PT::is_equal_nc(ext, L"pic") ||
PT::is_equal_nc(ext, L"tga") ||
PT::is_equal_nc(ext, L"gif") ||
PT::is_equal_nc(ext, L"bmp") ||
PT::is_equal_nc(ext, L"png") )
if( pt::is_equal_nc(ext, L"jpg") ||
pt::is_equal_nc(ext, L"jpeg") ||
pt::is_equal_nc(ext, L"jpe") ||
pt::is_equal_nc(ext, L"pic") ||
pt::is_equal_nc(ext, L"tga") ||
pt::is_equal_nc(ext, L"gif") ||
pt::is_equal_nc(ext, L"bmp") ||
pt::is_equal_nc(ext, L"png") )
return WINIX_ITEM_FILETYPE_IMAGE;
if( PT::is_equal_nc(ext, L"pdf") ||
PT::is_equal_nc(ext, L"doc") ||
PT::is_equal_nc(ext, L"xls") ||
PT::is_equal_nc(ext, L"txt") ||
PT::is_equal_nc(ext, L"ods") ||
PT::is_equal_nc(ext, L"odt") )
if( pt::is_equal_nc(ext, L"pdf") ||
pt::is_equal_nc(ext, L"doc") ||
pt::is_equal_nc(ext, L"xls") ||
pt::is_equal_nc(ext, L"txt") ||
pt::is_equal_nc(ext, L"ods") ||
pt::is_equal_nc(ext, L"odt") )
return WINIX_ITEM_FILETYPE_DOCUMENT;
if( PT::is_equal_nc(ext, L"avi") ||
PT::is_equal_nc(ext, L"mp4") ||
PT::is_equal_nc(ext, L"flv") ||
PT::is_equal_nc(ext, L"mpg") ||
PT::is_equal_nc(ext, L"mpeg") ||
PT::is_equal_nc(ext, L"mkv") ||
PT::is_equal_nc(ext, L"wmv") )
if( pt::is_equal_nc(ext, L"avi") ||
pt::is_equal_nc(ext, L"mp4") ||
pt::is_equal_nc(ext, L"flv") ||
pt::is_equal_nc(ext, L"mpg") ||
pt::is_equal_nc(ext, L"mpeg") ||
pt::is_equal_nc(ext, L"mkv") ||
pt::is_equal_nc(ext, L"wmv") )
return WINIX_ITEM_FILETYPE_VIDEO;
return WINIX_ITEM_FILETYPE_UNKNOWN;
@ -1280,7 +1280,7 @@ void UrlEncode(const wchar_t * in, std::string & out, bool clear_out)
{
static std::string ain;
PT::WideToUTF8(in, ain);
pt::WideToUTF8(in, ain);
if( clear_out )
out.clear();
@ -1301,7 +1301,7 @@ void UrlEncode(const wchar_t * in, std::wstring & out, bool clear_out)
{
static std::string ain;
PT::WideToUTF8(in, ain);
pt::WideToUTF8(in, ain);
if( clear_out )
out.clear();
@ -1372,7 +1372,7 @@ int c1, c2;
url_utf8[index] = 0;
return PT::UTF8ToWide(url_utf8, out, false);
return pt::UTF8ToWide(url_utf8, out, false);
}
@ -1418,7 +1418,7 @@ void RemovePostFileTmp(PostFileTab & post_file_tab)
bool WideToUTF8(const wchar_t * wide_string, char * utf8, size_t utf8_size)
{
bool res = PT::WideToUTF8(wide_string, utf8, utf8_size);
bool res = pt::WideToUTF8(wide_string, utf8, utf8_size);
if( !res )
{

@ -238,13 +238,13 @@ void CorrectUrlOnlyAllowedChar(std::wstring & url);
const wchar_t * DateToStr(int year, int month, int day);
const wchar_t * DateToStr(int year, int month, int day, int hour, int min, int sec);
const wchar_t * DateToStr(const PT::Date & d);
const wchar_t * DateToStr(const pt::Date & d);
const wchar_t * DateToStr(time_t t);
const wchar_t * DateToStrWithoutHours(const PT::Date & d);
const wchar_t * DateToStrWithoutHours(const pt::Date & d);
const wchar_t * DateToStrWithoutHours(time_t t);
const char * DateToStrCookie(int year, int month, int day, int hour, int min, int sec);
const char * DateToStrCookie(const PT::Date & d);