MCPcopy Create free account
hub / github.com/comaps/comaps / read_uint

Function read_uint

tools/python/mwm/mwm_python.py:431–443  ·  view source on GitHub ↗
(f, bytelen: int = 1)

Source from the content-addressed store, hash-verified

429
430
431def read_uint(f, bytelen: int = 1) -> int:
432 if bytelen == 1:
433 fmt = "B"
434 elif bytelen == 2:
435 fmt = "H"
436 elif bytelen == 4:
437 fmt = "I"
438 elif bytelen == 8:
439 fmt = "Q"
440 else:
441 raise Exception("Bytelen {0} is not supported".format(bytelen))
442 res = struct.unpack(fmt, f.read(bytelen))
443 return res[0]
444
445
446def read_varuint(f) -> int:

Callers 9

_read_osm2ft_v0Function · 0.90
_read_osm2ft_v1Function · 0.90
read_osm2ftFunction · 0.90
_read_sections_infoMethod · 0.85
__init__Method · 0.85
metadataMethod · 0.85
read_pointFunction · 0.85

Calls 2

formatMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected