MCPcopy Create free account
hub / github.com/avast/retdec / getString

Method getString

src/fileformat/types/resource_table/resource.cpp:232–241  ·  view source on GitHub ↗

* Get content of resource as plain string * @param sResult Into this parameter is stored content of resource as plain string * @param sOffset First byte of the resource data to be loaded (0 means * first byte of resource data) * @param sSize Number of bytes for read. If this parameter is set to zero, * method will read all bytes from @a sOffset until end of resource data. * @return @c

Source from the content-addressed store, hash-verified

230 * @return @c true if operation went OK, @c false otherwise
231 */
232bool Resource::getString(std::string &sResult, std::size_t sOffset, std::size_t sSize) const
233{
234 if(sOffset >= bytes.size())
235 {
236 return false;
237 }
238
239 bytesToString(bytes.data(), bytes.size(), sResult, sOffset, sSize);
240 return loaded;
241}
242
243/**
244 * Get content of resource as bytes

Callers

nothing calls this directly

Calls 3

bytesToStringFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected