Codechange: Use std::string in file scanners.

This commit is contained in:
Michael Lutz
2020-12-06 21:11:50 +01:00
parent 358056ec42
commit b408fe77f7
16 changed files with 91 additions and 132 deletions

View File

@@ -586,7 +586,7 @@ public:
{
}
bool AddFile(const char *filename, size_t basepath_length, const char *tar_filename) override;
bool AddFile(const std::string &filename, size_t basepath_length, const std::string &tar_filename) override;
/** Do the scan for GRFs. */
static uint DoScan()
@@ -600,9 +600,9 @@ public:
}
};
bool GRFFileScanner::AddFile(const char *filename, size_t basepath_length, const char *tar_filename)
bool GRFFileScanner::AddFile(const std::string &filename, size_t basepath_length, const std::string &tar_filename)
{
GRFConfig *c = new GRFConfig(filename + basepath_length);
GRFConfig *c = new GRFConfig(filename.c_str() + basepath_length);
bool added = true;
if (FillGRFDetails(c, false)) {