MCPcopy Create free account
hub / github.com/Duet3D/RepRapFirmware / Seek

Method Seek

src/Storage/FileStore.cpp:245–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245bool FileStore::Seek(FilePosition pos) noexcept
246{
247 switch (usageMode)
248 {
249 case FileUseMode::free:
250 REPORT_INTERNAL_ERROR;
251 return false;
252
253 case FileUseMode::readOnly:
254 case FileUseMode::readWrite:
255#if HAS_SBC_INTERFACE
256 if (reprap.UsingSbcInterface())
257 {
258 if (reprap.GetSbcInterface().SeekFile(handle, pos))
259 {
260 offset = pos;
261 return true;
262 }
263 return false;
264 }
265#endif
266#if HAS_MASS_STORAGE
267 return f_lseek(&file, pos) == FR_OK;
268#elif HAS_EMBEDDED_FILES
269 offset = min<FilePosition>(pos, EmbeddedFiles::Length(fileIndex));
270 return true;
271#else
272 return false;
273#endif
274
275 case FileUseMode::invalidated:
276 default:
277 return false;
278 }
279}
280
281FilePosition FileStore::Position() const noexcept
282{

Callers 11

GCodes.cppFile · 0.80
ReadFromFileMethod · 0.80
ForkFromMethod · 0.80
RestartFromMethod · 0.80
StartMethod · 0.80
RepRap.cppFile · 0.80
preMethod · 0.80
RecordSimulationTimeMethod · 0.80
FindEndCommentsMethod · 0.80
SpinMethod · 0.80

Calls 3

f_lseekFunction · 0.85
UsingSbcInterfaceMethod · 0.80
SeekFileMethod · 0.80

Tested by

no test coverage detected