C++ Portable Types Library (PTypes) Version 1.7

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

#include <ptypes.h>

enum slflags {
    SL_SORTED = 0x0001,       // has no effect for strmap
    SL_DUPLICATES = 0x0002,   // has no effect for strmap
    SL_CASESENS = 0x0004,
    SL_OWNOBJECTS = 0x0008

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

strmap::strmap() -- the default constructor creates a string map which does not own objects.

strmap::strmap(slflags iflags) -- with this constructor additional options can be specified (unlike strlist only two of the flags are allowed here):

SL_CASESENS -- the comparison of the strings is case sensitive.

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 map object itself is being destroyed.

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

strmap::~strmap() -- destroys member objects if SL_OWNOBJECTS was specified during creation of this string map.

See also: Manipulation, Search

PTypes home