SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Static Public Member Functions
RWCollectableString Class Reference

Provides a polymorphically persistable RWCString. More...

#include <rw/collstr.h>

Inheritance diagram for RWCollectableString:
RWCollectable RWCString

Public Member Functions

 RWCollectableString ()
 
 RWCollectableString (const RWCollectableString &str)
 
 RWCollectableString (RWCollectableString &&str)
 
 RWCollectableString (const char *c)
 
 RWCollectableString (const char *a, size_t N)
 
 RWCollectableString (char c, size_t N)
 
 RWCollectableString (const RWCString &s)
 
 RWCollectableString (const RWCSubString &s)
 
virtual ~RWCollectableString ()
 
virtual RWspace binaryStoreSize () const
 
virtual int compareTo (const RWCollectable *c) const
 
virtual int compareTo (const RWCollectableString &c) const
 
virtual RWCollectablecopy () const
 
virtual unsigned hash () const
 
virtual RWClassID isA () const
 
virtual bool isEqual (const RWCollectable *c) const
 
virtual RWCollectablenewSpecies () const
 
RWCollectableStringoperator= (const RWCollectableString &str)
 
RWCollectableStringoperator= (RWCollectableString &&str)
 
virtual void restoreGuts (RWvistream &)
 
virtual void restoreGuts (RWFile &)
 
virtual void saveGuts (RWvostream &) const
 
virtual void saveGuts (RWFile &) const
 
- Public Member Functions inherited from RWCollectable
virtual ~RWCollectable ()
 
RWspace recursiveStoreSize () const
 
RWStringID stringID () const
 
- Public Member Functions inherited from RWCString
 RWCString ()
 
 RWCString (const RWCString &str)
 
 RWCString (RWCString &&str)
 
 RWCString (const SubString &str)
 
 RWCString (const ConstSubString &str)
 
 RWCString (const std::string &str)
 
 RWCString (const char *str)
 
 RWCString (const char *str, size_t len)
 
 RWCString (char c)
 
 RWCString (signed char c)
 
 RWCString (unsigned char c)
 
 RWCString (char c, size_t count)
 
 RWCString (RWSize_T cap)
 
RWCStringappend (const RWCString &str)
 
RWCStringappend (const SubString &str)
 
RWCStringappend (const ConstSubString &str)
 
RWCStringappend (const RWCString &str, size_t len)
 
RWCStringappend (const std::string &str)
 
RWCStringappend (const std::string &str, size_t len)
 
RWCStringappend (const char *str)
 
RWCStringappend (const char *str, size_t len)
 
RWCStringappend (char c, size_t count=1)
 
RWCStringassign (const RWCString &str)
 
RWCStringassign (const std::string &str)
 
RWCStringassign (const SubString &str)
 
RWCStringassign (const ConstSubString &str)
 
RWCStringassign (const char *str)
 
RWCStringassign (const char *str, size_t len)
 
RWCStringassign (char c, size_t count=1)
 
RWspace binaryStoreSize () const
 
size_t capacity () const
 
size_t capacity (size_t cap)
 
int collate (const RWCString &str) const
 
int collate (const std::string &str) const
 
int collate (const char *str) const
 
int compareTo (const RWCString &str, caseCompare cmp=exact) const
 
int compareTo (const SubString &str, caseCompare cmp=exact) const
 
int compareTo (const ConstSubString &str, caseCompare cmp=exact) const
 
int compareTo (const RWCString *str, caseCompare cmp=exact) const
 
int compareTo (const std::string &str, caseCompare cmp=exact) const
 
int compareTo (const std::string *str, caseCompare cmp=exact) const
 
int compareTo (const char *str, caseCompare cmp=exact) const
 
int compareTo (const char *str, size_t len, caseCompare cmp=exact) const
 
bool contains (const RWCString &str, caseCompare cmp=exact) const
 
bool contains (const SubString &str, caseCompare cmp=exact) const
 
bool contains (const ConstSubString &str, caseCompare cmp=exact) const
 
bool contains (const std::string &str, caseCompare cmp=exact) const
 
bool contains (const char *str, caseCompare cmp=exact) const
 
bool contains (const char *str, size_t len, caseCompare cmp=exact) const
 
const char * data () const
 
size_t first (char c) const
 
size_t first (char c, size_t) const
 
size_t first (const char *str) const
 
size_t first (const char *str, size_t len) const
 
size_t firstNotOf (char c, size_t pos=0) const
 
