summaryrefslogtreecommitdiff
path: root/libs/pbd
diff options
context:
space:
mode:
Diffstat (limited to 'libs/pbd')
-rw-r--r--libs/pbd/pbd/whitespace.h5
-rw-r--r--libs/pbd/whitespace.cc9
2 files changed, 14 insertions, 0 deletions
diff --git a/libs/pbd/pbd/whitespace.h b/libs/pbd/pbd/whitespace.h
index 444be112b0..dcdb4e5f27 100644
--- a/libs/pbd/pbd/whitespace.h
+++ b/libs/pbd/pbd/whitespace.h
@@ -22,11 +22,16 @@
#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
diff --git a/libs/pbd/whitespace.cc b/libs/pbd/whitespace.cc
index d73fced321..7fafd07c6f 100644
--- a/libs/pbd/whitespace.cc
+++ b/libs/pbd/whitespace.cc
@@ -18,6 +18,7 @@
*/
#include "pbd/whitespace.h"
+#include <glibmm/ustring.h>
using namespace std;
@@ -77,4 +78,12 @@ strip_whitespace_edges (string& str)
}
}
+void
+strip_whitespace_edges (Glib::ustring& str)
+{
+ string copy (str.raw());
+ strip_whitespace_edges (copy);
+ str = copy;
+}
+
} // namespace PBD