CXaraFileRecord Class Reference

This is the class that encapsulates a record in the new v2 format. More...

#include <cxfrec.h>

Inheritance diagram for CXaraFileRecord:

CCObject SimpleCCObject CamelotFileRecord List of all members.

Public Member Functions

 CXaraFileRecord (UINT32 Tag, INT32 Size=-1)
 Creates a record object. These are used by CXaraFile for reading and writing records.
virtual ~CXaraFileRecord ()
 Default destructor.
void DumpTypes (void)
 Dumps the type list to TRACE.
void WriteAsText (CCLexFile *pFile)
virtual CXaraFileRecordGetCopy ()
 Copy function.
virtual BOOL Init (BOOL ZeroMemBlock=FALSE)
 You must call this function before use use any of the Write functions. It initialises the record ready for writing data to (i.e. allocates a buffer).
virtual BOOL Reinit (UINT32 ThisTag, INT32 Size)
 Allows you to reinit the record with a different record tag & size.
virtual BOOL WriteBYTE (BYTE b)
 Writes a BYTE to the record's data section.
virtual BOOL WriteUINT32 (UINT32 n)
 Writes the UINT32 to the record's data section.
virtual BOOL WriteINT32 (INT32 n)
virtual BOOL WriteReference (INT32 n)
virtual BOOL WriteUINT16 (UINT16 n)
virtual BOOL WriteINT16 (INT16 n)
virtual BOOL WriteBuffer (BYTE *pBuf, size_t BufSize)
 Writes out a buffer of BYTEs to the record's data section.
virtual BOOL WriteFLOAT (FLOAT f)
virtual BOOL WriteDOUBLE (double d)
virtual BOOL WriteFIXED16 (FIXED16 n)
virtual BOOL WriteANGLE (ANGLE a)
virtual BOOL WriteWCHAR (WCHAR w)
virtual BOOL WriteWCHARs (const WCHAR *pw, UINT32 Count)
virtual BOOL WriteCoord (const DocCoord &Coord)
 Writes out the coord.
virtual BOOL WriteCoordTrans (const DocCoord &Coord, INT32 dx, INT32 dy)
virtual BOOL WriteCoordInterleaved (const DocCoord &Coord)
 Writes out the coord to the record, in an interleaved format.
virtual BOOL WriteCoordTransInterleaved (const DocCoord &Coord, INT32 dx, INT32 dy)
virtual BOOL WritePath (Path *pPath)
virtual BOOL WritePathRelative (Path *pPath)
virtual BOOL WritePathTrans (Path *pPath, INT32 dx, INT32 dy)
virtual BOOL WritePathRelativeTrans (Path *pPath, INT32 dx, INT32 dy)
virtual BOOL WriteXOrd (INT32 XOrdinate)
 Writes out the x ordinate to the record.
virtual BOOL WriteYOrd (INT32 YOrdinate)
virtual BOOL WriteCCPanose (const CCPanose &MyCCPanose)
 Writes a CCPanose structure to th file.
virtual BOOL WriteASCII (const TCHAR *pStr)
 Writes out the string as an ASCII string.
virtual BOOL WriteUnicode (const TCHAR *pStr)
 Writes out the string as a Unicode string.
virtual BOOL WriteBSTR (_bstr_t bstr)
virtual BOOL WriteUTF16STR (const StringVar &pvstr)
 Writes out the string as a Unicode string Writes a variable length string as a stream of UTF16 unicode characters.
virtual BOOL WriteMatrix (const Matrix &m)
virtual BOOL WriteMatrixTrans (const Matrix &m, INT32 dx, INT32 dy)
virtual UINT32 GetTag ()
virtual UINT32 GetSize ()
 Returns the size of the record.
virtual BYTE * GetBuffer ()
virtual FTTypeListGetTypeList (void)
virtual INT32 GetRecordNumber ()
 Returns the record's number. This value is set by a call to SetRecordNumber().
virtual void SetRecordNumber (UINT32 n)
 Sets the record's number. This value is read by a call to GetRecordNumber().
