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

  PUBLIC
StringC::search(int,int,const char *,int) const
StringC::search(int,int,char) const
StringC::match(int,int,int,const char *,int) const
StringC::_gsub(const char *,int,const char *,int)
StringC::_gsub(const Regex &,const char *,int)
StringC::_substr(int,int)
StringC::StringC(StrRepC *)
StringC::StringC(void)
StringC::StringC(const StringC &)
StringC::StringC(const SubStringC &)
StringC::StringC(const char *)
StringC::StringC(const char *,const SizeT)
StringC::StringC(const char *,SizeT,SizeT)
StringC::StringC(const SizeT,const char *)
StringC::StringC(const IndexC)
StringC::StringC(IntT)
StringC::StringC(UIntT)
StringC::StringC(RealT)
StringC::StringC(char)
StringC::StringC(istream &)
StringC::~StringC(void)
StringC::Copy(void) const
StringC::Hash(void) const
StringC::operator =(const StringC &)
StringC::operator =(const char *)
StringC::operator =(char)
StringC::operator =(const SubStringC &)
StringC::operator +=(const StringC &)
StringC::operator +=(const SubStringC &)
StringC::operator +=(const char *)
StringC::operator +=(char)
StringC::prepend(const StringC &)
StringC::prepend(const SubStringC &)
StringC::prepend(const char *)
StringC::prepend(char)
StringC::index(char,int) const
StringC::index(const StringC &,int) const
StringC::index(const SubStringC &,int) const
StringC::index(const char *,int) const
StringC::index(const Regex &,int) const
StringC::contains(char) const
StringC::contains(const StringC &) const
StringC::contains(const SubStringC &) const
StringC::contains(const char *) const
StringC::contains(char,int) const
StringC::contains(const StringC &,int) const
StringC::contains(const SubStringC &,int) const
StringC::contains(const char *,int) const
StringC::contains(const Regex &) const
StringC::contains(const Regex &,int) const
StringC::matches(char,int) const
StringC::matches(const StringC &,int) const
StringC::matches(const SubStringC &,int) const
StringC::matches(const char *,int) const
StringC::matches(const Regex &,int) const
StringC::CaseCmp(const StringC &) const
StringC::freq(char) const
StringC::freq(const StringC &) const
StringC::freq(const SubStringC &) const
StringC::freq(const char *) const
StringC::at(int,int)
StringC::operator ()(int,int)
StringC::at(const StringC &,int)
StringC::at(const SubStringC &,int)
StringC::at(const char *,int)
StringC::at(char,int)
StringC::at(const Regex &,int)
StringC::before(int)
StringC::before(const StringC &,int)
StringC::before(const SubStringC &,int)
StringC::before(const char *,int)
StringC::before(char,int)
StringC::before(const Regex &,int)
StringC::through(int)
StringC::through(const StringC &,int)
StringC::through(const SubStringC &,int)
StringC::through(const char *,int)
StringC::through(char,int)
StringC::through(const Regex &,int)
StringC::from(int)
StringC::from(const StringC &,int)
StringC::from(const SubStringC &,int)
StringC::from(const char *,int)
StringC::from(char,int)
StringC::from(const Regex &,int)
StringC::after(int)
StringC::after(const StringC &,int)
StringC::after(const SubStringC &,int)
StringC::after(const char *,int)
StringC::after(char,int)
StringC::after(const Regex &,int)
StringC::del(int,int)
StringC::del(const StringC &,int)
StringC::del(const SubStringC &,int)
StringC::del(const char *,int)
StringC::del(char,int)
StringC::del(const Regex &,int)
StringC::gsub(const StringC &,const StringC &)
StringC::gsub(const SubStringC &,const StringC &)
StringC::gsub(const char *,const StringC &)
StringC::gsub(const char *,const char *)
StringC::gsub(const Regex &,const StringC &)
StringC::split(const StringC &,StringC,int,const StringC &)
StringC::split(const StringC &,StringC,int,const Regex &)
StringC::common_prefix(const StringC &,const StringC &,int)
StringC::common_suffix(const StringC &,const StringC &,int)
StringC::StrCreplicate(char,int)
StringC::StrCreplicate(const StringC &,int)
StringC::StrCreplicateStrC(const StringC &,int)
StringC::join(StringC,int,const StringC &)
StringC::reverse(const StringC &)
StringC::upcase(const StringC &)
StringC::downcase(const StringC &)
StringC::capitalize(const StringC &)
StringC::reverse(void)
StringC::upcase(void)
StringC::downcase(void)
StringC::capitalize(void)
StringC::operator [](UIntT)
StringC::operator [](UIntT) const
StringC::operator [](IndexC)
StringC::operator [](IndexC) const
StringC::operator [](int)
StringC::operator [](int) const
StringC::elem(int) const
StringC::firstchar(void) const
StringC::lastchar(void) const
StringC::operator const char *(void) const
StringC::chars(void) const
StringC::operator <<(ostream &,const StringC &)
StringC::operator <<(ostream &,const SubStringC &)
StringC::operator >>(istream &,StringC &)
StringC::operator >>(BinIStreamC &,StringC &)
StringC::readline(istream &,StringC &,char,int)
StringC::length(void) const
StringC::empty(void) const
StringC::IsEmpty(void) const
StringC::alloc(int)
StringC::allocation(void) const
StringC::Size(void) const
StringC::OK(void) const
StringC::TopAndTail(void) const
StringC::IntValue(void) const
StringC::RealValue(void) const
StringC::cat(const StringC &,const StringC &,StringC &)
StringC::cat(const StringC &,const SubStringC &,StringC &)
StringC::cat(const StringC &,const char *,StringC &)
StringC::cat(const StringC &,char,StringC &)
StringC::cat(const SubStringC &,const StringC &,StringC &)
StringC::cat(const SubStringC &,const SubStringC &,StringC &)
StringC::cat(const SubStringC &,const char *,StringC &)
StringC::cat(const SubStringC &,char,StringC &)
StringC::cat(const char *,const StringC &,StringC &)
StringC::cat(const char *,const SubStringC &,StringC &)
StringC::cat(const char *,const char *,StringC &)
StringC::cat(const char *,char,StringC &)
StringC::cat(const StringC &,const StringC &,const StringC &,StringC &)
StringC::cat(const StringC &,const StringC &,const SubStringC &,StringC &)
StringC::cat(const StringC &,const StringC &,const char *,StringC &)
StringC::cat(const StringC &,const StringC &,char,StringC &)
StringC::cat(const StringC &,const SubStringC &,const StringC &,StringC &)
StringC::cat(const StringC &,const SubStringC &,const SubStringC &,StringC &)
StringC::cat(const StringC &,const SubStringC &,const char *,StringC &)
StringC::cat(const StringC &,const SubStringC &,char,StringC &)
StringC::cat(const StringC &,const char *,const StringC &,StringC &)
StringC::cat(const StringC &,const char *,const SubStringC &,StringC &)
StringC::cat(const StringC &,const char *,const char *,StringC &)
StringC::cat(const StringC &,const char *,char,StringC &)
StringC::cat(const char *,const StringC &,const StringC &,StringC &)
StringC::cat(const char *,const StringC &,const SubStringC &,StringC &)
StringC::cat(const char *,const StringC &,const char *,StringC &)
StringC::cat(const char *,const StringC &,char,StringC &)
StringC::cat(const char *,const SubStringC &,const StringC &,StringC &)
StringC::cat(const char *,const SubStringC &,const SubStringC &,StringC &)
StringC::cat(const char *,const SubStringC &,const char *,StringC &)
StringC::cat(const char *,const SubStringC &,char,StringC &)
StringC::cat(const char *,const char *,const StringC &,StringC &)
StringC::cat(const char *,const char *,const SubStringC &,StringC &)
StringC::cat(const char *,const char *,const char *,StringC &)
StringC::cat(const char *,const char *,char,StringC &)

   StringC   
 
