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 - 2019 Christian Schoenebeck * |
* Copyright (C) 2005 - 2020 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 * |
111 |
} |
} |
112 |
|
|
113 |
inline std::string ltrim(std::string s) { |
inline std::string ltrim(std::string s) { |
114 |
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace)))); |
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) { |
115 |
|
return !std::isspace(ch); |
116 |
|
})); |
117 |
return s; |
return s; |
118 |
} |
} |
119 |
|
|
120 |
inline std::string rtrim(std::string s) { |
inline std::string rtrim(std::string s) { |
121 |
s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end()); |
s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { |
122 |
|
return !std::isspace(ch); |
123 |
|
}).base(), s.end()); |
124 |
return s; |
return s; |
125 |
} |
} |
126 |
|
|