Migrate ParseTagAndName to use absl::string_view
PiperOrigin-RevId: 574492000
This commit is contained in:
		
							parent
							
								
									de1b1b6b97
								
							
						
					
					
						commit
						d006304f6a
					
				| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user