A reference-counted string.
 
include "Ravl/String.hh"
Source file:Ravl/Core/Base/String.hh
User Level:Basic
Library:RavlCore
In Scope:RavlN

Derived Classes: Variables:
StrRepP rep;
StringCs are pointers to their representations some helper functions

Methods:
int search(int,int,const char *,int x = - 1) const

int search(int,int,char) const

int match(int,int,int,const char *,int = - 1) const

int _gsub(const char *,int,const char *,int)

int _gsub(const Regex &,const char *,int)

SubStringC _substr(int,int)

StringC(StrRepC * x)
Create a new string from a rep.

Constructors, copies, assignment, and destructor

StringC()
Create a handle to the NULL string.

StringC(const StringC & x)
Create a new handle to string 'x'

StringC(const SubStringC & y)
Make a copy of substring 'x' in a real string

StringC(const char * t)
Copy C style 't' string into a StringC.
t should be 0 terminated.

StringC(const char * t,const SizeT len)
Allocate new string, with len bytes in it.

StringC(const char * t,SizeT useLen,SizeT allocLen)
Create a string of length allocLen;
copy useLen characters from t into new string.

StringC(const SizeT len,const char * defaultString)
Construct a string which is a copy of 'defaultString's first 'len' characters.
Caution: if default string is shorter than 'len' the contents of the resulting string are undefined.

