MCPcopy Create free account
hub / github.com/carbonengine/trinity / _StringTable

Class _StringTable

shadercompiler/python/shadercompiler/effectinfo.py:74–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73
74class _StringTable(object):
75 def __init__(self, stream):
76 table_size = stream.read_uint32()
77 self._data = stream.read_raw(table_size)
78
79 def get_string(self, offset):
80 try:
81 return self._data[offset:self._data.index(b'\000', offset)].decode('utf-8')
82 except ValueError:
83 return self._data[offset:]
84
85 def get_blob(self, offset, size):
86 return self._data[offset:offset + size]
87
88
89class ShaderInput(object):

Callers 1

_loadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected