Module: Essential Tools Module Group: RWCollectable Classes
RWCollectable RWCollectableString RWCString
binaryStoreSize() compareTo() hash() |
isA() isEqual() restoreGuts() |
RWCollectableCString RWCollectableString() saveGuts() |
stringID() ~RWCollectableString() |
typedef RWCollectableString String; // Smalltalk typedef #include <rw/collstr.h> RWCollectableString c;
Collectable strings. This class is useful when strings are stored and retrieved as RWCollectables, or when they are used as keys in the "dictionary" collection classes. Class RWCollectableString inherits from both class RWCString and class RWCollectable. The virtual functions of the base class RWCollectable have been redefined.
Polymorphic
RWCollectableString();
Constructs an RWCollectableString with zero characters.
RWCollectableString(const RWCString& s);
Constructs an RWCollectableString from the RWCString s.
RWCollectableString(const char* c);
Converts from character string.
RWCollectableString(const RWCSubString&);
Converts from sub-string.
RWCollectableString(char c, size_t N);
Constructs an RWCollectableString with N characters (default blanks).
virtual ~RWCollectableString();
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 RWCString::compareTo(*(const String*)c, RWCString::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 RWCollectableStrings 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 RWCString::hash() and returns the results.
virtual RWClassID isA() const;
Redefined from class RWCollectable to return __RWCOLLECTABLESTRING.
virtual bool isEqual(const RWCollectable* c) const;
Redefined from class RWCollectable. Calls RWCString::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.
typedef RWCollectableString RWCollectableCString;
© 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.