virtual BOOL IsDataSectionFull ()
virtual void ResetReadPos ()
 Resets the read position, so that the next Read() func call starts from the beginning of the data section.
virtual BOOL ReadBYTE (BYTE *pb)
 Reads a BYTE from the record's data section.
virtual BOOL ReadBYTEtoBOOL (BOOL *pb)
 Reads a BYTE from the record's data section.
virtual BOOL ReadBYTEnoError (BYTE *pb)
 Dangerous, no-error version of CXaraFileRecord::ReadBYTE().
virtual BOOL ReadUINT32 (UINT32 *pn)
virtual BOOL ReadINT32 (INT32 *pn)
virtual BOOL ReadINT32noError (INT32 *pn)
virtual BOOL ReadUINT16 (UINT16 *pn)
virtual BOOL ReadINT16 (INT16 *pn)
virtual BOOL ReadBuffer (BYTE *pBuf, UINT32 BufSize)
virtual BOOL ReadBuffernoError (BYTE *pBuf, UINT32 BufSize)
virtual BOOL ReadFLOAT (FLOAT *pf)
virtual BOOL ReadDOUBLE (double *pd)
virtual BOOL ReadDOUBLEnoError (double *pd)
virtual BOOL ReadFIXED16 (FIXED16 *pn)
virtual BOOL ReadANGLE (ANGLE *pa)
virtual BOOL ReadWCHAR (WCHAR *pw)
virtual BOOL ReadCoord (DocCoord *pCoord)
virtual BOOL ReadCoordTrans (DocCoord *pCoord, INT32 dx, INT32 dy)
virtual BOOL ReadCoordInterleaved (DocCoord *pCoord)
virtual BOOL ReadCoordTransInterleaved (DocCoord *pCoord, INT32 dx, INT32 dy)
virtual BOOL ReadPath (Path *pPath)
virtual BOOL ReadPathRelative (Path *pPath)
virtual BOOL ReadPathTrans (Path *pPath, INT32 dx, INT32 dy)
virtual BOOL ReadPathRelativeTrans (Path *pPath, INT32 dx, INT32 dy)
virtual BOOL ReadXOrd (INT32 *pXOrdinate)
 Reads the x ordinate from the record.
virtual BOOL ReadYOrd (INT32 *pYOrdinate)
virtual BOOL ReadCCPanose (CCPanose *pPanose)
virtual BOOL ReadUnicode (StringBase *pStr)
virtual BOOL ReadUnicode (TCHAR *pStr, UINT32 MaxChars)
virtual BOOL ReadASCII (TCHAR *pStr, UINT32 MaxChars)
virtual BOOL ReadBSTR (_bstr_t *bstr, UINT32 MaxChars)
virtual BOOL ReadUTF16STR (StringVar *pvstr, UINT32 MaxChars)
 Reads a BSTR from the record's data section (i.e. a run of WCHARs)Reads a BSTR from the record's data section (i.e. a run of WCHARs).
virtual BOOL ReadMatrix (Matrix *pMatrix)
virtual BOOL ReadMatrixTrans (Matrix *pMatrix, INT32 dx, INT32 dy)

Private Member Functions

 CC_DECLARE_DYNAMIC (CXaraFileRecord)
void SetUpVars (UINT32 ThisTag, INT32 Size)
 Sets up the member vars for this record.
void FreeBuffer ()
 Deallocates the associated buffer, if it has one. Can be safely called if the record no longer has a buffer.
BOOL AllocBuffer (INT32 Size)
 Allocates a buffer of the given size.
BOOL ExtendBuffer (INT32 Size)
 Extends the buffer by the given amount of bytes.

Private Attributes

BOOL Initialised
UINT32 Tag
UINT32 BufferSize
UINT32 KnownSize
BOOL SizeIsKnown
INT32 RecordNumber
void * pBuffer
UINT32 CurrentPos
BOOL Overflow
FTTypeListm_pTypeList

Detailed Description

This is the class that encapsulates a record in the new v2 format.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/5/96

Definition at line 129 of file cxfrec.h.


Constructor & Destructor Documentation

CXaraFileRecord::CXaraFileRecord UINT32  Tag,
INT32  Size = -1
 

Creates a record object. These are used by CXaraFile for reading and writing records.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
Parameters:
Tag - Tag value for the record [INPUTS] Size- The exact size of the record in bytes, or CXF_UNKNOWN_SIZE
Returns:
Errors: -
See also:
-

Definition at line 163 of file cxfrec.cpp.

00164 {
00165     SetUpVars(Tag,Size);
00166 }

CXaraFileRecord::~CXaraFileRecord  )  [virtual]
 

Default destructor.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
Returns:
Errors: -
See also:
-

Definition at line 212 of file cxfrec.cpp.

00213 {
00214     FreeBuffer();
00215 }


Member Function Documentation

BOOL CXaraFileRecord::AllocBuffer INT32  Size  )  [private]
 

Allocates a buffer of the given size.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
Parameters:
Size = Size of buffer in bytes [INPUTS]
Returns:
TRUE if ok, FALSE otherwise
If Size == 0, no buffer is allocated, but TRUE is still returned.

Returns:
Errors: -
See also:
-

Definition at line 484 of file cxfrec.cpp.

00485 {
00486     ERROR3IF(Size < 0,"Buffer size is < 0, it's a bit difficult to allocate that many bytes");
00487 
00488     FreeBuffer();
00489 
00490     if (Size == 0)
00491         return TRUE;
00492 
00493     if (Size > 0)
00494         pBuffer = CCMalloc(Size);
00495 
00496     if (pBuffer != NULL)
00497     {
00498         BufferSize = Size;
00499         return TRUE;
00500     }
00501     else
00502         return FALSE;
00503 }

CXaraFileRecord::CC_DECLARE_DYNAMIC CXaraFileRecord   )  [private]
 

void CXaraFileRecord::DumpTypes void   ) 
 

Dumps the type list to TRACE.

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

Definition at line 279 of file cxfrec.cpp.

00280 {
00281     TRACEUSER( "Gerry", _T("Tag:% 5d  Size:% 6d  Data:"), Tag, GetSize());
00282 
00283     if (m_pTypeList == NULL ||
00284         m_pTypeList->GetCount() == 0)
00285     {
00286         TRACEUSER( "Gerry", _T(" None\n"));
00287         return;
00288     }
00289 
00290     BYTE* pPtr = m_pTypeList->GetBuffer();
00291     DWORD Count = m_pTypeList->GetCount();
00292     DWORD Index;
00293     for (Index = 0; Index < Count; Index++)
00294     {
00295         PTSTR           pType = NULL;
00296         DWORD len = 0;
00297         switch (pPtr[Index])
00298         {
00299         case FTT_BYTE:      pType = _T(" Byte");        break;
00300         case FTT_UINT32:        pType = _T(" ULong");       break;
00301         case FTT_INT32:     pType = _T(" Long");        break;
00302         case FTT_UINT16:    pType = _T(" UInt16");      break;
00303         case FTT_INT16:     pType = _T(" Int16");       break;
00304         case FTT_FLOAT:     pType = _T(" Float");       break;
00305         case FTT_DOUBLE:    pType = _T(" Double");      break;
00306         case FTT_WCHAR:     pType = _T(" WChar");       break;
00307         case FTT_ASCII:     pType = _T(" Ascii");       break;
00308         case FTT_UNICODE:   pType = _T(" Unicode");     break;
00309         case FTT_COORD:     pType = _T(" Coord");       break;
00310         case FTT_INTCOORD:  pType = _T(" IntCoord");    break;
00311         case FTT_BINHEX:
00312             {
00313                 pType = _T(" Buffer");
00314                 len = *((DWORD*)(pPtr+Index+1));    // Get the length (BYTE pointer arithmetic)
00315                 Index += 4;                         // and skip it
00316                 break;
00317             }
00318         default:            pType = _T(" <BAD TYPE>");  break;
00319         }
00320 
00321         if (pType)
00322             TRACEUSER("Gerry", pType);
00323         if (len != 0)
00324             TRACEUSER( "Gerry", _T("(%d)"), len);
00325     }
00326     TRACEUSER( "Gerry", _T("\n"));
00327 }

BOOL CXaraFileRecord::ExtendBuffer INT32  Size  )  [private]
 

Extends the buffer by the given amount of bytes.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
Parameters:
Size = number of *extra* bytes to add to the buffer [INPUTS]
Returns:
TRUE if ok, FALSE otherwise

Errors: -

See also:
-

Definition at line 519 of file cxfrec.cpp.

00520 {
00521     ERROR3IF(pBuffer == NULL,"No buffer to extend");
00522     if (pBuffer == NULL)
00523         return FALSE;
00524 
00525     pBuffer = CCRealloc(pBuffer,BufferSize+Size);
00526 
00527     if (pBuffer != NULL)
00528     {
00529         BufferSize += Size;
00530         return TRUE;
00531     }
00532     else
00533         return FALSE;
00534 }

void CXaraFileRecord::FreeBuffer  )  [private]
 

Deallocates the associated buffer, if it has one. Can be safely called if the record no longer has a buffer.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
Parameters:
- [INPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 449 of file cxfrec.cpp.

00450 {
00451     if (pBuffer != NULL)
00452     {
00453         CCFree(pBuffer);
00454         pBuffer = NULL;
00455         BufferSize = 0;
00456     }
00457 
00458     if (m_pTypeList != NULL)
00459     {
00460         delete m_pTypeList;
00461         m_pTypeList = NULL;
00462     }
00463 
00464     Initialised = FALSE;
00465 }

virtual BYTE* CXaraFileRecord::GetBuffer  )  [inline, virtual]
 

Definition at line 185 of file cxfrec.h.

00185 { return (BYTE*)pBuffer; }

CXaraFileRecord * CXaraFileRecord::GetCopy  )  [virtual]
 

Copy function.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/6/96
Parameters:
- [INPUTS]
Returns:
ptr to a CXaraFileRecord, which is an exact copy

Errors: -

See also:
-

Definition at line 368 of file cxfrec.cpp.

00369 {
00370     BOOL ok = TRUE;
00371     UINT32 Size = GetSize();
00372 
00373     CXaraFileRecord* pRecord = new CXaraFileRecord(GetTag(),Size);
00374 
00375     if (pRecord != NULL && Size > 0)
00376     {
00377         ok = pRecord->Init();
00378 
00379         if (ok)
00380         {
00381             BYTE* pSrcBuf  = GetBuffer();
00382             BYTE* pDestBuf = pRecord->GetBuffer();
00383 
00384             ok = (pSrcBuf != NULL) && (pDestBuf != NULL);
00385             if (ok) memcpy(pDestBuf,pSrcBuf,Size);
00386         }
00387     }
00388 
00389     if (pRecord != NULL && RecordNumber > 0)
00390         pRecord->SetRecordNumber(RecordNumber);
00391 
00392     if (!ok && pRecord != NULL)
00393     {
00394         delete pRecord;
00395         pRecord = NULL;
00396     }
00397     
00398     return pRecord;
00399 }

INT32 CXaraFileRecord::GetRecordNumber  )  [virtual]
 

Returns the record's number. This value is set by a call to SetRecordNumber().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/5/96
Parameters:
- [INPUTS]
Returns:
The record number of this record

Errors: -

See also:
-

Definition at line 552 of file cxfrec.cpp.

00553 {
00554     ERROR3IF(RecordNumber == 0,"Record number has not been set, or set incorrectly");
00555 
00556     return RecordNumber;
00557 }

UINT32 CXaraFileRecord::GetSize  )  [virtual]
 

Returns the size of the record.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/6/96
Parameters:
- [INPUTS]
Returns:
The size of the record
If the size of the record is known exactly, it returns the size of the buffer that's been allocated for the record.

If it is not known (i.e. when creating a rec of unknown length for writing purposes) the current write position in the buffer is returned. This is the dangerous case, because it is possible that the size returned is not the correct final size.

Returns:
Errors: -
See also:
-

Definition at line 423 of file cxfrec.cpp.

