diff --git a/hoot-core/src/main/cpp/hoot/core/util/FileUtils.cpp b/hoot-core/src/main/cpp/hoot/core/util/FileUtils.cpp
index b5a89aa..ec35a6b 100644
--- a/hoot-core/src/main/cpp/hoot/core/util/FileUtils.cpp
+++ b/hoot-core/src/main/cpp/hoot/core/util/FileUtils.cpp
@@ -140,6 +140,22 @@ void FileUtils::writeFully(const QString& path, const QString& text)
outFile.close();
}
+void FileUtils::replaceFully(const QString& path, const QStringList& textsToReplace,
+ const QStringList& replacementTexts)
+{
+ if (textsToReplace.size() != replacementTexts.size())
+ {
+ throw IllegalArgumentException("Texts to replace not the same size as the replacements texts.");
+ }
+
+ QString input = readFully(path);
+ for (int i = 0; i < textsToReplace.size(); i++)
+ {
+ input = input.replace(textsToReplace.at(i), replacementTexts.at(i));
+ }
+ writeFully(path, input);
+}
+
long FileUtils::getNumberOfLinesInFile(const QString& file)
{
std::ifstream inFile(file.toStdString().c_str());