changed: updated to the new ezc api, this with O(1) when looking for a specific ezc function

changed: sessions are deleted at the end of a request (and only a few sessions)
         other sessions will be deleted after a next request


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@684 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-11-25 22:42:24 +00:00
parent 933c8841ff
commit 08e53919e2
25 changed files with 753 additions and 634 deletions

View File

@@ -18,6 +18,8 @@
#include "htmltextstream.h"
#include "core/user.h"
// !! usunac
#include "core/log.h"
namespace TemplatesFunctions
{
@@ -48,9 +50,35 @@ void print_user_name(Info & i, const User * puser, const std::wstring & guest_na
int ParseCKeditorFun();
// those functions from here are used in the second thread too
void Read(Patterns & patterns, size_t pat, Locale & locale, LocaleFilter & locale_filter, const wchar_t * file, bool delete_white = false);
template<class StreamType>
void Read(Patterns & patterns, size_t pat, Locale & locale, LocaleFilter & locale_filter,
Ezc::Functions<StreamType> & ezc_fun, const wchar_t * file, bool read_file_as_utf8,
const std::wstring & templates_dir, const std::wstring & templates_dir_default,
bool delete_white = false)
{
size_t i;
size_t len = patterns.size();
for(i=0 ; i<len ; ++i)
{
if( pat < patterns[i].size() )
{
patterns[i][pat].UTF8(read_file_as_utf8);
patterns[i][pat].DeleteWhiteTextItems(delete_white);
patterns[i][pat].Directory(templates_dir, templates_dir_default);
patterns[i][pat].ParseFile(file);
patterns[i][pat].CacheFunctions(ezc_fun);
locale_filter.Filter(patterns[i][pat], locale, static_cast<Locale::Lang>(i));
}
}
}
void ClearPatterns(Patterns & patterns, size_t len);