SourcePro® API Reference Guide

 
List of all members | Public Member Functions | Related Functions

An identifier for RWCollectable instances. More...

#include <rw/stringid.h>

Inheritance diagram for RWStringID:
RWCString

Public Member Functions

 RWStringID ()
 
 RWStringID (const RWStringID &sid)
 
 RWStringID (const RWCString &s)
 
 RWStringID (const char *name)
 
 RWStringID (RWCString &&s)
 
 RWStringID (RWStringID &&sid)
 
 ~RWStringID ()
 
RWspace binaryStoreSize () const
 
size_t capacity () const
 
size_t capacity (size_t N)
 
int collate (const char *cs) const
 
int collate (const RWCString &st) const
 
int compareTo (const char *cs, caseCompare cmp=exact) const
 
int compareTo (const RWCString &st, caseCompare cmp=exact) const
 
bool contains (const char *pat, caseCompare cmp=exact) const
 
bool contains (const RWCString &pat, caseCompare cmp=exact) const
 
const char * data () const
 
size_t first (char c) const
 
size_t first (const char *cs) const
 
size_t firstOf (char c, size_t pos=0) const
 
size_t firstOf (const char *str, size_t pos=0) const
 
unsigned hash () const
 
size_t index (const char *pat, size_t i=0, caseCompare cmp=exact) const
 
size_t index (const RWCString &s, size_t i=0, caseCompare cmp=exact) const
 
size_t index (const char *pat, size_t patlen, size_t i, caseCompare cmp) const
 
size_t index (const RWCString &s, size_t patlen, size_t i, caseCompare cmp) const
 
size_t index (const RWCRExpr &pat, size_t i=0) const
 
size_t index (const RWCRExpr &pat, size_t *ext, size_t i=0) const
 
size_t index (const char *pat, size_t *ext, size_t i=0) const
 
size_t index (const RWCRegexp &pat, size_t i=0) const
 
size_t index (const RWCRegexp &pat, size_t *ext, size_t i=0) const
 
bool isAscii () const
 
bool isNull () const
 
size_t last (char c) const
 
size_t last (char c, size_t) const
 
size_t lastOf (char c, size_t pos=RW_NPOS) const
 
size_t length () const
 
 operator const char * () const
 
char operator() (size_t t) const
 
RWStringIDoperator= (const RWStringID &sid)
 
RWStringIDoperator= (const RWCString &s)
 
RWStringIDoperator= (RWCString &&s)
 
RWStringIDoperator= (RWStringID &&sid)
 
char operator[] (size_t t) const
 
void swap (RWStringID &rhs)
 

Related Functions

(Note that these are not member functions.)

bool operator!= (const RWStringID &lhs, const char *rhs)
 
bool operator!= (const char *lhs, const RWStringID &rhs)
 
bool operator!= (const RWStringID &lhs, const RWStringID &rhs)
 
bool operator< (const RWStringID &lhs, const RWStringID &rhs)
 
RWvostreamoperator<< (RWvostream &vos, const RWStringID &sid)
 
RWFileoperator<< (RWFile &file, const RWStringID &sid)
 
std::ostream & operator<< (std::ostream &os, const RWStringID &sid)
 
bool operator<= (const RWStringID &lhs, const RWStringID &rhs)
 
bool operator== (const RWStringID &lhs, const RWStringID &rhs)
 
bool operator== (const RWStringID &lhs, const char *rhs)
 
bool operator== (const char *lhs, const RWStringID &rhs)
 
bool operator> (const RWStringID &lhs, const RWStringID &rhs)
 
bool operator>= (const RWStringID &lhs, const RWStringID &rhs)
 
RWvistreamoperator>> (RWvistream &vis, RWStringID &sid)
 
RWFileoperator>> (RWFile &file, RWStringID &sid)
 
std::istream & operator>> (std::istream &is, RWStringID &sid)
 

Additional Inherited Members

- Protected Types inherited from RWCString
enum  caseCompare { exact, ignoreCase, ignoreCaseStrict }
 
typedef RWCConstSubString ConstSubString
 
enum  scopeType { one, all }
 
enum  stripType { leading, trailing, both }
 
typedef RWCSubString SubString
 
- Protected 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 Protected 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)
 

Detailed Description

