use isspace() and not isgraph() to identify whitespace; remove Glib::ustring version...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 14 Sep 2010 16:50:22 +0000 (16:50 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 14 Sep 2010 16:50:22 +0000 (16:50 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@7773 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/pbd/pbd/whitespace.h
libs/pbd/whitespace.cc

index dcdb4e5f2771aa86e666de5b2b07e5a7a528689c..444be112b064bf3e40d48f76bcc2b6c5d0acbb5a 100644 (file)
 
 #include <string>
 
-namespace Glib {
-       class ustring;
-}
-
 namespace PBD {
 
 // returns the empty string if the entire string is whitespace
 // so check length after calling.
 extern void strip_whitespace_edges (std::string& str);
-extern void strip_whitespace_edges (Glib::ustring& str);
 
 } // namespace PBD
 
index 7fafd07c6f6367094d01728daf6e8129b108fce9..00d47523db184bcfdeaeaaeca5616e0e32c0cb6b 100644 (file)
@@ -18,7 +18,6 @@
 */
 
 #include "pbd/whitespace.h"
-#include <glibmm/ustring.h>
 
 using namespace std;
 
@@ -40,7 +39,7 @@ strip_whitespace_edges (string& str)
     /* strip front */
                                        
     for (i = 0; i < len; ++i) {
-        if (isgraph (str[i])) {
+        if (!isspace (str[i])) {
             break;
         }
     }
@@ -63,7 +62,7 @@ strip_whitespace_edges (string& str)
            }
            
            do {
-                   if (isgraph (str[i]) || i == 0) {
+                   if (!isspace (str[i]) || i == 0) {
                            break;
                    }
 
@@ -78,12 +77,4 @@ strip_whitespace_edges (string& str)
     }
 }
 
-void
-strip_whitespace_edges (Glib::ustring& str)
-{   
-       string copy (str.raw());
-       strip_whitespace_edges (copy);
-       str = copy;
-}
-
 } // namespace PBD