Use c_str() instead of data()

This commit is contained in:
skdltmxn 2021-01-07 04:28:19 +09:00
parent c093a50f3f
commit e1cfa8693f
4 changed files with 4 additions and 4 deletions

View File

@ -31,7 +31,7 @@ public:
}
int32_t error;
_zip = zip_open(std::string(path).data(), zipOpenMode, &error);
_zip = zip_open(std::string(path).c_str(), zipOpenMode, &error);
if (_zip == nullptr)
{
throw IOException("Unable to open zip file.");

View File

@ -59,7 +59,7 @@ public:
std::vector<uint8_t> GetData(std::string_view path) const override
{
auto absolutePath = Path::Combine(_basePath, std::string(path).data());
auto absolutePath = Path::Combine(_basePath, std::string(path).c_str());
return File::ReadAllBytes(absolutePath);
}
};

View File

@ -158,7 +158,7 @@ PluginType Plugin::ParsePluginType(std::string_view type)
void Plugin::CheckForLicence(const DukValue& dukLicence, std::string_view pluginName)
{
if (dukLicence.type() != DukValue::Type::STRING || dukLicence.as_string().empty())
log_error("Plugin %s does not specify a licence", std::string(pluginName).data());
log_error("Plugin %s does not specify a licence", std::string(pluginName).c_str());
}
#endif

View File

@ -21,7 +21,7 @@ class ImageImporterTests : public testing::Test
public:
static std::string GetImagePath(const std::string& name)
{
return Path::Combine(TestData::GetBasePath(), "images", name.data());
return Path::Combine(TestData::GetBasePath(), "images", name.c_str());
}
static uint32_t GetHash(void* buffer, size_t bufferLength)