StringC(const IndexC n)
Create a string from IndexC

StringC(IntT n)
Create a string from Int

StringC(UIntT n)
Create a string from unsigned int

StringC(RealT val)
Create a string from real value

StringC(char c)
Create a string from char "c"

StringC(istream & in)
Create a string from the stream "in"

~StringC()
Destructor.

StringC Copy(void) const
Make a copy of this string.

unsigned int Hash(void) const
Create a hash value that is "fairly unique" for string.

StringC & operator =(const StringC & y)
Copy handle of string 'y'.

StringC & operator =(const char * t)
Assign a 'c' string to this string.

StringC & operator =(char c)
Assign a character to this string.

StringC & operator =(const SubStringC & y)
Assign a substring to this string.

StringC & operator +=(const StringC & y)
Copy string 'y' to the end of this one.

StringC & operator +=(const SubStringC & y)
Copy sub string 'y' to the end of this string.

StringC & operator +=(const char * t)
Copy 'C' style string 'y' to the end of this one.

StringC & operator +=(char c)
Copy character 'c' to the end of this string.

void prepend(const StringC & y)
Prepend string 'y' before this one.

void prepend(const SubStringC & y)
Prepend string 'y' before this one.

void prepend(const char * t)
Prepend 'C' style string 'y' before this one

void prepend(char c)
Prepend character 'c' to this string.

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(char c) const
Returns 1 if this string contains the character 'c'.

int contains(const StringC & y) const
Returns 1 if this string contains the sub-string 'y'.

int contains(const SubStringC & y) const
Returns 1 if this string contains the sub-string 'y'.

int contains(const char * t) const
Returns 1 if this string contains the sub-string 't'.

int contains(char c,int pos) const
return 1 if target appears anywhere after position pos
(or before, if pos is negative) in StringC; else 0

int contains(const StringC & y,int pos) const
return 1 if target appears anywhere after position pos
(or before, if pos is negative) in StringC; else 0

int contains(const SubStringC & y,int pos) const
return 1 if target appears anywhere after position pos
(or before, if pos is negative) in StringC; else 0

int contains(const char * t,int pos) const
return 1 if target appears anywhere after position pos
(or before, if pos is negative) in StringC; else 0

int contains(const Regex & r) const
Returns 1 if this string contains the sub-string 'r'.

int contains(const Regex & r,int pos) const
return 1 if target appears anywhere after position pos
(or before, if pos is negative) in StringC; else 0

int matches(char c,int pos = 0) const
return 1 if target appears at position pos in StringC; else 0