00424 {
00425     if (SizeIsKnown)
00426         return BufferSize;
00427     else
00428     {
00429         //TRACEUSER( "Markn", _T("*+*+* Getting the size of a record, yet don't know it's exact size\n"));
00430         return CurrentPos;
00431     }
00432 }

virtual UINT32 CXaraFileRecord::GetTag  )  [inline, virtual]
 

Definition at line 183 of file cxfrec.h.

00183 { return Tag; }

virtual FTTypeList* CXaraFileRecord::GetTypeList void   )  [inline, virtual]
 

Definition at line 187 of file cxfrec.h.

00187 { return(m_pTypeList); };

BOOL CXaraFileRecord::Init BOOL  ZeroMemBlock = FALSE  )  [virtual]
 

You must call this function before use use any of the Write functions. It initialises the record ready for writing data to (i.e. allocates a buffer).

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
Parameters:
ZeroMemBlock = If TRUE, any memory allocated for the record is filled with zeros [INPUTS]
Returns:
TRUE if initialised OK FALSE otherwise

Errors: -

See also:
-

Definition at line 234 of file cxfrec.cpp.

00235 {
00236     if (!Initialised)
00237     {
00238         ERROR2IF(SizeIsKnown && KnownSize < 0,FALSE,"A -ve size has been given");
00239 
00240         ERROR3IF(pBuffer != NULL,"Initialising the record, yet it already has a buffer");
00241         
00242         if (SizeIsKnown)
00243             Initialised = AllocBuffer(KnownSize);
00244         else
00245             Initialised = AllocBuffer(CXF_RECORD_CHUNK);
00246     }
00247 
00248     if (Initialised && ZeroMemBlock)
00249     {
00250         BYTE* pBuf = GetBuffer();
00251         if (pBuf != NULL)
00252         {
00253             for (UINT32 i=0;i<BufferSize;i++)
00254                 pBuf[i] = 0;
00255         }
00256     }
00257 
00258     if (Initialised)
00259     {
00260         m_pTypeList = new FTTypeList;
00261         if (m_pTypeList == NULL)
00262             TRACEUSER( "Gerry", _T("Failed to create FTTypeList\n"));
00263     }
00264     
00265     return Initialised;
00266 }

virtual BOOL CXaraFileRecord::IsDataSectionFull  )  [inline, virtual]
 

Definition at line 192 of file cxfrec.h.

00192 { return (!(SizeIsKnown && CurrentPos < KnownSize)); }

BOOL CXaraFileRecord::ReadANGLE ANGLE pa  )  [virtual]
 

Definition at line 1305 of file cxfrec.cpp.

01306 {
01307     BOOL ok = ReadBuffer((BYTE*)pa,sizeof(ANGLE));
01308     *pa = LEtoNative(*pa);
01309     return ok;
01310 }

BOOL CXaraFileRecord::ReadASCII TCHAR pStr,
UINT32  MaxChars
[virtual]
 

Definition at line 1546 of file cxfrec.cpp.

01547 {
01548     BOOL ok = TRUE;
01549     BYTE b = 1;
01550     TCHAR* pBuf = pStr;
01551     TCHAR* pBufEnd = pBuf + MaxChars;
01552 
01553     while (ok && b != 0)
01554     {
01555         ok = ReadBYTE(&b);
01556         if (ok) ok = (pBuf < pBufEnd);
01557         if (ok) *pBuf++ = b;
01558     }
01559 
01560     return ok;
01561 }

virtual BOOL CXaraFileRecord::ReadBSTR _bstr_t *  bstr,
UINT32  MaxChars
[virtual]
 

BOOL CXaraFileRecord::ReadBuffer BYTE *  pBuf,
UINT32  BufSize
[virtual]
 

Definition at line 1229 of file cxfrec.cpp.

01230 {
01231     ERROR3IF(pBuf == NULL,"pBuf is NULL");
01232     if (pBuf == NULL)
01233         return FALSE;
01234 
01235     BOOL ok = TRUE;
01236 
01237     for (UINT32 i=0;ok && i < BufSize;i++)
01238         ok = ReadBYTE(pBuf+i);
01239 
01240     return ok;
01241 }

