cprover
substitute.cpp
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module:
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
9 #include "substitute.h"
10 
11 #include <cassert>
12 
14  std::string &dest,
15  const std::string &what,
16  const std::string &by)
17 {
18  assert(!what.empty());
19 
20  while(true)
21  {
22  std::string::size_type pos=dest.find(what);
23 
24  if(pos==std::string::npos)
25  return; // done
26 
27  dest.replace(dest.begin()+pos,
28  dest.begin()+pos+what.size(),
29  by);
30  }
31 }
literalt pos(literalt a)
Definition: literal.h:193
unsignedbv_typet size_type()
Definition: c_types.cpp:57
void substitute(std::string &dest, const std::string &what, const std::string &by)
Definition: substitute.cpp:13