From e48a28a5c8033c9ac4d9756d9089f2e0811e7fe6 Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Thu, 20 May 2021 20:59:12 +0200 Subject: [PATCH] namespace PT renamed to pt --- winixd/core/app.cpp | 78 ++++++++++++------------ winixd/core/app.h | 10 ++-- winixd/core/basethread.cpp | 4 +- winixd/core/basethread.h | 4 +- winixd/core/config.cpp | 14 ++--- winixd/core/config.h | 6 +- winixd/core/crypt.cpp | 10 ++-- winixd/core/filelog.cpp | 6 +- winixd/core/filelog.h | 8 +-- winixd/core/httpsimpleparser.cpp | 6 +- winixd/core/image.cpp | 10 ++-- winixd/core/ipbancontainer.cpp | 4 +- winixd/core/job.cpp | 8 +-- winixd/core/job.h | 8 +-- winixd/core/lastcontainer.h | 4 +- winixd/core/log.cpp | 58 +++++++++--------- winixd/core/log.h | 14 ++--- winixd/core/misc.cpp | 74 +++++++++++------------ winixd/core/misc.h | 38 ++++++------ winixd/core/postmultiparser.cpp | 6 +- winixd/core/postparser.h | 2 +- winixd/core/request.h | 28 ++++----- winixd/core/requesttypes.h | 2 +- winixd/core/session.h | 4 +- winixd/core/sessionidmanager.cpp | 20 +++---- winixd/core/sessionidmanager.h | 2 +- winixd/core/sessionmanager.cpp | 4 +- winixd/core/slog.cpp | 4 +- winixd/core/slog.h | 6 +- winixd/core/system.cpp | 8 +-- winixd/core/system.h | 8 +-- winixd/core/textstream.h | 28 ++++----- winixd/core/threadmanager.h | 2 +- winixd/core/timezone.cpp | 34 +++++------ winixd/core/timezone.h | 20 +++---- winixd/core/timezones.cpp | 12 ++-- winixd/core/timezones.h | 4 +- winixd/core/winixbase.cpp | 2 +- winixd/core/winixbase.h | 2 +- winixd/db/dbbase.cpp | 16 ++--- winixd/db/dbbase.h | 6 +- winixd/db/dbtextstream.cpp | 10 ++-- winixd/db/dbtextstream.h | 16 ++--- winixd/functions/env.cpp | 2 +- winixd/functions/env.h | 4 +- winixd/functions/functionparser.cpp | 12 ++-- winixd/functions/login.cpp | 4 +- winixd/functions/meta.cpp | 2 +- winixd/functions/meta.h | 4 +- winixd/functions/rm.cpp | 2 +- winixd/functions/sort.cpp | 2 +- winixd/functions/upload.cpp | 4 +- winixd/main/main.cpp | 8 +-- winixd/models/item.cpp | 10 ++-- winixd/models/itemcontent.h | 8 +-- winixd/models/migration.cpp | 12 ++-- winixd/models/migration.h | 2 +- winixd/models/user.h | 6 +- winixd/notify/notifythread.cpp | 6 +- winixd/plugins/export/exportinfo.cpp | 8 +-- winixd/plugins/export/exportinfo.h | 2 +- winixd/plugins/export/exportthread.cpp | 8 +-- winixd/plugins/group/groupinfo.cpp | 6 +- winixd/plugins/group/groupinfo.h | 2 +- winixd/plugins/group/groups.cpp | 18 +++--- winixd/plugins/group/groups.h | 10 ++-- winixd/plugins/mailregister/init.cpp | 10 ++-- winixd/plugins/menu/cache.h | 2 +- winixd/plugins/seo/seo.cpp | 2 +- winixd/plugins/stats/stats.cpp | 4 +- winixd/plugins/thread/reply.cpp | 2 +- winixd/plugins/thread/templates.cpp | 8 +-- winixd/plugins/thread/thread.h | 2 +- winixd/plugins/ticket/createticket.cpp | 8 +-- winixd/plugins/ticket/createticket.h | 2 +- winixd/plugins/ticket/editticket.cpp | 16 ++--- winixd/plugins/ticket/editticket.h | 2 +- winixd/plugins/ticket/sessiondata.cpp | 16 ++--- winixd/plugins/ticket/sessiondata.h | 16 ++--- winixd/plugins/ticket/templates.cpp | 82 +++++++++++++------------- winixd/plugins/ticket/ticketinfo.cpp | 56 +++++++++--------- winixd/plugins/ticket/ticketinfo.h | 30 +++++----- winixd/templates/currentdate.cpp | 14 ++--- winixd/templates/dir.cpp | 10 ++-- winixd/templates/doc.cpp | 4 +- winixd/templates/htmltextstream.cpp | 14 ++--- winixd/templates/htmltextstream.h | 18 +++--- winixd/templates/ipban.cpp | 8 +-- winixd/templates/item.cpp | 16 ++--- winixd/templates/locale.cpp | 14 ++--- winixd/templates/locale.h | 20 +++---- winixd/templates/misc.cpp | 6 +- winixd/templates/misc.h | 2 +- winixd/templates/miscspace.cpp | 20 +++---- winixd/templates/miscspace.h | 10 ++-- winixd/templates/mount.cpp | 4 +- winixd/templates/stat.cpp | 4 +- winixd/templates/textextstream.cpp | 4 +- winixd/templates/textextstream.h | 14 ++--- winixd/templates/winix.cpp | 2 +- 100 files changed, 597 insertions(+), 597 deletions(-) diff --git a/winixd/core/app.cpp b/winixd/core/app.cpp index 9a819c5..0380f5e 100644 --- a/winixd/core/app.cpp +++ b/winixd/core/app.cpp @@ -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(-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(); diff --git a/winixd/core/app.h b/winixd/core/app.h index 5825fc4..6d1172a 100644 --- a/winixd/core/app.h +++ b/winixd/core/app.h @@ -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(); diff --git a/winixd/core/basethread.cpp b/winixd/core/basethread.cpp index a2d9a6e..06c6beb 100644 --- a/winixd/core/basethread.cpp +++ b/winixd/core/basethread.cpp @@ -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); } diff --git a/winixd/core/basethread.h b/winixd/core/basethread.h index 6eb3a2b..144e7a0 100644 --- a/winixd/core/basethread.h +++ b/winixd/core/basethread.h @@ -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 diff --git a/winixd/core/config.cpp b/winixd/core/config.cpp index 69d0aac..ad2c156 100644 --- a/winixd/core/config.cpp +++ b/winixd/core/config.cpp @@ -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(); diff --git a/winixd/core/config.h b/winixd/core/config.h index 7edc691..ec952ac 100644 --- a/winixd/core/config.h +++ b/winixd/core/config.h @@ -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; diff --git a/winixd/core/crypt.cpp b/winixd/core/crypt.cpp index 3a0932d..923ed0b 100644 --- a/winixd/core/crypt.cpp +++ b/winixd/core/crypt.cpp @@ -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) ) { diff --git a/winixd/core/filelog.cpp b/winixd/core/filelog.cpp index 717ae06..d3372f3 100644 --- a/winixd/core/filelog.cpp +++ b/winixd/core/filelog.cpp @@ -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 diff --git a/winixd/core/filelog.h b/winixd/core/filelog.h index ecac425..42b44df 100644 --- a/winixd/core/filelog.h +++ b/winixd/core/filelog.h @@ -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(); diff --git a/winixd/core/httpsimpleparser.cpp b/winixd/core/httpsimpleparser.cpp index a06c2cc..2589ffb 100644 --- a/winixd/core/httpsimpleparser.cpp +++ b/winixd/core/httpsimpleparser.cpp @@ -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); } diff --git a/winixd/core/image.cpp b/winixd/core/image.cpp index 786b1a1..4a5af02 100644 --- a/winixd/core/image.cpp +++ b/winixd/core/image.cpp @@ -294,7 +294,7 @@ bool end; void Image::Add(const std::wstring & in, TextStream & 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(); diff --git a/winixd/core/ipbancontainer.cpp b/winixd/core/ipbancontainer.cpp index c39316d..43816f2 100644 --- a/winixd/core/ipbancontainer.cpp +++ b/winixd/core/ipbancontainer.cpp @@ -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; diff --git a/winixd/core/job.cpp b/winixd/core/job.cpp index 0538664..ac2ac50 100644 --- a/winixd/core/job.cpp +++ b/winixd/core/job.cpp @@ -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; } diff --git a/winixd/core/job.h b/winixd/core/job.h index c8c5671..6123cc6 100644 --- a/winixd/core/job.h +++ b/winixd/core/job.h @@ -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 JobsQueue; + typedef std::queue JobsQueue; typedef std::vector 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); }; diff --git a/winixd/core/lastcontainer.h b/winixd/core/lastcontainer.h index 9f079af..f58f905 100644 --- a/winixd/core/lastcontainer.h +++ b/winixd/core/lastcontainer.h @@ -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(); diff --git a/winixd/core/log.cpp b/winixd/core/log.cpp index b50d806..93fa31b 100644 --- a/winixd/core/log.cpp +++ b/winixd/core/log.cpp @@ -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(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; } diff --git a/winixd/core/log.h b/winixd/core/log.h index e985836..234f6b0 100644 --- a/winixd/core/log.h +++ b/winixd/core/log.h @@ -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 - Log & operator<<(const PT::TextStreamBase & buf); + Log & operator<<(const pt::TextStreamBase & buf); virtual Log & LogString(const std::string & value, size_t max_size); @@ -112,9 +112,9 @@ private: template -Log & Log::operator<<(const PT::TextStreamBase & buf) +Log & Log::operator<<(const pt::TextStreamBase & buf) { - PT::Log::operator<<(buf); + pt::Log::operator<<(buf); return *this; } diff --git a/winixd/core/misc.cpp b/winixd/core/misc.cpp index d426c38..b0b747f 100644 --- a/winixd/core/misc.cpp +++ b/winixd/core/misc.cpp @@ -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(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 ) { diff --git a/winixd/core/misc.h b/winixd/core/misc.h index 1e1521b..635a7a9 100644 --- a/winixd/core/misc.h +++ b/winixd/core/misc.h @@ -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); +const char * DateToStrCookie(const pt::Date & d); const char * DateToStrCookie(time_t t); // depracated @@ -253,8 +253,8 @@ const wchar_t * IpToStr(unsigned int ip_); // in a new code we can use WTextStream in such a way // DateToStr() etc can use it too -PT::WTextStream IPToStr(unsigned int ip); -PT::WTextStream IPToStr(int ip); +pt::WTextStream IPToStr(unsigned int ip); +pt::WTextStream IPToStr(int ip); @@ -420,7 +420,7 @@ size_t i = 0; while( i < buf.size() ) { - if( PT::is_substr(look_for.c_str(), buf.c_str() + i) ) + if( pt::is_substr(look_for.c_str(), buf.c_str() + i) ) { buf.erase(i, look_for.size()); buf.insert(i, replace); @@ -681,7 +681,7 @@ int SelectFileType(const std::wstring & file_name); // thread safe template void UrlEncode(char c, - PT::TextStreamBase & out, + pt::TextStreamBase & out, bool clear_out = true) { char buffer[10]; @@ -713,7 +713,7 @@ size_t buflen = sizeof(buffer)/sizeof(char); // thread safe template void UrlEncode(const char * in, - PT::TextStreamBase & out, + pt::TextStreamBase & out, bool clear_out = true) { if( clear_out ) @@ -727,7 +727,7 @@ void UrlEncode(const char * in, // thread safe template void UrlEncode(const std::string & in, - PT::TextStreamBase & out, + pt::TextStreamBase & out, bool clear_out = true) { UrlEncode(in.c_str(), out, clear_out); @@ -738,12 +738,12 @@ void UrlEncode(const std::string & in, // not thread safe template void UrlEncode(const wchar_t * in, - PT::TextStreamBase & out, + pt::TextStreamBase & out, bool clear_out = true) { static std::string ain; - PT::WideToUTF8(in, ain); + pt::WideToUTF8(in, ain); if( clear_out ) out.clear(); @@ -756,7 +756,7 @@ static std::string ain; // not thread safe template void UrlEncode(const std::wstring & in, - PT::TextStreamBase & out, + pt::TextStreamBase & out, bool clear_out = true) { UrlEncode(in.c_str(), out, clear_out); @@ -768,14 +768,14 @@ void UrlEncode(const std::wstring & in, template void UrlEncode(char c, StringType & out, bool clear_out = true) { -static PT::TextStream tmp; +static pt::TextStream tmp; UrlEncode(c, tmp); tmp.to_string(out, clear_out); } -// !! IMROVE ME we need some UrlEncode methods with PT::TextBuffer instead of std::string +// !! IMROVE ME we need some UrlEncode methods with pt::TextBuffer instead of std::string void UrlEncode(const char * in, std::string & out, bool clear_out = true); @@ -802,7 +802,7 @@ bool UrlDecode(const std::string & url, std::wstring & out, bool clear_out = tr template -void QEncodeAddChar(char_type c, PT::TextStreamBase & out) +void QEncodeAddChar(char_type c, pt::TextStreamBase & out) { if( (c>='A' && c<='Z') || (c>='a' && c<='z') || @@ -817,7 +817,7 @@ void QEncodeAddChar(char_type c, PT::TextStreamBase -void QEncode(const wchar_t * in, PT::TextStreamBase & out, +void QEncode(const wchar_t * in, pt::TextStreamBase & out, bool clear = true) { if( clear ) @@ -866,7 +866,7 @@ void QEncode(const wchar_t * in, PT::TextStreamBase -void QEncode(const std::wstring & in, PT::TextStreamBase & out, +void QEncode(const std::wstring & in, pt::TextStreamBase & out, bool clear = true) { if( clear ) @@ -984,7 +984,7 @@ void JSONescape(Stream & out, const StringType & str) * converting from a wide string to an UTF-8 string * and puts a log if the conversion fails * - * it uses PT::WideToUTF8() + * it uses pt::WideToUTF8() */ bool WideToUTF8(const wchar_t * wide_string, char * utf8, size_t utf8_size); bool WideToUTF8(const std::wstring & wide_string, char * utf8, size_t utf8_size); diff --git a/winixd/core/postmultiparser.cpp b/winixd/core/postmultiparser.cpp index 21e6b76..341a9c6 100644 --- a/winixd/core/postmultiparser.cpp +++ b/winixd/core/postmultiparser.cpp @@ -382,14 +382,14 @@ void PostMultiParser::ReadContent() log << log2 << "PMP: content size: " << content_len << " bytes" << logend; - if( !PT::is_substr_nc("pass", name.c_str()) ) + if( !pt::is_substr_nc("pass", name.c_str()) ) LogFirst(content, config->log_post_value_size); } void PostMultiParser::ConvStr(const std::string & src, std::wstring & dst) { - PT::UTF8ToWide(src, dst); + pt::UTF8ToWide(src, dst); } @@ -496,7 +496,7 @@ size_t buf_len = sizeof(buf)/sizeof(wchar_t); tmp_filename_postfix += 1; tmp_filename = buf; - PT::WideToUTF8(tmp_filename, atmp_filename); + pt::WideToUTF8(tmp_filename, atmp_filename); tmp_file.open(atmp_filename.c_str(), std::ios_base::binary | std::ios_base::out); // !! IMPROVE ME dodac ustawienie chmod config.upload_files_chmod dla tymczasowego pliku diff --git a/winixd/core/postparser.h b/winixd/core/postparser.h index d52fd85..e9535cd 100644 --- a/winixd/core/postparser.h +++ b/winixd/core/postparser.h @@ -77,7 +77,7 @@ protected: { log << log2 << "Method POST, name: \"" << name << "\""; - if( log_value_size > 0 && !PT::is_substr_nc(L"pass", name.c_str()) ) + if( log_value_size > 0 && !pt::is_substr_nc(L"pass", name.c_str()) ) { log << ", value: "; diff --git a/winixd/core/request.h b/winixd/core/request.h index 7ee0068..0022bb0 100644 --- a/winixd/core/request.h +++ b/winixd/core/request.h @@ -88,7 +88,7 @@ struct Request they are set when a request starts */ time_t start_time; - PT::Date start_date; + pt::Date start_date; @@ -118,13 +118,13 @@ struct Request /* raw parameters - !! CHECK ME may post_tab and cookie_tab should be changed to PT::Space now? + !! CHECK ME may post_tab and cookie_tab should be changed to pt::Space now? or may change the name to cookie_in? or in_cookie? */ PostTab post_tab; PostFileTab post_file_tab; CookieTab cookie_tab; - PT::Space post_in; + pt::Space post_in; bool is_postin_used;// temporarily, before all post variables will be put to post_in // input headers (without cookies) @@ -134,7 +134,7 @@ struct Request // although https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2 says that there can be more // than one http header with the same name we do not support it // each header has a different name here, cookies we have in a different container (cookie_tab) - PT::Space headers_in; + pt::Space headers_in; /* @@ -232,11 +232,11 @@ struct Request bool send_as_attachment; // headers send to the client (without cookies) (may change to headers_out?) - PT::Space out_headers; + pt::Space out_headers; // cookies send to the client // a value can be either a cookie value or the whole cookie string (with domain, date etc) - PT::Space out_cookies; + pt::Space out_cookies; // winix can return either a text answer or a binary answer // if send_bin_stream is true then the binary answer is sent (out_bin_stream) @@ -305,7 +305,7 @@ struct Request bool return_info_only; // additional info added when sending the JSON answer - PT::Space info; + pt::Space info; @@ -382,14 +382,14 @@ struct Request // setting a cookie - // name - cookie name (either const wchar_t, or std::wstring or PT::WTextStream) - // value - cookie value (can be everything which can be put to PT::WTextStream stream) + // name - cookie name (either const wchar_t, or std::wstring or pt::WTextStream) + // value - cookie value (can be everything which can be put to pt::WTextStream stream) // the return std::wstring reference is a reference to the cookie inserted value (in out_cookies structure) template - void AddCookie(const NameType & name, const ValueType & value, PT::Date * expires = 0); + void AddCookie(const NameType & name, const ValueType & value, pt::Date * expires = 0); template - void AddCookie(const NameType & name, const ValueType & value, PT::Date & expires); + void AddCookie(const NameType & name, const ValueType & value, pt::Date & expires); @@ -409,9 +409,9 @@ private: template -void Request::AddCookie(const NameType & name, const ValueType & value, PT::Date * expires) +void Request::AddCookie(const NameType & name, const ValueType & value, pt::Date * expires) { - PT::WTextStream cookie; + pt::WTextStream cookie; cookie << value; @@ -438,7 +438,7 @@ void Request::AddCookie(const NameType & name, const ValueType & value, PT::Date template -void Request::AddCookie(const NameType & name, const ValueType & value, PT::Date & expires) +void Request::AddCookie(const NameType & name, const ValueType & value, pt::Date & expires) { AddCookie(name, value, &expires); } diff --git a/winixd/core/requesttypes.h b/winixd/core/requesttypes.h index 099797c..26e99e1 100644 --- a/winixd/core/requesttypes.h +++ b/winixd/core/requesttypes.h @@ -77,7 +77,7 @@ typedef std::vector ParamTab; typedef std::map CookieTab; -typedef PT::TextStreamBase BinaryPage; +typedef pt::TextStreamBase BinaryPage; diff --git a/winixd/core/session.h b/winixd/core/session.h index 3ff8fe5..7678e96 100644 --- a/winixd/core/session.h +++ b/winixd/core/session.h @@ -81,12 +81,12 @@ struct Session // when this session was created // (the same values) time_t start_time; - PT::Date start_date; + pt::Date start_date; // when this session was last used // (the same values) time_t last_time; - PT::Date last_date; + pt::Date last_date; // when there was a last get request // (used to calculate spam or invalid login attempts etc.) diff --git a/winixd/core/sessionidmanager.cpp b/winixd/core/sessionidmanager.cpp index 0011eb0..ba5913e 100644 --- a/winixd/core/sessionidmanager.cpp +++ b/winixd/core/sessionidmanager.cpp @@ -86,7 +86,7 @@ void SessionIdManager::SetKeyRenewTime(time_t renew_time) } -void SessionIdManager::ReadKey(const wchar_t * name, PT::Space & space, std::vector & dest_key) +void SessionIdManager::ReadKey(const wchar_t * name, pt::Space & space, std::vector & dest_key) { std::vector keys; std::string key_ascii, key_base64_decoded; @@ -100,7 +100,7 @@ std::string key_ascii, key_base64_decoded; { dest_key[i].clear(); - if( PT::WideToUTF8(keys[i], key_ascii) ) + if( pt::WideToUTF8(keys[i], key_ascii) ) { if( base64.Decode(key_ascii, key_base64_decoded) ) { @@ -140,14 +140,14 @@ void SessionIdManager::InitializeAesKeys() bool SessionIdManager::ReadKeysFromFile(const wchar_t * file) { -PT::Space space; -PT::SpaceParser parser; -PT::Date date; +pt::Space space; +pt::SpaceParser parser; +pt::Date date; parser.SetSpace(space); - PT::SpaceParser::Status status = parser.ParseSpaceFile(file); + pt::SpaceParser::Status status = parser.ParseSpaceFile(file); - if( status == PT::SpaceParser::ok ) + if( status == pt::SpaceParser::ok ) { key_index = space.to_ulong(L"key_index"); @@ -166,7 +166,7 @@ PT::Date date; log << log1 << "SIM: I cannot read the session keys from: " << file << logend; } -return status == PT::SpaceParser::ok; +return status == pt::SpaceParser::ok; } @@ -196,8 +196,8 @@ void SessionIdManager::SaveKeysToFile(std::vector & keys) bool SessionIdManager::SaveKeysToFile(const wchar_t * file) { - PT::Date date = last_key_generated; - PT::WideToUTF8(file, file_name_ascii); + pt::Date date = last_key_generated; + pt::WideToUTF8(file, file_name_ascii); out_file.clear(); out_file.open(file_name_ascii, std::ios_base::binary | std::ios_base::out); diff --git a/winixd/core/sessionidmanager.h b/winixd/core/sessionidmanager.h index 86b83db..eaaf819 100644 --- a/winixd/core/sessionidmanager.h +++ b/winixd/core/sessionidmanager.h @@ -124,7 +124,7 @@ private: bool ReadKeysFromFile(const std::wstring & file); bool SaveKeysToFile(const wchar_t * file); bool SaveKeysToFile(const std::wstring & file); - void ReadKey(const wchar_t * name, PT::Space & space, std::vector & dest_key); + void ReadKey(const wchar_t * name, pt::Space & space, std::vector & dest_key); bool AreKeysCorrect(size_t index); void GenerateKeys(size_t index, time_t cur_utc_time); void CheckKeys(time_t cur_utc_time); diff --git a/winixd/core/sessionmanager.cpp b/winixd/core/sessionmanager.cpp index 9054a83..be90a02 100644 --- a/winixd/core/sessionmanager.cpp +++ b/winixd/core/sessionmanager.cpp @@ -256,7 +256,7 @@ void SessionManager::IncrementBanLevel(IPBan * ip_ban) cur->request->start_time + (time_t)config->ban_level_2_delay, cur->request->start_time + (time_t)config->ban_level_3_delay); - PT::Date date(ip_ban->expires); + pt::Date date(ip_ban->expires); main_log << log2 << "SM: this IP address has been banned to: " << date << " UTC" << logend; } @@ -444,7 +444,7 @@ bool SessionManager::IsIPBanned() else if( current_ip_ban->IsIPBanned() ) { - PT::Date date = current_ip_ban->expires; + pt::Date date = current_ip_ban->expires; main_log << log2 << "SM: this ip is bannned to: " << date << " UTC" << logend; return true; } diff --git a/winixd/core/slog.cpp b/winixd/core/slog.cpp index 2bd45cd..fbc9ae3 100644 --- a/winixd/core/slog.cpp +++ b/winixd/core/slog.cpp @@ -144,7 +144,7 @@ SLog & SLog::operator<<(double s) } -SLog & SLog::operator<<(const PT::Date & date) +SLog & SLog::operator<<(const pt::Date & date) { return PutLog(date); } @@ -189,7 +189,7 @@ return *this; SLog & SLog::TranslateText(const char * str) { - PT::UTF8ToWide(str, key_temp); + pt::UTF8ToWide(str, key_temp); return TranslateText(key_temp.c_str()); } diff --git a/winixd/core/slog.h b/winixd/core/slog.h index 8eecfcc..9c05295 100644 --- a/winixd/core/slog.h +++ b/winixd/core/slog.h @@ -99,10 +99,10 @@ public: SLog & operator<<(size_t s); SLog & operator<<(double s); SLog & operator<<(LogManipulators m); - SLog & operator<<(const PT::Date & date); + SLog & operator<<(const pt::Date & date); template - SLog & operator<<(const PT::TextStreamBase & buf); + SLog & operator<<(const pt::TextStreamBase & buf); SLog & TranslateText(const char * str); @@ -148,7 +148,7 @@ SLog::TranslateTextHelper T(const RawType & par) template -SLog & SLog::operator<<(const PT::TextStreamBase & buf) +SLog & SLog::operator<<(const pt::TextStreamBase & buf) { return PutLog(buf); } diff --git a/winixd/core/system.cpp b/winixd/core/system.cpp index 74341d5..383d34c 100644 --- a/winixd/core/system.cpp +++ b/winixd/core/system.cpp @@ -219,7 +219,7 @@ void System::PutUrlProto(bool can_use_ssl, std::wstring & str, bool clear_str) /* * try_to_use_ssl is to be meant: config->use_ssl, config->use_ssl_static, config->use_ssl_common */ -void System::PutUrlProto(bool can_use_ssl, PT::TextStream & str, bool clear_stream) +void System::PutUrlProto(bool can_use_ssl, pt::TextStream & str, bool clear_stream) { if( clear_stream ) str.clear(); @@ -241,7 +241,7 @@ void System::PutUrlProto(std::wstring & str, bool clear_str) } -void System::PutUrlProto(PT::TextStream & str, bool clear_stream) +void System::PutUrlProto(pt::TextStream & str, bool clear_stream) { return PutUrlProto(config->use_ssl, str, clear_stream); } @@ -1117,7 +1117,7 @@ return utc_time; -PT::Date System::ToLocal(const PT::Date & utc_date) +pt::Date System::ToLocal(const pt::Date & utc_date) { size_t tz_id; @@ -1156,7 +1156,7 @@ return local_time; -PT::Date System::ToUTC(const PT::Date & local_date) +pt::Date System::ToUTC(const pt::Date & local_date) { size_t tz_id; diff --git a/winixd/core/system.h b/winixd/core/system.h index 96165ac..86a1c81 100644 --- a/winixd/core/system.h +++ b/winixd/core/system.h @@ -127,9 +127,9 @@ public: bool IsSSLRequired(bool try_to_use_ssl); bool IsSSLRequired(); void PutUrlProto(bool can_use_ssl, std::wstring & str, bool clear_str = true); - void PutUrlProto(bool can_use_ssl, PT::TextStream & str, bool clear_stream = true); + void PutUrlProto(bool can_use_ssl, pt::TextStream & str, bool clear_stream = true); void PutUrlProto(std::wstring & str, bool clear_str = true); - void PutUrlProto(PT::TextStream & str, bool clear_stream = true); + void PutUrlProto(pt::TextStream & str, bool clear_stream = true); void RedirectTo(const Item & item, const wchar_t * postfix = 0, bool use_reqtype = true); void RedirectTo(long item_id, const wchar_t * postfix = 0, bool use_reqtype = true); @@ -185,10 +185,10 @@ public: time_t ToLocal(time_t utc_time); - PT::Date ToLocal(const PT::Date & utc_date); + pt::Date ToLocal(const pt::Date & utc_date); time_t ToUTC(time_t local_time); - PT::Date ToUTC(const PT::Date & local_date); + pt::Date ToUTC(const pt::Date & local_date); int FollowLink(const std::vector & current_dir_tab, const std::wstring & link_to, diff --git a/winixd/core/textstream.h b/winixd/core/textstream.h index e7d63fa..34cf3f4 100644 --- a/winixd/core/textstream.h +++ b/winixd/core/textstream.h @@ -104,11 +104,11 @@ public: TextStream & operator<<(unsigned long); TextStream & operator<<(double); TextStream & operator<<(const void *);// printing a pointer - TextStream & operator<<(const PT::Space & space); - TextStream & operator<<(const PT::Date & date); + TextStream & operator<<(const pt::Space & space); + TextStream & operator<<(const pt::Date & date); template - TextStream & operator<<(const PT::TextStreamBase & arg); + TextStream & operator<<(const pt::TextStreamBase & arg); TextStream & Write(const char * buf, size_t len); TextStream & Write(const wchar_t * buf, size_t len); @@ -396,7 +396,7 @@ TextStream & TextStream::write(const wchar_t * buf, size template -TextStream & TextStream::operator<<(const PT::Space & space) +TextStream & TextStream::operator<<(const pt::Space & space) { space.serialize_to_space_stream(*this, true); @@ -406,7 +406,7 @@ return *this; template -TextStream & TextStream::operator<<(const PT::Date & date) +TextStream & TextStream::operator<<(const pt::Date & date) { date.Serialize(*this); @@ -417,9 +417,9 @@ return *this; template template TextStream & TextStream::operator<<( - const PT::TextStreamBase & arg) + const pt::TextStreamBase & arg) { -typename PT::TextStreamBase::const_iterator i; +typename pt::TextStreamBase::const_iterator i; for(i=arg.begin() ; i != arg.end() ; ++i) buffer += static_cast(*i); @@ -434,7 +434,7 @@ return *this; template void TextStream::Convert(wchar_t c, std::string & dst) { - PT::IntToUTF8((int)c, dst, false); + pt::IntToUTF8((int)c, dst, false); } @@ -448,7 +448,7 @@ void TextStream::Convert(wchar_t c, std::wstring & dst) template void TextStream::Convert(const char * src, size_t len, std::wstring & dst) { - PT::UTF8ToWide(src, len, dst, false); + pt::UTF8ToWide(src, len, dst, false); } @@ -456,14 +456,14 @@ void TextStream::Convert(const char * src, size_t len, std::wstring template void TextStream::Convert(const char * src, std::wstring & dst) { - PT::UTF8ToWide(src, dst, false); + pt::UTF8ToWide(src, dst, false); } template void TextStream::Convert(const std::string & src, std::wstring & dst) { - PT::UTF8ToWide(src, dst, false); + pt::UTF8ToWide(src, dst, false); } @@ -473,21 +473,21 @@ void TextStream::Convert(const std::string & src, std::wstring & dst template void TextStream::Convert(const wchar_t * src, size_t len, std::string & dst) { - PT::WideToUTF8(src, len, dst, false); + pt::WideToUTF8(src, len, dst, false); } template void TextStream::Convert(const wchar_t * src, std::string & dst) { - PT::WideToUTF8(src, dst, false); + pt::WideToUTF8(src, dst, false); } template void TextStream::Convert(const std::wstring & src, std::string & dst) { - PT::WideToUTF8(src, dst, false); + pt::WideToUTF8(src, dst, false); } diff --git a/winixd/core/threadmanager.h b/winixd/core/threadmanager.h index aa47e01..3718a0d 100644 --- a/winixd/core/threadmanager.h +++ b/winixd/core/threadmanager.h @@ -80,7 +80,7 @@ private: morm::JSONConnector json_connector; morm::PostgreSQLConnector postgresql_connector; - PT::WTextStream log_buffer; + pt::WTextStream log_buffer; }; struct ThreadItem diff --git a/winixd/core/timezone.cpp b/winixd/core/timezone.cpp index ca97640..1164ace 100644 --- a/winixd/core/timezone.cpp +++ b/winixd/core/timezone.cpp @@ -57,7 +57,7 @@ void TimeZone::Dst::Clear() } -bool TimeZone::Dst::IsDstUsed(const PT::Date & date) const +bool TimeZone::Dst::IsDstUsed(const pt::Date & date) const { if( !has_dst ) return false; @@ -70,7 +70,7 @@ return false; } -int TimeZone::Dst::Compare(const PT::Date & date1, const PT::Date & date2) const +int TimeZone::Dst::Compare(const pt::Date & date1, const pt::Date & date2) const { // year is ignored @@ -135,7 +135,7 @@ return &i->second; -time_t TimeZone::CalcLocalOffset(const PT::Date & utc_date) +time_t TimeZone::CalcLocalOffset(const pt::Date & utc_date) { time_t dst_offset = 0; @@ -151,22 +151,22 @@ return offset + dst_offset; time_t TimeZone::ToLocal(time_t utc_time) { - time_t offset = CalcLocalOffset(PT::Date(utc_time)); + time_t offset = CalcLocalOffset(pt::Date(utc_time)); return utc_time + offset; } -PT::Date TimeZone::ToLocal(const PT::Date & utc_date) +pt::Date TimeZone::ToLocal(const pt::Date & utc_date) { - PT::Date local(utc_date); + pt::Date local(utc_date); local += CalcLocalOffset(utc_date); return local; } -time_t TimeZone::CalcUTCOffset(const PT::Date & local_date) +time_t TimeZone::CalcUTCOffset(const pt::Date & local_date) { time_t dst_offset = 0; @@ -175,7 +175,7 @@ time_t dst_offset = 0; if( dst && dst->has_dst ) { // dst date ranges we have in UTC - PT::Date utc(local_date); + pt::Date utc(local_date); utc -= (offset + dst->offset); if( dst->IsDstUsed(utc) ) @@ -189,17 +189,17 @@ return offset + dst_offset; time_t TimeZone::ToUTC(time_t local_time) { - time_t offset = CalcUTCOffset(PT::Date(local_time)); + time_t offset = CalcUTCOffset(pt::Date(local_time)); return local_time - offset; } -PT::Date TimeZone::ToUTC(const PT::Date & local_date) +pt::Date TimeZone::ToUTC(const pt::Date & local_date) { time_t offset; -PT::Date utc(local_date); +pt::Date utc(local_date); offset = CalcUTCOffset(local_date); utc -= offset; @@ -211,7 +211,7 @@ return utc; time_t TimeZone::ParseStrOffset(const wchar_t * str) { -PT::Date date; +pt::Date date; bool is_sign = false; time_t offset = 0; @@ -240,7 +240,7 @@ return offset; } -time_t TimeZone::GetOffset(PT::Space & space) +time_t TimeZone::GetOffset(pt::Space & space) { std::wstring * offset_str = space.get_wstr(L"offset_str"); @@ -251,7 +251,7 @@ time_t TimeZone::GetOffset(PT::Space & space) } -bool TimeZone::SetTzDst(PT::Space & year) +bool TimeZone::SetTzDst(pt::Space & year) { time_t h24 = 60 * 60 * 24; // 24 hours bool result = true; @@ -291,7 +291,7 @@ return result; } -bool TimeZone::SetTz(PT::Space & space) +bool TimeZone::SetTz(pt::Space & space) { bool result = true; name.clear(); @@ -306,13 +306,13 @@ bool TimeZone::SetTz(PT::Space & space) if( offset < -h24 || offset > h24 ) result = false; - PT::Space * dst = space.find_child_space(L"dst"); + pt::Space * dst = space.find_child_space(L"dst"); if( dst && dst->child_spaces ) { for(size_t i=0 ; ichild_spaces->size() ; ++i) { - PT::Space & year = *(*dst->child_spaces)[i]; + pt::Space & year = *(*dst->child_spaces)[i]; if( !SetTzDst(year) ) { diff --git a/winixd/core/timezone.h b/winixd/core/timezone.h index 03312c8..21a7b29 100644 --- a/winixd/core/timezone.h +++ b/winixd/core/timezone.h @@ -61,7 +61,7 @@ public: // time zone daylight saving time (used if has_dst is true) // the 'year' field is the same in 'start' and 'end' // start and end are represented in UTC time - PT::Date start, end; + pt::Date start, end; // time zone daylight saving time offset // used when has_dst is true and the date is whithin start and end @@ -74,7 +74,7 @@ public: // checking whether specified 'date' is in the range of // the year field in date, start and end is ignored // has_dst must be true - bool IsDstUsed(const PT::Date & date) const; + bool IsDstUsed(const pt::Date & date) const; private: @@ -83,7 +83,7 @@ public: // return value less than zero if date1 is lower than date2 // and a value greater than zero if date1 is greater than date2 // the year field is ignored - int Compare(const PT::Date & date1, const PT::Date & date2) const; + int Compare(const pt::Date & date1, const pt::Date & date2) const; }; @@ -106,23 +106,23 @@ public: "tz_dst_end" the same as above "tz_dst_offset" (long) */ - bool SetTz(PT::Space & space); + bool SetTz(pt::Space & space); /* converting from UTC to local time */ - time_t CalcLocalOffset(const PT::Date & utc_date); + time_t CalcLocalOffset(const pt::Date & utc_date); time_t ToLocal(time_t utc_time); - PT::Date ToLocal(const PT::Date & utc_date); + pt::Date ToLocal(const pt::Date & utc_date); /* converting from local time to UTC */ - time_t CalcUTCOffset(const PT::Date & local_date); + time_t CalcUTCOffset(const pt::Date & local_date); time_t ToUTC(time_t local_time); - PT::Date ToUTC(const PT::Date & local_date); + pt::Date ToUTC(const pt::Date & local_date); // return a Dst structure for the specified year // or null if it not exists @@ -155,8 +155,8 @@ public: private: time_t ParseStrOffset(const wchar_t * str); - time_t GetOffset(PT::Space & space); - bool SetTzDst(PT::Space & year); + time_t GetOffset(pt::Space & space); + bool SetTzDst(pt::Space & year); }; diff --git a/winixd/core/timezones.cpp b/winixd/core/timezones.cpp index 251f088..ec69e3b 100644 --- a/winixd/core/timezones.cpp +++ b/winixd/core/timezones.cpp @@ -127,7 +127,7 @@ void TimeZones::ParseZones() { for(size_t i=0 ; isize() ; ++i) { - PT::Space & zone = *((*temp_space.child_spaces)[i]); + pt::Space & zone = *((*temp_space.child_spaces)[i]); temp_zone.Clear(); if( temp_zone.SetTz(zone) ) @@ -171,27 +171,27 @@ bool TimeZones::ReadTimeZones(const wchar_t * path) zone_tab.clear(); temp_space.clear(); - PT::SpaceParser::Status status = parser.ParseSpaceFile(path); + pt::SpaceParser::Status status = parser.ParseSpaceFile(path); - if( status == PT::SpaceParser::ok ) + if( status == pt::SpaceParser::ok ) { ParseZones(); log << log2 << "Tz: time zones loaded, there are " << zone_tab.size() << " zones" << logend; } else - if( status == PT::SpaceParser::syntax_error ) + if( status == pt::SpaceParser::syntax_error ) { log << log1 << "TZ: error in time zone file, line: " << parser.get_last_parsed_line() << logend; } else - if( status == PT::SpaceParser::cant_open_file ) + if( status == pt::SpaceParser::cant_open_file ) { log << log1 << "TZ: I cannot open the time zone file: " << path << logend; } temp_space.clear(); -return status == PT::SpaceParser::ok; +return status == pt::SpaceParser::ok; } diff --git a/winixd/core/timezones.h b/winixd/core/timezones.h index afa96c0..84a6dc5 100644 --- a/winixd/core/timezones.h +++ b/winixd/core/timezones.h @@ -98,8 +98,8 @@ private: // everywhere we use zone_index we refer to this table std::vector zone_tab; - PT::SpaceParser parser; - PT::Space temp_space; + pt::SpaceParser parser; + pt::Space temp_space; TimeZone temp_zone; void ParseZones(); diff --git a/winixd/core/winixbase.cpp b/winixd/core/winixbase.cpp index 364532c..d8956b1 100644 --- a/winixd/core/winixbase.cpp +++ b/winixd/core/winixbase.cpp @@ -63,7 +63,7 @@ void WinixBase::set_synchro(Synchro * synchro) } -void WinixBase::set_log_buffer(PT::WTextStream * log_buffer) +void WinixBase::set_log_buffer(pt::WTextStream * log_buffer) { log.SetLogBuffer(log_buffer); } diff --git a/winixd/core/winixbase.h b/winixd/core/winixbase.h index 2716df0..9eed0b8 100644 --- a/winixd/core/winixbase.h +++ b/winixd/core/winixbase.h @@ -58,7 +58,7 @@ public: void set_config(Config * config); void set_synchro(Synchro * synchro); - void set_log_buffer(PT::WTextStream * log_buffer); + void set_log_buffer(pt::WTextStream * log_buffer); void set_file_log(FileLog * file_log); Log * get_logger(); diff --git a/winixd/db/dbbase.cpp b/winixd/db/dbbase.cpp index 71fbaef..9c80419 100644 --- a/winixd/db/dbbase.cpp +++ b/winixd/db/dbbase.cpp @@ -187,7 +187,7 @@ const std::wstring & DbBase::AssertValueWide(PGresult * r, int row, int col) const char * res = AssertValue(r, row, col); static std::wstring temp_wide_value; // !! IMPROVE ME add as a class field (nonstatic) - PT::UTF8ToWide(res, temp_wide_value); + pt::UTF8ToWide(res, temp_wide_value); return temp_wide_value; } @@ -211,7 +211,7 @@ void DbBase::AssertValueBin(PGresult * r, int row, int col, std::string & result void DbBase::AssertValueWide(PGresult * r, int row, int col, std::wstring & result) { const char * res = AssertValue(r, row, col); - PT::UTF8ToWide(res, result); + pt::UTF8ToWide(res, result); } @@ -247,28 +247,28 @@ unsigned int DbBase::AssertValueUInt(PGresult * r, int row, int col) -PT::Date DbBase::AssertValueDate(PGresult * r, int row, int col) +pt::Date DbBase::AssertValueDate(PGresult * r, int row, int col) { - PT::Date date = AssertValue(r, row, col); + pt::Date date = AssertValue(r, row, col); return date; } -bool DbBase::AssertValueSpace(PGresult * r, int row, int col, PT::Space & space) +bool DbBase::AssertValueSpace(PGresult * r, int row, int col, pt::Space & space) { const char * res = AssertValue(r, row, col); conf_parser.SetSpace(space); space.clear(); - PT::SpaceParser::Status status = conf_parser.ParseSpace(res); + pt::SpaceParser::Status status = conf_parser.ParseSpace(res); - if( status != PT::SpaceParser::ok ) + if( status != pt::SpaceParser::ok ) { log << log1 << "Db: a problem with parsing a PT::Space"; - if( status == PT::SpaceParser::syntax_error ) + if( status == pt::SpaceParser::syntax_error ) log << ", syntax error at line: " << conf_parser.get_last_parsed_line(); log << logend; diff --git a/winixd/db/dbbase.h b/winixd/db/dbbase.h index 6c8b1b1..1ce60ae 100644 --- a/winixd/db/dbbase.h +++ b/winixd/db/dbbase.h @@ -80,9 +80,9 @@ public: bool AssertValueBool(PGresult * r, int row, int col); unsigned long AssertValueULong(PGresult * r, int row, int col); unsigned int AssertValueUInt(PGresult * r, int row, int col); - PT::Date AssertValueDate(PGresult * r, int row, int col); + pt::Date AssertValueDate(PGresult * r, int row, int col); - bool AssertValueSpace(PGresult * r, int row, int col, PT::Space & space); + bool AssertValueSpace(PGresult * r, int row, int col, pt::Space & space); void ClearResult(PGresult * r); long AssertCurrval(const char * table); @@ -129,7 +129,7 @@ private: char UnescapeBinHexToDigit(char hex); DbTextStream bquery; - PT::SpaceParser conf_parser; + pt::SpaceParser conf_parser; }; diff --git a/winixd/db/dbtextstream.cpp b/winixd/db/dbtextstream.cpp index 79a9815..959de1a 100644 --- a/winixd/db/dbtextstream.cpp +++ b/winixd/db/dbtextstream.cpp @@ -225,11 +225,11 @@ return *this; -DbTextStream & DbTextStream::operator<<(RawText date) +DbTextStream & DbTextStream::operator<<(RawText date) { tmp_stream.Clear(); date.par.Serialize(tmp_stream); - PT::WideToUTF8(tmp_stream.CStr(), buffer, false); + pt::WideToUTF8(tmp_stream.CStr(), buffer, false); tmp_stream.Clear(); was_param = false; @@ -290,7 +290,7 @@ DbTextStream & DbTextStream::ETextPutChar(wchar_t c) buffer += "\\\'"; // don't use "''" because we use the method for PQconnectdb too else if( c != 0 ) - PT::IntToUTF8(int(c), buffer, false); + pt::IntToUTF8(int(c), buffer, false); return *this; } @@ -584,7 +584,7 @@ return *this; -DbTextStream & DbTextStream::operator<<(const PT::Space & space) +DbTextStream & DbTextStream::operator<<(const pt::Space & space) { tmp_stream.Clear(); // !! IMPROVE ME @@ -597,7 +597,7 @@ return *this; } -DbTextStream & DbTextStream::operator<<(const PT::Date & date) +DbTextStream & DbTextStream::operator<<(const pt::Date & date) { tmp_stream.Clear(); date.Serialize(tmp_stream); diff --git a/winixd/db/dbtextstream.h b/winixd/db/dbtextstream.h index 5c99721..b72f9d5 100644 --- a/winixd/db/dbtextstream.h +++ b/winixd/db/dbtextstream.h @@ -143,10 +143,10 @@ public: DbTextStream & operator<<(RawText raw); DbTextStream & operator<<(RawText raw); DbTextStream & operator<<(RawText raw); - DbTextStream & operator<<(RawText date); + DbTextStream & operator<<(RawText date); template - DbTextStream & operator<<(RawText > raw); + DbTextStream & operator<<(RawText > raw); /* with escaping @@ -183,11 +183,11 @@ public: DbTextStream & operator<<(double); DbTextStream & operator<<(const void *); DbTextStream & operator<<(const std::vector & tabid); - DbTextStream & operator<<(const PT::Space & space); - DbTextStream & operator<<(const PT::Date & date); + DbTextStream & operator<<(const pt::Space & space); + DbTextStream & operator<<(const pt::Date & date); template - DbTextStream & operator<<(const PT::TextStreamBase & arg); + DbTextStream & operator<<(const pt::TextStreamBase & arg); private: @@ -202,7 +202,7 @@ private: template -DbTextStream & DbTextStream::operator<<(RawText > raw) +DbTextStream & DbTextStream::operator<<(RawText > raw) { TextStream::operator<<(raw.par); @@ -212,9 +212,9 @@ return *this; template -DbTextStream & DbTextStream::operator<<(const PT::TextStreamBase & arg) +DbTextStream & DbTextStream::operator<<(const pt::TextStreamBase & arg) { -typename PT::TextStreamBase::const_iterator i; +typename pt::TextStreamBase::const_iterator i; if( was_param ) buffer += ", "; diff --git a/winixd/functions/env.cpp b/winixd/functions/env.cpp index d06bf9f..2f60e82 100644 --- a/winixd/functions/env.cpp +++ b/winixd/functions/env.cpp @@ -73,7 +73,7 @@ bool Env::Parse(const std::wstring & env_str) space.clear(); conf_parser.SetSpace(space); - return (conf_parser.ParseSpace(env_str) == PT::SpaceParser::ok); + return (conf_parser.ParseSpace(env_str) == pt::SpaceParser::ok); } diff --git a/winixd/functions/env.h b/winixd/functions/env.h index 91fa060..5ce3a0f 100644 --- a/winixd/functions/env.h +++ b/winixd/functions/env.h @@ -58,8 +58,8 @@ public: private: - PT::SpaceParser conf_parser; - PT::Space space; + pt::SpaceParser conf_parser; + pt::Space space; User * puser; bool EditAdminEnv(const std::wstring & env_str, bool use_ses_log = false); diff --git a/winixd/functions/functionparser.cpp b/winixd/functions/functionparser.cpp index 2ba3c0e..e157961 100644 --- a/winixd/functions/functionparser.cpp +++ b/winixd/functions/functionparser.cpp @@ -296,7 +296,7 @@ void FunctionParser::ParseAnchor() while( *path ) name_ascii += GetChar(); - PT::UTF8ToWide(name_ascii, cur->request->anchor); + pt::UTF8ToWide(name_ascii, cur->request->anchor); if( !cur->request->anchor.empty() ) log << log3 << "FP: anchor: " << cur->request->anchor << logend; @@ -368,7 +368,7 @@ void FunctionParser::ReadName() while( *path && *path!='/' && *path!='?' && *path!='#' ) name_ascii += GetChar(); - PT::UTF8ToWide(name_ascii, name); + pt::UTF8ToWide(name_ascii, name); } @@ -379,7 +379,7 @@ void FunctionParser::ReadOrdinaryParName() while( *path && *path!='=' && *path!='&' && *path!='#' ) name_ascii += GetChar(); - PT::UTF8ToWide(name_ascii, name); + pt::UTF8ToWide(name_ascii, name); } @@ -393,7 +393,7 @@ void FunctionParser::ReadOrdinaryParValue() while( *path && *path!='&' && *path!='#' ) value_ascii += GetChar(); - PT::UTF8ToWide(value_ascii, value); + pt::UTF8ToWide(value_ascii, value); } @@ -404,7 +404,7 @@ void FunctionParser::ReadWinixParName() while( *path && *path!='/' && *path!=':' && *path!='#' ) name_ascii += GetChar(); - PT::UTF8ToWide(name_ascii, name); + pt::UTF8ToWide(name_ascii, name); } @@ -418,7 +418,7 @@ void FunctionParser::ReadWinixParValue() while( *path && *path!='/' && *path!='#' ) value_ascii += GetChar(); - PT::UTF8ToWide(value_ascii, value); + pt::UTF8ToWide(value_ascii, value); } diff --git a/winixd/functions/login.cpp b/winixd/functions/login.cpp index 85dcfdf..acffdcf 100644 --- a/winixd/functions/login.cpp +++ b/winixd/functions/login.cpp @@ -69,7 +69,7 @@ bool Login::CheckPasswords(User & user, const std::wstring & password) { if( system->crypt.RSA(false, config->pass_rsa_private_key, user.pass_encrypted, pass_decrypted) ) { - PT::UTF8ToWide(pass_decrypted, user.password); + pt::UTF8ToWide(pass_decrypted, user.password); } else { @@ -173,7 +173,7 @@ void Login::CheckBan() if( ip_ban->expires < expires ) ip_ban->expires = expires; - PT::Date date(ip_ban->expires); + pt::Date date(ip_ban->expires); log << log2 << "Login: logging from this IP address has been blocked until to: " << date << " UTC" << logend; } else diff --git a/winixd/functions/meta.cpp b/winixd/functions/meta.cpp index 051fa37..2dc52f5 100644 --- a/winixd/functions/meta.cpp +++ b/winixd/functions/meta.cpp @@ -65,7 +65,7 @@ bool Meta::Parse(const std::wstring & meta_str) space.clear(); conf_parser.SetSpace(space); -return (conf_parser.ParseSpace(meta_str) == PT::SpaceParser::ok); +return (conf_parser.ParseSpace(meta_str) == pt::SpaceParser::ok); } diff --git a/winixd/functions/meta.h b/winixd/functions/meta.h index 67870fd..17c70be 100644 --- a/winixd/functions/meta.h +++ b/winixd/functions/meta.h @@ -60,8 +60,8 @@ public: private: - PT::SpaceParser conf_parser; - PT::Space space; + pt::SpaceParser conf_parser; + pt::Space space; bool Parse(const std::wstring & meta_str); void ChangeAdminMeta(); diff --git a/winixd/functions/rm.cpp b/winixd/functions/rm.cpp index 9609ebc..188e2df 100644 --- a/winixd/functions/rm.cpp +++ b/winixd/functions/rm.cpp @@ -524,7 +524,7 @@ void Rm::Clear() void Rm::CreateJSON(bool status) { using TemplatesFunctions::R; -PT::WTextStream buf; +pt::WTextStream buf; JSONescape(buf, cur->request->item.url); diff --git a/winixd/functions/sort.cpp b/winixd/functions/sort.cpp index 2f8a086..a7bf9f0 100644 --- a/winixd/functions/sort.cpp +++ b/winixd/functions/sort.cpp @@ -119,7 +119,7 @@ SortPair sp; for( ; i2 != cur->request->post_tab.end() ; ++i2 ) { - if( PT::is_substr_nc(L"sort", i2->first.c_str()) ) + if( pt::is_substr_nc(L"sort", i2->first.c_str()) ) { sp.id = Tol(i2->first.c_str() + 4); sp.sort_index = Toi(i2->second); diff --git a/winixd/functions/upload.cpp b/winixd/functions/upload.cpp index 8a68672..6d0f6a4 100644 --- a/winixd/functions/upload.cpp +++ b/winixd/functions/upload.cpp @@ -306,11 +306,11 @@ void Upload::MakePost() void Upload::CreateAnswer() { Request & req = *cur->request; - PT::Space & files = req.info.add_empty_space(L"files"); + pt::Space & files = req.info.add_empty_space(L"files"); for(size_t i=0 ; i 1 ) { postfix = L"_("; - PT::Toa(index, postfix, false); + pt::Toa(index, postfix, false); postfix += L")"; } @@ -291,14 +291,14 @@ bool Item::do_migration_to_2() eq(L"content_id", -1). get_list(); - PT::Log * log = model_connector->get_logger(); + pt::Log * log = model_connector->get_logger(); for(Item & item : list) { if( log ) { (*log) << "Item: adding a content row corresponding to item id: " << item.id << ", type: " << (int)item.type << ", url: " << item.url - << ", subject: " << item.subject << PT::Log::logend; + << ", subject: " << item.subject << pt::Log::logend; } item.item_content.set_save_mode(morm::Model::DO_INSERT_ON_SAVE); diff --git a/winixd/models/itemcontent.h b/winixd/models/itemcontent.h index 6ceec19..15ac948 100644 --- a/winixd/models/itemcontent.h +++ b/winixd/models/itemcontent.h @@ -113,12 +113,12 @@ public: /* * when the object was created */ - PT::Date date_creation; + pt::Date date_creation; /* * when the object was last modified */ - PT::Date date_modification; + pt::Date date_modification; @@ -201,13 +201,13 @@ public: * meta information * additional information in the form af a Space struct */ - PT::Space meta; + pt::Space meta; /* * admin meta information * additional information available to edit only by an admin */ - PT::Space meta_admin; + pt::Space meta_admin; ItemContent(); diff --git a/winixd/models/migration.cpp b/winixd/models/migration.cpp index b3b8cd1..82f4449 100644 --- a/winixd/models/migration.cpp +++ b/winixd/models/migration.cpp @@ -78,19 +78,19 @@ bool Migration::do_migration(morm::ModelConnector * model_connector, morm::Model migration.table_version = current_table_version; migration_status = migration.save(); - PT::Log * log = model_connector->get_logger(); + pt::Log * log = model_connector->get_logger(); if( log ) { - (*log) << PT::Log::log2 << "Migration: table " << table_name << " has been migrated to version " << current_table_version << PT::Log::logend; + (*log) << pt::Log::log2 << "Migration: table " << table_name << " has been migrated to version " << current_table_version << pt::Log::logend; } if( !migration_status && log ) { - (*log) << PT::Log::log1 << "Migration: table " << table_name << " has been migrated to version " << current_table_version; - (*log) << " but there was a problem with saving this information in the migration table." << PT::Log::logend; - (*log) << "Make sure the migration table is created and save/update following record there:" << PT::Log::logend; - (*log) << migration << PT::Log::logend; + (*log) << pt::Log::log1 << "Migration: table " << table_name << " has been migrated to version " << current_table_version; + (*log) << " but there was a problem with saving this information in the migration table." << pt::Log::logend; + (*log) << "Make sure the migration table is created and save/update following record there:" << pt::Log::logend; + (*log) << migration << pt::Log::logend; } } diff --git a/winixd/models/migration.h b/winixd/models/migration.h index 817a769..d3bcc74 100644 --- a/winixd/models/migration.h +++ b/winixd/models/migration.h @@ -52,7 +52,7 @@ public: long id; std::wstring table_name; int table_version; - PT::Date migration_date; + pt::Date migration_date; void fields() diff --git a/winixd/models/user.h b/winixd/models/user.h index ac2c546..4540111 100644 --- a/winixd/models/user.h +++ b/winixd/models/user.h @@ -107,12 +107,12 @@ public: // environment variables which can be set by this user // use 'env' winix function - PT::Space env; + pt::Space env; // environment variables set only by an administrator // an administrator can use 'env' winix function with 'a' parameter // IMPROVEME rename me to something better (env_admin?) - PT::Space aenv; + pt::Space aenv; // account status // WINIX_ACCOUNT_* @@ -138,7 +138,7 @@ public: void Clear(); // IMPROVEME what about clear() from Model? bool IsMemberOf(long group); - bool ReadMonthDayTime(PT::Date & date, const wchar_t * str); + bool ReadMonthDayTime(pt::Date & date, const wchar_t * str); bool SetTzFromEnv(); void clear_passwords(); diff --git a/winixd/notify/notifythread.cpp b/winixd/notify/notifythread.cpp index dc16728..01e8b04 100644 --- a/winixd/notify/notifythread.cpp +++ b/winixd/notify/notifythread.cpp @@ -258,7 +258,7 @@ void NotifyThread::SendMail() // second thread void NotifyThread::SendMail(const std::wstring & email, const std::wstring & message) { - log << log1 << PT::Date(std::time(0)) << ' '; + log << log1 << pt::Date(std::time(0)) << ' '; if( !ValidateEmail(email) ) { @@ -267,7 +267,7 @@ void NotifyThread::SendMail(const std::wstring & email, const std::wstring & mes } sendmail_command = "sendmail "; - PT::WideToUTF8(email, sendmail_command, false); + pt::WideToUTF8(email, sendmail_command, false); FILE * sendmail = popen(sendmail_command.c_str(), "w"); if( !sendmail ) @@ -297,7 +297,7 @@ size_t len; } else { - len = PT::IntToUTF8(int(message[i]), buf, sizeof(buf) / sizeof(char)); + len = pt::IntToUTF8(int(message[i]), buf, sizeof(buf) / sizeof(char)); for(size_t a=0 ; acrypt.RSA(false, rsa_key, exp.ftp_pass_bin, pass_decrypted) ) { - PT::UTF8ToWide(pass_decrypted, exp.ftp_pass); + pt::UTF8ToWide(pass_decrypted, exp.ftp_pass); system->crypt.ClearString(pass_decrypted); } else @@ -143,7 +143,7 @@ bool ExportInfo::SkipDir(long dir_id, std::wstring & dir) { if( system->dirs.MakePath(dir_id, tmp_dir) ) { - if( !tmp_dir.empty() && PT::is_substr(tmp_dir, dir) ) + if( !tmp_dir.empty() && pt::is_substr(tmp_dir, dir) ) { // tmp_dir has a slash at the end // we want the slash at the beginning @@ -334,7 +334,7 @@ void ExportInfo::AdditionalExport(const Item & item) { for(size_t i=0 ; isize() ; ++i) { - PT::Space & child = *(*item.item_content.meta.child_spaces)[i]; + pt::Space & child = *(*item.item_content.meta.child_spaces)[i]; if( child.name && *child.name == L"export" ) AdditionalExport(item, child); @@ -343,7 +343,7 @@ void ExportInfo::AdditionalExport(const Item & item) } -void ExportInfo::AdditionalExport(const Item & item, PT::Space & meta) +void ExportInfo::AdditionalExport(const Item & item, pt::Space & meta) { meta.to_list(L"additional_export", additional_export); diff --git a/winixd/plugins/export/exportinfo.h b/winixd/plugins/export/exportinfo.h index 676fc36..1cc240f 100644 --- a/winixd/plugins/export/exportinfo.h +++ b/winixd/plugins/export/exportinfo.h @@ -103,7 +103,7 @@ private: bool SkipDir(long dir_id, std::wstring & dir); void AdditionalExport(const Item & item); - void AdditionalExport(const Item & item, PT::Space & meta); + void AdditionalExport(const Item & item, pt::Space & meta); void AdditionalExport(const std::wstring & path); bool HasRecurrenceId(long id); diff --git a/winixd/plugins/export/exportthread.cpp b/winixd/plugins/export/exportthread.cpp index 9ff1bf2..3cb9b15 100644 --- a/winixd/plugins/export/exportthread.cpp +++ b/winixd/plugins/export/exportthread.cpp @@ -262,7 +262,7 @@ return len; void ExportThread::Convert(const std::wstring & in, std::string & out, bool clear) { Lock(); - PT::WideToUTF8(in, out, clear); + pt::WideToUTF8(in, out, clear); Unlock(); } @@ -393,13 +393,13 @@ bool ExportThread::HasThumbInAdress(std::string & buf, size_t i) for( ; i GroupsWrap; GroupsWrap groups_wrap; - PT::SpaceParser conf_parser; + pt::SpaceParser conf_parser; std::vector config_dir_tab; Item config_file; diff --git a/winixd/plugins/group/groups.cpp b/winixd/plugins/group/groups.cpp index a4f690f..92139fe 100644 --- a/winixd/plugins/group/groups.cpp +++ b/winixd/plugins/group/groups.cpp @@ -46,7 +46,7 @@ namespace GroupItem -PT::Space * Groups::GetSpace() +pt::Space * Groups::GetSpace() { return &space; } @@ -63,7 +63,7 @@ void Groups::Reindex() { while( seti < space.child_spaces->size() ) { - PT::Space & sp = *(*space.child_spaces)[seti]; + pt::Space & sp = *(*space.child_spaces)[seti]; if( sp.name ) { @@ -85,7 +85,7 @@ void Groups::Reindex() } -void Groups::ReindexGroups(GroupIndex & group_index, PT::Space & set) +void Groups::ReindexGroups(GroupIndex & group_index, pt::Space & set) { size_t i, v; @@ -94,7 +94,7 @@ size_t i, v; // loop through all groups in the set for( i=0 ; i < set.child_spaces->size() ; ++i ) { - PT::Space & group = *(*set.child_spaces)[i]; + pt::Space & group = *(*set.child_spaces)[i]; // !! IMPROVE ME will be safer to copy the value out // if we used accidently the group.Text later the key // would be overwritten @@ -141,7 +141,7 @@ size_t i, v; } -void Groups::SortValues(PT::Space & group) +void Groups::SortValues(pt::Space & group) { sort_by = group.to_wstr(L"sort_by"); sort_asc = group.is_equal(L"sort_asc", L"true"); @@ -154,7 +154,7 @@ void Groups::SortValues(PT::Space & group) } -bool Groups::SortFunHelper::operator()(PT::Space * sp1, PT::Space * sp2) +bool Groups::SortFunHelper::operator()(pt::Space * sp1, pt::Space * sp2) { const std::wstring * val1 = sp1->get_wstr(groups->sort_by.c_str()); const std::wstring * val2 = sp2->get_wstr(groups->sort_by.c_str()); @@ -208,11 +208,11 @@ const std::wstring & Groups::GetOption(size_t seti, size_t groupi, size_t valuei { if( space.child_spaces && seti < space.child_spaces->size() ) { - PT::Space & groups = *(*space.child_spaces)[seti]; + pt::Space & groups = *(*space.child_spaces)[seti]; if( groups.child_spaces && groupi < groups.child_spaces->size() ) { - PT::Space & value = *(*groups.child_spaces)[groupi]; + pt::Space & value = *(*groups.child_spaces)[groupi]; if( value.child_spaces && valuei < value.child_spaces->size() ) { @@ -239,7 +239,7 @@ size_t Groups::Size(size_t seti, size_t groupi) { if( space.child_spaces && seti < space.child_spaces->size() ) { - PT::Space & groups = *(*space.child_spaces)[seti]; + pt::Space & groups = *(*space.child_spaces)[seti]; if( groups.child_spaces && groupi < groups.child_spaces->size() ) return (*groups.child_spaces)[groupi]->child_spaces->size(); diff --git a/winixd/plugins/group/groups.h b/winixd/plugins/group/groups.h index 6a53d65..0bebb93 100644 --- a/winixd/plugins/group/groups.h +++ b/winixd/plugins/group/groups.h @@ -57,7 +57,7 @@ public: reading all space (sets and groups) */ - PT::Space * GetSpace(); + pt::Space * GetSpace(); /* @@ -110,7 +110,7 @@ private: # sets should have a unique name # groups don't have a name */ - PT::Space space; + pt::Space space; /* @@ -143,13 +143,13 @@ private: Groups * groups; SortFunHelper(Groups * pgroups) : groups(pgroups) {}; size_t SortValue(const std::wstring & val); - bool operator()(PT::Space * sp1, PT::Space * sp2); + bool operator()(pt::Space * sp1, pt::Space * sp2); }; - void ReindexGroups(GroupIndex & group_index, PT::Space & set); - void SortValues(PT::Space & group); + void ReindexGroups(GroupIndex & group_index, pt::Space & set); + void SortValues(pt::Space & group); }; diff --git a/winixd/plugins/mailregister/init.cpp b/winixd/plugins/mailregister/init.cpp index 993f840..f76cd4b 100644 --- a/winixd/plugins/mailregister/init.cpp +++ b/winixd/plugins/mailregister/init.cpp @@ -73,18 +73,18 @@ void AddWinixFunctions(PluginInfo & info) // create a class from these methods void ReloadConfigFile(PluginInfo & info, Item & file) { - PT::Space space; - PT::SpaceParser parser; + pt::Space space; + pt::SpaceParser parser; parser.SetSpace(space); - PT::SpaceParser::Status status = parser.ParseSpace(file.item_content.content_raw); + pt::SpaceParser::Status status = parser.ParseSpace(file.item_content.content_raw); - if( status == PT::SpaceParser::syntax_error ) + if( status == pt::SpaceParser::syntax_error ) { info.log << log1 << "MR: syntax error in file: " << file.url << ", line: " << parser.get_last_parsed_line() << " (skipping this file)" << logend; } else - if( status == PT::SpaceParser::ok ) + if( status == pt::SpaceParser::ok ) { std::wstring * list_id_str = space.get_wstr(L"list_id"); diff --git a/winixd/plugins/menu/cache.h b/winixd/plugins/menu/cache.h index e157e6c..ee0ccc4 100644 --- a/winixd/plugins/menu/cache.h +++ b/winixd/plugins/menu/cache.h @@ -55,7 +55,7 @@ struct MenuItem long id; // item id std::wstring url; std::wstring subject; - PT::Space meta; + pt::Space meta; Item::Type type; int file_type; }; diff --git a/winixd/plugins/seo/seo.cpp b/winixd/plugins/seo/seo.cpp index 324bea2..9da1eba 100644 --- a/winixd/plugins/seo/seo.cpp +++ b/winixd/plugins/seo/seo.cpp @@ -77,7 +77,7 @@ void Seo::MakePost() item.subject = subject; - PT::Space & seo = item.item_content.meta.find_add_child_space(L"seo"); + pt::Space & seo = item.item_content.meta.find_add_child_space(L"seo"); seo.add(L"description", description); seo.add(L"keywords", keywords); diff --git a/winixd/plugins/stats/stats.cpp b/winixd/plugins/stats/stats.cpp index 8597565..346fc3e 100644 --- a/winixd/plugins/stats/stats.cpp +++ b/winixd/plugins/stats/stats.cpp @@ -96,7 +96,7 @@ void Stats::ReadStats() if( stats_file.empty() ) return; - PT::WideToUTF8(stats_file, astats_file); + pt::WideToUTF8(stats_file, astats_file); std::ifstream file(astats_file.c_str()); if( !file ) @@ -147,7 +147,7 @@ void Stats::SaveStats() if( stats_file.empty() ) return; - PT::WideToUTF8(stats_file, astats_file); + pt::WideToUTF8(stats_file, astats_file); std::ofstream file(astats_file.c_str()); if( !file ) diff --git a/winixd/plugins/thread/reply.cpp b/winixd/plugins/thread/reply.cpp index 432ac6e..18ff470 100644 --- a/winixd/plugins/thread/reply.cpp +++ b/winixd/plugins/thread/reply.cpp @@ -80,7 +80,7 @@ bool Reply::HasAccess() return false; - PT::Space * thread_space = cur->request->item.item_content.meta_admin.find_child_space(L"thread"); + pt::Space * thread_space = cur->request->item.item_content.meta_admin.find_child_space(L"thread"); if( thread_space ) { diff --git a/winixd/plugins/thread/templates.cpp b/winixd/plugins/thread/templates.cpp index 127168a..1fcba50 100644 --- a/winixd/plugins/thread/templates.cpp +++ b/winixd/plugins/thread/templates.cpp @@ -298,7 +298,7 @@ void thread_sort_tab_date_creation(Info & i) { if( item_sort_index < thread_info.item_sort_tab.size() ) { - PT::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_creation); + pt::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_creation); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } } @@ -308,7 +308,7 @@ void thread_sort_tab_date_modification(Info & i) { if( item_sort_index < thread_info.item_sort_tab.size() ) { - PT::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_modification); + pt::Date date = system->ToLocal(thread_info.item_sort_tab[item_sort_index]->item_content.date_modification); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } } @@ -337,8 +337,8 @@ void thread_sort_tab_dates_equal(Info & i) { if( item_sort_index < thread_info.item_sort_tab.size() ) { - PT::Date & date1 = thread_info.item_sort_tab[item_sort_index]->item_content.date_creation; - PT::Date & date2 = thread_info.item_sort_tab[item_sort_index]->item_content.date_modification; + pt::Date & date1 = thread_info.item_sort_tab[item_sort_index]->item_content.date_creation; + pt::Date & date2 = thread_info.item_sort_tab[item_sort_index]->item_content.date_modification; i.res = date1 == date2; } diff --git a/winixd/plugins/thread/thread.h b/winixd/plugins/thread/thread.h index 26b126f..2cf4ab1 100644 --- a/winixd/plugins/thread/thread.h +++ b/winixd/plugins/thread/thread.h @@ -57,7 +57,7 @@ public: // the last file in a thread long last_item_id; - PT::Date last_item_date_modification; + pt::Date last_item_date_modification; long last_item_user_id; std::wstring last_item_guest_name; diff --git a/winixd/plugins/ticket/createticket.cpp b/winixd/plugins/ticket/createticket.cpp index 3ce925c..9c270a6 100644 --- a/winixd/plugins/ticket/createticket.cpp +++ b/winixd/plugins/ticket/createticket.cpp @@ -164,13 +164,13 @@ return ticket; } -PT::Space & CreateTicket::PrepareSpace() +pt::Space & CreateTicket::PrepareSpace() { SessionData * session_data = reinterpret_cast( cur->session->plugin_data.Get(ticket_info->plugin_id) ); long dir_id = cur->request->dir_tab.back()->id; - PT::Space & new_space = session_data->GetNewSpace(dir_id, session_data->create_space_map); + pt::Space & new_space = session_data->GetNewSpace(dir_id, session_data->create_space_map); return new_space; } @@ -182,7 +182,7 @@ void CreateTicket::MakePost() ticket_info->FindCurrentConf(); Ticket & ticket = PrepareTicket(); - PT::Space & meta = PrepareSpace(); + pt::Space & meta = PrepareSpace(); Item & item = cur->request->item; ticket_info->ticket = &ticket; ticket_info->item = &item; @@ -209,7 +209,7 @@ void CreateTicket::MakeGet() ticket_info->FindCurrentConf(); Ticket & ticket = PrepareTicket(); - PT::Space & meta = PrepareSpace(); + pt::Space & meta = PrepareSpace(); ticket_info->ticket = &ticket; ticket_info->item = &cur->request->item; diff --git a/winixd/plugins/ticket/createticket.h b/winixd/plugins/ticket/createticket.h index b736f3a..c3c2ab3 100644 --- a/winixd/plugins/ticket/createticket.h +++ b/winixd/plugins/ticket/createticket.h @@ -66,7 +66,7 @@ private: void Submit(Ticket & ticket, Item & item); void RemoveTmpTicket(); Ticket & PrepareTicket(); - PT::Space & PrepareSpace(); + pt::Space & PrepareSpace(); TDb * tdb; TicketInfo * ticket_info; diff --git a/winixd/plugins/ticket/editticket.cpp b/winixd/plugins/ticket/editticket.cpp index 3dab104..d28151c 100644 --- a/winixd/plugins/ticket/editticket.cpp +++ b/winixd/plugins/ticket/editticket.cpp @@ -174,23 +174,23 @@ return ticket; -PT::Space & EditTicket::PrepareSpace() +pt::Space & EditTicket::PrepareSpace() { SessionData * session_data = reinterpret_cast( cur->session->plugin_data.Get(ticket_info->plugin_id) ); bool is_new; long file_id = cur->request->item.id; - PT::Space & new_space = session_data->GetNewSpace(file_id, session_data->edit_space_map, &is_new); + pt::Space & new_space = session_data->GetNewSpace(file_id, session_data->edit_space_map, &is_new); if( is_new ) { - PT::Space * ticket_space = cur->request->item.item_content.meta.find_child_space(L"ticket"); + pt::Space * ticket_space = cur->request->item.item_content.meta.find_child_space(L"ticket"); if( ticket_space ) { new_space = *ticket_space; - PT::Space & old_space = session_data->GetOldSpace(file_id, session_data->edit_space_map); + pt::Space & old_space = session_data->GetOldSpace(file_id, session_data->edit_space_map); old_space = new_space; } } @@ -203,10 +203,10 @@ bool EditTicket::CloseTicket() { cur->request->item.propagate_connector(); - PT::Space & ticket_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"ticket"); + pt::Space & ticket_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"ticket"); ticket_space.add(L"closed", true); - PT::Space & thread_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"thread"); + pt::Space & thread_space = cur->request->item.item_content.meta_admin.find_add_child_space(L"thread"); thread_space.add(L"closed", true); //if( db->EditAdminMetaById(cur->request->item.ameta, cur->request->item.id) == WINIX_ERR_OK ) @@ -228,7 +228,7 @@ void EditTicket::MakePost() ticket_info->FindCurrentConf(); Ticket & ticket = PrepareTicket(); - PT::Space & meta = PrepareSpace(); + pt::Space & meta = PrepareSpace(); Item & item = cur->request->item; old_url = item.url; @@ -267,7 +267,7 @@ void EditTicket::MakeGet() ticket_info->FindCurrentConf(); Ticket & ticket = PrepareTicket(); - PT::Space & meta = PrepareSpace(); + pt::Space & meta = PrepareSpace(); ticket_info->ticket = &ticket; ticket_info->item = &cur->request->item; diff --git a/winixd/plugins/ticket/editticket.h b/winixd/plugins/ticket/editticket.h index 36d77ab..448aaa1 100644 --- a/winixd/plugins/ticket/editticket.h +++ b/winixd/plugins/ticket/editticket.h @@ -70,7 +70,7 @@ private: void RemoveTmpTicket(); Ticket & PrepareTicket(); - PT::Space & PrepareSpace(); + pt::Space & PrepareSpace(); void ChangeTicket(Ticket & ticket, Item & item); void Submit(Ticket & ticket, Item & item); bool CloseTicket(); diff --git a/winixd/plugins/ticket/sessiondata.cpp b/winixd/plugins/ticket/sessiondata.cpp index d12438a..2175352 100644 --- a/winixd/plugins/ticket/sessiondata.cpp +++ b/winixd/plugins/ticket/sessiondata.cpp @@ -83,7 +83,7 @@ SpaceMap::iterator i; -void SessionData::RemoveAllFiles(PT::Space & new_space) +void SessionData::RemoveAllFiles(pt::Space & new_space) { std::vector new_file_tab; BuildFileList(new_file_tab, new_space); @@ -94,7 +94,7 @@ void SessionData::RemoveAllFiles(PT::Space & new_space) -void SessionData::RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_space) +void SessionData::RemoveAllStaleFiles(pt::Space & new_space, pt::Space & old_space) { std::vector new_file_tab; std::vector old_file_tab; @@ -140,7 +140,7 @@ void SessionData::RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_spa -void SessionData::BuildFileList(std::vector & file_tab, PT::Space & space) +void SessionData::BuildFileList(std::vector & file_tab, pt::Space & space) { file_tab.clear(); @@ -148,7 +148,7 @@ void SessionData::BuildFileList(std::vector & file_tab, PT::Space & space) { for(size_t i=0 ; isize() ; ++i) { - PT::Space & sp = *(*space.child_spaces)[i]; + pt::Space & sp = *(*space.child_spaces)[i]; if( sp.name && (*sp.name) == L"param" ) CheckFile(file_tab, sp); @@ -157,13 +157,13 @@ void SessionData::BuildFileList(std::vector & file_tab, PT::Space & space) } -void SessionData::CheckFile(std::vector & file_tab, PT::Space & space) +void SessionData::CheckFile(std::vector & file_tab, pt::Space & space) { if( space.child_spaces ) { for(size_t i=0 ; isize() ; ++i) { - PT::Space & subsp = *(*space.child_spaces)[i]; + pt::Space & subsp = *(*space.child_spaces)[i]; if( subsp.name && *subsp.name == L"file" ) { @@ -194,7 +194,7 @@ return res.first->second; -PT::Space & SessionData::GetOldSpace(long id, SpaceMap & space_map, bool * is_new) +pt::Space & SessionData::GetOldSpace(long id, SpaceMap & space_map, bool * is_new) { std::pair res = space_map.insert( std::make_pair(id, SpacePair()) ); @@ -205,7 +205,7 @@ return res.first->second.old_space; } -PT::Space & SessionData::GetNewSpace(long id, SpaceMap & space_map, bool * is_new) +pt::Space & SessionData::GetNewSpace(long id, SpaceMap & space_map, bool * is_new) { std::pair res = space_map.insert( std::make_pair(id, SpacePair()) ); diff --git a/winixd/plugins/ticket/sessiondata.h b/winixd/plugins/ticket/sessiondata.h index ad883b3..ffc97bd 100644 --- a/winixd/plugins/ticket/sessiondata.h +++ b/winixd/plugins/ticket/sessiondata.h @@ -58,8 +58,8 @@ struct SessionData : public PluginDataBase struct SpacePair { - PT::Space new_space; - PT::Space old_space; + pt::Space new_space; + pt::Space old_space; // old_space is used when editing an existing ticket // current ticket space is copied to old_space @@ -95,8 +95,8 @@ struct SessionData : public PluginDataBase Ticket & GetTicket(long id, TicketMap & ticket_map, bool * is_new = 0); // inserting and returning a new/old space or just returning the space if it exists - PT::Space & GetOldSpace(long id, SpaceMap & space_map, bool * is_new = 0); - PT::Space & GetNewSpace(long id, SpaceMap & space_map, bool * is_new = 0); + pt::Space & GetOldSpace(long id, SpaceMap & space_map, bool * is_new = 0); + pt::Space & GetNewSpace(long id, SpaceMap & space_map, bool * is_new = 0); // for deleting files Fun::Rm * fun_rm; @@ -104,11 +104,11 @@ struct SessionData : public PluginDataBase private: void RemoveFiles(SpaceMap & space_map, bool only_stale_files); - void RemoveAllFiles(PT::Space & new_space); - void RemoveAllStaleFiles(PT::Space & new_space, PT::Space & old_space); + void RemoveAllFiles(pt::Space & new_space); + void RemoveAllStaleFiles(pt::Space & new_space, pt::Space & old_space); - void BuildFileList(std::vector & file_tab, PT::Space & space); - void CheckFile(std::vector & file_tab, PT::Space & space); + void BuildFileList(std::vector & file_tab, pt::Space & space); + void CheckFile(std::vector & file_tab, pt::Space & space); }; diff --git a/winixd/plugins/ticket/templates.cpp b/winixd/plugins/ticket/templates.cpp index 94a15cf..c6ac87e 100644 --- a/winixd/plugins/ticket/templates.cpp +++ b/winixd/plugins/ticket/templates.cpp @@ -66,7 +66,7 @@ struct TicketValue { bool is_param; // true if there is a paremeter (in config Space) -PT::Space * config_par; // current space param (from current config) if is_param is true +pt::Space * config_par; // current space param (from current config) if is_param is true // when is_param is true then this pointer is never null long param_id; // param id (the same as config_par->Long(L"id")) @@ -79,7 +79,7 @@ bool is_in_ticket_par; // true if the value is defined in ticket.par_tab // else the value can be defined in meta (or not at all) Ticket::TicketParam * ticket_par; // if is_in_ticket_par is true -PT::Space * value_meta; // if is_in_ticket_par is false and if there is such a value in meta +pt::Space * value_meta; // if is_in_ticket_par is false and if there is such a value in meta TicketValue() @@ -169,7 +169,7 @@ return false; looking for a subspace in meta which has id equal to param_id can return a null pointer */ -PT::Space * find_ticket_param(long param_id, PT::Space & meta) +pt::Space * find_ticket_param(long param_id, pt::Space & meta) { wchar_t param_id_str[50]; @@ -181,7 +181,7 @@ wchar_t param_id_str[50]; for(size_t i=0 ; isize() ; ++i) { - PT::Space & sp = *(*meta.child_spaces)[i]; + pt::Space & sp = *(*meta.child_spaces)[i]; if( sp.name && *sp.name == L"param" && sp.is_equal(L"id", param_id_str) ) return &sp; @@ -211,7 +211,7 @@ return 0; value.ticket_par value.value_meta */ -void find_ticket_value(TicketValue & value, Ticket::ParTab & par_tab, PT::Space & item_meta) +void find_ticket_value(TicketValue & value, Ticket::ParTab & par_tab, pt::Space & item_meta) { size_t par_index; @@ -229,11 +229,11 @@ size_t par_index; } else { - PT::Space * meta = item_meta.find_child_space(L"ticket"); + pt::Space * meta = item_meta.find_child_space(L"ticket"); if( meta ) { - PT::Space * sp = find_ticket_param(value.param_id, *meta); + pt::Space * sp = find_ticket_param(value.param_id, *meta); if( sp ) { @@ -253,7 +253,7 @@ void ticket_print_value_select(Info & i, TicketValue & value) { for(size_t a=0 ; achild_spaces->size() ; ++a) { - PT::Space & sp = *(*value.config_par->child_spaces)[a]; + pt::Space & sp = *(*value.config_par->child_spaces)[a]; if( sp.name && *sp.name == L"option" && sp.to_long(L"id") == value.ticket_par->intv ) { @@ -322,7 +322,7 @@ void ticket_meta_value(Info & i) void ticket_is_closed(Info & i) { - PT::Space * ticket_space = ticket_info.item->item_content.meta_admin.find_child_space(L"ticket"); + pt::Space * ticket_space = ticket_info.item->item_content.meta_admin.find_child_space(L"ticket"); if( ticket_space ) i.res = ticket_space->to_bool(L"closed", false); @@ -337,14 +337,14 @@ void ticket_param_value_for_param_id(Info & i) value_for_param_id.Clear(); size_t conf_index = 0; - PT::Space & space = *ticket_info.cur_conf; + pt::Space & space = *ticket_info.cur_conf; int id = Toi(i.par); if( space.child_spaces ) { for( ; conf_index < space.child_spaces->size() ; ++conf_index) { - PT::Space & sp = *(*space.child_spaces)[conf_index]; + pt::Space & sp = *(*space.child_spaces)[conf_index]; if( sp.name && *sp.name == L"param" && sp.to_int(L"id") == id ) { @@ -372,7 +372,7 @@ void ticket_does_param_id_have_value(Info & i) value_for_param_id.Clear(); size_t conf_index = 0; - PT::Space & space = *ticket_info.cur_conf; + pt::Space & space = *ticket_info.cur_conf; if( i.params.size() == 2 && space.child_spaces ) { @@ -381,7 +381,7 @@ void ticket_does_param_id_have_value(Info & i) for( ; conf_index < space.child_spaces->size() ; ++conf_index) { - PT::Space & sp = *(*space.child_spaces)[conf_index]; + pt::Space & sp = *(*space.child_spaces)[conf_index]; if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == id ) { @@ -559,7 +559,7 @@ void tickets_tab_is_closed(Info & i) if( tickets_value.is_item ) { - PT::Space * ticket_space = tickets_value.item->item_content.meta_admin.find_child_space(L"ticket"); + pt::Space * ticket_space = tickets_value.item->item_content.meta_admin.find_child_space(L"ticket"); if( ticket_space ) i.res = ticket_space->to_bool(L"closed", false); @@ -638,14 +638,14 @@ void tickets_tab_param_value_for_param_id(Info & i) if( tickets_value.is_ticket ) { size_t param_index = 0; - PT::Space & space = *ticket_info.cur_conf; + pt::Space & space = *ticket_info.cur_conf; long id = Tol(i.par); if( space.child_spaces ) { for( ; param_index < space.child_spaces->size() ; ++param_index) { - PT::Space & sp = *(*space.child_spaces)[param_index]; + pt::Space & sp = *(*space.child_spaces)[param_index]; if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == id ) @@ -675,7 +675,7 @@ void tickets_tab_does_param_id_have_value(Info & i) if( tickets_value.is_ticket && i.params.size() == 2 ) { size_t param_index = 0; - PT::Space & space = *ticket_info.cur_conf; + pt::Space & space = *ticket_info.cur_conf; long id = Toi(i.params[0].str); long id2 = Toi(i.params[1].str); @@ -683,7 +683,7 @@ void tickets_tab_does_param_id_have_value(Info & i) { for( ; param_index < space.child_spaces->size() ; ++param_index) { - PT::Space & sp = *(*space.child_spaces)[param_index]; + pt::Space & sp = *(*space.child_spaces)[param_index]; if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == id ) { @@ -723,13 +723,13 @@ void tickets_tab_conf_tab(Info & i) if( tickets_value.is_ticket ) { conf_index = i.iter; - PT::Space & space = *ticket_info.cur_conf; + pt::Space & space = *ticket_info.cur_conf; if( space.child_spaces ) { while( conf_index < space.child_spaces->size() ) { - PT::Space & sp = *(*space.child_spaces)[conf_index]; + pt::Space & sp = *(*space.child_spaces)[conf_index]; if( sp.name && *sp.name == L"param" ) break; @@ -840,13 +840,13 @@ void tickets_tab_conf_tab_file_tab(Info & i) if( i.iter == 0 ) tickets_file_number = 0; - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces ) { while( tickets_file_index < mt.child_spaces->size() ) { - PT::Space & sp = *(*mt.child_spaces)[tickets_file_index]; + pt::Space & sp = *(*mt.child_spaces)[tickets_file_index]; if( sp.name && *sp.name == L"file" ) break; @@ -869,7 +869,7 @@ void tickets_tab_conf_tab_file_tab_index(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() ) i.out << tickets_file_number; @@ -884,7 +884,7 @@ void tickets_tab_conf_tab_file_tab_path(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() ) i.out << (*mt.child_spaces)[tickets_file_index]->to_wstr(L"path"); @@ -898,7 +898,7 @@ void tickets_tab_conf_tab_file_tab_itemid(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() ) i.out << (*mt.child_spaces)[tickets_file_index]->to_wstr(L"itemid"); @@ -912,7 +912,7 @@ void tickets_tab_conf_tab_file_tab_meta(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && tickets_file_index < mt.child_spaces->size() ) space_value(i, *(*mt.child_spaces)[tickets_file_index]); @@ -954,13 +954,13 @@ void ticket_tab(Info & i) value.Clear(); conf_index = i.iter; - PT::Space & space = *ticket_info.cur_conf; + pt::Space & space = *ticket_info.cur_conf; if( space.child_spaces ) { while( conf_index < space.child_spaces->size() ) { - PT::Space & sp = *(*space.child_spaces)[conf_index]; + pt::Space & sp = *(*space.child_spaces)[conf_index]; if( sp.name && *sp.name == L"param" ) break; @@ -1072,13 +1072,13 @@ void ticket_tab_select_tab(Info & i) if( value.is_param ) { select_index = i.iter; - PT::Space & sp = *value.config_par; + pt::Space & sp = *value.config_par; if( sp.child_spaces ) { while( select_index < sp.child_spaces->size() ) { - PT::Space & sp_child = *(*sp.child_spaces)[select_index]; + pt::Space & sp_child = *(*sp.child_spaces)[select_index]; if( sp_child.name && *sp_child.name == L"option" ) break; @@ -1098,11 +1098,11 @@ void ticket_tab_select_tab_is_selected(Info & i) if( value.is_param ) { - PT::Space & sp = *value.config_par; + pt::Space & sp = *value.config_par; if( sp.child_spaces && select_index < sp.child_spaces->size() ) { - PT::Space & sp_child = *(*sp.child_spaces)[select_index]; + pt::Space & sp_child = *(*sp.child_spaces)[select_index]; long id = sp_child.to_long(L"id"); @@ -1126,7 +1126,7 @@ void ticket_tab_select_tab_name(Info & i) if( value.is_param ) { - PT::Space & sp = *value.config_par; + pt::Space & sp = *value.config_par; if( sp.child_spaces && select_index < sp.child_spaces->size() ) i.out << (*sp.child_spaces)[select_index]->to_wstr(L"value"); @@ -1140,7 +1140,7 @@ void ticket_tab_select_tab_id(Info & i) if( value.is_param ) { - PT::Space & sp = *value.config_par; + pt::Space & sp = *value.config_par; if( sp.child_spaces && select_index < sp.child_spaces->size() ) i.out << (*sp.child_spaces)[select_index]->to_wstr(L"id"); @@ -1153,7 +1153,7 @@ void ticket_tab_select_tab_meta(Info & i) if( value.is_param ) { - PT::Space & sp = *value.config_par; + pt::Space & sp = *value.config_par; if( sp.child_spaces && select_index < sp.child_spaces->size() ) space_value(i, *(*sp.child_spaces)[select_index]); @@ -1173,13 +1173,13 @@ void ticket_tab_file_tab(Info & i) if( i.iter == 0 ) ticket_file_number = 0; - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces ) { while( ticket_file_index < mt.child_spaces->size() ) { - PT::Space & sp = *(*mt.child_spaces)[ticket_file_index]; + pt::Space & sp = *(*mt.child_spaces)[ticket_file_index]; if( sp.name && *sp.name == L"file" ) break; @@ -1202,7 +1202,7 @@ void ticket_tab_file_tab_index(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() ) i.out << ticket_file_number; @@ -1216,7 +1216,7 @@ void ticket_tab_file_tab_path(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() ) i.out << (*mt.child_spaces)[ticket_file_index]->to_wstr(L"path"); @@ -1229,7 +1229,7 @@ void ticket_tab_file_tab_itemid(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() ) i.out << (*mt.child_spaces)[ticket_file_index]->to_wstr(L"itemid"); @@ -1242,7 +1242,7 @@ void ticket_tab_file_tab_meta(Info & i) if( value.is_value && !value.is_in_ticket_par ) { - PT::Space & mt = *value.value_meta; + pt::Space & mt = *value.value_meta; if( mt.child_spaces && ticket_file_index < mt.child_spaces->size() ) space_value(i, *(*mt.child_spaces)[ticket_file_index]); diff --git a/winixd/plugins/ticket/ticketinfo.cpp b/winixd/plugins/ticket/ticketinfo.cpp index 0770df8..749bdc3 100644 --- a/winixd/plugins/ticket/ticketinfo.cpp +++ b/winixd/plugins/ticket/ticketinfo.cpp @@ -169,7 +169,7 @@ bool TicketInfo::ParseTicketConf(long mount_dir_id, const std::wstring & path) conf_parser.SetSpace(conf_tab[mount_dir_id].conf); conf_tab[mount_dir_id].conf.clear(); -return (conf_parser.ParseSpace(config_file.item_content.content_raw) == PT::SpaceParser::ok); +return (conf_parser.ParseSpace(config_file.item_content.content_raw) == pt::SpaceParser::ok); } @@ -262,7 +262,7 @@ void TicketInfo::FindCurrentConf() -void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par) +void TicketInfo::CheckMinMaxValue(pt::Space & space, Ticket::TicketParam & par) { std::wstring * type = space.get_wstr(L"type"); @@ -307,7 +307,7 @@ void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par) { for(size_t a=0 ; asize() ; ++a) { - PT::Space & sp = *(*space.child_spaces)[a]; + pt::Space & sp = *(*space.child_spaces)[a]; if( sp.name && *sp.name == L"option" && sp.to_long(L"id") == par.intv ) return; @@ -323,20 +323,20 @@ void TicketInfo::CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par) } -PT::Space & TicketInfo::FindAddMetaByParam(PT::Space & meta, long param) +pt::Space & TicketInfo::FindAddMetaByParam(pt::Space & meta, long param) { if( meta.child_spaces ) { for(size_t i=0 ; isize() ; ++i) { - PT::Space & sp = *(*meta.child_spaces)[i]; + pt::Space & sp = *(*meta.child_spaces)[i]; if( sp.name && *sp.name == L"param" && sp.to_long(L"id") == param ) return sp; } } - PT::Space & sp = meta.add_child_space(L"param"); + pt::Space & sp = meta.add_child_space(L"param"); sp.add(L"id", param); return sp; @@ -344,7 +344,7 @@ return sp; -bool TicketInfo::ReadTicketValue(PT::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, PT::Space & meta) +bool TicketInfo::ReadTicketValue(pt::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, pt::Space & meta) { if( space.is_equal(L"type", L"integer") || space.is_equal(L"type", L"progress") || @@ -360,7 +360,7 @@ bool TicketInfo::ReadTicketValue(PT::Space & space, long param_id, Ticket::Ticke space.is_equal(L"type", L"multistring") ) { // !! dodac cos co sprawdzi czy string nie zawiera znakow konca linii - PT::Space & sp = FindAddMetaByParam(meta, param_id); + pt::Space & sp = FindAddMetaByParam(meta, param_id); sp.add(L"value", value); return false; } @@ -391,10 +391,10 @@ return false; -void TicketInfo::ReadTicketValue(PT::Space & space, +void TicketInfo::ReadTicketValue(pt::Space & space, long param_id, const PostFile & value, - PT::Space & meta, + pt::Space & meta, Item & upload_dir) { file.Clear(); // clearing and setting date @@ -409,8 +409,8 @@ void TicketInfo::ReadTicketValue(PT::Space & space, if( cur->request->status == WINIX_ERR_OK ) { - PT::Space & space = FindAddMetaByParam(meta, param_id); - PT::Space & file_space = space.add_child_space(L"file"); + pt::Space & space = FindAddMetaByParam(meta, param_id); + pt::Space & file_space = space.add_child_space(L"file"); if( file.item_content.file_type == WINIX_ITEM_FILETYPE_IMAGE ) file_space.add(L"type", L"image"); @@ -428,8 +428,8 @@ void TicketInfo::ReadTicketValue(PT::Space & space, } -void TicketInfo::ReadTicketValue(PT::Space & space, - long param_id, const PostFile & value, PT::Space & meta) +void TicketInfo::ReadTicketValue(pt::Space & space, + long param_id, const PostFile & value, pt::Space & meta) { std::wstring * type = space.get_wstr(L"type"); @@ -456,7 +456,7 @@ void TicketInfo::ReadTicketValue(PT::Space & space, // adding a new parameter only if it not exists in ticket.par_tab -void TicketInfo::ReadTicketParam(PT::Space & space, Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta) +void TicketInfo::ReadTicketParam(pt::Space & space, Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta) { ticket_param.param = param_id; @@ -481,7 +481,7 @@ void TicketInfo::ReadTicketParam(PT::Space & space, Ticket & ticket, long param_ -void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta) +void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta) { ticket_param.Clear(); @@ -489,7 +489,7 @@ void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstr { for(size_t i=0 ; ichild_spaces->size() ; ++i) { - PT::Space & space = *(*cur_conf->child_spaces)[i]; + pt::Space & space = *(*cur_conf->child_spaces)[i]; if( space.name && *space.name == L"param" && space.to_long(L"id") == param_id ) { @@ -504,13 +504,13 @@ void TicketInfo::ReadTicketParam(Ticket & ticket, long param_id, const std::wstr // always adds a new parameter -void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, PT::Space & meta) +void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, pt::Space & meta) { if( cur_conf->child_spaces ) { for(size_t i=0 ; ichild_spaces->size() ; ++i) { - PT::Space & space = *(*cur_conf->child_spaces)[i]; + pt::Space & space = *(*cur_conf->child_spaces)[i]; if( space.name && *space.name == L"param" && space.to_long(L"id") == param_id ) { @@ -527,19 +527,19 @@ void TicketInfo::ReadTicketParam(long param_id, const PostFile & value, PT::Spac -bool TicketInfo::DeleteTicketFile(Ticket & ticket, long file_id, PT::Space & meta) +bool TicketInfo::DeleteTicketFile(Ticket & ticket, long file_id, pt::Space & meta) { if( meta.child_spaces ) { for(size_t i=0 ; isize() ; ++i) { - PT::Space & param = *(*meta.child_spaces)[i]; + pt::Space & param = *(*meta.child_spaces)[i]; if( param.name && *param.name == L"param" && param.child_spaces ) { for(size_t z=0 ; zsize() ; ++z) { - PT::Space & file = *(*param.child_spaces)[z]; + pt::Space & file = *(*param.child_spaces)[z]; if( file.name && *file.name == L"file" ) { @@ -566,7 +566,7 @@ return false; -void TicketInfo::ReadTicketParams(Ticket & ticket, bool clear_ticket, PT::Space & meta, bool & file_was_deleted) +void TicketInfo::ReadTicketParams(Ticket & ticket, bool clear_ticket, pt::Space & meta, bool & file_was_deleted) { PostTab::iterator i; PostFileTab::iterator i2; @@ -583,13 +583,13 @@ PostFileTab::iterator i2; { // !! CHECKME why ticket_form_prefix is in the global config? // (this is a plugin variable) - if( PT::is_substr(config->ticket_form_prefix, i->first) ) + if( pt::is_substr(config->ticket_form_prefix, i->first) ) { long param_id = Tol(i->first.c_str() + config->ticket_form_prefix.size()); ReadTicketParam(ticket, param_id, i->second, meta); } - if( PT::is_substr(ticket_delete_prefix, i->first) ) + if( pt::is_substr(ticket_delete_prefix, i->first) ) { long file_id = Tol(i->first.c_str() + ticket_delete_prefix.size()); @@ -602,7 +602,7 @@ PostFileTab::iterator i2; for(i2=cur->request->post_file_tab.begin() ; i2!=cur->request->post_file_tab.end() ; ++i2) { - if( PT::is_substr(config->ticket_form_prefix, i2->first) ) + if( pt::is_substr(config->ticket_form_prefix, i2->first) ) ReadTicketParam(Tol(i2->first.c_str() + config->ticket_form_prefix.size()), i2->second, meta); } @@ -629,9 +629,9 @@ void TicketInfo::RemoveTicket(long file_id) } -void TicketInfo::CopyTicketSpace(PT::Space & ticket_space, Item & item) +void TicketInfo::CopyTicketSpace(pt::Space & ticket_space, Item & item) { - PT::Space & ticket_meta = item.item_content.meta.find_add_child_space(L"ticket"); + pt::Space & ticket_meta = item.item_content.meta.find_add_child_space(L"ticket"); ticket_meta = ticket_space; } diff --git a/winixd/plugins/ticket/ticketinfo.h b/winixd/plugins/ticket/ticketinfo.h index a9b6bc1..96fc645 100644 --- a/winixd/plugins/ticket/ticketinfo.h +++ b/winixd/plugins/ticket/ticketinfo.h @@ -58,7 +58,7 @@ struct TicketConfWrap { bool to_delete; std::wstring file_name; - PT::Space conf; + pt::Space conf; TicketConfWrap() { @@ -106,7 +106,7 @@ public: // current ticket config // will be set by FindCurrentConf() TicketConfWrap * cur_conf_wrap; - PT::Space * cur_conf; + pt::Space * cur_conf; // default: "progress" // can be set in config in option: ticket_form_progress_prefix @@ -127,9 +127,9 @@ public: void ReadTicketConf(bool skip_existing_configs = false); void FindCurrentConf(long dir_id); void FindCurrentConf(); - void ReadTicketParams(Ticket & ticket, bool clear_ticket, PT::Space & meta, bool & file_was_deleted); + void ReadTicketParams(Ticket & ticket, bool clear_ticket, pt::Space & meta, bool & file_was_deleted); void RemoveTicket(long file_id); - void CopyTicketSpace(PT::Space & ticket_space, Item & item); + void CopyTicketSpace(pt::Space & ticket_space, Item & item); void MakeRedirectIfPossible(const Item & item); @@ -154,14 +154,14 @@ private: std::wstring file_path; // for reading config file - PT::SpaceParser conf_parser; + pt::SpaceParser conf_parser; std::vector config_dir_tab; Item config_file; // for Clearing // (we don't want to use empty pointers) TicketConfWrap cur_conf_wrap_empty; - PT::Space cur_conf_empty; + pt::Space cur_conf_empty; Ticket ticket_empty; Item item_empty; @@ -174,17 +174,17 @@ private: void MarkAllConfToDelete(); void DeleteAllMarkedConf(); void ReadTicketConf(const Mount & mount, bool skip_existing_configs); - PT::Space & FindAddMetaByParam(PT::Space & meta, long param); + pt::Space & FindAddMetaByParam(pt::Space & meta, long param); - void CheckMinMaxValue(PT::Space & space, Ticket::TicketParam & par); - bool ReadTicketValue(PT::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, PT::Space & meta); - void ReadTicketValue(PT::Space & space, long param_id, const PostFile & value, PT::Space & meta, Item & upload_dir); - void ReadTicketValue(PT::Space & space, long param_id, const PostFile & value, PT::Space & meta); - void ReadTicketParam(PT::Space & space, Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta); - void ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, PT::Space & meta); - void ReadTicketParam(long param_id, const PostFile & value, PT::Space & meta); - bool DeleteTicketFile(Ticket & ticket, long file_id, PT::Space & meta); + void CheckMinMaxValue(pt::Space & space, Ticket::TicketParam & par); + bool ReadTicketValue(pt::Space & space, long param_id, Ticket::TicketParam & par, const std::wstring & value, pt::Space & meta); + void ReadTicketValue(pt::Space & space, long param_id, const PostFile & value, pt::Space & meta, Item & upload_dir); + void ReadTicketValue(pt::Space & space, long param_id, const PostFile & value, pt::Space & meta); + void ReadTicketParam(pt::Space & space, Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta); + void ReadTicketParam(Ticket & ticket, long param_id, const std::wstring & value, pt::Space & meta); + void ReadTicketParam(long param_id, const PostFile & value, pt::Space & meta); + bool DeleteTicketFile(Ticket & ticket, long file_id, pt::Space & meta); }; diff --git a/winixd/templates/currentdate.cpp b/winixd/templates/currentdate.cpp index 6219e62..b32232a 100644 --- a/winixd/templates/currentdate.cpp +++ b/winixd/templates/currentdate.cpp @@ -87,45 +87,45 @@ void current_date_utc(Info & i) void current_sec(Info & i) { - PT::Date date = system->ToLocal(cur->request->start_date); + pt::Date date = system->ToLocal(cur->request->start_date); i.out << date.sec; } void current_min(Info & i) { - PT::Date date = system->ToLocal(cur->request->start_date); + pt::Date date = system->ToLocal(cur->request->start_date); i.out << date.min; } void current_hour(Info & i) { - PT::Date date = system->ToLocal(cur->request->start_date); + pt::Date date = system->ToLocal(cur->request->start_date); i.out << date.hour; } void current_day(Info & i) { - PT::Date date = system->ToLocal(cur->request->start_date); + pt::Date date = system->ToLocal(cur->request->start_date); i.out << date.day; } void current_month(Info & i) { - PT::Date date = system->ToLocal(cur->request->start_date); + pt::Date date = system->ToLocal(cur->request->start_date); i.out << date.month; } void current_year(Info & i) { - PT::Date date = system->ToLocal(cur->request->start_date); + pt::Date date = system->ToLocal(cur->request->start_date); i.out << date.year; } void current_date(Info & i) { - PT::Date date = system->ToLocal(cur->request->start_date); + pt::Date date = system->ToLocal(cur->request->start_date); i.out << date; } diff --git a/winixd/templates/dir.cpp b/winixd/templates/dir.cpp index 0715473..2f467ba 100644 --- a/winixd/templates/dir.cpp +++ b/winixd/templates/dir.cpp @@ -192,7 +192,7 @@ void dir_has_parents(Info & i) dir_parents_str += '/'; } - i.res = PT::is_substr(i.par, dir_parents_str); + i.res = pt::is_substr(i.par, dir_parents_str); } @@ -402,14 +402,14 @@ void dir_last_url_is_no(Info & i) void dir_last_date_creation(Info & i) { - PT::Date date = system->ToLocal(cur->request->dir_tab.back()->item_content.date_creation); + pt::Date date = system->ToLocal(cur->request->dir_tab.back()->item_content.date_creation); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } void dir_last_date_modification(Info & i) { - PT::Date date = system->ToLocal(cur->request->dir_tab.back()->item_content.date_modification); + pt::Date date = system->ToLocal(cur->request->dir_tab.back()->item_content.date_modification); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } @@ -429,8 +429,8 @@ void dir_last_date_modification_nice(Info & i) void dir_last_dates_equal(Info & i) { - PT::Date & date1 = cur->request->dir_tab.back()->item_content.date_creation; - PT::Date & date2 = cur->request->dir_tab.back()->item_content.date_modification; + pt::Date & date1 = cur->request->dir_tab.back()->item_content.date_creation; + pt::Date & date2 = cur->request->dir_tab.back()->item_content.date_modification; i.res = date1 == date2; } diff --git a/winixd/templates/doc.cpp b/winixd/templates/doc.cpp index 04614ed..b07a835 100644 --- a/winixd/templates/doc.cpp +++ b/winixd/templates/doc.cpp @@ -163,8 +163,8 @@ void doc_css_tab_file_is_global(Info & i) // !! z konfiga wziasc przedrostki if( doc_css_index < cur->session->last_css.size() ) - i.res = PT::is_substr(L"http://", cur->session->last_css[doc_css_index].c_str()) || - PT::is_substr(L"https://", cur->session->last_css[doc_css_index].c_str()); + i.res = pt::is_substr(L"http://", cur->session->last_css[doc_css_index].c_str()) || + pt::is_substr(L"https://", cur->session->last_css[doc_css_index].c_str()); } diff --git a/winixd/templates/htmltextstream.cpp b/winixd/templates/htmltextstream.cpp index 6f25bde..48f1522 100644 --- a/winixd/templates/htmltextstream.cpp +++ b/winixd/templates/htmltextstream.cpp @@ -233,14 +233,14 @@ HtmlTextStream & HtmlTextStream::operator<<(RawText raw) } -HtmlTextStream & HtmlTextStream::operator<<(RawText raw) +HtmlTextStream & HtmlTextStream::operator<<(RawText raw) { TextStream::operator<<(raw.par); return *this; } -HtmlTextStream & HtmlTextStream::operator<<(RawText raw) +HtmlTextStream & HtmlTextStream::operator<<(RawText raw) { TextStream::operator<<(raw.par); return *this; @@ -329,7 +329,7 @@ return *this; HtmlTextStream & HtmlTextStream::EPutText(const char * str) { - PT::UTF8ToWide(str, tmp_string); + pt::UTF8ToWide(str, tmp_string); for(size_t i=0 ; i raw); HtmlTextStream & operator<<(RawText raw); HtmlTextStream & operator<<(RawText raw); - HtmlTextStream & operator<<(RawText raw); - HtmlTextStream & operator<<(RawText raw); + HtmlTextStream & operator<<(RawText raw); + HtmlTextStream & operator<<(RawText raw); template - HtmlTextStream & operator<<(RawText > raw); + HtmlTextStream & operator<<(RawText > raw); @@ -196,11 +196,11 @@ public: HtmlTextStream & operator<<(unsigned long); HtmlTextStream & operator<<(double); HtmlTextStream & operator<<(const void *); - HtmlTextStream & operator<<(const PT::Space & space); - HtmlTextStream & operator<<(const PT::Date & Date); + HtmlTextStream & operator<<(const pt::Space & space); + HtmlTextStream & operator<<(const pt::Date & Date); template - HtmlTextStream & operator<<(const PT::TextStreamBase & arg); + HtmlTextStream & operator<<(const pt::TextStreamBase & arg); private: @@ -214,7 +214,7 @@ private: template -HtmlTextStream & HtmlTextStream::operator<<(RawText > raw) +HtmlTextStream & HtmlTextStream::operator<<(RawText > raw) { TextStream::operator<<(raw.par); @@ -223,9 +223,9 @@ return *this; template -HtmlTextStream & HtmlTextStream::operator<<(const PT::TextStreamBase & arg) +HtmlTextStream & HtmlTextStream::operator<<(const pt::TextStreamBase & arg) { -typename PT::TextStreamBase::const_iterator i; +typename pt::TextStreamBase::const_iterator i; if( escape ) { diff --git a/winixd/templates/ipban.cpp b/winixd/templates/ipban.cpp index 2243e56..ac7a788 100644 --- a/winixd/templates/ipban.cpp +++ b/winixd/templates/ipban.cpp @@ -59,7 +59,7 @@ void ipban_current_ip_expires_time(Info & i) { if( cur->session->ip_ban && cur->session->ip_ban->expires != 0 ) { - PT::Date date = cur->session->ip_ban->expires; + pt::Date date = cur->session->ip_ban->expires; i.out << date << " UTC"; } } @@ -96,7 +96,7 @@ void ipban_tab_ip(Info & i) { if( ipban_index < session_manager->BanListSize() ) { - PT::WTextStream buf = IPToStr(session_manager->GetIPBan(ipban_index).ip); + pt::WTextStream buf = IPToStr(session_manager->GetIPBan(ipban_index).ip); i.out << buf; } } @@ -164,7 +164,7 @@ void ipban_tab_expires(Info & i) if( ipban.expires != 0 ) { time_t expires_local = system->ToLocal(ipban.expires); - PT::Date date(expires_local); + pt::Date date(expires_local); i.out << date; } } @@ -180,7 +180,7 @@ void ipban_tab_last_used(Info & i) if( ipban.last_used != 0 ) { time_t last_used_local = system->ToLocal(ipban.last_used); - PT::Date date(last_used_local); + pt::Date date(last_used_local); i.out << date; } } diff --git a/winixd/templates/item.cpp b/winixd/templates/item.cpp index 64b210f..ba7f219 100644 --- a/winixd/templates/item.cpp +++ b/winixd/templates/item.cpp @@ -285,14 +285,14 @@ void item_users_different(Info & i) void item_date_creation(Info & i) { - PT::Date date = system->ToLocal(cur->request->last_item->item_content.date_creation); + pt::Date date = system->ToLocal(cur->request->last_item->item_content.date_creation); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } void item_date_modification(Info & i) { - PT::Date date = system->ToLocal(cur->request->last_item->item_content.date_modification); + pt::Date date = system->ToLocal(cur->request->last_item->item_content.date_modification); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } @@ -311,8 +311,8 @@ void item_date_modification_nice(Info & i) void item_dates_equal(Info & i) { - PT::Date & date1 = cur->request->last_item->item_content.date_creation; - PT::Date & date2 = cur->request->last_item->item_content.date_modification; + pt::Date & date1 = cur->request->last_item->item_content.date_creation; + pt::Date & date2 = cur->request->last_item->item_content.date_modification; i.res = date1 == date2; } @@ -684,7 +684,7 @@ void item_tab_date_creation(Info & i) { if( item_index < cur->request->item_tab.size() ) { - PT::Date date = system->ToLocal(cur->request->item_tab[item_index].item_content.date_creation); + pt::Date date = system->ToLocal(cur->request->item_tab[item_index].item_content.date_creation); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } } @@ -694,7 +694,7 @@ void item_tab_date_modification(Info & i) { if( item_index < cur->request->item_tab.size() ) { - PT::Date date = system->ToLocal(cur->request->item_tab[item_index].item_content.date_modification); + pt::Date date = system->ToLocal(cur->request->item_tab[item_index].item_content.date_modification); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } } @@ -723,8 +723,8 @@ void item_tab_dates_equal(Info & i) { if( item_index < cur->request->item_tab.size() ) { - PT::Date & date1 = cur->request->item_tab[item_index].item_content.date_creation; - PT::Date & date2 = cur->request->item_tab[item_index].item_content.date_modification; + pt::Date & date1 = cur->request->item_tab[item_index].item_content.date_creation; + pt::Date & date2 = cur->request->item_tab[item_index].item_content.date_modification; i.res = date1 == date2; } diff --git a/winixd/templates/locale.cpp b/winixd/templates/locale.cpp index 599f5fc..f3d4579 100644 --- a/winixd/templates/locale.cpp +++ b/winixd/templates/locale.cpp @@ -113,15 +113,15 @@ bool read = false; file_name += file; loc_parser.SetSpace(temp_space); - PT::SpaceParser::Status status = loc_parser.ParseSpaceFile(file_name); + pt::SpaceParser::Status status = loc_parser.ParseSpaceFile(file_name); - if( status == PT::SpaceParser::ok ) + if( status == pt::SpaceParser::ok ) { read = true; log << log3 << "Locale: read locale from: " << file_name << logend; } else - if( status == PT::SpaceParser::syntax_error ) + if( status == pt::SpaceParser::syntax_error ) { log << log1 << "Locale: syntax error in: " << file_name << " in line: " << loc_parser.get_last_parsed_line() << logend; } @@ -187,7 +187,7 @@ bool read = false; loc_parser.SetSpace(temp_space); - if( loc_parser.ParseSpaceFile(file_name) == PT::SpaceParser::ok ) + if( loc_parser.ParseSpaceFile(file_name) == pt::SpaceParser::ok ) { read = true; CreateSubstVector(subst_url, temp_space.to_wstr(L"url_original"), temp_space.to_wstr(L"url_changeto")); @@ -266,7 +266,7 @@ void Locale::Read(const char * dir, const char * dir_def) for(size_t i=0 ; i - bool IsKey(const PT::TextStreamBase & key, + bool IsKey(const pt::TextStreamBase & key, bool try_default_too = true); // checking whether there is a 'key' in the lang_id language @@ -97,7 +97,7 @@ public: bool IsKey(const std::wstring & key, size_t lang_id, bool try_default_too = true) const; template - bool IsKey(const PT::TextStreamBase & key, + bool IsKey(const pt::TextStreamBase & key, size_t lang_id, bool try_default_too = true); // returning a value for a specific key @@ -107,7 +107,7 @@ public: const std::wstring & Get(const std::wstring & key, size_t lang_id, bool try_default_too = true) const; template - const std::wstring & Get(const PT::TextStreamBase & key, + const std::wstring & Get(const pt::TextStreamBase & key, bool try_default_too = true); template @@ -232,7 +232,7 @@ private: std::vector locale_indices; // messages vector - std::vector locale_tab; + std::vector locale_tab; // default locale index (index to locale_indexes) size_t default_lang; @@ -240,7 +240,7 @@ private: // current locale index (index to locale_indexes) size_t current_lang; - PT::WPatternReplacer pattern_replacer; + pt::WPatternReplacer pattern_replacer; // vectors of characters substitution (sort by 'from') @@ -250,8 +250,8 @@ private: std::vector subst_sort; // local characters for comparison - PT::Space temp_space; - PT::SpaceParser loc_parser; + pt::Space temp_space; + pt::SpaceParser loc_parser; std::string locale_filea; std::string file_name; std::wstring key_str; @@ -262,7 +262,7 @@ private: template -bool Locale::IsKey(const PT::TextStreamBase & key, +bool Locale::IsKey(const pt::TextStreamBase & key, bool try_default_too) { key.to_string(key_str); @@ -271,7 +271,7 @@ bool Locale::IsKey(const PT::TextStreamBase -bool Locale::IsKey(const PT::TextStreamBase & key, +bool Locale::IsKey(const pt::TextStreamBase & key, size_t lang_id, bool try_default_too) { key.to_string(key_str); @@ -281,7 +281,7 @@ bool Locale::IsKey(const PT::TextStreamBase -const std::wstring & Locale::Get(const PT::TextStreamBase & key, +const std::wstring & Locale::Get(const pt::TextStreamBase & key, bool try_default_too) { key.to_string(key_str); diff --git a/winixd/templates/misc.cpp b/winixd/templates/misc.cpp index f53c8cc..f65ec6f 100644 --- a/winixd/templates/misc.cpp +++ b/winixd/templates/misc.cpp @@ -126,10 +126,10 @@ char buffer[100]; -void print_date_nice(Info & i, const PT::Date & date) +void print_date_nice(Info & i, const pt::Date & date) { time_t one_day = 60 * 60 * 24; - PT::Date ltm = system->ToLocal(date); + pt::Date ltm = system->ToLocal(date); if( date + one_day > cur->request->start_time ) i.out << DateToStr(ltm.year, ltm.month, ltm.day, ltm.hour, ltm.min, ltm.sec); @@ -140,7 +140,7 @@ void print_date_nice(Info & i, const PT::Date & date) -// cannot be a const reference at the moment (PT::Space is used) +// cannot be a const reference at the moment (pt::Space is used) void print_user_name(Info & i, User & user) { std::wstring * dname = user.aenv.get_wstr(L"display_name"); diff --git a/winixd/templates/misc.h b/winixd/templates/misc.h index 7f20712..15649f9 100644 --- a/winixd/templates/misc.h +++ b/winixd/templates/misc.h @@ -68,7 +68,7 @@ void InitGenerator(EzcGen & gen); void HtmlEscapeFormTxt(HtmlTextStream & out, const std::wstring & in); void print_hour_min(Info & i, time_t time); -void print_date_nice(Info & i, const PT::Date & date); +void print_date_nice(Info & i, const pt::Date & date); /* diff --git a/winixd/templates/miscspace.cpp b/winixd/templates/miscspace.cpp index dd3dc31..8a3d180 100644 --- a/winixd/templates/miscspace.cpp +++ b/winixd/templates/miscspace.cpp @@ -73,13 +73,13 @@ void copy_space(const std::vector & params, std::vector } -PT::Space * find_space(const std::vector & params, PT::Space & space, size_t level = 0) +pt::Space * find_space(const std::vector & params, pt::Space & space, size_t level = 0) { if( level + 1 < params.size() && space.child_spaces ) { for(size_t i=0 ; isize() ; ++i) { - PT::Space & child = *(*space.child_spaces)[i]; + pt::Space & child = *(*space.child_spaces)[i]; if( child.name && *child.name == params[level].str ) return find_space(params, child, level+1); @@ -107,7 +107,7 @@ PT::Space * find_space(const std::vector & params, PT::Space & space, struct SpaceInfo { bool inited; - PT::Space * last_space; + pt::Space * last_space; std::vector spaces; SpaceInfo() @@ -117,14 +117,14 @@ struct SpaceInfo } }; -static std::map spaces_map; +static std::map spaces_map; static size_t space_reqid = 0; -void space_init(const std::vector & params, PT::Space & space, SpaceInfo & space_info) +void space_init(const std::vector & params, pt::Space & space, SpaceInfo & space_info) { if( !space_info.inited || !are_spaces_the_same(params, space_info.spaces) ) { @@ -145,7 +145,7 @@ void space_check_reqid() } -void space_value(Info & i, PT::Space & space, bool escape) +void space_value(Info & i, pt::Space & space, bool escape) { space_check_reqid(); @@ -183,7 +183,7 @@ struct SpaceTabStackItem : public Ezc::FunData -void space_list_tab(Info & i, PT::Space & space) +void space_list_tab(Info & i, pt::Space & space) { if( !i.stack.fun_data ) { @@ -192,7 +192,7 @@ void space_list_tab(Info & i, PT::Space & space) SpaceTabStackItem * stack_item = new SpaceTabStackItem(); i.stack.fun_data = stack_item; - PT::Space * dst_space = find_space(i.params, space); + pt::Space * dst_space = find_space(i.params, space); if( dst_space ) dst_space->to_list(i.params.back().str, stack_item->values); @@ -209,7 +209,7 @@ void space_list_tab(Info & i, PT::Space & space) -void space_list_tab_value(Info & i, PT::Space & space, const std::wstring & function_name) +void space_list_tab_value(Info & i, pt::Space & space, const std::wstring & function_name) { Ezc::Stack * stack; auto user_object = i.FindUserObject(function_name, &stack); @@ -219,7 +219,7 @@ void space_list_tab_value(Info & i, PT::Space & space, const std::wstring & func } -void space_list_tab_has_next(Info & i, PT::Space & space, const std::wstring & function_name) +void space_list_tab_has_next(Info & i, pt::Space & space, const std::wstring & function_name) { Ezc::Stack * stack; auto user_object = i.FindUserObject(function_name, &stack); diff --git a/winixd/templates/miscspace.h b/winixd/templates/miscspace.h index 3d3932f..269264b 100644 --- a/winixd/templates/miscspace.h +++ b/winixd/templates/miscspace.h @@ -65,18 +65,18 @@ namespace TemplatesFunctions * * */ -void space_value(Info & i, PT::Space & space, bool escape = true); +void space_value(Info & i, pt::Space & space, bool escape = true); // !! IMPROVE ME // add -// void space_list_tab_size(Info & i, PT::Space & space); +// void space_list_tab_size(Info & i, pt::Space & space); -void space_list_tab(Info & i, PT::Space & space); -void space_list_tab_value(Info & i, PT::Space & space, const std::wstring & function_name); -void space_list_tab_has_next(Info & i, PT::Space & space, const std::wstring & function_name); +void space_list_tab(Info & i, pt::Space & space); +void space_list_tab_value(Info & i, pt::Space & space, const std::wstring & function_name); +void space_list_tab_has_next(Info & i, pt::Space & space, const std::wstring & function_name); diff --git a/winixd/templates/mount.cpp b/winixd/templates/mount.cpp index 67d5744..7e7e826 100644 --- a/winixd/templates/mount.cpp +++ b/winixd/templates/mount.cpp @@ -122,8 +122,8 @@ void mount_css_tab_file_is_global(Info & i) int parcss = system->mounts.MountParCss(); if( mount_css_index < cur->mount->param[parcss].arg.size() ) - i.res = PT::is_substr(L"http://", cur->mount->param[parcss].arg[mount_css_index].c_str()) || - PT::is_substr(L"https://", cur->mount->param[parcss].arg[mount_css_index].c_str()); + i.res = pt::is_substr(L"http://", cur->mount->param[parcss].arg[mount_css_index].c_str()) || + pt::is_substr(L"https://", cur->mount->param[parcss].arg[mount_css_index].c_str()); } diff --git a/winixd/templates/stat.cpp b/winixd/templates/stat.cpp index 4e780ed..fe1f8ab 100644 --- a/winixd/templates/stat.cpp +++ b/winixd/templates/stat.cpp @@ -99,14 +99,14 @@ void stat_item_privileges(Info & i) void stat_item_date_creation(Info & i) { - PT::Date date = system->ToLocal(cur->request->last_item->item_content.date_creation); + pt::Date date = system->ToLocal(cur->request->last_item->item_content.date_creation); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } void stat_item_date_modification(Info & i) { - PT::Date date = system->ToLocal(cur->request->last_item->item_content.date_modification); + pt::Date date = system->ToLocal(cur->request->last_item->item_content.date_modification); i.out << DateToStr(date.year, date.month, date.day, date.hour, date.min, date.sec); } diff --git a/winixd/templates/textextstream.cpp b/winixd/templates/textextstream.cpp index a70680e..1b1c4f0 100644 --- a/winixd/templates/textextstream.cpp +++ b/winixd/templates/textextstream.cpp @@ -472,7 +472,7 @@ return *this; -TexTextStream & TexTextStream::operator<<(const PT::Space & space) +TexTextStream & TexTextStream::operator<<(const pt::Space & space) { tmp_stream.Clear(); // !! IMPROVE ME @@ -485,7 +485,7 @@ return *this; } -TexTextStream & TexTextStream::operator<<(const PT::Date & date) +TexTextStream & TexTextStream::operator<<(const pt::Date & date) { tmp_stream.Clear(); // !! IMPROVE ME diff --git a/winixd/templates/textextstream.h b/winixd/templates/textextstream.h index 7fc1d0a..4ea138e 100644 --- a/winixd/templates/textextstream.h +++ b/winixd/templates/textextstream.h @@ -132,7 +132,7 @@ public: TexTextStream & operator<<(RawText raw); template - TexTextStream & operator<<(RawText > raw); + TexTextStream & operator<<(RawText > raw); // 'write' don't escapes too @@ -175,11 +175,11 @@ public: TexTextStream & operator<<(unsigned long); TexTextStream & operator<<(double); TexTextStream & operator<<(const void *); - TexTextStream & operator<<(const PT::Space & space); - TexTextStream & operator<<(const PT::Date & Date); + TexTextStream & operator<<(const pt::Space & space); + TexTextStream & operator<<(const pt::Date & Date); template - TexTextStream & operator<<(const PT::TextStreamBase & arg); + TexTextStream & operator<<(const pt::TextStreamBase & arg); private: @@ -189,7 +189,7 @@ private: template -TexTextStream & TexTextStream::operator<<(RawText > raw) +TexTextStream & TexTextStream::operator<<(RawText > raw) { TextStream::operator<<(raw.par); @@ -198,9 +198,9 @@ return *this; template -TexTextStream & TexTextStream::operator<<(const PT::TextStreamBase & arg) +TexTextStream & TexTextStream::operator<<(const pt::TextStreamBase & arg) { -typename PT::TextStreamBase::const_iterator i; +typename pt::TextStreamBase::const_iterator i; for(i=arg.begin() ; i != arg.end() ; ++i) ETextPutChar(*i); diff --git a/winixd/templates/winix.cpp b/winixd/templates/winix.cpp index 09b0deb..7116215 100644 --- a/winixd/templates/winix.cpp +++ b/winixd/templates/winix.cpp @@ -56,7 +56,7 @@ void winix_cur_time(Info & i) { static char buffer[100]; - PT::Date & date = cur->request->start_date; + pt::Date & date = cur->request->start_date; sprintf(buffer, "%02d:%02d:%02d", date.hour, date.min, date.sec); i.out << buffer;