diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 01:05:14 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-03-02 01:05:14 +0000 |
commit | a5ab2e99e19d5f5d4c1f91f38cd774fefdf257dc (patch) | |
tree | d4741f329eea4d523afe3f020e59c9b6983932a7 /libs/pbd/convert.cc | |
parent | db8b575c30845bafc34b87bacd52129c95d1c478 (diff) |
PBD::capitalize() and use it to for the XML node name of a SequenceProperty's history node
git-svn-id: svn://localhost/ardour2/branches/3.0@6719 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/convert.cc')
-rw-r--r-- | libs/pbd/convert.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc index 0610567102..bda0683910 100644 --- a/libs/pbd/convert.cc +++ b/libs/pbd/convert.cc @@ -21,6 +21,7 @@ #include <stdint.h> #include <stdlib.h> #include <cstdio> +#include <ctype.h> #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif @@ -37,6 +38,17 @@ using Glib::ustring; namespace PBD { string +capitalize (const string& str) +{ + string ret = str; + if (!str.empty()) { + /* XXX not unicode safe */ + ret[0] = toupper (str[0]); + } + return ret; +} + +string short_version (string orig, string::size_type target_length) { /* this tries to create a recognizable abbreviation |