Use std::optional instead of mbgl::optional (#911)
This commit is contained in:
@@ -94,13 +94,13 @@ bool copyFile(JNIEnv* env,
|
||||
|
||||
bool stateOk = true;
|
||||
if (env->CallBooleanMethod(fileToCopy.get(), fileExists)) {
|
||||
mbgl::Log::Warning(mbgl::Event::General, "File '%s' already exists", filePath.c_str());
|
||||
mbgl::Log::Warning(mbgl::Event::General, "File '" + filePath + "' already exists");
|
||||
} else {
|
||||
std::unique_ptr<AAsset, std::function<void(AAsset*)>> fileAsset(
|
||||
AAssetManager_open(assetManager, fileName.c_str(), AASSET_MODE_BUFFER),
|
||||
[](AAsset* asset) { AAsset_close(asset); });
|
||||
if (fileAsset == nullptr) {
|
||||
mbgl::Log::Warning(mbgl::Event::General, "Failed to open asset file %s", fileName.c_str());
|
||||
mbgl::Log::Warning(mbgl::Event::General, "Failed to open asset file " + fileName);
|
||||
return false;
|
||||
}
|
||||
const void* fileData = AAsset_getBuffer(fileAsset.get());
|
||||
@@ -111,12 +111,12 @@ bool copyFile(JNIEnv* env,
|
||||
stateOk = newFile != nullptr;
|
||||
|
||||
if (!stateOk) {
|
||||
mbgl::Log::Warning(mbgl::Event::General, "Failed to create new file entry %s", fileName.c_str());
|
||||
mbgl::Log::Warning(mbgl::Event::General, "Failed to create new file entry " + fileName);
|
||||
} else {
|
||||
auto res = static_cast<off_t>(std::fwrite(fileData, sizeof(char), fileLen, newFile.get()));
|
||||
if (fileLen != res) {
|
||||
mbgl::Log::Warning(
|
||||
mbgl::Event::General, "Failed to generate file entry %s from assets", fileName.c_str());
|
||||
mbgl::Event::General, "Failed to generate file entry" + fileName + "from assets");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,7 @@ void unZipFile(JNIEnv* env, const std::string& zipFilePath, const std::string& d
|
||||
|
||||
if (!success) {
|
||||
mbgl::Log::Warning(
|
||||
mbgl::Event::General, "Failed to create folder entry %s from zip", fileNameStr.c_str());
|
||||
mbgl::Event::General, "Failed to create folder entry " + fileNameStr + " from zip");
|
||||
}
|
||||
}
|
||||
} else if (!(env->CallBooleanMethod(f, fileExists))) {
|
||||
@@ -194,7 +194,7 @@ void unZipFile(JNIEnv* env, const std::string& zipFilePath, const std::string& d
|
||||
|
||||
if (!success) {
|
||||
mbgl::Log::Warning(
|
||||
mbgl::Event::General, "Failed to create folder entry %s from zip", fileNameStr.c_str());
|
||||
mbgl::Event::General, "Failed to create folder entry" + fileNameStr + "from zip");
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ void unZipFile(JNIEnv* env, const std::string& zipFilePath, const std::string& d
|
||||
if (env->CallBooleanMethod(fileToDelete.get(), fileExists)) {
|
||||
jboolean success = (env->CallBooleanMethod(fileToDelete.get(), deleteFile));
|
||||
if (!success) {
|
||||
mbgl::Log::Warning(mbgl::Event::General, "Failed to delete file entry %s", zipFilePath.c_str());
|
||||
mbgl::Log::Warning(mbgl::Event::General, "Failed to delete file entry " + zipFilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user