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);
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user