CompressionRecordHandler Class Reference

Provide a compression record handler for the new native and web file formats. This asks the ZLib code within side the CCFile class to turn compression on or off. More...

#include <rechcomp.h>

Inheritance diagram for CompressionRecordHandler:

CamelotRecordHandler CXaraFileRecordHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 CompressionRecordHandler ()
 ~CompressionRecordHandler ()
virtual UINT32GetTagList ()
 Provides the record handler system with a list of records handled by this handler.
virtual BOOL HandleRecord (CXaraFileRecord *pCXaraFileRecord)
 Handles the given record.
virtual BOOL HandleStreamedRecord (CXaraFile *pCXFile, UINT32 Tag, UINT32 Size, UINT32 RecordNumber)
 This is the streamed record handler. It is used when.
virtual BOOL IsStreamed (UINT32 Tag)
 Function to find out if the record is streamed or not.
virtual void IncProgressBarCount (UINT32 n)

Private Member Functions

 CC_DECLARE_DYNAMIC (CompressionRecordHandler)

Detailed Description

Provide a compression record handler for the new native and web file formats. This asks the ZLib code within side the CCFile class to turn compression on or off.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/6/96
See also:

Definition at line 122 of file rechcomp.h.


Constructor & Destructor Documentation

CompressionRecordHandler::CompressionRecordHandler  )  [inline]
 

Definition at line 128 of file rechcomp.h.

00128 : CamelotRecordHandler() {}

CompressionRecordHandler::~CompressionRecordHandler  )  [inline]
 

Definition at line 129 of file rechcomp.h.

00129 {}


Member Function Documentation

CompressionRecordHandler::CC_DECLARE_DYNAMIC CompressionRecordHandler   )  [private]
 

UINT32 * CompressionRecordHandler::GetTagList  )  [virtual]
 

Provides the record handler system with a list of records handled by this handler.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/6/96
Parameters:
- [INPUTS]
Returns:
Ptr to a list of tag values, terminated by CXFRH_TAG_LIST_END
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 137 of file rechcomp.cpp.

00138 {
00139     static UINT32 TagList[] = {TAG_STARTCOMPRESSION, TAG_ENDCOMPRESSION, CXFRH_TAG_LIST_END};
00140 
00141     return (UINT32*)&TagList;
00142 }

BOOL CompressionRecordHandler::HandleRecord CXaraFileRecord pCXaraFileRecord  )  [virtual]
 

Handles the given record.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/6/96
Parameters:
pCXaraFileRecord = ptr to record to handle [INPUTS]
Returns:
TRUE if handled successfuly FALSE otherwise
See also:
-

Implements CXaraFileRecordHandler.

Definition at line 158 of file rechcomp.cpp.

00159 {
00160     ERROR2IF(pCXaraFileRecord == NULL,FALSE,"CompressionRecordHandler::HandleRecord pCXaraFileRecord is NULL");
00161     
00162     // This should be unused and we should error if this is called
00163     ERROR2(FALSE,"CompressionRecordHandler::HandleRecord called! Use Streamed form instead");
00164     
00165     BOOL ok = TRUE;
00166 
00167     switch (pCXaraFileRecord->GetTag())
00168     {
00169         case TAG_STARTCOMPRESSION:
00170             // Ask the compression system to be turned on
00171             TRACEUSER( "Neville", _T("Turn compression on\n"));
00172             ok = SetCompression(TRUE);
00173             break;
00174         case TAG_ENDCOMPRESSION:
00175             // Ask the compression system to be turned off
00176             TRACEUSER( "Neville", _T("Turn compression on\n"));
00177             ok = SetCompression(FALSE);
00178             break;
00179 
00180         default:
00181             ok = FALSE;
00182             ERROR3_PF(("CompressionRecordHandler::HandleRecord I don't handle records with the tag (%d)\n",pCXaraFileRecord->GetTag()));
00183             break;
00184     }
00185 
00186     return ok;
00187 }

BOOL CompressionRecordHandler::HandleStreamedRecord CXaraFile pCXFile,
UINT32  Tag,
UINT32  Size,
UINT32  RecordNumber
[virtual]
 

This is the streamed record handler. It is used when.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/6/96
Parameters:
pCXFile = access to the CXaraFile class [INPUTS] Tag = the tag value Size = size of record RecordNumber = the record number in the file
Returns:
TRUE if handled ok FALSE otherwise

Errors: -

See also:
-

Reimplemented from CXaraFileRecordHandler.

Definition at line 207 of file rechcomp.cpp.

00208 {
00209     ERROR2IF(Tag <= 0,FALSE,"CompressionRecordHandler::HandleStreamedRecord Tag is negative!");
00210     
00211     BOOL ok = TRUE;
00212 
00213     switch (Tag)
00214     {
00215         case TAG_STARTCOMPRESSION:
00216             // Ask the compression system to be turned on
00217             TRACEUSER( "Neville", _T("Turn compression on\n"));
00218             ok = SetCompression(TRUE);
00219             break;
00220         case TAG_ENDCOMPRESSION:
00221             // Ask the compression system to be turned off
00222             TRACEUSER( "Neville", _T("Turn compression off\n"));
00223             ok = SetCompression(FALSE);
00224             break;
00225 
00226         default:
00227             ok = FALSE;
00228             ERROR3_PF(("CompressionRecordHandler::HandleStreamedRecord I don't handle records with the tag (%d)\n",Tag));
00229             break;
00230     }
00231 
00232     return ok;
00233 }

virtual void CompressionRecordHandler::IncProgressBarCount UINT32  n  )  [inline, virtual]
 

Reimplemented from CamelotRecordHandler.

Definition at line 139 of file rechcomp.h.

00139 {};

BOOL CompressionRecordHandler::IsStreamed UINT32  Tag  )  [virtual]
 

Function to find out if the record is streamed or not.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/6/96
Parameters:
The tag of the record [INPUTS]
Returns:
TRUE if this is a streamed record FALSE otherwise

Errors: -

See also:
-

Reimplemented from CamelotRecordHandler.

Definition at line 251 of file rechcomp.cpp.

00252 {
00253     // We don't want these records read in or handled by any outsiders as the ZLib code
00254     // reads things like the CRC and uncompressed size itself when compression is stopped
00255     return TRUE;
00256 }


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