// about : \82¢\82¢\89Á\8c¸\82È\82Æ\82±\82ë\82ð\83N\83\8a\83b\83N\82µ\82Ä\82à\92P\8cê\82³\82¦\82 \82ê\82Î\95K\82¸get\82·\82é
// alnum : \89p\90\94\8e\9a\88È\8aO\82Í\96³\8e\8b
-BOOL GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum )
+bool GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum )
{
if ( !about )
if ( !IsWordChar( *(str+pos) ) )
- return FALSE;
+ return false;
// while ( *(str+pos) == ' ' || *(str+pos) == '\t' ){
// pos++;
// }
wordtop = p;
const tchar *wordtail = NULL;
const tchar *wordprev = NULL;
- BOOL fSpc = FALSE;
+ bool fSpc = false;
// pos\82É\82 \82é\92P\8cê\82Ìstart\82Æend\82ð\8b\81\82ß\82é
while ( *p ){
if ( !IsWordChar( *p ) || (alnum && !isalphanum(*p)) ){
}
}
}
- fSpc = TRUE;
+ fSpc = true;
} else {
// \92P\8cê\95¶\8e\9a
if ( fSpc ){
if ( (unsigned)wordtop - (about ? 3 : 0) > (unsigned)(orgp + pos) ){
// \92P\8cê\82Ì\8bæ\90Ø\82è\82¾\82Á\82½\81A\92P\8cê\82Ì\8dÅ\8f\89\82ªpos\82æ\82è\8cã\82ë\82É\82 \82Á\82½
// about = true\82Ì\8fê\8d\87\82Í\81A\82R\95¶\8e\9a\95ª\82Ù\82Ç\82¢\82¢\82©\82°\82ñ\8d·\82ð\91«\82µ\82Ä\82¨\82
- return FALSE;
+ return false;
}
if ( fLongest ){
if ( !fSpc ){
if ( --wordcount == 0 )
break;
- fSpc = TRUE;
+ fSpc = true;
}
} else {
fSpc = FALSE;
} else {
prevstart = start;
}
- return TRUE;
+ return true;
}
#if 0
bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, int wordcount )
const tchar *p = orgp;
const tchar *wordtop = p;
const tchar *wordtail = NULL;
- BOOL fSpc = FALSE;
+ bool fSpc = false;
while ( 1 ){
sp = p;
LD_CHAR( c, p );
wordtail = sp;
break;
}
- fSpc = TRUE;
+ fSpc = true;
} else {
if ( fSpc ){
wordtop = sp;
- fSpc = FALSE;
+ fSpc = false;
}
}
}
if ( !fSpc ){
if ( --wordcount == 0 )
break;
- fSpc = TRUE;
+ fSpc = true;
}
} else {
- fSpc = FALSE;
+ fSpc = false;
}
}
wordtail = sp;
wordtail = sp;
start = STR_DIFF( wordtop, orgp );
end = STR_DIFF( wordtail, orgp );
- return TRUE;
+ return true;
}
bool mbIsWordChar( unsigned short c )
{
// prototypes //
int isalphanum( tuchar c );
bool mbIsWordChar( unsigned short c );
-BOOL GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum );
+bool GetWord( const tchar *str, int pos, int &start, int &end, int &prevstart, bool fLongest, int wordcount, bool about, bool alnum, int numPrev );
bool mbGetWord( const tchar *str, int pos, int &start, int &end, bool fLongest, int wordcount );
// inlines //