MCPcopy Create free account
hub / github.com/Tencent/libpag / readUTF8String

Method readUTF8String

exporter/src/utils/ByteArray.cpp:145–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145std::string ByteArray::readUTF8String() {
146 if (_position < dataView.size()) {
147 auto text = reinterpret_cast<const char*>(dataView.bytes() + _position);
148 auto maxLength = dataView.size() - _position;
149 auto textLength = strnlen(text, maxLength);
150 textLength = std::min(textLength, maxLength);
151 positionChanged(textLength);
152 return {text, textLength};
153 }
154 LOGI("End of file was encountered.");
155 return "";
156}
157
158void ByteArray::bitPositionChanged(size_t offset) {
159 _bitPosition += offset;

Callers 4

ReadCompositionsFunction · 0.45
ReadLayersFunction · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected