absl_string -> std_string as Sandbox param

This commit is contained in:
Alexandra Latysheva 2020-10-28 12:04:12 +00:00
parent b41bcccab7
commit 8ceb08dbf4
2 changed files with 6 additions and 6 deletions

View File

@ -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<TIFF*> status_or_tif;

View File

@ -24,8 +24,8 @@ namespace {
class TiffSapiSandbox : public TiffSandbox {
public:
TiffSapiSandbox(std::optional<absl::string_view> file = std::nullopt,
std::optional<absl::string_view> dir = std::nullopt)
TiffSapiSandbox(std::optional<std::string> file = std::nullopt,
std::optional<std::string> 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<absl::string_view> file_;
std::optional<absl::string_view> dir_;
std::optional<std::string> file_;
std::optional<std::string> dir_;
};
} // namespace