From 8ceb08dbf4bc3b2679ec3718bd9c9dc12378d997 Mon Sep 17 00:00:00 2001 From: Alexandra Latysheva Date: Wed, 28 Oct 2020 12:04:12 +0000 Subject: [PATCH] absl_string -> std_string as Sandbox param --- oss-internship-2020/libtiff/example/main_sandboxed.cc | 4 ++-- oss-internship-2020/libtiff/sandboxed.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/oss-internship-2020/libtiff/example/main_sandboxed.cc b/oss-internship-2020/libtiff/example/main_sandboxed.cc index 11e8a9e..ec29762 100644 --- a/oss-internship-2020/libtiff/example/main_sandboxed.cc +++ b/oss-internship-2020/libtiff/example/main_sandboxed.cc @@ -165,7 +165,7 @@ std::string GetFilePath(const absl::string_view filename) { return sandbox2::file::JoinPath(project_path, "test", "images", filename); } -absl::Status LibTIFFMain(const absl::string_view srcfile) { +absl::Status LibTIFFMain(const std::string& srcfile) { // to use dir and file inside sapi-libtiff, use // sandbox(file) – file only -- or // sandbox(file, dir) -- file and dir -- or @@ -180,7 +180,7 @@ absl::Status LibTIFFMain(const absl::string_view srcfile) { SAPI_RETURN_IF_ERROR(sandbox.Init()); TiffApi api(&sandbox); - sapi::v::ConstCStr srcfile_var(srcfile.data()); + sapi::v::ConstCStr srcfile_var(srcfile.c_str()); sapi::v::ConstCStr r_var("r"); absl::StatusOr status_or_tif; diff --git a/oss-internship-2020/libtiff/sandboxed.h b/oss-internship-2020/libtiff/sandboxed.h index 9015522..031c633 100644 --- a/oss-internship-2020/libtiff/sandboxed.h +++ b/oss-internship-2020/libtiff/sandboxed.h @@ -24,8 +24,8 @@ namespace { class TiffSapiSandbox : public TiffSandbox { public: - TiffSapiSandbox(std::optional file = std::nullopt, - std::optional dir = std::nullopt) + TiffSapiSandbox(std::optional file = std::nullopt, + std::optional dir = std::nullopt) : file_(std::move(file)), dir_(std::move(dir)) {} private: @@ -61,8 +61,8 @@ class TiffSapiSandbox : public TiffSandbox { return builder.get()->BuildOrDie(); } - std::optional file_; - std::optional dir_; + std::optional file_; + std::optional dir_; }; } // namespace