From 1aadb341164bd3ec28dc1176247406d85bfa7801 Mon Sep 17 00:00:00 2001 From: villa Date: Tue, 21 Feb 1995 10:21:39 +0000 Subject: [PATCH] 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 --- include/printapp.cpp | 4 ++-- include/strings.cpp | 9 +++++++++ include/strings.h | 1 + 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/printapp.cpp b/include/printapp.cpp index c1fa3b9cc..df18e59d8 100755 --- a/include/printapp.cpp +++ b/include/printapp.cpp @@ -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 #include @@ -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) diff --git a/include/strings.cpp b/include/strings.cpp index 93ed40a9a..a70d90ae5 100755 --- a/include/strings.cpp +++ b/include/strings.cpp @@ -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'; diff --git a/include/strings.h b/include/strings.h index cb03dcaf4..09ab628ee 100755 --- a/include/strings.h +++ b/include/strings.h @@ -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