diff --git a/apps/esmtool/esmtool.cpp b/apps/esmtool/esmtool.cpp index 2e64168046..9d90a542be 100644 --- a/apps/esmtool/esmtool.cpp +++ b/apps/esmtool/esmtool.cpp @@ -284,7 +284,7 @@ void loadCell(const Arguments& info, ESM::Cell &cell, ESM::ESMReader &esm, ESMDa } } -void printRawTes3(const std::string& path) +void printRawTes3(std::string_view path) { std::cout << "TES3 RAW file listing: " << path << '\n'; ESM::ESMReader esm; diff --git a/components/esm3/esmreader.cpp b/components/esm3/esmreader.cpp index 08cd100ab1..68228a8156 100644 --- a/components/esm3/esmreader.cpp +++ b/components/esm3/esmreader.cpp @@ -84,7 +84,7 @@ void ESMReader::resolveParentFileIndices(const std::vector& allPlugin } } -void ESMReader::openRaw(std::unique_ptr&& stream, const std::string& name) +void ESMReader::openRaw(std::unique_ptr&& stream, std::string_view name) { close(); mEsm = std::move(stream); @@ -94,9 +94,9 @@ void ESMReader::openRaw(std::unique_ptr&& stream, const std::strin mEsm->seekg(0, mEsm->beg); } -void ESMReader::openRaw(const std::string& filename) +void ESMReader::openRaw(std::string_view filename) { - openRaw(Files::openBinaryInputFileStream(filename), filename); + openRaw(Files::openBinaryInputFileStream(std::string(filename)), filename); } void ESMReader::open(std::unique_ptr&& stream, const std::string &name) diff --git a/components/esm3/esmreader.hpp b/components/esm3/esmreader.hpp index 2c987ef025..658a409ed6 100644 --- a/components/esm3/esmreader.hpp +++ b/components/esm3/esmreader.hpp @@ -61,7 +61,7 @@ public: /// Raw opening. Opens the file and sets everything up but doesn't /// parse the header. - void openRaw(std::unique_ptr&& stream, const std::string &name); + void openRaw(std::unique_ptr&& stream, std::string_view name); /// Load ES file from a new stream, parses the header. Closes the /// currently open file first, if any. @@ -69,7 +69,7 @@ public: void open(const std::string &file); - void openRaw(const std::string &filename); + void openRaw(std::string_view filename); /// Get the current position in the file. Make sure that the file has been opened! size_t getFileOffset() const { return mEsm->tellg(); };