MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _get_c_string

Function _get_c_string

bson/__init__.py:269–272  ·  view source on GitHub ↗

Decode a BSON 'C' string to python str.

(data: Any, view: Any, position: int, opts: CodecOptions[Any])

Source from the content-addressed store, hash-verified

267
268
269def _get_c_string(data: Any, view: Any, position: int, opts: CodecOptions[Any]) -> Tuple[str, int]:
270 """Decode a BSON 'C' string to python str."""
271 end = data.index(b"\x00", position)
272 return _utf_8_decode(view[position:end], opts.unicode_decode_error_handler, True)[0], end + 1
273
274
275def _get_float(

Callers 2

_get_regexFunction · 0.85
_element_to_dictFunction · 0.85

Calls 1

indexMethod · 0.80

Tested by

no test coverage detected