RecordReferencingExporter Class Reference

#include <styles.h>

Inheritance diagram for RecordReferencingExporter:

StylesExporter List of all members.

Protected Member Functions

 RecordReferencingExporter (BaseCamelotFilter &FilterToUse)
 RecordReferencingExporter (const RecordReferencingExporter &Other)
 Let's us know we should be copying this.
const RecordReferencingExporteroperator= (const RecordReferencingExporter &Other)
virtual ~RecordReferencingExporter ()
 Deletes the internal data structures.
virtual XFileRef WriteItem (const RecordReferenceItem &TentativeExportItem)
 Provides support for derived classes using record references. Attempts to write out an export item, but will just return an XFileRef if the record has already been written for the item. Derived classes should create a suitable item on the stack, and call this function to do the spade work.
virtual XFileRef WriteRecord (const RecordReferenceItem &ItemToExport)=0
virtual BOOL AddExportedItem (RecordReferenceItem &NewItem)
 Adds the RecordReferenceItem to the list of exported items. You can override it if you want.
virtual const RecordReferenceItemFindExportedItem (const RecordReferenceItem &ItemToFind)
 Looks for the given item in the list of exported items. If you're worried about efficiency override it.
BaseCamelotFilterGetFilter ()

Private Attributes

BaseCamelotFilterm_Filter
List m_ExportedItems

Detailed Description

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/07/96
See also:
Styles

Definition at line 352 of file styles.h.


Constructor & Destructor Documentation

RecordReferencingExporter::RecordReferencingExporter BaseCamelotFilter FilterToUse  )  [inline, protected]
 

Definition at line 357 of file styles.h.

00357 : m_Filter(FilterToUse) {}

RecordReferencingExporter::RecordReferencingExporter const RecordReferencingExporter Other  )  [protected]
 

Let's us know we should be copying this.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97

Definition at line 1840 of file styles.cpp.

01840                                                                                            :
01841     m_Filter(Other.m_Filter)
01842 {
01843     TRACE( _T("RecordReferencingExporter - Copy constructor not implemented"));
01844 }

RecordReferencingExporter::~RecordReferencingExporter  )  [protected, virtual]
 

Deletes the internal data structures.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97

Definition at line 1822 of file styles.cpp.

01823 {
01824     m_ExportedItems.DeleteAll();
01825 }


Member Function Documentation

BOOL RecordReferencingExporter::AddExportedItem RecordReferenceItem NewItem  )  [protected, virtual]
 

Adds the RecordReferenceItem to the list of exported items. You can override it if you want.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97

Definition at line 1864 of file styles.cpp.

01865 {
01866     m_ExportedItems.AddHead(&NewItem);
01867 
01868     return TRUE;
01869 }

const RecordReferenceItem * RecordReferencingExporter::FindExportedItem const RecordReferenceItem ItemToFind  )  [protected, virtual]
 

Looks for the given item in the list of exported items. If you're worried about efficiency override it.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97

Definition at line 1882 of file styles.cpp.

01883 {
01884     const RecordReferenceItem* pFoundItem = NULL;       // return this
01885 
01886     RecordReferenceItem* pCurrentItem = (RecordReferenceItem*)m_ExportedItems.GetHead();
01887 
01888     while (pCurrentItem != NULL && pFoundItem == NULL)
01889     {
01890         if (ItemToFind == *pCurrentItem)
01891         {
01892             pFoundItem = pCurrentItem;
01893         }
01894         else
01895         {
01896             pCurrentItem = (RecordReferenceItem*)m_ExportedItems.GetNext(pCurrentItem);
01897         }
01898     }
01899 
01900     return pFoundItem;
01901 }

BaseCamelotFilter& RecordReferencingExporter::GetFilter  )  [inline, protected]
 

Definition at line 374 of file styles.h.

00374 {   return m_Filter;    }

const RecordReferencingExporter & RecordReferencingExporter::operator= const RecordReferencingExporter Other  )  [protected]
 

Definition at line 1846 of file styles.cpp.

01847 {
01848     TRACE( _T("RecordReferencingExporter - Assignment operator not implemented"));
01849     return *this;
01850 }

XFileRef RecordReferencingExporter::WriteItem const RecordReferenceItem TentativeExportItem  )  [protected, virtual]
 

Provides support for derived classes using record references. Attempts to write out an export item, but will just return an XFileRef if the record has already been written for the item. Derived classes should create a suitable item on the stack, and call this function to do the spade work.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/07/97
Parameters:
TentativeExportItem,: The item to be exported that will be copied if it [INPUTS] needs to be written out.
Returns:
The record number for the given RecordReferenceItem XFILEREF_ERROR if an error occurred.

Definition at line 1924 of file styles.cpp.

01925 {
01926 #ifdef DO_EXPORT
01927     XFileRef RecordReference = XFILEREF_ERROR;  // return this
01928 
01929     const RecordReferenceItem* const pExistingItem = FindExportedItem(TentativeExportItem);
01930     if (pExistingItem == NULL)
01931     {
01932         // The item hasn't been exported, so do it now
01933         RecordReference = WriteRecord(TentativeExportItem);
01934         if (RecordReference != XFILEREF_ERROR)
01935         {
01936             RecordReferenceItem* pNewItem = TentativeExportItem.CreateCopy(RecordReference);
01937             if (pNewItem != NULL)
01938             {
01939                 AddExportedItem(*pNewItem);
01940             }
01941             else
01942             {
01943                 RecordReference = XFILEREF_ERROR;
01944             }
01945         }
01946     }
01947     else    // the record has already been written, so just get the reference
01948     {
01949         RecordReference = pExistingItem->GetRecordRef();
01950     }
01951 
01952     return RecordReference;
01953 #else
01954     return 0L;
01955 #endif
01956 }

virtual XFileRef RecordReferencingExporter::WriteRecord const RecordReferenceItem ItemToExport  )  [protected, pure virtual]
 

Implemented in StylesExporter.


Member Data Documentation

List RecordReferencingExporter::m_ExportedItems [private]
 

Definition at line 378 of file styles.h.

BaseCamelotFilter& RecordReferencingExporter::m_Filter [private]
 

Definition at line 377 of file styles.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:22 2007 for Camelot by  doxygen 1.4.4