Aggiunto metodo bool TString::blank() per vedere se una stringa e'

vuota o piena solo di whitespace


git-svn-id: svn://10.65.10.50/trunk@1021 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
villa 1995-02-21 10:21:39 +00:00
parent d78ec66ffa
commit 1aadb34116
3 changed files with 12 additions and 2 deletions

View File

@ -1,4 +1,4 @@
// $Id: printapp.cpp,v 1.17 1995-02-17 09:16:57 villa Exp $
// $Id: printapp.cpp,v 1.18 1995-02-21 10:21:35 villa Exp $
#include <ctype.h>
#include <stdarg.h>
@ -912,7 +912,7 @@ bool TPrint_application::print_one (int file)
{
int i = 0;
if ((_prind && _prind->iscancelled ()) || printer ().frozen ())
if ((_prind && _prind->iscancelled()) || printer().frozen())
if (_cancelled = cancel_hook()) return FALSE;
if (!_print_defined)

View File

@ -187,6 +187,15 @@ TString& TString::strip(const char* k)
}
bool TString::blank() const
{
if (empty()) return TRUE;
for (int i = 0; _str[i]; i++)
if (!isspace(_str[i]))
return FALSE;
return TRUE;
}
TString& TString::strip_spaces()
{
char instring = '\0';

View File

@ -71,6 +71,7 @@ public:
int len() const { return strlen(_str); }
bool empty() const { return *_str == '\0'; }
bool not_empty() const { return *_str != '\0'; }
bool blank() const; // TRUE se e' vuota o contiene solo whitespace
int find(char, int from = 0) const; // Ritorna la posizione del carattere char nell'oggetto TString
int find(const char* s, int from = 0) const; // Ritorna la posizione della stringa s nell'oggetto TString