Module: Essential Tools Module Group: RWCollectable Classes
RWCollectable RWCollectableWString RWClassicWString
binaryStoreSize() compareTo() hash() |
isA() isEqual() restoreGuts() |
RWCollectableWString() saveGuts() stringID() |
~RWCollectableWString() |
#include <rw/collstr.h> RWCollectableWString c;
Collectable wide strings paralleling RWCollectableString. This class is useful when wide strings are stored and retrieved as RWCollectables, or when they are used as keys in the "dictionary" collection classes. Class RWCollectableWString inherits from both class RWWString and class RWCollectable. The virtual functions of the base class RWCollectable have been redefined.
NOTE -- Encodings used by operating systems for wchar_t strings may vary. If your application is dependent on the presence of encodings across different operating systems, you will need to ensure that it supports the desired formats.
Polymorphic
RWCollectableWString();
Constructs an RWCollectableWString with zero characters.
RWCollectableWString(const RWWString& s);
Constructs an RWCollectableWString from the RWWStrings.
RWCollectableWString(const wchar_t* c);
Converts from character string.
RWCollectableWString(const RWWSubString&);
Converts from sub-string.
RWCollectableWString(wchar_t c, size_t N);
Constructs an RWCollectableWString with N characters (default blanks).
virtual ~RWCollectableWString();
Empty destructor.
virtual RWspace binaryStoreSize() const;
Redefined from class RWCollectable.
virtual int compareTo(const RWCollectable* c) const;
Redefined from class RWCollectable. Returns the result of RWWString::compareTo(*(const String*)c, RWWString::exact). This compares strings lexicographically, with case considered. It would be possible to define, for instance, CaseFoldedString which did comparisons ignoring case. We have deliberately left this as an exercise for two reasons: Because it is both easy to do and not universally needed; and because the presence of both RWCollectableWStrings and such a CaseFoldedString in any kind of sorted collection has the potential for very confusing behavior, since the result of a comparison would depend on the order in which the comparison was done.
virtual unsigned hash() const;
Redefined from class RWCollectable. Calls RWWString::hash() and returns the results.
virtual RWClassID isA() const;
Redefined from class RWCollectable to return __RWCOLLECTABLEWSTRING.
virtual bool isEqual(const RWCollectable* c) const;
Redefined from class RWCollectable. Calls RWWString::operator==() (i.e., the equivalence operator) with c as the argument and returns the results.
virtual void restoreGuts(RWvistream&); virtual void restoreGuts(RWFile&); virtual void saveGuts(RWvostream&) const; virtual void saveGuts(RWFile&) const;
Redefined from class RWCollectable.
RWStringID stringID();
(acts virtual) Inherited from class RWCollectable.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.