changed: SpaceParser -- parser's engine has been rewritten
now we can map all strings to all strings documentation in space.h need to be updated yet git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@407 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -638,6 +638,31 @@ return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
those white characters here should be the same as in spaceparser.cpp
|
||||
*/
|
||||
bool Space::IsWhite(int c)
|
||||
{
|
||||
// dont use '\n' here
|
||||
// 13 (\r) is at the end of a line in a dos file \r\n
|
||||
// 160 is an unbreakable space
|
||||
if( c==' ' || c=='\t' || c==13 || c==160 )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Space::HasWhite(const std::wstring & str)
|
||||
{
|
||||
for(size_t i=0 ; i<str.size() ; ++i)
|
||||
if( IsWhite(str[i]) )
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user