Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TStrListMaker Class Reference

Used to create string lists for use with TStringList. More...

#include <resource.h>

Inheritance diagram for TStrListMaker::

TObject TStreamable List of all members.

Public Methods

 TStrListMaker (ushort aStrSize, ushort aIndexSize)
 ~TStrListMaker ()
void put (ushort key, char *str)

Static Public Methods

TStreamablebuild ()

Protected Methods

 TStrListMaker (StreamableInit)
virtual void write (opstream &os)
virtual void* read (ipstream &)

Detailed Description

TStrListMaker is a simple object type used to create string lists for use with TStringList.

Definition at line 465 of file resource.h.


Constructor & Destructor Documentation

TStrListMaker::TStrListMaker ( ushort aStrSize,
ushort aIndexSize )
 

Creates an in-memory string list of size `aStrSize' with an index of `aIndexSize' elements. A string buffer and an index buffer of the specified size are allocated on the heap.

`aStrSize' must be large enough to hold all strings to be added to the string list; each string occupies its length plus a final 0.

As strings are added to the string list (using put()), a string index is built.

Strings with contiguous keys (such `as' and `sError' in the example above) are recorded in one index record, up to 16 at a time. `aIndexSize' must be large enough to allow for all index records generated as strings are added. Each index entry occupies 6 bytes.

TStrListMaker::~TStrListMaker ( )
 

Frees the memory allocated to the string list maker.

TStrListMaker::TStrListMaker ( StreamableInit ) [protected]
 

Each streamable class needs a "builder" to allocate the correct memory for its objects together with the initialized virtual table pointers. This is achieved by calling this constructor with an argument of type StreamableInit.


Member Function Documentation

TStreamable * TStrListMaker::build ( ) [static]
 

Called to create an object in certain stream-reading situations.

void TStrListMaker::put ( ushort key,
char * str )
 

Adds the given string `str' to the calling string list (with the given numerical key).

void * TStrListMaker::read ( ipstream & is ) [inline, protected, virtual]
 

This pure virtual function must be overridden (or redeclared as pure virtual) in every derived class. The overriding read() function for each streamable class must read the necessary data members from the ipstream object `is'. read() is usually implemented by calling the base class's read() (if any), then extracting any additional data members for the derived class.

Reimplemented from TStreamable.

Definition at line 517 of file resource.h.

void TStrListMaker::write ( opstream & os ) [protected, virtual]
 

Writes to the output stream `os'.

Reimplemented from TStreamable.


The documentation for this class was generated from the following file:
Generated at Sat Sep 22 20:19:37 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001