mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
Convert esmtool from const std::string&
to std::string_view
This commit is contained in:
parent
8047a2138e
commit
23eccebe9e
@ -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;
|
||||
|
@ -84,7 +84,7 @@ void ESMReader::resolveParentFileIndices(const std::vector<ESMReader>& allPlugin
|
||||
}
|
||||
}
|
||||
|
||||
void ESMReader::openRaw(std::unique_ptr<std::istream>&& stream, const std::string& name)
|
||||
void ESMReader::openRaw(std::unique_ptr<std::istream>&& stream, std::string_view name)
|
||||
{
|
||||
close();
|
||||
mEsm = std::move(stream);
|
||||
@ -94,9 +94,9 @@ void ESMReader::openRaw(std::unique_ptr<std::istream>&& 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<std::istream>&& stream, const std::string &name)
|
||||
|
@ -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<std::istream>&& stream, const std::string &name);
|
||||
void openRaw(std::unique_ptr<std::istream>&& 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(); };
|
||||
|
Loading…
x
Reference in New Issue
Block a user