SourcePro® API Reference Guide

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

Provides a polymorphically persistable RWWString. More...

#include <rw/collstr.h>

Inheritance diagram for RWCollectableWString:
RWCollectable RWWString

Public Member Functions

 RWCollectableWString ()
 
 RWCollectableWString (const RWCollectableWString &str)
 
 RWCollectableWString (RWCollectableWString &&str)
 
 RWCollectableWString (const wchar_t *a)
 
 RWCollectableWString (const wchar_t *a, size_t N)
 
 RWCollectableWString (wchar_t c, size_t N)
 
 RWCollectableWString (const RWWString &s)
 
 RWCollectableWString (const RWWSubString &s)
 
virtual ~RWCollectableWString ()
 
virtual RWspace binaryStoreSize () const
 
virtual int compareTo (const RWCollectable *c) const
 
virtual int compareTo (const RWCollectableWString &c) const
 
virtual RWCollectablecopy () const
 
virtual unsigned hash () const
 
virtual RWClassID isA () const
 
virtual bool isEqual (const RWCollectable *c) const
 
virtual RWCollectablenewSpecies () const
 
RWCollectableWStringoperator= (const RWCollectableWString &str)
 
RWCollectableWStringoperator= (RWCollectableWString &&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 RWWString
 RWWString ()
 
 RWWString (const std::wstring &str)
 
 RWWString (const RWWString &str)
 
 RWWString (RWWString &&str)
 
 RWWString (RWSize_T cap)
 
 RWWString (wchar_t c)
 
 RWWString (wchar_t c, size_t count)
 
 RWWString (const wchar_t *str)
 
 RWWString (const wchar_t *str, size_t len)
 
 RWWString (char c)
 
 RWWString (char c, size_t count)
 
 RWWString (signed char c)
 
 RWWString (unsigned char c)
 
 RWWString (const char *str, ascii_)
 
 RWWString (const RWCString &str, ascii_)
 
 RWWString (const char *str, multiByte_)
 
 RWWString (const RWCString &str, multiByte_)
 
 RWWString (const char *str, size_t len, ascii_)
 
 RWWString (const char *str, size_t len, multiByte_)
 
 RWWString (const SubString &str)
 
 RWWString (const ConstSubString &str)
 
RWWStringappend (wchar_t c, size_t count=1)
 
RWWStringappend (const wchar_t *str)
 
RWWStringappend (const wchar_t *str, size_t len)
 
RWWStringappend (const std::wstring &str)
 
RWWStringappend (const RWWString &str)
 
RWWStringappend (const std::wstring &str, size_t len)
 
RWWStringappend (const RWWString &str, size_t len)
 
RWWStringassign (const RWWString &str)
 
RWWStringassign (const std::wstring &str)
 
RWWStringassign (const SubString &str)
 
RWWStringassign (const ConstSubString &str)
 
RWWStringassign (const wchar_t *str)
 
RWWStringassign (const wchar_t *str, size_t len)
 
RWWStringassign (const wchar_t c, size_t count=1)
 
RWspace binaryStoreSize () const
 
size_t capacity () const
 
size_t capacity (size_t cap)
 
int collate (const wchar_t *str) const
 
int collate (const std::wstring &str) const
 
int collate (const RWWString &str) const
 
int compareTo (const RWWString &str, caseCompare cmp=exact) const
 
int compareTo (const wchar_t *str, caseCompare cmp=exact) const
 
int compareTo (const std::wstring &str, caseCompare cmp=exact) const
 
int compareTo (const std::wstring *str, caseCompare cmp=exact) const
 
int compareTo (const RWWString *str, caseCompare cmp=exact) const
 
bool contains (const wchar_t *str, caseCompare cmp=exact) const
 
bool contains (const std::wstring &str, caseCompare cmp=exact) const
 
bool contains (const RWWString &str, caseCompare cmp=exact) const
 
const wchar_t * data () const
 
size_t first (wchar_t c) const
 
size_t first (wchar_t c, size_t) const
 
size_t first (const wchar_t *str) const
 
size_t first (const wchar_t *str, size_t len) const
 
unsigned long hash (caseCompare cmp=exact) const
 
size_t index (const wchar_t *pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const std::wstring &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const RWWString &pat, size_t start=0, caseCompare cmp=exact) const
 
size_t index (const wchar_t *pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const std::wstring &pat, size_t patlen, size_t start, caseCompare cmp) const
 
size_t index (const RWWString &pat, size_t patlen, size_t start, caseCompare cmp) const
 
RWWStringinsert (size_t pos, wchar_t c, size_t count)
 
RWWStringinsert (size_t pos, const wchar_t *str)
 
RWWStringinsert (size_t pos, const wchar_t *str, size_t len)
 
RWWStringinsert (size_t pos, const std::wstring &str)
 
RWWStringinsert (size_t pos, const RWWString &str)
 
RWWStringinsert (size_t pos, const std::wstring &str, size_t len)
 
RWWStringinsert (size_t pos, const RWWString &str, size_t len)
 
bool isAscii () const
 
bool isNull () const
 
size_t last (wchar_t c) const
 
size_t last (wchar_t c, size_t) const
 
size_t last (const wchar_t *str) const
 
size_t last (const wchar_t *str, size_t len) const
 
size_t length () const
 
 operator const wchar_t * () const
 
bool operator!= (const RWWString &rhs) const
 
wchar_t & operator() (size_t i)
 
wchar_t operator() (size_t i) const
 
SubString operator() (size_t start, size_t len)
 
ConstSubString operator() (size_t start, size_t len) const
 
RWWStringoperator+= (wchar_t c)
 
RWWStringoperator+= (const wchar_t *str)
 
RWWStringoperator+= (const std::wstring &str)
 
RWWStringoperator+= (const RWWString &str)
 
bool operator< (const RWWString &rhs) const
 
RWWStringoperator= (wchar_t c)
 
RWWStringoperator= (const wchar_t *str)
 
RWWStringoperator= (const std::wstring &str)
 
RWWStringoperator= (const RWWString &str)
 
RWWStringoperator= (const SubString &str)
 
RWWStringoperator= (const ConstSubString &str)
 
RWWStringoperator= (RWWString &&str)
 
bool operator== (const RWWString &rhs) const
 
bool operator> (const RWWString &rhs) const
 
wchar_t & operator[] (short i)
 
wchar_t & operator[] (int i)
 
wchar_t & operator[] (long i)
 
wchar_t & operator[] (unsigned short i)
 
wchar_t & operator[] (unsigned int i)
 
wchar_t & operator[] (unsigned long i)
 
wchar_t operator[] (short i) const
 
wchar_t operator[] (int i) const
 
wchar_t operator[] (long i) const
 
wchar_t operator[] (unsigned short i) const
 
wchar_t operator[] (unsigned int i) const
 
wchar_t operator[] (unsigned long i) const
 
wchar_t & operator[] (long long i)
 
wchar_t & operator[] (unsigned long long i)
 
wchar_t operator[] (long long i) const
 
wchar_t operator[] (unsigned long long i) const
 
RWWStringprepend (wchar_t c, size_t count=1)
 
RWWStringprepend (const wchar_t *str)
 
RWWStringprepend (const wchar_t *str, size_t len)
 
RWWStringprepend (const std::wstring &str)
 
RWWStringprepend (const RWWString &str)
 
RWWStringprepend (const std::wstring &str, size_t len)
 
RWWStringprepend (const RWWString &str, size_t len)
 
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)
 
