mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
absl_string -> std_string as Sandbox param
This commit is contained in:
parent
b41bcccab7
commit
8ceb08dbf4
|
@ -165,7 +165,7 @@ std::string GetFilePath(const absl::string_view filename) {
|
||||||
return sandbox2::file::JoinPath(project_path, "test", "images", 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
|
// to use dir and file inside sapi-libtiff, use
|
||||||
// sandbox(file) – file only -- or
|
// sandbox(file) – file only -- or
|
||||||
// sandbox(file, dir) -- file and dir -- 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());
|
SAPI_RETURN_IF_ERROR(sandbox.Init());
|
||||||
|
|
||||||
TiffApi api(&sandbox);
|
TiffApi api(&sandbox);
|
||||||
sapi::v::ConstCStr srcfile_var(srcfile.data());
|
sapi::v::ConstCStr srcfile_var(srcfile.c_str());
|
||||||
sapi::v::ConstCStr r_var("r");
|
sapi::v::ConstCStr r_var("r");
|
||||||
|
|
||||||
absl::StatusOr<TIFF*> status_or_tif;
|
absl::StatusOr<TIFF*> status_or_tif;
|
||||||
|
|
|
@ -24,8 +24,8 @@ namespace {
|
||||||
|
|
||||||
class TiffSapiSandbox : public TiffSandbox {
|
class TiffSapiSandbox : public TiffSandbox {
|
||||||
public:
|
public:
|
||||||
TiffSapiSandbox(std::optional<absl::string_view> file = std::nullopt,
|
TiffSapiSandbox(std::optional<std::string> file = std::nullopt,
|
||||||
std::optional<absl::string_view> dir = std::nullopt)
|
std::optional<std::string> dir = std::nullopt)
|
||||||
: file_(std::move(file)), dir_(std::move(dir)) {}
|
: file_(std::move(file)), dir_(std::move(dir)) {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -61,8 +61,8 @@ class TiffSapiSandbox : public TiffSandbox {
|
||||||
return builder.get()->BuildOrDie();
|
return builder.get()->BuildOrDie();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::optional<absl::string_view> file_;
|
std::optional<std::string> file_;
|
||||||
std::optional<absl::string_view> dir_;
|
std::optional<std::string> dir_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
Loading…
Reference in New Issue
Block a user