~ubuntu-branches/ubuntu/precise/exiv2/precise

« back to all changes in this revision

Viewing changes to src/utils.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Mercatante
  • Date: 2006-12-07 18:40:10 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061207184010-0ouu8v0dr8nznob9
Tags: 0.12-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
/*
22
22
  File:      utils.cpp
23
 
  Version:   $Rev: 669 $
 
23
  Version:   $Rev: 983 $
24
24
  Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
25
25
  History:   08-Dec-03, ahu: created
26
26
 */
27
27
// *****************************************************************************
28
28
#include "rcsid.hpp"
29
 
EXIV2_RCSID("@(#) $Id: utils.cpp 669 2006-01-17 14:53:57Z ahuggel $");
 
29
EXIV2_RCSID("@(#) $Id: utils.cpp 983 2006-11-16 14:42:38Z ahuggel $")
30
30
 
31
31
// *****************************************************************************
32
32
// included header files
143
143
        return true;
144
144
    }
145
145
 
 
146
    void replace(std::string& text, const std::string& searchText, const std::string& replaceText)
 
147
    {
 
148
        std::string::size_type index = 0;
 
149
        while ((index = text.find(searchText, index)) != std::string::npos)
 
150
        {
 
151
            text.replace(index, searchText.length(), replaceText.c_str(), replaceText.length());
 
152
            index++;
 
153
        }
 
154
    }
 
155
 
146
156
}                                       // namespace Util