size_t firstNotOf (const char *str, size_t pos=0) const
 
size_t firstNotOf (const char *str, size_t pos, size_t len) const
 
size_t firstNotOf (const RWCString &str, size_t pos=0) const
 
size_t firstNotOf (const SubString &str, size_t pos=0) const
 
size_t firstNotOf (const ConstSubString &str, size_t pos=0) const
 
size_t firstNotOf (const std::string &str, size_t pos=0) const
 
size_t firstOf (char c, size_t pos=0) const
 
size_t firstOf (const char *str, size_t pos=0) const
 
size_t firstOf (const char *str, size_t pos, size_t len) const
 
size_t firstOf (const RWCString &str, size_t pos=0) const
 
size_t firstOf (const SubString &str, size_t pos=0) const
 
size_t firstOf (const ConstSubString &str, size_t pos=0) const
 
size_t firstOf (const std::string &str, size_t pos=0) const
 
unsigned hash (caseCompare cmp=exact) const
 
size_t index (const RWCString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const SubString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const ConstSubString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const RWCString &pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const std::string &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const std::string &pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const char *pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const char *pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const char pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const RWCRegexp &re, size_t start=0) const
 
size_t index (const RWCRegexp &re, size_t *ext, size_t start=0) const
 
size_t index (const RWCRExpr &re, size_t start=0) const
 
size_t index (const RWCRExpr &re, size_t *ext, size_t start=0) const
 
size_t index (const char *re, size_t *ext, size_t start=0) const
 
RWCStringinsert (size_t pos, const RWCString &str)
 
RWCStringinsert (size_t pos, const SubString &str)
 
RWCStringinsert (size_t pos, const ConstSubString &str)
 
RWCStringinsert (size_t pos, const RWCString &str, size_t len)
 
RWCStringinsert (size_t pos, const std::string &str)
 
RWCStringinsert (size_t pos, const std::string &str, size_t len)
 
RWCStringinsert (size_t pos, const char *str)
 
RWCStringinsert (size_t pos, const char *str, size_t len)
 
RWCStringinsert (size_t pos, char c, size_t count)
 
bool isAscii () const
 
bool isNull () const
 
size_t last (char c) const
 
size_t last (char c, size_t) const
 
size_t last (const char *str) const
 
size_t last (const char *str, size_t len) const
 
size_t lastNotOf (char c, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const char *str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const char *str, size_t pos, size_t len) const
 
size_t lastNotOf (const RWCString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const SubString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const ConstSubString &str, size_t pos=RW_NPOS) const
 
size_t lastNotOf (const std::string &str, size_t pos=RW_NPOS) const
 
size_t lastOf (char c, size_t pos=RW_NPOS) const
 
size_t lastOf (const char *str, size_t pos=RW_NPOS) const
 
size_t lastOf (const char *str, size_t pos, size_t len) const
 
size_t lastOf (const RWCString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const SubString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const ConstSubString &str, size_t pos=RW_NPOS) const
 
size_t lastOf (const std::string &str, size_t pos=RW_NPOS) const
 
size_t length () const
 
SubString match (const RWCRExpr &re)
 
ConstSubString match (const RWCRExpr &) const
 
SubString match (const RWCRExpr &re, size_t start)
 
ConstSubString match (const RWCRExpr &re, size_t start) const
 
size_t mbLength () const
 
 operator const char * () const
 
char & operator() (size_t i)
 
char operator() (size_t i) const
 
SubString operator() (size_t start, size_t len)
 
ConstSubString operator() (size_t start, size_t len) const
 
SubString operator() (const RWCRegexp &re)
 
ConstSubString operator() (const RWCRegexp &re) const
 
SubString operator() (const RWCRegexp &re, size_t start)
 
ConstSubString operator() (const RWCRegexp &re, size_t start) const
 
RWCStringoperator+= (const RWCString &str)
 
RWCStringoperator+= (const SubString &str)
 
RWCStringoperator+= (const ConstSubString &str)
 
RWCStringoperator+= (const std::string &str)
 
RWCStringoperator+= (const char *str)
 
RWCStringoperator+= (char c)
 
RWCStringoperator= (const RWCString &str)
 
RWCStringoperator= (RWCString &&str)
 
RWCStringoperator= (const SubString &str)
 
RWCStringoperator= (const ConstSubString &str)
 
RWCStringoperator= (const std::string &str)
 
