MCPcopy Index your code
hub / github.com/JoshData/fast_diff_match_patch / to_string

Method to_string

interface.cpp:12–19  ·  view source on GitHub ↗

Extract the bytes data.

Source from the content-addressed store, hash-verified

10
11 // Extract the bytes data.
12 static std::string to_string(Py_buffer& value) {
13 auto buffer = (char*)malloc(value.len + 1);
14 PyBuffer_ToContiguous(buffer, &value, value.len, 'C');
15 PyBuffer_Release(&value);
16 auto s = std::string(buffer, value.len);
17 free(buffer);
18 return s;
19 }
20
21 // Create PyString from underlying char array
22 static PyObject* from_string(std::string& value) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected