#include <cxfrech.h>
Inheritance diagram for StripSubTreeRecordHandler:
Public Member Functions | |
StripSubTreeRecordHandler () | |
Default constructor. | |
virtual UINT32 * | GetTagList () |
Provides the record handler system with a list of records handled by this handler. | |
virtual BOOL | HandleRecord (CXaraFileRecord *pCXaraFileRecord) |
The main record handling function. | |
virtual BOOL | IsTagInList (UINT32 Tag) |
This decides whether the given Tag should be handled by the sub tree stripper or not. | |
virtual BOOL | BeginImport () |
Informs the record handler that importing is about to begin. | |
virtual void | IncProgressBarCount (UINT32 n) |
virtual void | StripSubTreeOn () |
virtual void | StripSubTreeOff () |
virtual BOOL | IsStripSubTreeOn () |
Private Member Functions | |
CC_DECLARE_DYNAMIC (StripSubTreeRecordHandler) | |
Private Attributes | |
BOOL | StripSubTree |
UINT32 | LevelCounter |
If the next record it gets is a TAG_DOWN, it increments the tree level counter. If the next record it gets is a TAG_UP, it decrements the tree level counter. If the next record is neither a TAG_UP or TAG_DOWN, and the level counter > 0, it is thrown away If the next record is neither a TAG_UP or TAG_DOWN, and the level counter == 0, it is passed on to it's proper handler
Definition at line 348 of file cxfrech.h.
|
Default constructor.
Definition at line 1633 of file cxfrech.cpp. 01634 { 01635 StripSubTreeOff(); 01636 LevelCounter = 0; 01637 }
|
|
Informs the record handler that importing is about to begin.
Reimplemented from CXaraFileRecordHandler. Definition at line 1654 of file cxfrech.cpp. 01655 { 01656 StripSubTreeOff(); 01657 LevelCounter = 0; 01658 01659 return TRUE; 01660 }
|
|
|
|
Provides the record handler system with a list of records handled by this handler.
Implements CXaraFileRecordHandler. Definition at line 1676 of file cxfrech.cpp. 01677 { 01678 static UINT32 TagList[] = {CXFRH_TAG_LIST_END}; 01679 01680 return (UINT32*)&TagList; 01681 }
|
|
The main record handling function.
Implements CXaraFileRecordHandler. Definition at line 1696 of file cxfrech.cpp. 01697 { 01698 ERROR3IF(!IsStripSubTreeOn(),"This should never be called if it's not stripping a subtree"); 01699 if (!IsStripSubTreeOn()) 01700 return TRUE; 01701 01702 ERROR2IF(pCXaraFileRecord == NULL,FALSE,"pCXaraFileRecord is NULL"); 01703 01704 switch (pCXaraFileRecord->GetTag()) 01705 { 01706 case TAG_UP: 01707 if (LevelCounter > 0) 01708 LevelCounter--; 01709 01710 if (LevelCounter == 0) 01711 StripSubTreeOff(); 01712 break; 01713 01714 case TAG_DOWN: 01715 LevelCounter++; 01716 break; 01717 } 01718 01719 return TRUE; 01720 }
|
|
Reimplemented from CamelotRecordHandler. Definition at line 360 of file cxfrech.h.
|
|
Definition at line 364 of file cxfrech.h. 00364 { return StripSubTree; }
|
|
This decides whether the given Tag should be handled by the sub tree stripper or not.
Reimplemented from CXaraFileRecordHandler. Definition at line 1737 of file cxfrech.cpp. 01738 { 01739 // If the stripper is not turned on, there's no point in trying 01740 if (!IsStripSubTreeOn()) 01741 return FALSE; 01742 01743 // If the next tag is not a down node (i.e. it's not the start of a sub-tree) 01744 // and the level counter is 0 (i.e. we're not in the depths of a sub-tree either) 01745 // then we should return FALSE & turn the stripper off 01746 if (Tag != TAG_DOWN && LevelCounter == 0) 01747 { 01748 StripSubTreeOff(); 01749 return FALSE; 01750 } 01751 01752 return TRUE; 01753 }
|
|
Definition at line 363 of file cxfrech.h. 00363 { StripSubTree = FALSE; }
|
|
Definition at line 362 of file cxfrech.h. 00362 { StripSubTree = TRUE; }
|
|
|
|
|