changed templates

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@715 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-01-27 14:35:25 +00:00
parent d4d9f89d1d
commit 18492e5d61
7 changed files with 56 additions and 6 deletions

View File

@@ -59,6 +59,35 @@ void fil_tosmall(Info & i)
}
// a first letter in a sentence will be capitalized
void fil_firstup(Info & i)
{
bool was_dot = true;
const std::wstring & str = i.in.Str();
for(size_t a=0 ; a<str.size() ; ++a)
{
if( was_dot )
{
if( str[a]!=' ' && str[a]!='\t' && str[a]!=13 && str[a]!=10 && str[a]!=160 )
was_dot = false;
if( str[a]>='a' && str[a]<='z' )
i.out << R(wchar_t(str[a] - 'a' + 'A'));
else
i.out << R(str[a]);
}
else
{
i.out << R(str[a]);
}
if( str[a] == '.' )
was_dot = true;
}
}
} // namespace

View File

@@ -189,7 +189,7 @@ void Templates::CreateFunctions()
ezc_functions.Insert("fil_qencode", fil_qencode);
ezc_functions.Insert("fil_capitalize", fil_capitalize);
ezc_functions.Insert("fil_tosmall", fil_tosmall);
ezc_functions.Insert("fil_firstup", fil_firstup);
/*
doc

View File

@@ -129,7 +129,7 @@ namespace TemplatesFunctions
void fil_qencode(Info & i);
void fil_capitalize(Info & i);
void fil_tosmall(Info & i);
void fil_firstup(Info & i);
/*
item