MCPcopy Create free account
hub / github.com/crownengine/crown / read

Method read

3rdparty/bx/src/process.cpp:72–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70 }
71
72 int32_t ProcessReader::read(void* _data, int32_t _size, Error* _err)
73 {
74 BX_ASSERT(NULL != _err, "Reader/Writer interface calling functions must handle errors."); BX_UNUSED(_err);
75
76 FILE* file = (FILE*)m_file;
77 int32_t size = (int32_t)fread(_data, 1, _size, file);
78 if (size != _size)
79 {
80 if (0 != feof(file) )
81 {
82 BX_ERROR_SET(_err, kErrorReaderWriterEof, "ProcessReader: EOF.");
83 }
84 else if (0 != ferror(file) )
85 {
86 BX_ERROR_SET(_err, kErrorReaderWriterRead, "ProcessReader: read error.");
87 }
88
89 return size >= 0 ? size : 0;
90 }
91
92 return size;
93 }
94
95 int32_t ProcessReader::getExitCode() const
96 {

Callers

nothing calls this directly

Calls 3

freadFunction · 0.85
feofFunction · 0.85
ferrorFunction · 0.85

Tested by

no test coverage detected