MCPcopy Create free account
hub / github.com/Exiv2/exiv2 / size

Method size

src/basicio.cpp:474–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474size_t FileIo::size() const {
475 // Flush and commit only if the file is open for writing
476 if (p_->fp_ && (p_->openMode_.at(0) != 'r' || p_->openMode_.at(1) == '+')) {
477 std::fflush(p_->fp_);
478#ifdef _MSC_VER
479 // This is required on msvcrt before stat after writing to a file
480 _commit(_fileno(p_->fp_));
481#endif
482 }
483
484 Impl::StructStat buf;
485 if (p_->stat(buf))
486 return std::numeric_limits<size_t>::max();
487 return buf.st_size;
488}
489
490int FileIo::open() {
491 // Default open is in read-only binary mode

Callers 4

readMethod · 0.45
writeMethod · 0.45
readFileFunction · 0.45
writeFileFunction · 0.45

Calls 1

statMethod · 0.80

Tested by

no test coverage detected