Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Hydra Core Library Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::CSubString

Module:  Hydra   Group:  General


Does not inherit

Local Index

Members

Non-Members

Synopsis

#include <rwsf/core/cstring.h>
RWCString s("test string");
s(6,3);     // "tri"

Description

The class rwsf::CSubString allows some subsection of an rwsf::CString to be addressed by defining a starting position and an extent. For example the 7th through the 11th elements, inclusive, would have a starting position of 7 and an extent of 5. The specification of a starting position and extent can also be done in your behalf by such functions as rwsf::CString::strip() or the overloaded function call operator taking a regular expression as an argument. There are no public constructors -- rwsf::CSubStrings are constructed by various functions of the rwsf::CString class and then destroyed immediately.

A zero length substring is one with a defined starting position and an extent of zero. It can be thought of as starting just before the indicated character, but not including it. It can be used as an lvalue. A null substring is also legal and is frequently used to indicate that a requested substring, perhaps through a search, does not exist. A null substring can be detected with member function isNull(). However, it cannot be used as an lvalue.

Persistence

None

Example

Program output:

Assignment Operators

CSubString&
operator=(const CString&);
CSubString&
operator=(const CSubString&);
CSubString&
operator=(const char*);

Indexing Operators

char&
operator[](size_t i);
char
operator[](size_t i) const;
char&
operator()(size_t i);
char
operator()(size_t i) const;

Public Member Functions

bool
isNull() const;
size_t
length() const;
int
operator!() const;
size_t
start() const;
void
toLower();
void
toUpper();

Global Logical Operators

bool
operator==(const CSubString& s1, const CSubString& s2);
bool
operator==(const CSubString& s1, const CString& s2);
bool
operator==(const CSubString& s1, const char* s2);


Previous fileTop of DocumentContentsIndex pageNext file

©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks and HydraSDO is a trademark of Quovadx, 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.