Beispiel #1
0
char * CLoader7Z::ReadMainStreamsInfo(char * buf)
{
//ILogger::log() << "ReadMainStreamsInfo()\n";

    if (*buf != kMainStreamsInfo)
    {
//ILogger::log() << "Erreur ! ("<<__LINE__<<")\n";
        throw "Fichier incorrect";
        return buf;
    }

//ILogger::log() << "[0x04]\n";

    ++buf;

    if (*buf == kPackInfo)
    {
        buf = ReadPackInfo(buf);
    }

    if (*buf == kUnPackInfo)
    {
        buf = ReadUnPackInfo(buf);
    }

    if (*buf == kSubStreamsInfo)
    {
        buf = ReadSubStreamsInfo(buf);
    }

    if (*buf != kEnd)
    {
//ILogger::log() << "Erreur ! ("<<__LINE__<<")\n";
        throw "Fichier incorrect";
        return buf;
    }

//ILogger::log() << "[0x00]\n";

    ++buf;

    return buf;
}
Beispiel #2
0
void CInArchive::ReadStreamsInfo(
    const CObjectVector<CByteBuffer> *dataVector,
    UInt64 &dataOffset,
    CRecordVector<UInt64> &packSizes,
    CBoolVector &packCRCsDefined,
    CRecordVector<UInt32> &packCRCs,
    CObjectVector<CFolder> &folders,
    CRecordVector<CNum> &numUnpackStreamsInFolders,
    CRecordVector<UInt64> &unpackSizes,
    CBoolVector &digestsDefined,
    CRecordVector<UInt32> &digests)
{
  for (;;)
  {
    UInt64 type = ReadID();
    if (type > ((UInt32)1 << 30))
      ThrowIncorrect();
    switch((UInt32)type)
    {
      case NID::kEnd:
        return;
      case NID::kPackInfo:
      {
        ReadPackInfo(dataOffset, packSizes, packCRCsDefined, packCRCs);
        break;
      }
      case NID::kUnpackInfo:
      {
        ReadUnpackInfo(dataVector, folders);
        break;
      }
      case NID::kSubStreamsInfo:
      {
        ReadSubStreamsInfo(folders, numUnpackStreamsInFolders,
            unpackSizes, digestsDefined, digests);
        break;
      }
      default:
        ThrowIncorrect();
    }
  }
}