winix/templates/misc.h

62 lines
1.4 KiB
C++
Executable File

/*
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2010, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslutemplatesmisc
#define headerfilecmslutemplatesmisc
#include <vector>
#include <string>
#include "localefilter.h"
#include "ezc.h"
#include "htmltextstream.h"
#include "core/user.h"
namespace TemplatesFunctions
{
typedef Ezc::Functions<HtmlTextStream> EzcFun;
typedef Ezc::Generator<HtmlTextStream> EzcGen;
typedef Ezc::FunInfo<HtmlTextStream> Info;
template<class RawType>
HtmlTextStream::RawText<RawType> R(const RawType & par)
{
return HtmlTextStream::RawText<RawType>(par);
}
//void HtmlEscape(TextStream<std::wstring> & out, const std::wstring & in);
void HtmlEscapeFormTxt(HtmlTextStream & out, const std::wstring & in);
//std::wstring HtmlEscape(const std::wstring & in);
//std::wstring HtmlEscapeFormTxt(const std::wstring & in);
// table: [language][file]
typedef std::vector<std::vector<Ezc::Pattern> > Patterns;
void print_date_nice(Info & i, const tm & rtm);
void print_user_name(Info & i, const User * puser, const std::wstring & guest_name);
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);
void ClearPatterns(Patterns & patterns, size_t len);
} // namespace TemplatesFunctions
#endif