Class RWStringID is an identifier for RWCollectable instances. It is derived from RWCString, and may be manipulated by any of the const RWCString methods. The non-const methods have been hidden to prevent the disaster that could occur if the RWStringID of a class changed at run time.

You can associate an RWStringID with an RWCollectable class in one of two ways: pick the RWStringID for the class, or allow the library to automatically generate an RWStringID that is the same sequence of characters as the name of the class; for example, class MyColl : public RWCollectable would get the automatic RWStringID "MyColl".

Example

You specify a class with a fixed RWClassID and generated RWStringID by using the macro RW_DEFINE_COLLECTABLE_CLASS_BY_ID as follows:

RW_DEFINE_COLLECTABLE_CLASS_BY_ID(USER_MODULE,ClassName, ClassID)
RW_DEFINE_COLLECTABLE_CLASS_BY_ID(USER_MODULE,MyCollectable1,0x1000) // for example

You specify a class with a fixed RWStringID and a generated RWClassID by using the new macro RW_DEFINE_COLLECTABLE_CLASS_BY_NAME as follows:

RW_DEFINE_COLLECTABLE_CLASS_BY_NAME(USER_MODULE, MyCollectable2, "Second Collectable") // for example
Example
#include <rw/collect.h>
// See the section in the Essential Tools Module User's Guide
// about exporting symbols for more information about this macro.
#define EXPORT
class MyCollectable1 : public RWCollectable {
RW_DECLARE_COLLECTABLE_CLASS(EXPORT, MyCollectable1);
};
RW_DEFINE_COLLECTABLE_CLASS_BY_ID(EXPORT,MyCollectable1,0x1000)
class MyCollectable2 : public RWCollectable {
RW_DECLARE_COLLECTABLE_CLASS(EXPORT, MyCollectable2);
};
RW_DEFINE_COLLECTABLE_CLASS_BY_NAME(EXPORT, MyCollectable2, "Second Collectable")
int main ()
{
// First set up the experiment
MyCollectable1 one;
MyCollectable2 two;
// All running RWClassIDs are guaranteed distinct
one.isA() != two.isA();
// Every RWCollectable has an RWStringID
one.stringID() == "MyCollectable1";
// There are several ways to find ids
two.isA();
RWCollectable::classID("Second Collectable");
return 0;
}

Constructor & Destructor Documentation

RWStringID::RWStringID ( )
inline

Default constructor. Sets the value of the string ID to "NoID".

RWStringID::RWStringID ( const RWStringID sid)
inline

Copy constructor. Sets the value of the string ID to the value of sid.

RWStringID::RWStringID ( const RWCString s)
inline

Sets the value of the string ID to the value of string s.

RWStringID::RWStringID ( const char *  name)
inline

Sets the value of the string ID to the value of char name.

RWStringID::RWStringID ( RWCString &&  s)
inline

Move Constructor. The created string ID takes ownership of the data owned by s.

Condition:
This method is available only on platforms with rvalue reference support.
RWStringID::RWStringID ( RWStringID &&  sid)
inline

Move constructor. The created string ID takes ownership of the data owned by sid.

Condition:
This method is available only on platforms with rvalue reference support.
RWStringID::~RWStringID ( )
inline

Destructor

Member Function Documentation

RWspace RWStringID::binaryStoreSize ( ) const
inline

Returns the number of bytes necessary to store the object using the global functions:

size_t RWStringID::capacity ( ) const
inline

Returns the current capacity of self. This is the number of bytes the string can hold without resizing.

size_t RWStringID::capacity ( size_t  N)
inline

A non-binding request to alter the capacity of self to cap. The capacity is never reduced below the current number of bytes. Returns the actual capacity.

int RWStringID::collate ( const char *  cs) const
inline

Returns an int less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::strcoll() on self and the argument str. This supports locale-dependent collation.

Note
This function is incompatible with strings with embedded nulls.
int RWStringID::collate ( const RWCString st) const
inline

Returns an int less than, greater than, or equal to zero, according to the result of calling the C++ Standard Library function std::strcoll() on self and the argument str. This supports locale-dependent collation.

