From c144c71349a82c4d41577d67434d4d9b447e72c0 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 11 Apr 2013 00:26:33 -0700 Subject: [PATCH] cmText.h/c: Added cmTextIsNotEmpty() --- cmText.c | 4 ++++ cmText.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmText.c b/cmText.c index d2c9d2c..478b962 100644 --- a/cmText.c +++ b/cmText.c @@ -611,6 +611,10 @@ bool cmTextIsEmpty( const cmChar_t* s ) return true; } +bool cmTextIsNotEmpty( const cmChar_t* s ) +{ return !cmTextIsEmpty(s); } + + cmChar_t* cmTextLine( cmChar_t* s, unsigned line ) { assert( line>0); diff --git a/cmText.h b/cmText.h index 3e4d521..72a918e 100644 --- a/cmText.h +++ b/cmText.h @@ -192,8 +192,9 @@ extern "C" { // Append 'n' copies of 'c' to the end of s[]. cmChar_t* cmTextAppendChar( cmChar_t* s, cmChar_t c, unsigned n ); - // Returns true if the string is all spaces. + // Returns true if the string is NULL or all spaces. bool cmTextIsEmpty( const cmChar_t* s ); + bool cmTextIsNotEmpty( const cmChar_t* s ); // Returns NULL if string contains fewer than lineIdx lines. // Note: first line == 1.