Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

DWFGoogleDesktopCrawl/DWFCrawlHandler.cpp

This is an example of using all components of the DWF Toolkit to extract text and thumbnails from EPlot and EModel sections for integration with Google's Desktop Search API. Of particular interest in this sample, is it's use of the DWFToolkit::DWFObjectDefinitionReader interface and how it not only overrides the default object definition parser but contrains the parser to only consider properties from the document.

// DWFCrawlHandler.cpp : Implementation of CDWFCrawlHandler

#include "stdafx.h"
#include "DWFCrawlHandler.h"

#include "dwfcore/BufferOutputStream.h"
#include "dwf/package/Constants.h"
#include "dwf/package/Manifest.h"
#include "dwf/package/reader/PackageReader.h"
#include "dwf/package/utility/ResourceContainer.h"
using namespace DWFCore;
using namespace DWFToolkit;



// CDWFCrawlHandler

STDMETHODIMP
CDWFCrawlHandler::InterfaceSupportsErrorInfo(REFIID riid)
{
        static const IID* arr[] = 
        {
                &IID_IDWFCrawlHandler
        };

        for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
        {
                if (InlineIsEqualGUID(*arr[i],riid))
                        return S_OK;
        }
        return S_FALSE;
}

STDMETHODIMP
CDWFCrawlHandler::HandleFile( BSTR bstrFullPath, IDispatch* pGoogleEventFactory )
{
        _bstrFullPath = bstrFullPath;
        _spGoogleEventFactory = pGoogleEventFactory;


        //
        // allocate a new reader for this DWF file
        //
    DWFCore::DWFString zFile( bstrFullPath );
    DWFToolkit::DWFPackageReader* pReader = DWFCORE_ALLOC_OBJECT( DWFPackageReader(zFile) );
    if (pReader == NULL)
    {
        return E_OUTOFMEMORY;
    }

        HRESULT hr = S_OK;
        DWFCore::DWFInputStream* pContentStream = NULL;
        DWFCore::DWFBufferOutputStream* pThumbnailStream = NULL;
        DWFCore::DWFString zThumbnailMIME;
        size_t nThumbnailSize = 0;

    try
    {
        //
        // get some initial information about this DWF file
        //
        DWFToolkit::DWFPackageReader::tPackageInfo tDWFInfo;
        pReader->getPackageInfo( tDWFInfo );

        switch (tDWFInfo.eType)
        {
            case DWFToolkit::DWFPackageReader::eDWFPackageEncrypted:
            {
                //
                // can't process protected DWF
                //
                hr = S_FALSE;
            }

                //
                // DWF package format
                //
            case DWFToolkit::DWFPackageReader::eDWFPackage:
            {

#define _DWFCRAWL_BUFFER_BYTES  16385
                                size_t nRead = 0;
                                char zBuffer[_DWFCRAWL_BUFFER_BYTES] = {0};
                                DWFCore::DWFString zDWFContent;

                                //
                                // pull the manifest en masse and index it
                                //
                                pContentStream = pReader->extract( L"manifest.xml", true );
                                if (pContentStream)
                                {
                                        while (pContentStream->available() > 0)
                                        {
                                                nRead = pContentStream->read( zBuffer, _DWFCRAWL_BUFFER_BYTES-1 );
                                                zDWFContent.append( zBuffer );
                                                DWFCORE_ZERO_MEMORY( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                        }

                                        DWFCORE_FREE_OBJECT( pContentStream );
                                        pContentStream = NULL;
                                }

                                //
                                // parse the manifest
                                //
                                DWFToolkit::DWFManifest& rManifest = pReader->getManifest();

                                //
                                // process all non-global section content
                                //
                                DWFToolkit::DWFManifest::SectionIterator* piSections = rManifest.getSections();

                                if (piSections)
                                {
                                        DWFToolkit::DWFSection* pSection = NULL;

                                        for (; piSections->valid(); piSections->next())
                                        {
                                                zDWFContent.assign( L"" );
                                                pSection = piSections->get();

                                                        //
                                                        // since we don't want to actually parse the descriptor
                                                        // just pull out the one resource and feed that to GDS
                                                        //
                                                DWFToolkit::DWFResourceContainer::ResourceIterator* piResources = pSection->findResourcesByRole( DWFXML::kzRole_Descriptor );
                                                if (piResources)
                                                {
                                                        pContentStream = piResources->get()->getInputStream();
                                                        while (pContentStream->available() > 0)
                                                        {
                                                                DWFCORE_ZERO_MEMORY( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                                                nRead = pContentStream->read( zBuffer, _DWFCRAWL_BUFFER_BYTES-1 );
                                                                zDWFContent.append( zBuffer );
                                                        }

                                                        DWFCORE_FREE_OBJECT( piResources );
                                                        DWFCORE_FREE_OBJECT( pContentStream );
                                                        pContentStream = NULL;

                                                        zDWFContent.append( L" " );
                                                }

                                                try
                                                {
                                                        //
                                                        // parse all object definitions selectively
                                                        //
                                                        _ObjectDefinitionCrawler oODCrawler;
                                                        pSection->getObjectDefinition( oODCrawler );
                                                        
                                                        zDWFContent.append( oODCrawler.content() );                                             
                                                }
                                                catch (...)
                                                {
                                                        ;
                                                }

                                                        //
                                                        // if we wanted to blast the entire object definition document(s)
                                                        // into GDS, we could like this but there are lots and lots of
                                                        // data (objects and instances) that aren't useful for indexing...
                                                        //
                                                /*
                                                piResources = pSection->findResourcesByRole( DWFXML::kzRole_ObjectDefinition );
                                                if (piResources)
                                                {
                                                        for (; piResources->valid(); piResources->next())
                                                        {
                                                                pContentStream = piResources->get()->getInputStream();
                                                                while (pContentStream->available() > 0)
                                                                {
                                                                        DWFCORE_ZERO_MEMORY( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                                                        nRead = pContentStream->read( zBuffer, _DWFCRAWL_BUFFER_BYTES-1 );
                                                                        zDWFContent.append( zBuffer );
                                                                }

                                                                DWFCORE_FREE_OBJECT( pContentStream );
                                                                pContentStream = NULL;

                                                                zContent.append( L" " );
                                                        }

                                                        DWFCORE_FREE_OBJECT( piResources );
                                                }
                                                */

                                                        //
                                                        // public markup data
                                                        //
                                                piResources = pSection->findResourcesByRole( DWFXML::kzRole_MarkupObjectDefinition );
                                                if (piResources)
                                                {
                                                        for (; piResources->valid(); piResources->next())
                                                        {
                                                                pContentStream = piResources->get()->getInputStream();
                                                                while (pContentStream->available() > 0)
                                                                {
                                                                        DWFCORE_ZERO_MEMORY( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                                                        nRead = pContentStream->read( zBuffer, _DWFCRAWL_BUFFER_BYTES-1 );
                                                                        zDWFContent.append( zBuffer );
                                                                }

                                                                DWFCORE_FREE_OBJECT( pContentStream );
                                                                pContentStream = NULL;

                                                                zDWFContent.append( L" " );
                                                        }

                                                        DWFCORE_FREE_OBJECT( piResources );
                                                }

                                                        //
                                                        // extract any text from the 2D graphics streams
                                                        //
                                                piResources = pSection->findResourcesByRole( DWFXML::kzRole_Graphics2d );
                                                if (piResources)
                                                {
                                                        for (; piResources->valid(); piResources->next())
                                                        {
                                                                pContentStream = piResources->get()->getInputStream();
                                                                {
                                                                        _W2DCrawler oW2DCrawler( *pContentStream );
                                                                        hr = (oW2DCrawler.crawl() == WT_Result::Success) ? S_OK : S_FALSE;

                                                                        if (SUCCEEDED(hr))
                                                                        {
                                                                                zDWFContent.append( oW2DCrawler.content() );
                                                                        }
                                                                }
                                                                DWFCORE_FREE_OBJECT( pContentStream );
                                                                pContentStream = NULL;

                                                                zDWFContent.append( L" " );
                                                        }

                                                        DWFCORE_FREE_OBJECT( piResources );
                                                }

                                                        //
                                                        // if there is a thumbnail image and we don't have one already
                                                        // then let's grab the first one and use that...
                                                        //
                                                if (pThumbnailStream == NULL)
                                                {
                                                        DWFToolkit::DWFResourceContainer::ResourceIterator* piResources = pSection->findResourcesByRole( DWFXML::kzRole_Thumbnail );
                                                        if (piResources)
                                                        {
                                                                pContentStream = piResources->get()->getInputStream();
                                                                pThumbnailStream = DWFCORE_ALLOC_OBJECT( DWFBufferOutputStream(pContentStream->available()) );

                                                                while (pContentStream->available() > 0)
                                                                {
                                                                        DWFCORE_ZERO_MEMORY( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                                                        nRead = pContentStream->read( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                                                        nThumbnailSize += pThumbnailStream->write( zBuffer, nRead );
                                                                }

                                                                zThumbnailMIME.assign( piResources->get()->mime() );

                                                                DWFCORE_FREE_OBJECT( piResources );
                                                                DWFCORE_FREE_OBJECT( pContentStream );
                                                                pContentStream = NULL;

                                                                zDWFContent.append( L" " );
                                                        }
                                                }
                                        }

                                        DWFCORE_FREE_OBJECT( piSections );
                                }


                                //
                                // process all global section content
                                //
                                piSections = rManifest.getGlobalSections();

                                if (piSections)
                                {
                                        DWFToolkit::DWFGlobalSection* pSection = NULL;

                                        for (; piSections->valid(); piSections->next())
                                        {
                                                zDWFContent.append( L"" );
                                                pSection = (DWFGlobalSection*)piSections->get();

                                                //
                                                // since we don't want to actually parse the descriptor
                                                // just pull out the one resource and feed that to GDS
                                                //
                                                DWFToolkit::DWFResourceContainer::ResourceIterator* piResources = pSection->findResourcesByRole( DWFXML::kzRole_Descriptor );
                                                if (piResources)
                                                {
                                                        pContentStream = piResources->get()->getInputStream();
                                                        while (pContentStream->available() > 0)
                                                        {
                                                                DWFCORE_ZERO_MEMORY( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                                                nRead = pContentStream->read( zBuffer, _DWFCRAWL_BUFFER_BYTES-1 );
                                                                zDWFContent.append( zBuffer );
                                                        }

                                                        DWFCORE_FREE_OBJECT( piResources );
                                                        DWFCORE_FREE_OBJECT( pContentStream );
                                                        pContentStream = NULL;

                                                        zDWFContent.append( L" " );
                                                }

                                                try
                                                {
                                                        //
                                                        // parse all object definitions selectively
                                                        //
                                                        _ObjectDefinitionCrawler oODCrawler;
                                                        pSection->getObjectDefinition( oODCrawler );
                                                        
                                                        zDWFContent.append( oODCrawler.content() );                                             
                                                }
                                                catch (...)
                                                {
                                                        ;
                                                }

                                                        //
                                                        // public markup data
                                                        //
                                                piResources = pSection->findResourcesByRole( DWFXML::kzRole_MarkupObjectDefinition );
                                                if (piResources)
                                                {
                                                        for (; piResources->valid(); piResources->next())
                                                        {
                                                                pContentStream = piResources->get()->getInputStream();
                                                                while (pContentStream->available() > 0)
                                                                {
                                                                        DWFCORE_ZERO_MEMORY( zBuffer, _DWFCRAWL_BUFFER_BYTES );
                                                                        nRead = pContentStream->read( zBuffer, _DWFCRAWL_BUFFER_BYTES-1 );
                                                                        zDWFContent.append( zBuffer );
                                                                }

                                                                DWFCORE_FREE_OBJECT( pContentStream );
                                                                pContentStream = NULL;

                                                                zDWFContent.append( L" " );
                                                        }

                                                        DWFCORE_FREE_OBJECT( piResources );
                                                }

                                        }

                                        DWFCORE_FREE_OBJECT( piSections );
                                }

                                if (pThumbnailStream)
                                {
                                        _postContent( zDWFContent, pThumbnailStream->buffer(), nThumbnailSize, zThumbnailMIME );
                                }
                                else
                                {
                                        _postContent( zDWFContent );
                                }

                                break;
            }

                //
                // legacy single stream formats
                //
            case DWFPackageReader::eW2DStream:
            case DWFPackageReader::eDWFStream:
            {
                                        //
                                        // open the legacy DWF directly
                                        //
                try
                                {
                                        //
                                        // close the reader
                                        //
                                        DWFCORE_FREE_OBJECT( pReader );
                                        pReader = NULL;

                                                //
                                                // re-open the file with streaming access
                                                //
                                        DWFCore::DWFStreamFileDescriptor* pFileDesc = DWFCORE_ALLOC_OBJECT( DWFStreamFileDescriptor(zFile, L"rb") );
                                        if (pFileDesc)
                                        {
                                                pFileDesc->open();

                                                DWFCore::DWFFileInputStream* pFileStream = DWFCORE_ALLOC_OBJECT( DWFFileInputStream );
                                                if (pFileStream)
                                                {
                                                        pFileStream->attach( pFileDesc, false );

                                                        _W2DCrawler oW2DCrawler( *pFileStream );
                                                        hr = (oW2DCrawler.crawl() == WT_Result::Success) ? S_OK : S_FALSE;

                                                        if (SUCCEEDED(hr))
                                                        {
                                                                _postContent( oW2DCrawler.content() );
                                                        }

                                                        DWFCORE_FREE_OBJECT( pFileStream );
                                                }
                                                else
                                                {
                                                        hr = S_FALSE;
                                                }

                                                DWFCORE_FREE_OBJECT( pFileDesc );
                                        }
                                        else
                                        {
                                                hr = S_FALSE;
                                        }
                                }
                                catch (DWFException& ex)
                                {
                                        Error( ex.message(), IID_IDWFCrawlHandler, E_FAIL );
                                        hr = S_FALSE;
                                }
                                catch (...)
                                {
                                        hr = S_FALSE;
                                }

                                break;
            }

                //
                // don't know what this is
                //
            default:
            {
                hr = S_FALSE;
            }
        }
    }
        catch (DWFException& ex)
        {
                Error( ex.message(), IID_IDWFCrawlHandler, E_FAIL );
                hr = E_FAIL;
        }
    catch (...)
    {
        hr = E_FAIL;
    }

        DWFCORE_FREE_OBJECT( pReader );
        if (pContentStream) DWFCORE_FREE_OBJECT( pContentStream );
        if (pThumbnailStream) DWFCORE_FREE_OBJECT( pThumbnailStream );

        _bstrFullPath.Empty();
        _spGoogleEventFactory.Release();

        return hr;
}

HRESULT
CDWFCrawlHandler::_postContent( const DWFString& zContent, const void* pThumbnailBuffer, size_t nThumbnailBytes, const DWFString& zThumbnailMIME )
{
        CComPtr<IDispatch> spEvent;

        HRESULT hr = _spGoogleEventFactory->CreateEvent( CComBSTR(CLSID_DWFCrawlHandler),
                                                                                                         CComBSTR(L"Google.Desktop.TextFile"), 
                                                                                                &spEvent );
        if (FAILED(hr))
        {
                return Error( L"Unable to create event", IID_IDWFCrawlHandler, hr );
        }

        CComQIPtr<IGoogleDesktopSearchEvent> spSearchEvent( spEvent );
        if (spSearchEvent == NULL)
        {
                return Error( L"Event does not implement IGoogleDesktopSearchEvent", IID_IDWFCrawlHandler, E_UNEXPECTED );
        }

        DWFCore::DWFString zURI( _bstrFullPath );
        //if (zSection.bytes() > 0)
        //{
        //      zURI.append( L"?page='" );
        //      zURI.append( zSection );
        //      zURI.append( L"'" );
        //}

        hr = spSearchEvent->AddProperty( CComBSTR(L"uri"), CComVariant(CComBSTR((const wchar_t*)zURI)) );
        if (FAILED(hr))
        {
                return Error( L"Unable to set 'uri' property", IID_IDWFCrawlHandler, hr );
        }

        WIN32_FIND_DATA tFindData = {0};
        ::GetFileAttributesEx( _bstrFullPath, GetFileExInfoStandard, &tFindData );

        SYSTEMTIME tSystemTime = {0};
        ::FileTimeToSystemTime( &tFindData.ftLastWriteTime, &tSystemTime );

        double varDate;
        ::SystemTimeToVariantTime( &tSystemTime, &varDate );

        hr = spSearchEvent->AddProperty( CComBSTR(L"last_modified_time"), CComVariant(varDate, VT_DATE) );
        if (FAILED(hr))
        {
                return Error( L"Unable to set 'uri' property", IID_IDWFCrawlHandler, hr );
        }

        hr = spSearchEvent->AddProperty( CComBSTR(L"format"), CComVariant(L"text/plain") );
        if (FAILED(hr))
        {
                return Error( L"Unable to set 'format' property", IID_IDWFCrawlHandler, hr );
        }

        CComBSTR bstrContent( (const wchar_t*)zContent );
        hr = spSearchEvent->AddProperty( CComBSTR(L"content"), CComVariant(bstrContent) );
        if (FAILED(hr))
        {
                return Error( L"Unable to set 'content' property", IID_IDWFCrawlHandler, hr );
        }

        if (pThumbnailBuffer)
        {
                // set up safearray
                SAFEARRAY* psa;

                // create a safe array to store the stream data
                psa = ::SafeArrayCreateVector( VT_UI1, 0, (ULONG)nThumbnailBytes );

                // pointers to byte arrays
                unsigned char *pData = NULL;

                // get a pointer to the safe array. Locks the array.
                ::SafeArrayAccessData( psa, (void**)&pData );

                // copy the memory file into the safearray
                memcpy( pData, pThumbnailBuffer, nThumbnailBytes );

                // unlock access to safearray
                ::SafeArrayUnaccessData(psa);
                  
                hr = spSearchEvent->AddProperty( CComBSTR(L"thumbnail"), CComVariant(psa) );

                if (SUCCEEDED(hr))
                {
                        spSearchEvent->AddProperty( CComBSTR(L"thumbnail_format"), CComVariant(CComBSTR((const wchar_t*)zThumbnailMIME)) );
                }
        }

        hr = spSearchEvent->Send( EventFlagIndexable );
        if (FAILED(hr))
        {
                return Error( L"Unable to send event", IID_IDWFCrawlHandler, hr );
        }

        return hr;
}


CDWFCrawlHandler::_ObjectDefinitionCrawler::_ObjectDefinitionCrawler()
                                : DWFToolkit::DWFObjectDefinitionReader( NULL, DWFToolkit::DWFObjectDefinitionReader::eProvideProperties )
{
        ;
}

CDWFCrawlHandler::_ObjectDefinitionCrawler::~_ObjectDefinitionCrawler()
{
        ;
}

const DWFString&
CDWFCrawlHandler::_ObjectDefinitionCrawler::content()
{
        _zContent.append( L" " );
        return _zContent;
}

void
CDWFCrawlHandler::_ObjectDefinitionCrawler::provideProperties( const DWFString&    zID,
                                                                                                                   vector<DWFString>*  pPropertyRefs,
                                                                                                                           DWFToolkit::DWFProperty::tList* pPropertyList )
throw()
{
        zID;

                //
                // build out a simple string (albeit a potentially long one)
                //
        if (pPropertyList)
        {
                DWFToolkit::DWFProperty* pProperty = NULL;

                for (size_t i = 0; i < pPropertyList->size(); i++)
                {
                        pProperty = (*pPropertyList)[i];

                        _zContent.append( L" name=" );
                        _zContent.append( pProperty->name() );
                        _zContent.append( L" value=" );
                        _zContent.append( pProperty->value() );

                        if (pProperty->category().bytes() > 0)
                        {
                                _zContent.append( L" category=" );
                                _zContent.append( pProperty->category() );
                        }

                        DWFCORE_FREE_OBJECT( pProperty );
                }

                DWFCORE_FREE_OBJECT( pPropertyList );
        }

        if (pPropertyRefs)
        {
                DWFCORE_FREE_OBJECT( pPropertyRefs );
        }
}


CDWFCrawlHandler::_W2DCrawler::_W2DCrawler( DWFCore::DWFInputStream& rW2DStream )
                                : _rW2DStream( rW2DStream )
                                , _nBytesAvailable( 0 )
{
        set_text_action( _handleText );
        set_layer_action( _handleLayer );
        set_named_view_action( _handleNamedView );
        set_author_action( _handleAuthor );
        set_comments_action( _handleComments );
        set_copyright_action( _handleCopyright );
        set_description_action( _handleDescription );
        set_keywords_action( _handleKeywords );
        set_title_action( _handleTitle );
        set_subject_action( _handleSubject );
        set_source_filename_action( _handleSourceFilename );

        set_file_mode( WT_File_mode::File_Read );
        set_stream_user_data( this );
        open();
}

CDWFCrawlHandler::_W2DCrawler::~_W2DCrawler()
{
        close();
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::crawl()
{
        while(WT_Result::Success == process_next_object())
        {
        }

        return WT_Result::Success;
}

const DWFString&
CDWFCrawlHandler::_W2DCrawler::content()
{
        return _zContent;
}

void
CDWFCrawlHandler::_W2DCrawler::addContent( const DWFCore::DWFString& zContent )
{
        _zContent.append( zContent );
        _zContent.append( L" " );
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::process_stream_close (void)
{
        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::process_stream_end_seek ()
{
        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::process_stream_open (void)
{
        _nBytesAvailable = _rW2DStream.available();
        
        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::process_stream_read (int desired_bytes, int& bytes_read, void* buffer)
{
        try
        {
                bytes_read = (int)_rW2DStream.read( buffer, desired_bytes );

                return WT_Result::Success;
        }
        catch (...)
        {
                return WT_Result::Internal_Error;
        }
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::process_stream_seek (int distance, int& amount_seeked)
{
        try
        {
                amount_seeked = _rW2DStream.seek( SEEK_CUR, distance );

                return WT_Result::Success;
        }
        catch (...)
        {
                return WT_Result::Internal_Error;
        }
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::process_stream_tell (unsigned long *current_file_pointer_position)
{
        *current_file_pointer_position = (int)(_nBytesAvailable - _rW2DStream.available());

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::process_stream_write(int size, void const* buffer)
{
        return WT_Result::Toolkit_Usage_Error;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleText( WT_Text& rText, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;
        rThisCrawler.addContent( rText.string().unicode() );
        
        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleLayer( WT_Layer& rLayer, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zLayerName( rLayer.layer_name().unicode() );
        if (zLayerName.chars() > 0)
        {
                rThisCrawler.addContent( L"Layer Name =" );
                rThisCrawler.addContent( zLayerName );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleNamedView( WT_Named_View& rView, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zName( rView.name().unicode() );
        if (zName.chars() > 0)
        {
                rThisCrawler.addContent( L"Named View =" );
                rThisCrawler.addContent( zName );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleAuthor( WT_Author& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Author =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleComments( WT_Comments& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Comments =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleCopyright( WT_Copyright& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Copyright =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleCreator( WT_Creator& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Creator =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleDescription( WT_Description& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Description =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleKeywords( WT_Keywords& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Keywords =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleTitle( WT_Title& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Title =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleSubject( WT_Subject& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Subject =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}

WT_Result
CDWFCrawlHandler::_W2DCrawler::_handleSourceFilename( WT_Source_Filename& rInformational, WT_File& rFile )
{
        CDWFCrawlHandler::_W2DCrawler& rThisCrawler = (CDWFCrawlHandler::_W2DCrawler&)rFile;

        DWFString zInfo( rInformational.string().unicode() );
        if (zInfo.chars() > 0)
        {
                rThisCrawler.addContent( L"Source Filename =" );
                rThisCrawler.addContent( zInfo );
        }

        return WT_Result::Success;
}


Generated on Tue May 17 12:38:49 2005 for Autodesk DWF Toolkit by  doxygen 1.4.1