Migrate ParseTagAndName to use absl::string_view

PiperOrigin-RevId: 574492000
This commit is contained in:
MediaPipe Team 2023-10-18 09:00:05 -07:00 committed by Copybara-Service
parent de1b1b6b97
commit d006304f6a
2 changed files with 3 additions and 2 deletions

View File

@ -127,7 +127,7 @@ absl::Status ValidateTag(const std::string& tag) {
"\" does not match \"" MEDIAPIPE_TAG_REGEX "\"."));
}
absl::Status ParseTagAndName(const std::string& tag_and_name, std::string* tag,
absl::Status ParseTagAndName(absl::string_view tag_and_name, std::string* tag,
std::string* name) {
// An optional tag and colon, followed by a name.
RET_CHECK(tag);

View File

@ -22,6 +22,7 @@
#include <vector>
#include "absl/base/macros.h"
#include "absl/strings/string_view.h"
#include "mediapipe/framework/port/proto_ns.h"
#include "mediapipe/framework/port/status.h"
@ -85,7 +86,7 @@ absl::Status ValidateTag(const std::string& tag);
// The format is an optional tag and colon, followed by a name.
// Example 1: "VIDEO:frames2" -> tag: "VIDEO", name: "frames2"
// Example 2: "video_frames_1" -> tag: "", name: "video_frames_1"
absl::Status ParseTagAndName(const std::string& tag_and_name, std::string* tag,
absl::Status ParseTagAndName(absl::string_view tag_and_name, std::string* tag,
std::string* name);
// Parse a generic TAG:index:name string. The format is a tag, then an