Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

void PoDoFo::PdfXRefStreamParserObject::ParseStream ( const pdf_int64  nW[W_ARRAY_SIZE],
const std::vector< pdf_int64 > &  rvecIndeces 
) [private]

Parse the stream contents

Parameters:
nW/W key
rvecIndecesindeces as filled by GetIndeces
See also:
GetIndeces

Definition at line 108 of file PdfXRefStreamParserObject.cpp.

References PoDoFo::ePdfError_NoXRef, PoDoFo::PdfStream::GetFilteredCopy(), PoDoFo::PdfObject::GetStream(), PoDoFo::podofo_free(), and PODOFO_RAISE_ERROR_INFO.

{
    char*        pBuffer;
    pdf_long     lBufferLen;
    const size_t entryLen  = static_cast<size_t>(nW[0] + nW[1] + nW[2]);

    this->GetStream()->GetFilteredCopy( &pBuffer, &lBufferLen );

    
    std::vector<pdf_int64>::const_iterator it = rvecIndeces.begin();
    char* const pStart = pBuffer;
    while( it != rvecIndeces.end() )
    {
        pdf_int64 nFirstObj = *it; ++it;
        pdf_int64 nCount    = *it; ++it;

        //pdf_int64 nFirstObjOrg = nFirstObj;
        //pdf_int64 nCountOrg = nCount;
        
        //printf("\n");
        //printf("nFirstObj=%i\n", static_cast<int>(nFirstObj));
        //printf("nCount=%i\n", static_cast<int>(nCount));
        while( nCount > 0 )
        {
            if( (pBuffer - pStart) >= lBufferLen ) 
            {
                PODOFO_RAISE_ERROR_INFO( ePdfError_NoXRef, "Invalid count in XRef stream" );
            }

            //printf("nCount=%i ", static_cast<int>(nCount));
            //printf("pBuffer=%li ", (long)(pBuffer - pStart));
            //printf("pEnd=%li ", lBufferLen);
                  if( ! (*m_pOffsets)[static_cast<int>(nFirstObj)].bParsed )
                        ReadXRefStreamEntry( pBuffer, lBufferLen, nW, static_cast<int>(nFirstObj) );
                  nFirstObj++ ;
            pBuffer += entryLen;
            --nCount;
        }
        //printf("Exp: nFirstObj=%i nFirstObjOrg + nCount=%i\n", nFirstObj - 1, nFirstObjOrg + nCountOrg - 1 );
        //printf("===\n");
    }
    podofo_free( pStart );

}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index