Developer Documentation
RAVL, Recognition And Vision Library
USER HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Strings - SubStringC
 

  PUBLIC
SubStringC::assign(const StrRepC *,const char *,int)
SubStringC::SubStringC(StringC &,int,int)
SubStringC::SubStringC(void)
SubStringC::SubStringC(const SubStringC &)
SubStringC::SubStringC(const char *)
SubStringC::SubStringC(const StringC &)
SubStringC::~SubStringC(void)
SubStringC::operator =(const StringC &)
SubStringC::operator =(const SubStringC &)
SubStringC::operator =(const char *)
SubStringC::operator =(char)
SubStringC::contains(char) const
SubStringC::contains(const StringC &) const
SubStringC::contains(const SubStringC &) const
SubStringC::contains(const char *) const
SubStringC::at(int,int)
SubStringC::before(int)
SubStringC::through(int)
SubStringC::from(int)
SubStringC::after(int)
SubStringC::index(char,int) const
SubStringC::index(const StringC &,int) const
SubStringC::index(const SubStringC &,int) const
SubStringC::index(const char *,int) const
SubStringC::index(const Regex &,int) const
SubStringC::contains(const Regex &) const
SubStringC::matches(const Regex &) const
SubStringC::Hash(void) const
SubStringC::TopAndTail(void) const
SubStringC::IntValue(void) const
SubStringC::RealValue(void) const
SubStringC::operator <<(ostream &,const SubStringC &)
SubStringC::length(void) const
SubStringC::empty(void) const
SubStringC::chars(void) const
SubStringC::operator [](int)
SubStringC::operator [](int) const
SubStringC::firstchar(void)
SubStringC::lastchar(void)
SubStringC::OK(void) const

   SubStringC   
 
Sub-string within a larger string.
 
include "Ravl/String.hh"
Source file:Ravl/Core/Base/String.hh
User Level:Normal
Library:RavlCore
In Scope:RavlN

Comments:
This class holds the position and length of a sub string within a string. This holds a reference to the string data and so memory management is taken care of automaticly.

Variables:
StringC S;
The StringC I'm a substring of

unsigned int pos;
starting position in S's rep

unsigned int len;
length of substring

Methods:
void assign(const StrRepC *,const char *,int = - 1)

SubStringC(StringC & x,int first,int l)
Construct from a string.

SubStringC()
Default constructor.

SubStringC(const SubStringC & x)
Copy constructor.

SubStringC(const char * txt)
Construct from a 'C' string,

SubStringC(const StringC & x)
Construct from a StringC.
Note there are no public constructors. SubStringCs are always created via StringC operations

~SubStringC()
Destructor.

SubStringC & operator =(const StringC & y)
Make a substring from a complete string.

SubStringC & operator =(const SubStringC & y)
Copy a sub-string handle.

SubStringC & operator =(const char * t)
Assign to a 'C' string.

SubStringC & operator =(char c)
Create a substring of a single character.

int contains(char c) const
return 1 if target appears anywhere in SubStringC; else 0

int contains(const StringC & y) const
return 1 if target appears anywhere in SubStringC; else 0

int contains(const SubStringC & y) const
return 1 if target appears anywhere in SubStringC; else 0

int contains(const char * t) const
return 1 if target appears anywhere in SubStringC; else 0

SubStringC at(int spos,int len)
Get a string of 'len' bytes starting at spos in sub-string.

SubStringC before(int spos)
All characters before position 'spos' in substring.

SubStringC through(int spos)
All characters before and including 'spos' in substring.

SubStringC from(int spos)
All characters from position 'spos' in substring.

SubStringC after(int spos)
All characters after position 'spos' in substring.

int index(char c,int startpos = 0) const
Return the index of the first occurance of 'c' in this string.
returns -1 on failure. The search starts from index 'startpos'.

int index(const StringC & y,int startpos = 0) const
Return the index of the first occurance of 'y' in this string.
returns -1 on failure. The search starts from index 'startpos'.

int index(const SubStringC & y,int startpos = 0) const
Return the index of the first occurance of 'y' in this string.
returns -1 on failure. The search starts from index 'startpos'.

int index(const char * t,int startpos = 0) const
Return the index of the first occurance of 'y' in this string.
returns -1 on failure. The search starts from index 'startpos'.

int index(const Regex & r,int startpos = 0) const
Return the index of the first occurance of 'y' in this string.
returns -1 on failure. The search starts from index 'startpos'.

int contains(const Regex & r) const
return 1 if target matches entire SubStringC

int matches(const Regex & r) const

unsigned int Hash() const
Return a hash number for substring.

SubStringC TopAndTail() const
Remove while space from begining and end of string.

IntT IntValue() const
Interpret string as an integer.

RealT RealValue() const
Interpret string as a floating point value.
IO

ostream & operator <<(ostream & s,const SubStringC & x)
status

unsigned int length() const
Get the length of the substring.

int empty() const
Test if the substring is empty.

const char * chars() const
Convert to a 'c' style string.
note this will not put a 0 at the end of the substring!

char & operator [](int i)
Access a character.

char operator [](int i) const
Access a character.

char & firstchar()
Access first character in substring.

char & lastchar()
Access last character in substring.

int OK() const
Test if the substring is valid.


Maintainer:Doug Lea, Modified by Charles Galambos, Documentation by CxxDoc: Tue Aug 13 09:59:30 2002