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

Method readUTF8String

src/codec/utils/DecodeStream.cpp:153–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153std::string DecodeStream::readUTF8String() {
154 if (_position < dataView.size()) {
155 auto text = reinterpret_cast<const char*>(dataView.bytes() + _position);
156 auto maxLength = dataView.size() - _position;
157 auto textLength = strnlen(text, maxLength);
158 if (textLength < maxLength) {
159 positionChanged(textLength + 1);
160 return {text, textLength};
161 }
162 }
163 PAGThrowError(context, "End of file was encountered.");
164 return "";
165}
166
167int32_t DecodeStream::readEncodedInt32() {
168 auto data = readEncodedUint32();

Callers 5

readValueMethod · 0.45
ReadStringFunction · 0.45
ReadMarkerListFunction · 0.45
ReadFileAttributesFunction · 0.45
ReadFontTablesFunction · 0.45

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected