IndGenFileBuffer Class Reference

Since MSDOS seems happy returning filenames of files in a directory in a completely random fashion, we need to have some way of storing all the ones it returns us and sorting them alphabetically, so we can generate index files in a nice alphabetical order. More...

#include <sgindgen.h>

Inheritance diagram for IndGenFileBuffer:

CCObject SimpleCCObject List of all members.

Public Member Functions

 IndGenFileBuffer ()
 Constructor Notes: Since MSDOS seems happy returning filenames of files in a directory in a completely random fashion, we need to have some way of storing all the ones it returns us and sorting them alphabetically, so we can generate index files in a nice alphabetical order.
 ~IndGenFileBuffer ()
 Destructor - frees all the memory Notes:.
BOOL Init (INT32 Count)
BOOL AddItem (TCHAR *String)
BOOL Sort (void)
TCHARGetItem (INT32 Count)
INT32 ItemCount (void)

Static Protected Member Functions

static INT32 __cdecl SortComparator (const void *Item1, const void *Item2)

Protected Attributes

TCHAR ** Buffer
INT32 Items
INT32 Position

Detailed Description

Since MSDOS seems happy returning filenames of files in a directory in a completely random fashion, we need to have some way of storing all the ones it returns us and sorting them alphabetically, so we can generate index files in a nice alphabetical order.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/05/95
The data structure used below is basically an array of TCHAR *'s pointed to by Buffer. These TCHAR *'s are CCMalloced and given variable length C style strings by AddItem. The destructor handles the memory tidying up.

Definition at line 124 of file sgindgen.h.


Constructor & Destructor Documentation

IndGenFileBuffer::IndGenFileBuffer  ) 
 

Constructor Notes: Since MSDOS seems happy returning filenames of files in a directory in a completely random fashion, we need to have some way of storing all the ones it returns us and sorting them alphabetically, so we can generate index files in a nice alphabetical order.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/05/95
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
The data structure used below is basically an array of TCHAR *'s pointed to by Buffer. These TCHAR *'s are CCMalloced and given variable length C style strings by AddItem. The destructor handles the memory tidying up.

Definition at line 964 of file sgindgen.cpp.

00965 {
00966     Buffer = NULL;
00967     Items = 0;
00968     Position = 0;
00969 }

IndGenFileBuffer::~IndGenFileBuffer  ) 
 

Destructor - frees all the memory Notes:.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/05/95
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:

Definition at line 987 of file sgindgen.cpp.

00988 {   
00989     if(Buffer != NULL)
00990     {
00991         for(INT32 i = 0; i<Items; i++)
00992         {
00993             if(Buffer[i] != NULL)
00994                 CCFree(Buffer[i]);
00995         }
00996 
00997         CCFree(Buffer);
00998         Buffer = NULL;
00999     }
01000 }


Member Function Documentation

BOOL IndGenFileBuffer::AddItem TCHAR String  ) 
 

TCHAR* IndGenFileBuffer::GetItem INT32  Count  ) 
 

BOOL IndGenFileBuffer::Init INT32  Count  ) 
 

INT32 IndGenFileBuffer::ItemCount void   )  [inline]
 

Definition at line 135 of file sgindgen.h.

00135 {return Items;}

BOOL IndGenFileBuffer::Sort void   ) 
 

static INT32 __cdecl IndGenFileBuffer::SortComparator const void *  Item1,
const void *  Item2
[static, protected]
 


Member Data Documentation

TCHAR** IndGenFileBuffer::Buffer [protected]
 

Definition at line 141 of file sgindgen.h.

INT32 IndGenFileBuffer::Items [protected]
 

Definition at line 142 of file sgindgen.h.

INT32 IndGenFileBuffer::Position [protected]
 

Definition at line 143 of file sgindgen.h.


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