std::istream & readToDelim (std::istream &strm, wchar_t delim)
 
std::istream & readToken (std::istream &strm)
 
std::wistream & readToken (std::wistream &strm)
 
RWWStringremove (size_t pos)
 
RWWStringremove (size_t pos, size_t len)
 
RWWStringreplace (size_t pos, size_t len, const wchar_t *str)
 
RWWStringreplace (size_t pos, size_t len, const std::wstring &str)
 
RWWStringreplace (size_t pos, size_t len, const RWWString &str)
 
RWWStringreplace (size_t pos, size_t len, const wchar_t *str, size_t strLen)
 
RWWStringreplace (size_t pos, size_t len, const std::wstring &str, size_t strLen)
 
RWWStringreplace (size_t pos, size_t len, const RWWString &str, size_t strLen)
 
void resize (size_t len)
 
size_t rindex (const wchar_t *pat, caseCompare cmp) const
 
size_t rindex (const wchar_t *pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const std::wstring &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const RWWString &pat, size_t end=RW_NPOS, caseCompare cmp=exact) const
 
size_t rindex (const wchar_t *pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const std::wstring &pat, size_t patlen, size_t end, caseCompare cmp) const
 
size_t rindex (const RWWString &pat, size_t patlen, size_t end, caseCompare cmp) const
 
