3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 - 2013 Christian Schoenebeck * |
* Copyright (C) 2005 - 2016 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
30 |
#include "global.h" |
#include "global.h" |
31 |
#include "Exception.h" |
#include "Exception.h" |
32 |
#include <sstream> |
#include <sstream> |
33 |
|
#include <algorithm> |
34 |
|
#include <math.h> |
35 |
|
|
36 |
#if HAVE_CONFIG_H |
#if HAVE_CONFIG_H |
37 |
# include <config.h> |
# include <config.h> |
106 |
return i; |
return i; |
107 |
} |
} |
108 |
|
|
109 |
|
inline std::string ltrim(std::string s) { |
110 |
|
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); |
111 |
|
return s; |
112 |
|
} |
113 |
|
|
114 |
|
inline std::string rtrim(std::string s) { |
115 |
|
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); |
116 |
|
return s; |
117 |
|
} |
118 |
|
|
119 |
|
inline std::string trim(std::string s) { |
120 |
|
return ltrim(rtrim(s)); |
121 |
|
} |
122 |
|
|
123 |
class Runnable { |
class Runnable { |
124 |
public: |
public: |
125 |
virtual ~Runnable() { } |
virtual ~Runnable() { } |