BOOL CXaraFileRecord::ReadBuffernoError BYTE *  pBuf,
UINT32  BufSize
[virtual]
 

Definition at line 1249 of file cxfrec.cpp.

01250 {
01251     ERROR3IF(pBuf == NULL,"pBuf is NULL");
01252     if (pBuf == NULL)
01253         return FALSE;
01254 
01255     BOOL ok = TRUE;
01256 
01257     if (CurrentPos >= BufferSize)
01258     {
01259         pBuf = NULL;
01260         return ok;
01261     }
01262     else
01263     {
01264         for (UINT32 i=0;ok && i < BufSize;i++)
01265         {
01266             ok = ReadBYTE(pBuf+i);
01267         }
01268     }
01269 
01270     return ok;
01271 }

BOOL CXaraFileRecord::ReadBYTE BYTE *  pBYTE  )  [virtual]
 

Reads a BYTE from the record's data section.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/5/96
Parameters:
pBYTE = ptr to place to stick data [INPUTS]
Returns:
TRUE if OK, FALSE otherwise

Errors: -

See also:
StartRecord(), EndRecord()

Definition at line 1148 of file cxfrec.cpp.

01149 {
01150     ERROR3IF(pBYTE == NULL,"pBYTE is NULL");
01151     if (pBYTE == NULL)
01152         return FALSE;
01153 
01154     ERROR3IF(CurrentPos >= BufferSize,"No more data in record");
01155     if (CurrentPos >= BufferSize)
01156         return FALSE;
01157 
01158     BYTE* pBuf = (BYTE*)pBuffer;
01159     *pBYTE = pBuf[CurrentPos++];
01160 
01161     return TRUE;
01162 }

BOOL CXaraFileRecord::ReadBYTEnoError BYTE *  pBYTE  )  [virtual]
 

Dangerous, no-error version of CXaraFileRecord::ReadBYTE().

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/02/2001
Returns:
TRUE if successfully read a BYTE, FALSE if we didn't read a BYTE for any reason.
!!! DO NOT USE UNLESS YOU ***KNOW EXACTLY*** WHAT YOU ARE DOING !!!

See Also: ReadBuffernoError() .

Definition at line 1212 of file cxfrec.cpp.

01213 {
01214     ERROR3IF(pBYTE == NULL, "pBYTE is NULL");
01215     if (pBYTE == NULL)
01216         return FALSE;
01217 
01218     // if we run out of buffer, fail quietly (no error!).
01219     if (CurrentPos >= BufferSize)
01220         return FALSE;
01221 
01222     BYTE* pBuf = (BYTE*)pBuffer;
01223     *pBYTE = pBuf[CurrentPos++];
01224 
01225     return TRUE;
01226 }

BOOL CXaraFileRecord::ReadBYTEtoBOOL BOOL *  pbool  )  [virtual]
 

Reads a BYTE from the record's data section.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/Feb/2006
Parameters:
pbool = ptr to place to stick data [INPUTS]
Returns:
TRUE if OK, FALSE otherwise

Errors: -

See also:
StartRecord(), EndRecord()

Definition at line 1180 of file cxfrec.cpp.

01181 {
01182     ERROR3IF(pbool == NULL,"pbool is NULL");
01183     if (pbool == NULL)
01184         return FALSE;
01185 
01186     ERROR3IF(CurrentPos >= BufferSize,"No more data in record");
01187     if (CurrentPos >= BufferSize)
01188         return FALSE;
01189 
01190     BYTE* pBuf = (BYTE*)pBuffer;
01191     *pbool = (BOOL)pBuf[CurrentPos++];
01192 
01193     return TRUE;
01194 }

BOOL CXaraFileRecord::ReadCCPanose CCPanose pPanose  )  [virtual]
 

Definition at line 1416 of file cxfrec.cpp.

01417 {
01418     BOOL ok = TRUE;
01419 
01420     BYTE value;
01421 
01422 PORTNOTE("other","Removed CCPanose usage - read to NULL")
01423 #ifndef EXCLUDE_FROM_XARALX
01424     if (ok) ok = pMyCCPanose->SetFamilyType(value);
01425     if (ok) ok = pMyCCPanose->SetSerifStyle(value);
01426     if (ok) ok = pMyCCPanose->SetWeight(value);
01427     if (ok) ok = pMyCCPanose->SetProportion(value);
01428     if (ok) ok = pMyCCPanose->SetContrast(value);
01429     if (ok) ok = pMyCCPanose->SetStrokeVariation(value);
01430     if (ok) ok = pMyCCPanose->SetArmStyle(value);
01431     if (ok) ok = pMyCCPanose->SetLetterform(value);
01432     if (ok) ok = pMyCCPanose->SetMidline(value);
01433     if (ok) ok = pMyCCPanose->SetXHeight(value);
01434 #else
01435     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetFamilyType(value);
01436     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetSerifStyle(value);
01437     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetWeight(value);
01438     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetProportion(value);
01439     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetContrast(value);
01440     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetStrokeVariation(value);
01441     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetArmStyle(value);
01442     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetLetterform(value);
01443     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetMidline(value);
01444     if (ok) ok = ReadBYTE(&value); // pMyCCPanose->SetXHeight(value);
01445 #endif
01446     return ok;
01447 }

BOOL CXaraFileRecord::ReadCoord DocCoord pCoord  )  [virtual]
 

Reimplemented in CamelotFileRecord.

Definition at line 1359 of file cxfrec.cpp.

01360 {
01361     if (pCoord != NULL)
01362         return ReadINT32(&(pCoord->x)) && ReadINT32(&(pCoord->y));
01363     else
01364         return FALSE;
01365 }

BOOL CXaraFileRecord::ReadCoordInterleaved DocCoord pCoord  )  [virtual]
 

Reimplemented in CamelotFileRecord.

Definition at line 1382 of file cxfrec.cpp.

01383 {
01384     return ReadCoordTransInterleaved(pCoord,0,0);
01385 }

BOOL CXaraFileRecord::ReadCoordTrans DocCoord pCoord,
INT32  dx,
INT32  dy
[virtual]
 

Definition at line 1367 of file cxfrec.cpp.

01368 {
01369     if (pCoord != NULL)
01370     {
01371         if (ReadINT32(&(pCoord->x)) && ReadINT32(&(pCoord->y)))
01372         {
01373             pCoord->x += dx;
01374             pCoord->y += dy;
01375             return TRUE;
01376         }
01377     }
01378 
01379     return FALSE;
01380 }

BOOL CXaraFileRecord::ReadCoordTransInterleaved DocCoord pCoord,
INT32  dx,
INT32  dy
[virtual]
 

Definition at line 1387 of file cxfrec.cpp.

01388 {
01389     BOOL ok = TRUE;
01390 
01391     if (pCoord != NULL)
01392     {
01393         BYTE b;
01394         INT32 x = 0;
01395         INT32 y = 0;
01396 
01397         if (ok) { ok = ReadBYTE(&b); x += (b << 24); }
01398         if (ok) { ok = ReadBYTE(&b); y += (b << 24); }
01399 
01400         if (ok) { ok = ReadBYTE(&b); x += (b << 16); }
01401         if (ok) { ok = ReadBYTE(&b); y += (b << 16); }
01402 
01403         if (ok) { ok = ReadBYTE(&b); x += (b <<  8); }
01404         if (ok) { ok = ReadBYTE(&b); y += (b <<  8); }
01405 
01406         if (ok) { ok = ReadBYTE(&b); x += (b <<  0); }
01407         if (ok) { ok = ReadBYTE(&b); y += (b <<  0); }
01408 
01409         pCoord->x = x + dx;
01410         pCoord->y = y + dy;
01411     }
01412 
01413     return ok;
01414 }

BOOL CXaraFileRecord::ReadDOUBLE double *  pd  )  [virtual]
 

Definition at line 1334 of file cxfrec.cpp.

01335 {
01336     DoubleUnion f;
01337     BOOL ok = ReadBuffer((BYTE*)&(f.u_INT64),sizeof(f.u_INT64));
01338     *pd = LEtoNative(f);
01339     return ok;
01340 }

BOOL CXaraFileRecord::ReadDOUBLEnoError double *  pd  )  [virtual]
 

Definition at line 1342 of file cxfrec.cpp.

01343 {
01344     DoubleUnion f;
01345     BOOL ok = ReadBuffernoError((BYTE*)&(f.u_INT64),sizeof(f.u_INT64));
01346     *pd = LEtoNative(f);
01347     return ok;
01348 }

BOOL CXaraFileRecord::ReadFIXED16 FIXED16 pn  )  [virtual]
 

Definition at line 1298 of file cxfrec.cpp.

01299 {
01300     BOOL ok = ReadBuffer((BYTE*)pn,sizeof(FIXED16));
01301     *pn = LEtoNative(*pn);
01302     return ok;
01303 }

BOOL CXaraFileRecord::ReadFLOAT FLOAT pf  )  [virtual]
 

Definition at line 1326 of file cxfrec.cpp.

01327 {
01328     FloatUnion f;
01329     BOOL ok = ReadBuffer((BYTE*)&(f.u_INT32),sizeof(f.u_INT32));
01330     *pf = LEtoNative(f);
01331     return ok;
01332 }

BOOL CXaraFileRecord::ReadINT16 INT16 pn  )  [virtual]
 

Definition at line 1319 of file cxfrec.cpp.

01320 {
01321     BOOL ok = ReadBuffer((BYTE*)pn,sizeof(INT16));
01322     *pn = LEtoNative(*pn);
01323     return ok;
01324 }

BOOL CXaraFileRecord::ReadINT32 INT32 *  pn  )  [virtual]
 

Definition at line 1282 of file cxfrec.cpp.

01283 {
01284 //  return ReadBuffer((BYTE*)pINT32,sizeof(INT32));
01285     BOOL ok = ReadBuffer((BYTE*)pINT32,sizeof(INT32));
01286     *pINT32 = LEtoNative(*pINT32);
01287     return ok;
01288 }

BOOL CXaraFileRecord::ReadINT32noError INT32 *  pn  )  [virtual]
 

Definition at line 1290 of file cxfrec.cpp.

01291 {
01292 //  return ReadBuffernoError((BYTE*)pINT32,sizeof(INT32));
01293     BOOL ok = ReadBuffernoError((BYTE*)pINT32,sizeof(INT32));
01294     *pINT32 = LEtoNative(*pINT32);
01295     return ok;
01296 }

BOOL CXaraFileRecord::ReadMatrix Matrix pMatrix  )  [virtual]
 

Reimplemented in CamelotFileRecord.

Definition at line 1933 of file cxfrec.cpp.

01934 {
01935     return ReadMatrixTrans(pMatrix,0,0);
01936 }

BOOL CXaraFileRecord::ReadMatrixTrans Matrix pMatrix,
INT32  dx,
INT32  dy
[virtual]
 

Definition at line 1938 of file cxfrec.cpp.

01939 {
01940     BOOL ok = TRUE;
01941 
01942     FIXED16 a;
01943     FIXED16 b;
01944     FIXED16 c;
01945     FIXED16 d;
01946     INT32 e;
01947     INT32 f;
01948 
01949     if (ok) ok = ReadFIXED16(&a);
01950     if (ok) ok = ReadFIXED16(&b);
01951     if (ok) ok = ReadFIXED16(&c);
01952     if (ok) ok = ReadFIXED16(&d);
01953     if (ok) ok = ReadINT32(&e);
01954     if (ok) ok = ReadINT32(&f);
01955 
01956     (*pMatrix) = Matrix(a,b,c,d,e+dx,f+dy);
01957 
01958     return ok;
01959 }

BOOL CXaraFileRecord::ReadPath Path pPath  )  [virtual]
 

Reimplemented in CamelotFileRecord.

Definition at line 1707 of file cxfrec.cpp.

01708 {
01709     return ReadPathTrans(pPath,0,0);
01710 }