summaryrefslogtreecommitdiff
path: root/libs/pbd/whitespace.cc
diff options
context:
space:
mode:
authorTaybin Rutkin <taybin@taybin.com>2006-06-29 22:21:30 +0000
committerTaybin Rutkin <taybin@taybin.com>2006-06-29 22:21:30 +0000
commit481f7c39655afec832ac10430dd61a3bb464aa58 (patch)
treecde736699cbe49374a6aaa079258f88c1d0c7059 /libs/pbd/whitespace.cc
parentd1a4f74ef2c86042a0cbe0e83e611596df27575f (diff)
Fixed i18n system.
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
Diffstat (limited to 'libs/pbd/whitespace.cc')
-rw-r--r--libs/pbd/whitespace.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/libs/pbd/whitespace.cc b/libs/pbd/whitespace.cc
new file mode 100644
index 0000000000..7f74940457
--- /dev/null
+++ b/libs/pbd/whitespace.cc
@@ -0,0 +1,30 @@
+#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);
+}
+