File: replace.cc

package info (click to toggle)
stealth 4.04.00-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,540 kB
  • sloc: cpp: 2,759; sh: 151; makefile: 111; ansic: 52
file content (17 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "integrityscanner.ih"

void IntegrityScanner::replace(std::string &str, char const *org, 
                                        char const *replacement)
{
    size_t orglen = strlen(org);

    while (true)
    {
        string::size_type idx = str.find(org);

        if (idx == string::npos)
            break;

        str.replace(idx, orglen, replacement);
    }
}