MCPcopy Create free account
hub / github.com/WheretIB/nullc / FileReadType

Function FileReadType

NULLC/includes/file.cpp:95–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94 template<typename T>
95 void FileReadType(T* data, File* file)
96 {
97 if(!file->handle)
98 {
99 nullcThrowError("Cannot read from a closed file.");
100 return;
101 }
102 if(1 != fread(data, sizeof(T), 1, file->handle))
103 nullcThrowError("Failed to read from a file.");
104 }
105 void FileReadC(char* data, File* file)
106 {
107 FileReadType<char>(data, file);

Callers

nothing calls this directly

Calls 1

nullcThrowErrorFunction · 0.50

Tested by

no test coverage detected