481f7c3965
Renamed pbd3 back to pbd, since it's version 4.1 now. Very minor fixes git-svn-id: svn://localhost/ardour2/trunk@656 d708f5d6-7413-0410-9779-e7cbd77b26cf
31 lines
489 B
C++
31 lines
489 B
C++
#include <pbd/whitespace.h>
|
|
|
|
using namespace std;
|
|
|
|
void
|
|
strip_whitespace_edges (string& str)
|
|
{
|
|
string::size_type i;
|
|
string::size_type len;
|
|
string::size_type s;
|
|
|
|
len = str.length();
|
|
|
|
for (i = 0; i < len; ++i) {
|
|
if (isgraph (str[i])) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
s = i;
|
|
|
|
for (i = len - 1; i >= 0; --i) {
|
|
if (isgraph (str[i])) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
str = str.substr (s, (i - s) + 1);
|
|
}
|
|
|