Files Classes Functions Hierarchy
#include <stringspace.h>
Public Member Functions | |
| boolc | operator() (stringc &s) const |
| All characters must be space or an empty string for the string to be interpreted as full of spaces. | |
| boolc | operator[] (string &str) |
| If the string is empty delete it. | |
Public Attributes | |
| SPC | spacer |
| Functional object to test if a character is a space. | |
Identifying empty strings
spacerdelete<> space;
... if (space(some_string)) ...
For deleting empty strings
spacedelete<>()[some_string];
Linux needed cast for
assertreturnOS( (bool)spacerdelete<>()[s] );
Definition at line 52 of file stringspace.h.
| boolc spacerdelete< SPC >::operator() | ( | stringc & | s | ) | const [inline] |
All characters must be space or an empty string for the string to be interpreted as full of spaces.
Definition at line 83 of file stringspace.h.
References spacerdelete< SPC >::spacer.
00084 { 00085 if (s.empty()) 00086 return true; 00087 uintc sz = s.size(); 00088 uint i=0; 00089 for ( ; i<sz; ++i) 00090 { 00091 if (spacer(s[i])==false) 00092 return false; 00093 } 00094 00095 return true; 00096 }
| boolc spacerdelete< SPC >::operator[] | ( | string & | str | ) | [inline] |
If the string is empty delete it.
Definition at line 72 of file stringspace.h.
00073 { 00074 if (spacerdelete<SPC>()(str)) 00075 { 00076 str=""; 00077 return true; 00078 } 00079 return false; 00080 }
| SPC spacerdelete< SPC >::spacer |
Functional object to test if a character is a space.
Definition at line 57 of file stringspace.h.
Referenced by spacerdelete< SPC >::operator()().
1.5.8