RWCollectable RWCollectableString RWCString
Member Functions | |
binaryStoreSize() compareTo() hash() isA() isEqual() restoreGuts() |
saveGuts() stringID() |
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();
Construct an RWCollectableString with zero characters.
RWCollectableString(const RWCString& s);
Construct an RWCollectableString from the RWCString s.
RWCollectableString(const char* c);
Conversion from character string.
RWCollectableString(const RWCSubString&);
Conversion from sub-string.
RWCollectableString(char c, size_t N);
Construct an RWCollectableString with N characters (default blanks).
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 RWBoolean 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.