Gestione dei const char * NULL negli operatori di confronto
git-svn-id: svn://10.65.10.50/trunk@4662 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
41ef2df2f8
commit
ee1a480054
@ -210,34 +210,34 @@ public:
|
||||
|
||||
// @cmember Controlla se due stringhe sono uguali
|
||||
bool operator ==(const char* s) const
|
||||
{ return strcmp(_str, s) == 0; }
|
||||
{ return s ? strcmp(_str, s) == 0 : empty();}
|
||||
// @cmember Controlla se due stringhe sono uguali
|
||||
bool operator ==(char* s) const
|
||||
{ return strcmp(_str, s) == 0; }
|
||||
{ return s ? strcmp(_str, s) == 0 : empty();}
|
||||
// @cmember Controlla se due stringe sono uguali
|
||||
bool operator ==(const TString& s) const
|
||||
{ return strcmp(_str, s._str) == 0; }
|
||||
// @cmember Controlla se due stringhe sono diverse
|
||||
bool operator !=(const char* s) const
|
||||
{ return strcmp(_str, s) != 0; }
|
||||
{ return s ? strcmp(_str, s) != 0 : not_empty();}
|
||||
// @cmember Controlla se due stringhe sono diverse
|
||||
bool operator !=(char* s) const
|
||||
{ return strcmp(_str, s) != 0; }
|
||||
{ return s ? strcmp(_str, s) != 0 : not_empty();}
|
||||
// @cmember Controlla se due stringhe sono diverse
|
||||
bool operator !=(const TString& s) const
|
||||
{ return strcmp(_str, s._str) != 0; }
|
||||
// @cmember Controlla se una stringa e' minore di un'altra
|
||||
bool operator <(const char* s) const
|
||||
{ return strcmp(_str, s) < 0; }
|
||||
{ return s ? strcmp(_str, s) < 0 : FALSE;}
|
||||
// @cmember Controlla se una stringa e' maggiore di un'altra
|
||||
bool operator >(const char* s) const
|
||||
{ return strcmp(_str, s) > 0; }
|
||||
{ return s ? strcmp(_str, s) > 0 : not_empty();}
|
||||
// @cmember Controlla se una stringa e' maggiore o uguale ad un'altra
|
||||
bool operator >=(const char* s) const
|
||||
{ return strcmp(_str, s) >= 0; }
|
||||
{ return s ? strcmp(_str, s) >= 0 : TRUE;}
|
||||
// @cmember Controlla se una stringa e' minore o uguale ad un'altra
|
||||
bool operator <=(const char* s) const
|
||||
{ return strcmp(_str, s) <= 0; }
|
||||
{ return s ? strcmp(_str, s) <= 0 : empty();}
|
||||
// @cmember Controlla se una stringa e' minore di un'altra
|
||||
bool operator <(const TString & s) const
|
||||
{ return strcmp(_str, s._str) < 0; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user