pic32/libraries/SD/utility/SdFile.cpp
//------------------------------------------------------------------------------
/**
 * Check for contiguous file and return its raw block range.
 *
 * \param[out] bgnBlock the first block address for the file.
 * \param[out] endBlock the last  block address for the file.
 *
 * \return The value one, true, is returned for success and
 * the value zero, false, is returned for failure.
 * Reasons for failure include file is not contiguous, file has zero length
 * or an I/O error occurred.
 */
Check for contiguous file and return its raw block range.
\param[out] bgnBlock the first block address for the file.
\param[out] endBlock the last  block address for the file.

\return The value one, true, is returned for success and
the value zero, false, is returned for failure.
Reasons for failure include file is not contiguous, file has zero length
or an I/O error occurred.
Check for contiguous file and return its raw block range . \ param [ out ] bgnBlock the first block address for the file . \ param [ out ] endBlock the last block address for the file . \ return The value one true is returned for success and the value zero false is returned for failure . Reasons for failure include file is not contiguous file has zero length or an I / O error occurred .
uint8_t SdFile::contiguousRange(uint32_t* bgnBlock, uint32_t* endBlock) {
  if (firstCluster_ == 0) return false;
  for (uint32_t c = firstCluster_; ; c++) {
    uint32_t next;
    if (!vol_->fatGet(c, &next)) return false;
    if (next != (c + 1)) {
      if (!vol_->isEOC(next)) return false;
      *bgnBlock = vol_->clusterStartBlock(firstCluster_);
      *endBlock = vol_->clusterStartBlock(c)
                  + vol_->blocksPerCluster_ - 1;
      return true;
    }
  }
}
uint8_t SdFile :: contiguousRange ( uint32_t * bgnBlock , uint32_t * endBlock ) { if ( firstCluster_ == 0 ) return false ; for ( uint32_t c = firstCluster_ ; ; c ++ ) { uint32_t next ; if ( ! vol_ -> fatGet ( c , & next ) ) return false ; if ( next != ( c + 1 ) ) { if ( ! vol_ -> isEOC ( next ) ) return false ; * bgnBlock = vol_ -> clusterStartBlock ( firstCluster_ ) ; * endBlock = vol_ -> clusterStartBlock ( c ) + vol_ -> blocksPerCluster_ - 1 ; return true ; } } }
Check for contiguous file and return its raw block range.
Check for contiguous file and return its raw block range .
// error if no blocks // check for contiguous // error if not end of chain