MCPcopy Create free account
hub / github.com/blender/cycles / path_read_binary

Function path_read_binary

src/util/path.cpp:681–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

679}
680
681bool path_read_binary(const string &path, vector<uint8_t> &binary)
682{
683 /* read binary file into memory */
684 FILE *f = path_fopen(path, "rb");
685
686 if (!f) {
687 binary.resize(0);
688 return false;
689 }
690
691 binary.resize(path_file_size(path));
692
693 if (binary.empty()) {
694 fclose(f);
695 return false;
696 }
697
698 if (fread(binary.data(), sizeof(uint8_t), binary.size(), f) != binary.size()) {
699 fclose(f);
700 return false;
701 }
702
703 fclose(f);
704
705 return true;
706}
707
708bool path_read_compressed_binary(const string &path, vector<uint8_t> &binary)
709{

Callers 3

load_custom_weightsMethod · 0.85
path_read_textFunction · 0.85

Calls 6

path_fopenFunction · 0.85
path_file_sizeFunction · 0.85
resizeMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected