FTTypeList Class Reference

Object used by CXaraFileRecord for recording type information while writing. More...

#include <fttyplis.h>

Inheritance diagram for FTTypeList:

CCObject SimpleCCObject List of all members.

Public Member Functions

 FTTypeList ()
virtual ~FTTypeList ()
DWORD GetCount (void)
BOOL StoreLength (DWORD len)
BOOL AddToListAndLock (FTType Type)
void Unlock (void)
BYTE * GetBuffer (void)

Protected Member Functions

BOOL Enlarge (DWORD Size=16)

Protected Attributes

DWORD m_Length
DWORD m_Used
BOOL m_bLock
BYTE * m_pArray

Private Member Functions

 CC_DECLARE_DYNAMIC (FTTypeList)

Detailed Description

Object used by CXaraFileRecord for recording type information while writing.

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

Definition at line 151 of file fttyplis.h.


Constructor & Destructor Documentation

FTTypeList::FTTypeList  )  [inline]
 

Definition at line 158 of file fttyplis.h.

00159     {
00160         m_pArray = NULL;
00161         m_Used = 0;
00162         m_bLock = FALSE;
00163         m_Length = 0;
00164     };

virtual FTTypeList::~FTTypeList  )  [inline, virtual]
 

Definition at line 166 of file fttyplis.h.

00167     {
00168         if (m_pArray)
00169             CCFree(m_pArray);
00170     };


Member Function Documentation

BOOL FTTypeList::AddToListAndLock FTType  Type  )  [inline]
 

Definition at line 186 of file fttyplis.h.

00187     {
00188         if (m_bLock)
00189             return(FALSE);
00190 
00191         // Add the type to the list
00192 
00193         if (m_Used == m_Length)
00194         {
00195             if (!Enlarge())
00196                 return(FALSE);
00197         }
00198 
00199         // This must exist now
00200         m_pArray[m_Used] = Type;
00201         m_Used++;
00202 
00203         m_bLock = TRUE;
00204         return(TRUE);
00205     };

FTTypeList::CC_DECLARE_DYNAMIC FTTypeList   )  [private]
 

BOOL FTTypeList::Enlarge DWORD  Size = 16  )  [inline, protected]
 

Definition at line 214 of file fttyplis.h.

00215     {
00216         if ((m_pArray == NULL) ||
00217             ((m_Length - m_Used) < Size))
00218         {
00219             DWORD NewLength = m_Length + Size;
00220             BYTE* pNew = (BYTE*)CCRealloc(m_pArray, NewLength);
00221 
00222             if (pNew == NULL)
00223                 return(FALSE);
00224 
00225             m_pArray = pNew;
00226             m_Length = NewLength;
00227         }
00228         return(TRUE);
00229     };

BYTE* FTTypeList::GetBuffer void   )  [inline]
 

Definition at line 209 of file fttyplis.h.

00209 { return(m_pArray); };

DWORD FTTypeList::GetCount void   )  [inline]
 

Definition at line 172 of file fttyplis.h.

00172 { return(m_Used); };

BOOL FTTypeList::StoreLength DWORD  len  )  [inline]
 

Definition at line 174 of file fttyplis.h.

00175     {
00176         // Ensure 4 bytes of space (chances are this is the last thing to be written)
00177         if (!Enlarge(4))
00178             return(FALSE);
00179 
00180         DWORD* pLen = (DWORD*)(m_pArray + m_Used);
00181         *pLen = len;
00182         m_Used += 4;
00183         return(TRUE);
00184     };

void FTTypeList::Unlock void   )  [inline]
 

Definition at line 207 of file fttyplis.h.

00207 { m_bLock = FALSE; };


Member Data Documentation

BOOL FTTypeList::m_bLock [protected]
 

Definition at line 234 of file fttyplis.h.

DWORD FTTypeList::m_Length [protected]
 

Definition at line 229 of file fttyplis.h.

BYTE* FTTypeList::m_pArray [protected]
 

Definition at line 235 of file fttyplis.h.

DWORD FTTypeList::m_Used [protected]
 

Definition at line 233 of file fttyplis.h.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 03:54:40 2007 for Camelot by  doxygen 1.4.4