Note
This function is incompatible with strings with embedded nulls.
int RWStringID::compareTo ( const char *  cs,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
This function is incompatible with str strings with embedded nulls.
int RWStringID::compareTo ( const RWCString st,
caseCompare  cmp = exact 
) const
inline

Lexicographically compares self to str. Returns the following values based on the results of the comparison:

<0 self precedes str.
0 self is equal to str.
>0 self follows str.

If cmp is either RWCString::ignoreCase or RWCString::ignoreCaseStrict, the strings are normalized before they are compared.

Note
If cmp is not RWCString::exact, this function is incompatible with MBCS strings.
bool RWStringID::contains ( const char *  pat,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, cmp) returns RW_NPOS, otherwise returns true.

bool RWStringID::contains ( const RWCString pat,
caseCompare  cmp = exact 
) const
inline

Returns false if RWCString::index(str, cmp) returns RW_NPOS, otherwise returns true.

const char* RWStringID::data ( void  ) const
inline

Provides access to the RWCString instances's data as a null-terminated string. This datum is owned by the RWCString and may not be deleted or changed. If the RWCString object itself changes or goes out of scope, the pointer value previously returned becomes invalid. While the string is null-terminated, its length is still given by the member function length(). That is, it may contain embedded nulls.

size_t RWStringID::first ( char  c) const
inline
Deprecated:
As of SourcePro 12, use RWCString::firstOf(char, size_t) const instead.
size_t RWStringID::first ( const char *  cs) const
inline
size_t RWStringID::firstOf ( char  c,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence of the character c in self, starting at position pos. Returns RW_NPOS if there is no match.

size_t RWStringID::firstOf ( const char *  str,
size_t  pos = 0 
) const
inline

Returns the index of the first occurrence in self, starting at position pos, of any character in the null-terminated string str. Returns RW_NPOS if there is no match.

Note
This function is incompatible with str strings with embedded nulls.
unsigned RWStringID::hash ( ) const
inline

Returns a suitable hash value.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWStringID::index ( const char *  pat,
size_t  i = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of the null-terminated string pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
This function is incompatible with pat strings with embedded nulls.
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWStringID::index ( const RWCString s,
size_t  i = 0,
caseCompare  cmp = exact 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWStringID::index ( const char *  pat,
size_t  patlen,
size_t  i,
caseCompare  cmp 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen bytes from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWStringID::index ( const RWCString s,
size_t  patlen,
size_t  i,
caseCompare  cmp 
) const
inline

Pattern matching. Starting with index start, searches for the first occurrence of the first patlen bytes from pat in self and returns the index of the start of the match. Returns RW_NPOS if there is no such pattern. Case sensitivity is according to cmp.

Note
If cmp is not RWCString::exact this function is incompatible with MBCS strings.
size_t RWStringID::index ( const RWCRExpr pat,
size_t  i = 0 
) const
inline
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWStringID::index ( const RWCRExpr pat,
size_t *  ext,
size_t  i = 0 
) const
inline
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWStringID::index ( const char *  pat,
size_t *  ext,
size_t  i = 0 
) const
inline
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWStringID::index ( const RWCRegexp pat,
size_t  i = 0 
) const
inline
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
size_t RWStringID::index ( const RWCRegexp pat,
size_t *  ext,
size_t  i = 0 
) const
inline
Deprecated:
As of SourcePro 12, use RWTRegex::index instead.
bool RWStringID::isAscii ( ) const
inline

Returns true if all bytes in self are between [0, 127].

bool RWStringID::isNull ( void  ) const
inline

Returns true if this is a zero length string (i.e., the null string).

size_t RWStringID::last ( char  c) const
inline
Deprecated:
As of SourcePro 12, use RWCString::lastOf(char, size_t) const instead.
size_t RWStringID::last ( char  c,
size_t   
) const
inline
Deprecated:
As of SourcePro 12, use RWCString::lastOf(char, size_t) const instead.
size_t RWStringID::lastOf ( char  c,
size_t  pos = RW_NPOS 
) const
inline

Returns the index of the last occurrence of the character c in self, ending at position pos. Returns RW_NPOS if there is no match.

size_t RWStringID::length ( ) const
inline

Returns the number of bytes in self.

Note
If self contains any multibyte characters, RWCString::mbLength() should be used to determine the number of characters in self.
RWStringID::operator const char * ( ) const
inline

Provides access to the RWCString instances's data as a null-terminated string. This datum is owned by the RWCString and may not be deleted or changed. If the RWCString object itself changes or goes out of scope, the pointer value previously returned becomes invalid. While the string is null-terminated, its length is still given by the member function length(). That is, it may contain embedded nulls.

char RWStringID::operator() ( size_t  t) const
inline

Returns the i th byte in self. The index i must be between 0 and the length of the string less one. Bounds checking is performed if the preprocessor macro RWBOUNDS_CHECK has been defined before including <rw/cstring.h>.

Exceptions
RWBoundsErrif RWBOUNDS_CHECK is defined and the index is out of range.
RWStringID& RWStringID::operator= ( const RWStringID sid)
inline

Assignment operator. Copies the data from string ID sid. Returns a reference to self.

RWStringID& RWStringID::operator= ( const RWCString s)
inline

Copies the data from string s. Returns a reference to self.

RWStringID& RWStringID::operator= ( RWCString &&  s)
inline

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

Condition:
This method is available only on platforms with rvalue reference support.
RWStringID& RWStringID::operator= ( RWStringID &&  sid)
inline

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

Condition:
This method is available only on platforms with rvalue reference support.
char RWStringID::operator[] ( size_t  t) const
inline

Returns the tth byte in self. The index t must be between 0 and the length of the string less one. Bounds checking is performed.

Exceptions
RWBoundsErrif the index is out of range.
void RWStringID::swap ( RWStringID rhs)
inline

Swaps the contents of rhs with self.

Friends And Related Function Documentation

bool operator!= ( const RWStringID lhs,
const char *  rhs 
)
friend

Logical equality and inequality. Case sensitivity is exact. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator!= ( const char *  lhs,
const RWStringID rhs 
)
friend

Logical equality and inequality. Case sensitivity is exact. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator!= ( const RWStringID lhs,
const RWStringID rhs 
)
friend

Logical equality and inequality. Case sensitivity is exact. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator< ( const RWStringID lhs,
const RWStringID rhs 
)
friend

Logical equality and inequality. Case sensitivity is exact. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

RWvostream& operator<< ( RWvostream vos,
const RWStringID sid 
)
friend

Saves string sid to a virtual stream.

RWFile& operator<< ( RWFile file,
const RWStringID sid 
)
friend

Saves string sid to an RWFile.

std::ostream& operator<< ( std::ostream &  os,
const RWStringID sid 
)
friend

Output an RWStringID on ostream os.

bool operator<= ( const RWStringID lhs,
const RWStringID rhs 
)
friend

Comparisons are done lexicographically, byte by byte. Case sensitivity is exact. Use member RWStringID::collate() for locale sensitivity. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator== ( const RWStringID lhs,
const RWStringID rhs 
)
friend

Logical equality and inequality. Case sensitivity is exact. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator== ( const RWStringID lhs,
const char *  rhs 
)
friend

Logical equality and inequality. Case sensitivity is exact. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator== ( const char *  lhs,
const RWStringID rhs 
)
friend

Logical equality and inequality. Case sensitivity is exact. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator> ( const RWStringID lhs,
const RWStringID rhs 
)
friend

Comparisons are done lexicographically, byte by byte. Case sensitivity is exact. Use member RWStringID::collate() for locale sensitivity. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

bool operator>= ( const RWStringID lhs,
const RWStringID rhs 
)
friend

Comparisons are done lexicographically, byte by byte. Case sensitivity is exact. Use member RWStringID::collate() for locale sensitivity. This function is incompatible with const char* strings with embedded nulls. This function may be incompatible with const char* MBCS strings.

RWvistream& operator>> ( RWvistream vis,
RWStringID sid 
)
friend

Restores a string into sid from a virtual stream, replacing the previous contents of sid. If the virtual stream produces an error on extraction, the operator returns the original string contents unmodified. Be sure to check the virtual stream to determine if an extraction error occurred.

RWFile& operator>> ( RWFile file,
RWStringID sid 
)
friend

Restores a string into sid from an RWFile, replacing the previous contents of sid. If the file produce an error on extraction, the operator returns the original string contents unmodified. Be sure to check the file to determine if an extraction error occurred.

std::istream& operator>> ( std::istream &  is,
RWStringID sid 
)
friend

Calls RWCString::readToken(std::istream&). That is, a token is read from the input stream is. This function is incompatible with MBCS strings.

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