C++ Portable Types Library (PTypes) Version 1.7

Top: Basic types: Lists: strlist: Constructors/destructors

#include <ptypes.h>

enum slflags {
    SL_SORTED = 0x0001,
    SL_DUPLICATES = 0x0002,
    SL_CASESENS = 0x0004,
    SL_OWNOBJECTS = 0x0008

strlist::strlist(slflags iflags);
virtual strlist::~strlist();

strlist::strlist() -- default constructor; creates an unsorted string list which does not own objects.

strlist::strlist(slflags iflags) -- with this constructor additional options can be specified:

SL_SORTED -- the string list is always kept in alphabetical order

SL_DUPLICATES -- the sorted list allows duplicate items. If this option was turned off and an attempt was made to insert an item which already exists in the list, an unrecoverable error is raised.

SL_CASESENS -- the comparison is case sensitive for sorted lists.

SL_OWNOBJECTS -- the objects are destroyed whenever either an item is removed from the list using del() function, or the function clear() is called, or the string list object itself is being destroyed.

These features are set only during construction of a string list object and can not be changed later.

strlist::~strlist() -- destroys member objects if SL_OWNOBJECTS was specified during creation of this string list, or otherwise only destroys the array and the strings.

See also: Manipulation, Search

PTypes home