cwText.h/cpp : Added textIsEqual(), textIsNotEqual().

This commit is contained in:
kevin 2021-11-05 22:22:30 -04:00
parent 10e6cac8d1
commit 5afd37c259
2 changed files with 6 additions and 4 deletions

View File

@ -70,10 +70,6 @@ int cw::textCompare( const char* s0, const char* s1, unsigned n)
return strncmp(s0,s1,n);
}
const char* cw::nextWhiteChar( const char* s )
{ return _nextWhiteChar(s,false); }

View File

@ -11,6 +11,12 @@ namespace cw
int textCompare( const char* s0, const char* s1 );
int textCompare( const char* s0, const char* s1, unsigned n);
inline bool textIsEqual( const char* s0, const char* s1 ) { return textCompare(s0,s1) == 0; }
inline bool textIsEqual( const char* s0, const char* s1, unsigned n ) { return textCompare(s0,s1,n) == 0; }
inline bool textIsNotEqual( const char* s0, const char* s1 ) { return !textIsEqual(s0,s1); }
inline bool textIsNotEqual( const char* s0, const char* s1, unsigned n ) { return !textIsEqual(s0,s1,n); }
// Return a pointer to the next white space char
// or nullptr if 's' is null are there are no whitespace char's.
const char* nextWhiteChar( const char* s );