[Classes] [Prev] [Next] [Methods]

CStringCollection

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Constructor and Destructor Methods
Helper Operators
State Methods
Protected Methods

CStringCollection


Heritage

Superclass: None

Subclasses: CStringCollectionRWC


Description

The CStringCollection class is a container for CStringRWC objects. This class is intended to be a transfer class from XVT-Power++ to the XVT Portability Toolkit and Rogue Wave collections.

CStringCollection is not intended to replace Rogue Wave collections. If you need a collection of strings, choose a suitable Rogue Wave collection and insert CStringRWCs into it.


Usage

Creating CStringCollections

You can create CStringCollections in several ways.

Using CStringCollections

CStringCollections are required by many classes in the XVT-Power++ framework. For example, all CNativeList classes require a CStringCollection, like this:

CStringCollection aStrColl(APP_START_LIST,
APP_END_LIST);
NListEdit aListEdit(itsEnclosure, CRect(...),
aStrColl);

Interacting with the XVT Portability Toolkit

For convenience, a conversion operator to XVT Portability Toolkit SLISTs is provided. Use the conversion operator like this:

xvt_list_add(anXVTWin, 0, aStrColl);
Note that the lifetime of the SLIST is the same as the lifetime of the object, so you should not destroy the result of this operator.

Interacting with Rogue Wave Collections

XVT-Power++ supports the RWCollection methods asSet, asBag, asOrderedCollection, and asSortedCollection. For example, you can obtain a Rogue Wave set containing CStringRWCs from a CStringCollection like this:

RWSet aSet(aStrColl.asSet());
Note that this is a shallow copy.

See Also: For more information on Rogue Wave and shallow copies, see the Tools.h++ manual.


Protected Data Members

RWOrdered itsCollection; The collection of strings
SLIST itsSlist; The parallel structure
short itIsManaged Flag to determine if internal strings should be destroyed.
RWOrdered itsCollection Internal list of hits of CStringRWC*


Public Methods

Constructor and Destructor Methods

CStringCollection(int theFirstId, int theLastId);
CStringCollection(const RWOrdered &theCollection);
CStringCollection(SLIST theSlist);
CStringCollection(
const CStringRW& the DelimitedList);
CStringCollection aList("Sun,Mon,Tue,Wed,Thu,Fri,Sat");
CStringCollection(
const CStringCollection &theCollection);
CStringCollection & operator= (
const CStringCollection &theCollection);
~CStringCollection();

Helper Operators

operator SLIST() const;

State Methods

void clearAndDestroy();
RWBag asBag(void) const;
RWSet asSet(void) const;
RWOrdered asOrderedCollection(void) const;
RWBinaryTree asSortedCollection(void) const;

Protected Methods

CStringCollection();



[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.