src/ccutil/indexmapbidi.cpp
bool IndexMap::DeSerialize(bool swap, FILE *fp) {
  uint32_t sparse_size;
  if (!tesseract::DeSerialize(fp, &sparse_size)) {
    return false;
  }
  if (swap) {
    ReverseN(&sparse_size, sizeof(sparse_size));
  }
  // Arbitrarily limit the number of elements to protect against bad data.
  if (sparse_size > UINT16_MAX) {
    return false;
  }
  sparse_size_ = sparse_size;
  return tesseract::DeSerialize(swap, fp, compact_map_);
}
// Reads from the given file. Returns false in case of error.
// If swap is true, assumes a big/little-endian swap is needed.
Reads from the given file. Returns false in case of error.
If swap is true, assumes a big/little-endian swap is needed.
Reads from the given file . Returns false in case of error . If swap is true assumes a big / little - endian swap is needed .
bool IndexMap::DeSerialize(bool swap, FILE *fp) {
  uint32_t sparse_size;
  if (!tesseract::DeSerialize(fp, &sparse_size)) {
    return false;
  }
  if (swap) {
    ReverseN(&sparse_size, sizeof(sparse_size));
  }
  if (sparse_size > UINT16_MAX) {
    return false;
  }
  sparse_size_ = sparse_size;
  return tesseract::DeSerialize(swap, fp, compact_map_);
}
bool IndexMap :: DeSerialize ( bool swap , FILE * fp ) { uint32_t sparse_size ; if ( ! tesseract :: DeSerialize ( fp , & sparse_size ) ) { return false ; } if ( swap ) { ReverseN ( & sparse_size , sizeof ( sparse_size ) ) ; } if ( sparse_size > UINT16_MAX ) { return false ; } sparse_size_ = sparse_size ; return tesseract :: DeSerialize ( swap , fp , compact_map_ ) ; }
Reads from the given file.
Reads from the given file .
// Arbitrarily limit the number of elements to protect against bad data.