mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
merged with 1697 revision of trunk (which is post-rc1 but pre-rc2
git-svn-id: svn://localhost/ardour2/branches/2.1-staging@1698 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
4bf712f501
commit
45d3ec1437
696 changed files with 48513 additions and 22850 deletions
19
libs/pbd/strreplace.cc
Normal file
19
libs/pbd/strreplace.cc
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#include <pbd/replace_all.h>
|
||||
|
||||
int
|
||||
replace_all (std::string& str,
|
||||
std::string const& target,
|
||||
std::string const& replacement)
|
||||
{
|
||||
std::string::size_type start = str.find (target, 0);
|
||||
int cnt = 0;
|
||||
|
||||
while (start != std::string::npos) {
|
||||
str.replace (start, target.size(), replacement);
|
||||
start = str.find (target, start+replacement.size());
|
||||
++cnt;
|
||||
}
|
||||
|
||||
return cnt;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue