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

void PoDoFo::PdfParserObject::DelayedStreamLoadImpl (  ) [protected, virtual, inherited]

Load the stream of the object if it has one and if loading on demand is enabled. Reimplemented from PdfObject. Do not call this directly, use DelayedStreamLoad().

Reimplemented from PoDoFo::PdfObject.

Definition at line 348 of file PdfParserObject.cpp.

References PoDoFo::PdfError::AddToCallstack(), PoDoFo::PdfVariant::DelayedLoadDone(), PoDoFo::PdfReference::GenerationNumber(), PoDoFo::PdfParserObject::HasStreamToParse(), PoDoFo::PdfReference::ObjectNumber(), PoDoFo::PdfParserObject::ParseStream(), and PoDoFo::PdfObject::Reference().

{
#if defined(PODOFO_EXTRA_CHECKS)
    // DelayedLoad() must've been called, either directly earlier
    // or via DelayedStreamLoad. DelayedLoad() will throw if the load
    // failed, so if we're being called this condition must be true.
    assert(DelayedLoadDone());

    // Similarly, we should not be being called unless the stream isn't
    // already loaded.
    assert(!DelayedStreamLoadDone());
    assert(DelayedStreamLoadInProgress());
#endif

    // Note: we can't use HasStream() here because it'll call DelayedStreamLoad()
    // causing a nasty loop. test m_pStream directly instead.
    if( this->HasStreamToParse() && !m_pStream )
    {
        try {
            this->ParseStream();
        } catch( PdfError & e ) {
            // TODO: track object ptr in error info so we don't have to do this memory-intensive
            // formatting here.
            std::ostringstream s;
            s << "Unable to parse the stream for object " << Reference().ObjectNumber() << ' '
              << Reference().GenerationNumber() << " obj .";
            e.AddToCallstack( __FILE__, __LINE__, s.str().c_str());
            throw e;
        }
    }

    // If we complete without throwing the stream will be flagged as loaded.
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index