MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / string_as_array

Function string_as_array

tensorflow/core/lib/gtl/stl_util.h:39–39  ·  view source on GitHub ↗

Returns a char* pointing to the beginning of a string's internal buffer. The result is a valid "null-terminated byte string", even if *str is empty. Up to C++14 it is not valid to *write* to the null terminator; as of C++17, it is valid to write zero to the null terminator (but not any other value).

Source from the content-addressed store, hash-verified

37// Up to C++14 it is not valid to *write* to the null terminator; as of C++17,
38// it is valid to write zero to the null terminator (but not any other value).
39inline char* string_as_array(string* str) { return &*str->begin(); }
40
41// The following vector_as_array functions return raw pointers to the underlying
42// data buffer. The return value is unspecified (but valid) if the input range

Callers 9

MemoryDebugStringMethod · 0.85
ReadFileSliceMethod · 0.85
ReadFileToStringFunction · 0.85
DecodeStringListFunction · 0.85
ReadAllMethod · 0.85
TEST_FFunction · 0.85
ReadAllMethod · 0.85
TEST_FFunction · 0.85

Calls 1

beginMethod · 0.45

Tested by 5

ReadAllMethod · 0.68
TEST_FFunction · 0.68
ReadAllMethod · 0.68
TEST_FFunction · 0.68