added: to misc:
bool IsWhite(const wchar_t * str, bool treat_new_line_as_white) bool IsWhite(const std::wstring & str, bool treat_new_line_as_white) return true if the whole string is white (or an empty string) added: global variable in admin environment for an user: "display_name" if defined it is used to display an user's name instead of its login it is used in: void print_user_name(Info & i, User & user); (tickets, threads, cat function etc) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@895 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -561,6 +561,40 @@ return false;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
return true if the whole string has only white characters
|
||||
an empty string is treated as white
|
||||
*/
|
||||
bool IsWhite(const wchar_t * str, bool treat_new_line_as_white)
|
||||
{
|
||||
for( ; *str != 0 ; ++str )
|
||||
{
|
||||
if( *str == '\n' )
|
||||
{
|
||||
if( !treat_new_line_as_white )
|
||||
return false;
|
||||
}
|
||||
else
|
||||
if( !IsWhite(*str) )
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
return true if the whole string has only white characters
|
||||
*/
|
||||
bool IsWhite(const std::wstring & str, bool treat_new_line_as_white)
|
||||
{
|
||||
return IsWhite(str.c_str(), treat_new_line_as_white);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
bool IsLastSlash(const std::wstring & path)
|
||||
{
|
||||
|
@@ -227,6 +227,8 @@ const char * DateToStrCookie(time_t t);
|
||||
const wchar_t * IpToStr(unsigned int ip_);
|
||||
|
||||
bool IsWhite(wchar_t s);
|
||||
bool IsWhite(const wchar_t * str, bool treat_new_line_as_white = false);
|
||||
bool IsWhite(const std::wstring & str, bool treat_new_line_as_white = false);
|
||||
bool IsLastSlash(const std::wstring & path);
|
||||
|
||||
template<class StringType>
|
||||
|
Reference in New Issue
Block a user