std::wstring & std ()
 
const std::wstring & std () const
 
SubString strip (stripType st=trailing, wchar_t c=L' ')
 
ConstSubString strip (stripType st=trailing, wchar_t c=L' ') const
 
SubString subString (const wchar_t *pat, size_t start=0, caseCompare cmp=exact)
 
ConstSubString subString (const wchar_t *pat, size_t start=0, caseCompare cmp=exact) const
 
void swap (RWWString &str)
 
RWCString toAscii () const
 
void toLower ()
 
RWCString toMultiByte () const
 
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 RWWString
static RWWString fromAscii (const RWCString &str)
 
static RWWString fromMultiByte (const RWCString &str)
 
static unsigned hash (const RWWString &wstr)
 
static size_t initialCapacity (size_t capacity=15)
 
static size_t maxWaste (size_t maxwaste=16)
 
static size_t resizeIncrement (size_t increment=16)
 

Additional Inherited Members

- Public Types inherited from RWWString
enum  ascii_ { ascii }
 
enum  caseCompare { exact, ignoreCase, ignoreCaseStrict }
 
typedef RWWConstSubString ConstSubString
 
enum  multiByte_ { multiByte }
 
enum  stripType { leading, trailing, both }
 
typedef RWWSubString SubString
 

Detailed Description

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 need to ensure that it supports the desired formats.
Synopsis
#include <rw/collstr.h>
Persistence
Polymorphic

Constructor & Destructor Documentation

RWCollectableWString::RWCollectableWString ( )

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

RWCollectableWString::RWCollectableWString ( const RWCollectableWString str)
inline

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

RWCollectableWString::RWCollectableWString ( RWCollectableWString &&  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.
RWCollectableWString::RWCollectableWString ( const wchar_t *  a)
inline

Creates a string from the wide character string a. The created string copies the data pointed to by a, up to the first terminating null.

RWCollectableWString::RWCollectableWString ( const wchar_t *  a,
size_t  N 
)
inline

Constructs a string from the character string a. The created string copies the data pointed to by a. Exactly N characters are copied, including any embedded nulls. Hence, the buffer pointed to by a must be at least N * sizeof(wchar_t) bytes or N wide characters long.

RWCollectableWString::RWCollectableWString ( wchar_t  c,
size_t  N 
)
inline

Constructs a string containing the character c repeated N times.

RWCollectableWString::RWCollectableWString ( const RWWString s)
inline

Constructs an RWCollectableWString from the RWWString s by copying data from s.

RWCollectableWString::RWCollectableWString ( const RWWSubString s)
inline

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

virtual RWCollectableWString::~RWCollectableWString ( )
virtual

Empty destructor.

Member Function Documentation

virtual RWspace RWCollectableWString::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 RWCollectableWString::classIsA ( )
static

Returns the RWClassID of this class.

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

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

Reimplemented from RWCollectable.

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

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

virtual RWCollectable* RWCollectableWString::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 RWCollectableWString::hash ( ) const
virtual

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

Reimplemented from RWCollectable.

virtual RWClassID RWCollectableWString::isA ( ) const
virtual

Returns the unique ID for RWCollectableWString.

Reimplemented from RWCollectable.

virtual bool RWCollectableWString::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* RWCollectableWString::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.

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

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

RWCollectableWString& RWCollectableWString::operator= ( RWCollectableWString &&  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 RWCollectableWString::restoreGuts ( RWvistream )
virtual

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

Reimplemented from RWCollectable.

virtual void RWCollectableWString::restoreGuts ( RWFile )
virtual

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

Reimplemented from RWCollectable.

virtual void RWCollectableWString::saveGuts ( RWvostream ) const
virtual

Writes an object's state to an output stream.

Reimplemented from RWCollectable.

virtual void RWCollectableWString::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.