int matches(const StringC & y,int pos = 0) const
return 1 if target appears at position pos in StringC; else 0

int matches(const SubStringC & y,int pos = 0) const
return 1 if target appears at position pos in StringC; else 0

int matches(const char * t,int pos = 0) const
return 1 if target appears at position pos in StringC; else 0

int matches(const Regex & r,int pos = 0) const
return 1 if target appears at position pos in StringC; else 0

int CaseCmp(const StringC & str) const
case-insensitive comparison of strings
(c.f. strcasecmp (3)) i.e. returns 0 if =, -1 if <, +1 if >.

int freq(char c) const
return number of occurences of target in StringC

int freq(const StringC & y) const
return number of occurences of target in StringC

int freq(const SubStringC & y) const
return number of occurences of target in StringC

int freq(const char * t) const
return number of occurences of target in StringC
SubStringC extraction Note that you can't take a substring of a const StringC, since this leaves open the possiblility of indirectly modifying the StringC through the SubStringC

SubStringC at(int pos,int len)

SubStringC operator ()(int pos,int len)
synonym for at

SubStringC at(const StringC & x,int startpos = 0)

SubStringC at(const SubStringC & x,int startpos = 0)

SubStringC at(const char * t,int startpos = 0)

SubStringC at(char c,int startpos = 0)

SubStringC at(const Regex & r,int startpos = 0)

SubStringC before(int pos)

SubStringC before(const StringC & x,int startpos = 0)

SubStringC before(const SubStringC & x,int startpos = 0)

SubStringC before(const char * t,int startpos = 0)

SubStringC before(char c,int startpos = 0)

SubStringC before(const Regex & r,int startpos = 0)

SubStringC through(int pos)

SubStringC through(const StringC & x,int startpos = 0)

SubStringC through(const SubStringC & x,int startpos = 0)

SubStringC through(const char * t,int startpos = 0)

SubStringC through(char c,int startpos = 0)

SubStringC through(const Regex & r,int startpos = 0)

SubStringC from(int pos)

SubStringC from(const StringC & x,int startpos = 0)

SubStringC from(const SubStringC & x,int startpos = 0)

SubStringC from(const char * t,int startpos = 0)

SubStringC from(char c,int startpos = 0)

SubStringC from(const Regex & r,int startpos = 0)

SubStringC after(int pos)

SubStringC after(const StringC & x,int startpos = 0)

SubStringC after(const SubStringC & x,int startpos = 0)

SubStringC after(const char * t,int startpos = 0)

SubStringC after(char c,int startpos = 0)

SubStringC after(const Regex & r,int startpos = 0)

void del(int pos,int len)
delete len chars starting at pos

void del(const StringC & y,int startpos = 0)
delete the first occurrence of target after startpos

void del(const SubStringC & y,int startpos = 0)
delete the first occurrence of target after startpos

void del(const char * t,int startpos = 0)
delete the first occurrence of target after startpos

void del(char c,int startpos = 0)
delete the first occurrence of target after startpos

void del(const Regex & r,int startpos = 0)
delete the first occurrence of target after startpos

int gsub(const StringC & pat,const StringC & repl)
global substitution: substitute all occurrences of pat with repl

int gsub(const SubStringC & pat,const StringC & repl)
global substitution: substitute all occurrences of pat with repl

int gsub(const char * pat,const StringC & repl)
global substitution: substitute all occurrences of pat with repl

int gsub(const char * pat,const char * repl)
global substitution: substitute all occurrences of pat with repl

int gsub(const Regex & pat,const StringC & repl)
global substitution: substitute all occurrences of pat with repl
friends & utilities split string into array res at separators; return number of elements

int split(const StringC & x,StringC res[],int maxn,const StringC & sep)

int split(const StringC & x,StringC res[],int maxn,const Regex & sep)

StringC common_prefix(const StringC & x,const StringC & y,int startpos = 0)

StringC common_suffix(const StringC & x,const StringC & y,int startpos = - 1)

