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

Function readPlainString

src/fileformat/utils/file_io.cpp:51–61  ·  view source on GitHub ↗

* Read bytes from file stream as plain text * @param fileStream Representation of input file * @param plain Into this parameter the resulting string is stored * @param start Start offset of read * @param desiredSize Number of bytes for read. If this parameter is set to zero, * function will read all bytes from @a start until end of file. * @return @c true if operation went OK, otherwise @

Source from the content-addressed store, hash-verified

49 * If function returns @c false, @a plain is set to empty string
50 */
51bool readPlainString(std::istream &fileStream, std::string &plain, std::size_t start, std::size_t desiredSize)
52{
53 std::vector<unsigned char> bytes;
54 if(!readFile(fileStream, bytes, start, desiredSize))
55 {
56 return false;
57 }
58
59 bytesToString(bytes, plain);
60 return true;
61}
62
63} // namespace fileformat
64} // namespace retdec

Callers

nothing calls this directly

Calls 2

readFileFunction · 0.85
bytesToStringFunction · 0.85

Tested by

no test coverage detected