RWCStringoperator= (const char *str)
 
RWCStringoperator= (char c)
 
char & operator[] (char i)
 
char operator[] (char i) const
 
char & operator[] (signed char i)
 
char operator[] (signed char i) const
 
char & operator[] (short i)
 
char operator[] (short i) const
 
char & operator[] (int i)
 
char operator[] (int i) const
 
char & operator[] (long i)
 
char operator[] (long i) const
 
char & operator[] (long long i)
 
char operator[] (long long i) const
 
char & operator[] (unsigned char i)
 
char operator[] (unsigned char i) const
 
char & operator[] (unsigned short i)
 
char operator[] (unsigned short i) const
 
char & operator[] (unsigned int i)
 
char operator[] (unsigned int i) const
 
char & operator[] (unsigned long i)
 
char operator[] (unsigned long i) const
 
char & operator[] (unsigned long long i)
 
char operator[] (unsigned long long i) const
 
RWCStringprepend (const RWCString &str)
 
RWCStringprepend (const SubString &str)
 
RWCStringprepend (const ConstSubString &str)
 
RWCStringprepend (const RWCString &str, size_t len)
 
RWCStringprepend (const std::string &str)
 
RWCStringprepend (const std::string &str, size_t len)
 
RWCStringprepend (const char *str)
 
RWCStringprepend (const char *str, size_t len)
 
RWCStringprepend (char c, size_t count=1)
 
std::istream & readFile (std::istream &strm)
 
std::istream & readLine (std::istream &strm, bool skipWhite=true)
 
std::istream & readString (std::istream &strm)
 
std::istream & readToDelim (std::istream &strm, char delim= '\n')
 
std::istream & readToken (std::istream &strm)
 
RWCStringremove (size_t pos)
 
RWCStringremove (size_t pos, size_t len)
 
RWCStringreplace (size_t pos, size_t len, const RWCString &str)
 
RWCStringreplace (size_t pos, size_t len, const SubString &str)
 
RWCStringreplace (size_t pos, size_t len, const ConstSubString &str)
 
RWCStringreplace (size_t pos, size_t len, const RWCString &str, size_t strLen)
 
RWCStringreplace (size_t pos, size_t len, const std::string &str)
 
RWCStringreplace (size_t pos, size_t len, const std::string &str, size_t strLen)
 
RWCStringreplace (size_t pos, size_t len, const char *str)
 
RWCStringreplace (size_t pos, size_t len, const char *str, size_t strLen)
 
RWCStringreplace (const RWCRExpr &re, const RWCString &str, scopeType scope=one)
 
RWCStringreplace (const RWCRExpr &re, const char *str, scopeType scope=one)
 
void resize (size_t len)
 
size_t rindex (const RWCString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const SubString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const ConstSubString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const RWCString &pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const std::string &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const std::string &pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const char *pat, caseCompare cmp) const
 
