Project import generated by Copybara.

GitOrigin-RevId: ea8d45731f5a052f79745e35bfd8240d6ac568d2
This commit is contained in:
MediaPipe Team
2020-12-16 00:05:25 -05:00
committed by chuoling
parent 38be2ec58f
commit 39309bedba
109 changed files with 5803 additions and 1500 deletions
+3 -2
View File
@@ -33,8 +33,9 @@ mediapipe::StatusOr<std::string> PathToResourceAsFile(const std::string& path) {
}
mediapipe::Status GetResourceContents(const std::string& path,
std::string* output) {
return mediapipe::file::GetContents(path, output);
std::string* output,
bool read_as_binary) {
return mediapipe::file::GetContents(path, output, read_as_binary);
}
} // namespace mediapipe
+2 -1
View File
@@ -44,7 +44,8 @@ mediapipe::StatusOr<std::string> PathToResourceAsFile(const std::string& path);
// Reads the entire contents of a resource. The search path is as in
// PathToResourceAsFile.
mediapipe::Status GetResourceContents(const std::string& path,
std::string* output);
std::string* output,
bool read_as_binary = true);
} // namespace mediapipe
+6 -1
View File
@@ -57,7 +57,12 @@ mediapipe::StatusOr<std::string> PathToResourceAsFile(const std::string& path) {
}
mediapipe::Status GetResourceContents(const std::string& path,
std::string* output) {
std::string* output,
bool read_as_binary) {
if (!read_as_binary) {
LOG(WARNING)
<< "Setting \"read_as_binary\" to false is a no-op on Android.";
}
if (absl::StartsWith(path, "/")) {
return file::GetContents(path, output, file::Defaults());
}
+5 -1
View File
@@ -66,7 +66,11 @@ mediapipe::StatusOr<std::string> PathToResourceAsFile(const std::string& path) {
}
mediapipe::Status GetResourceContents(const std::string& path,
std::string* output) {
std::string* output,
bool read_as_binary) {
if (!read_as_binary) {
LOG(WARNING) << "Setting \"read_as_binary\" to false is a no-op on ios.";
}
ASSIGN_OR_RETURN(std::string full_path, PathToResourceAsFile(path));
std::ifstream input_file(full_path);