summaryrefslogtreecommitdiff
path: root/libs/pbd/convert.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-02-08 19:37:51 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-02-08 19:37:51 +0000
commit1afb1cfea4f2ea66962faef01d729014bdc9eb56 (patch)
treef01902b162d95b5fb3e8bf8865ac7387df42aa4f /libs/pbd/convert.cc
parent222c18d18afe76228775c0d73004e9c77bea611e (diff)
add variants of atoi etc. for std::string
git-svn-id: svn://localhost/ardour2/branches/3.0@6651 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/convert.cc')
-rw-r--r--libs/pbd/convert.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/libs/pbd/convert.cc b/libs/pbd/convert.cc
index 617fbec473..0610567102 100644
--- a/libs/pbd/convert.cc
+++ b/libs/pbd/convert.cc
@@ -106,6 +106,18 @@ atoi (const string& s)
return ::atoi (s.c_str());
}
+int32_t
+atol (const string& s)
+{
+ return (int32_t) ::atol (s.c_str());
+}
+
+int64_t
+atoll (const string& s)
+{
+ return (int64_t) ::atoll (s.c_str());
+}
+
double
atof (const string& s)
{
@@ -282,11 +294,14 @@ length2string (const int64_t frames, const double sample_rate)
return duration_str;
}
+
static bool
chars_equal_ignore_case(char x, char y)
{
- static std::locale loc;
- return toupper(x, loc) == toupper(y, loc);
+ /* app should have called setlocale() if its wants this comparison to be
+ locale sensitive.
+ */
+ return toupper (x) == toupper (y);
}
bool