StringC StrCreplicate(char c,int n)

StringC StrCreplicate(const StringC & y,int n)

StringC StrCreplicateStrC(const StringC & y,int n)

StringC join(StringC src[],int n,const StringC & sep)
simple builtin transformations

StringC reverse(const StringC & x)

StringC upcase(const StringC & x)

StringC downcase(const StringC & x)

StringC capitalize(const StringC & x)

void reverse()
Reverse order of characters in string, in place.

void upcase()
Convert all characters to upper case, in place.

void downcase()
Convert all characters to lower case, in place.

void capitalize()
Convert all characters to upper case, in place.

char & operator [](UIntT i)

const char & operator [](UIntT i) const

char & operator [](IndexC i)

const char & operator [](IndexC i) const

char & operator [](int i)

const char & operator [](int i) const

char elem(int i) const

char firstchar() const
Get the first character in the string.

char lastchar() const
Get the last character in the string.

operator const char *() const
Access as a 'C' sytle string.

const char * chars() const
Access as a 'C' sytle string.
IO

ostream & operator <<(ostream & s,const StringC & x)

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

istream & operator >>(istream & s,StringC & x)

BinIStreamC & operator >>(BinIStreamC & s,StringC & x)

int readline(istream & s,StringC & x,char terminator = '\n',int discard_terminator = 1)
status

unsigned int length() const
Get length of string.

int empty() const
Test if string is empty.

bool IsEmpty() const
Test if the string is empty.

void alloc(int newsize)
Preallocate some space for StringC

int allocation() const
report current allocation (not length!)

SizeT Size() const
Get the length of this string.

int OK() const
Check it valid.

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.

void cat(const StringC &,const StringC &,StringC &)

void cat(const StringC &,const SubStringC &,StringC &)

void cat(const StringC &,const char *,StringC &)

void cat(const StringC &,char,StringC &)

void cat(const SubStringC &,const StringC &,StringC &)

void cat(const SubStringC &,const SubStringC &,StringC &)

void cat(const SubStringC &,const char *,StringC &)

void cat(const SubStringC &,char,StringC &)

void cat(const char *,const StringC &,StringC &)

void cat(const char *,const SubStringC &,StringC &)

void cat(const char *,const char *,StringC &)

void cat(const char *,char,StringC &)
double concatenation, by request. (yes, there are too many versions, but if one is supported, then the others should be too...) Concatenate first 3 args, store in last arg

void cat(const StringC &,const StringC &,const StringC &,StringC &)

void cat(const StringC &,const StringC &,const SubStringC &,StringC &)

void cat(const StringC &,const StringC &,const char *,StringC &)

void cat(const StringC &,const StringC &,char,StringC &)

void cat(const StringC &,const SubStringC &,const StringC &,StringC &)

void cat(const StringC &,const SubStringC &,const SubStringC &,StringC &)

void cat(const StringC &,const SubStringC &,const char *,StringC &)

void cat(const StringC &,const SubStringC &,char,StringC &)

void cat(const StringC &,const char *,const StringC &,StringC &)

void cat(const StringC &,const char *,const SubStringC &,StringC &)

void cat(const StringC &,const char *,const char *,StringC &)

void cat(const StringC &,const char *,char,StringC &)

void cat(const char *,const StringC &,const StringC &,StringC &)

void cat(const char *,const StringC &,const SubStringC &,StringC &)

void cat(const char *,const StringC &,const char *,StringC &)

void cat(const char *,const StringC &,char,StringC &)

void cat(const char *,const SubStringC &,const StringC &,StringC &)

void cat(const char *,const SubStringC &,const SubStringC &,StringC &)

void cat(const char *,const SubStringC &,const char *,StringC &)

void cat(const char *,const SubStringC &,char,StringC &)

void cat(const char *,const char *,const StringC &,StringC &)

void cat(const char *,const char *,const SubStringC &,StringC &)

void cat(const char *,const char *,const char *,StringC &)

void cat(const char *,const char *,char,StringC &)


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