size_t rindex (const char *pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const char *pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const char pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
void shrink ()
 
std::string & std ()
 
const std::string & std () const
 
SubString strip (stripType st=trailing, char c= ' ')
 
ConstSubString strip (stripType st=trailing, char c= ' ') const
 
SubString subString (const char *pat, size_t start=0, caseCompare cmp=exact)
 
ConstSubString subString (const char *pat, size_t start=0, caseCompare cmp=exact) const
 
void swap (RWCString &str)
 
void toLower ()
 
void toUpper ()
 

Static Public Member Functions

static RWClassID classIsA ()
 
- Static Public Member Functions inherited from RWCollectable
static RWClassID classID (const RWStringID &name)
 
static RWClassID classIsA ()
 
static bool isAtom (RWClassID id)
 
static RWspace nilStoreSize ()
 
- Static Public Member Functions inherited from RWCString
static size_t byteCount (const char *str, size_t nChars=RW_NPOS)
 
static unsigned hash (const RWCString &str)
 
static size_t mbLength (const char *str, size_t nBytes=RW_NPOS)
 

Additional Inherited Members

- Public Types inherited from RWCString
enum  caseCompare { exact, ignoreCase, ignoreCaseStrict }
 
typedef RWCConstSubString ConstSubString
 
enum  scopeType { one, all }
 
enum  stripType { leading, trailing, both }
 
typedef RWCSubString SubString
 

Detailed Description

Collectable strings. This class is useful when strings are stored and retrieved as RWCollectable instances, 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.

Synopsis
typedef RWCollectableString String; // Smalltalk typedef
#include <rw/collstr.h>
Persistence
Polymorphic

Constructor & Destructor Documentation

RWCollectableString::RWCollectableString ( )

Creates a string of length zero (the null string).

RWCollectableString::RWCollectableString ( const RWCollectableString str)
inline

Copy constructor. The created string copies the data from str.

RWCollectableString::RWCollectableString ( RWCollectableString &&  str)
inline

Move constructor. The created collectable string takes ownership of the data owned by str.

Condition:
This method is available only on platforms with rvalue reference support.
RWCollectableString::RWCollectableString ( const char *  c)
inline

Converts from the null-terminated character string c. The created string copies the data pointed to by c, up to the first terminating null. This function is incompatible with c strings with embedded nulls. This function may be incompatible with c MBCS strings.

RWCollectableString::RWCollectableString ( const char *  a,
size_t  N 
)
inline

Constructs an RWCollectableString from the character string a. The created string copies the data pointed to by a. Exactly N bytes are copied, including any embedded nulls. Hence, the buffer pointed to by a must be at least N bytes long.

RWCollectableString::RWCollectableString ( char  c,
size_t  N 
)
inline

Constructs an RWCollectableString containing the character c repeated N times.

RWCollectableString::RWCollectableString ( const RWCString s)
inline

Constructs an RWCollectableString from the RWCString s by copying data from s.

RWCollectableString::RWCollectableString ( const RWCSubString s)
inline

Converts from a sub-string. The created string copies the substring represented by s.

virtual RWCollectableString::~RWCollectableString ( )
virtual

Empty destructor.

Member Function Documentation

virtual RWspace RWCollectableString::binaryStoreSize ( ) const
inlinevirtual

Returns the number of bytes used by the virtual function saveGuts(RWFile&) to store an object. Typically, this involves adding up the space required to store all primitives, plus the results of calling recursiveStoreSize() for all objects inheriting from RWCollectable. See the Essential Tools Module User's Guide for details.

Reimplemented from RWCollectable.

static RWClassID RWCollectableString::classIsA ( )
static

Returns the RWClassID of this class.

virtual int RWCollectableString::compareTo ( const RWCollectable c) const
virtual

If c is an RWCollectableString, returns the result of calling RWCString::compareTo(), otherwise returns a nonzero value based on the type of c.

Reimplemented from RWCollectable.

virtual int RWCollectableString::compareTo ( const RWCollectableString c) const
inlinevirtual

Returns a result equivalent to calling RWCString::compareTo(const RWCString& c).

virtual RWCollectable* RWCollectableString::copy ( ) const
virtual

Returns a new, copy-constructed object of the same type as self. The caller is responsible for deleting the object.

Reimplemented from RWCollectable.

virtual unsigned RWCollectableString::hash ( ) const
virtual

Calls RWCString::hash() and returns the results.

Reimplemented from RWCollectable.

virtual RWClassID RWCollectableString::isA ( ) const
virtual

Returns the unique ID for RWCollectableString.

Reimplemented from RWCollectable.

virtual bool RWCollectableString::isEqual ( const RWCollectable t) const
virtual

Behaves as if compareTo(t) was invoked, returning true if the result equals 0, false otherwise.

Reimplemented from RWCollectable.

virtual RWCollectable* RWCollectableString::newSpecies ( ) const
virtual

Returns a new, default-constructed object of the same type as self. The caller is responsible for deleting the object.

Reimplemented from RWCollectable.

RWCollectableString& RWCollectableString::operator= ( const RWCollectableString str)
inline

Assignment operator. The string copies the data from str. Returns a reference to self.

RWCollectableString& RWCollectableString::operator= ( RWCollectableString &&  str)
inline

Move assignment. Self takes ownership of the data owned by str.

Condition:
This method is available only on platforms with rvalue reference support.
virtual void RWCollectableString::restoreGuts ( RWvistream )
virtual

Reads an object's state from an input stream, replacing the previous state.

Reimplemented from RWCollectable.

virtual void RWCollectableString::restoreGuts ( RWFile )
virtual

Reads an object's state from a binary file, using class RWFile, replacing the previous state.

Reimplemented from RWCollectable.

virtual void RWCollectableString::saveGuts ( RWvostream ) const
virtual

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

virtual void RWCollectableString::saveGuts ( RWFile ) const
virtual

Writes an object's state to a binary file, using class RWFile.

Reimplemented from RWCollectable.

Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.