From 627bda9d82c178641e5b5253379c21ce556eb3c2 Mon Sep 17 00:00:00 2001 From: Alexander Tkachev Date: Wed, 6 Jul 2016 15:37:13 +0600 Subject: COMMON: Add replace(String, String, String) Searches for a substring in the string and replaces it with the other string. --- backends/networking/sdl_net/indexpagehandler.cpp | 9 --------- backends/networking/sdl_net/indexpagehandler.h | 1 - 2 files changed, 10 deletions(-) (limited to 'backends/networking') diff --git a/backends/networking/sdl_net/indexpagehandler.cpp b/backends/networking/sdl_net/indexpagehandler.cpp index c44c3d4a5a..b3790a8393 100644 --- a/backends/networking/sdl_net/indexpagehandler.cpp +++ b/backends/networking/sdl_net/indexpagehandler.cpp @@ -249,15 +249,6 @@ Common::String IndexPageHandler::code() { return _code; } /// utils -void IndexPageHandler::replace(Common::String &source, const Common::String &what, const Common::String &with) { - const char *cstr = source.c_str(); - const char *position = strstr(cstr, what.c_str()); - if (position) { - uint32 index = position - cstr; - source.replace(index, what.size(), with); - } -} - Common::Archive *IndexPageHandler::getZipArchive() { // first search in themepath if (ConfMan.hasKey("themepath")) { diff --git a/backends/networking/sdl_net/indexpagehandler.h b/backends/networking/sdl_net/indexpagehandler.h index 0ccbf32480..a75c7a0381 100644 --- a/backends/networking/sdl_net/indexpagehandler.h +++ b/backends/networking/sdl_net/indexpagehandler.h @@ -61,7 +61,6 @@ class IndexPageHandler: public GUI::CommandSender { */ bool transformPath(Common::String &path, Common::String &prefixToRemove, Common::String &prefixToAdd); - void replace(Common::String &source, const Common::String &what, const Common::String &with); Common::Archive *getZipArchive(); Common::ArchiveMemberList listArchive(); Common::SeekableReadStream *getArchiveFile(Common::String name); -- cgit v1.2.3