MCPcopy Create free account
hub / github.com/Kitware/CMake / read_load_commands

Method read_load_commands

Source/cmMachO.cxx:164–192  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162};
163
164bool cmMachOHeaderAndLoadCommands::read_load_commands(uint32_t ncmds,
165 uint32_t sizeofcmds,
166 cmsys::ifstream& fin)
167{
168 uint32_t size_read = 0;
169 this->LoadCommands.resize(ncmds);
170 for (uint32_t i = 0; i < ncmds; i++) {
171 load_command lc;
172 if (!peek(fin, lc)) {
173 return false;
174 }
175 lc.cmd = swap(lc.cmd);
176 lc.cmdsize = swap(lc.cmdsize);
177 size_read += lc.cmdsize;
178
179 RawLoadCommand& c = this->LoadCommands[i];
180 c.LoadCommand.resize(lc.cmdsize);
181 if (!read(fin, c.LoadCommand)) {
182 return false;
183 }
184 }
185
186 if (size_read != sizeofcmds) {
187 this->LoadCommands.clear();
188 return false;
189 }
190
191 return true;
192}
193
194class cmMachOInternal
195{

Callers

nothing calls this directly

Calls 5

peekFunction · 0.85
swapFunction · 0.70
readFunction · 0.70
resizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected