added: to IsWhite (core/misc)
other unicode white characters 25 characters -- without a new line character (10) added: config option: account_need_email_verification if true then when creating an account a user has to provide his email address and a message with an activation link will be sent back to him added: 'pw' winix function (not finished yet) at the moment only one parameter 'activate' git-svn-id: svn://ttmath.org/publicrep/winix/trunk@810 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -19,13 +19,15 @@
|
||||
|
||||
namespace misc_private
|
||||
{
|
||||
// white_chars table should be sorted
|
||||
// we do not treat a new line character (10) as a white character
|
||||
static const wchar_t white_chars[] = { 0x0009, 0x000B, 0x000C, 0x000D, 0x0020, 0x0085, 0x00A0,
|
||||
0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004,
|
||||
0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x2028,
|
||||
0x2029, 0x202F, 0x205F, 0x3000 };
|
||||
|
||||
std::ifstream get_file_content;
|
||||
std::string get_file_content_ansi;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -536,18 +538,42 @@ return buffer;
|
||||
|
||||
|
||||
|
||||
// !! IMPROVE ME
|
||||
// in UNICODE there are some additional white characters
|
||||
bool IsWhite(wchar_t s)
|
||||
/*
|
||||
we do not treat a new line character (10) as a white character
|
||||
*/
|
||||
bool IsWhite(wchar_t c)
|
||||
{
|
||||
if( s==' ' || s=='\t' || s==13 || s==160 )
|
||||
using misc_private::white_chars;
|
||||
|
||||
size_t len = sizeof(white_chars) / sizeof(wchar_t);
|
||||
size_t o1 = 0;
|
||||
size_t o2 = len - 1;
|
||||
|
||||
if( c < white_chars[o1] || c > white_chars[o2] )
|
||||
return false;
|
||||
|
||||
if( c == white_chars[o1] || c == white_chars[o2] )
|
||||
return true;
|
||||
|
||||
|
||||
while( o1 + 1 < o2 )
|
||||
{
|
||||
size_t o = (o2 - o1)/2 + o1;
|
||||
|
||||
if( c == white_chars[o] )
|
||||
return true;
|
||||
|
||||
if( c > white_chars[o] )
|
||||
o1 = o;
|
||||
else
|
||||
o2 = o;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool IsLastSlash(const std::wstring & path)
|
||||
{
|
||||
if( path.empty() )
|
||||
|
Reference in New Issue
Block a user