golib  0.5
goString Class Reference

String class. More...

#include <gostring.h>

Public Member Functions

 goString (const char *n)
 
 goString (const goString &n)
 
goIndex_t getSize () const
 
void resize (goIndex_t newsize)
 
void getPathName (goString &pathRet) const
 Get the path portion of a string describing a file name with full path. More...
 
void getFileName (goString &fileNameRet) const
 Get the file name portion of a string describing a file name with full path. More...
 
goIndex_t findFirst (char c, goIndex_t start=0) const
 
goIndex_t findLast (char c) const
 
goIndex_t find (const char *str, goIndex_t start=0)
 Find occurrence of str. More...
 
goIndex_t replace (const char *str, const char *replacement)
 
goIndex_t getLine (goString &ret, goIndex_t start)
 
bool copy (goString &target, goIndex_t start, goIndex_t end) const
 Copy a part of this string to another string. More...
 
bool getWords (goList< goString > &wordsRet) const
 
void fill (char c)
 
int toInt () const
 
goUInt32 toUInt32 () const
 
goUInt64 toUInt64 () const
 
float toFloat () const
 
double toDouble () const
 
bool toBool () const
 
const char * toCharPtr () const
 
goDate toDate ()
 
void toUpper ()
 
void toLower ()
 
char & operator[] (goIndex_t i)
 
const char & operator[] (goIndex_t i) const
 
goStringoperator= (const goString &other)
 
goStringoperator= (const char *other)
 
goStringoperator= (goDate &d)
 
goStringoperator+= (const char c)
 
goStringoperator+= (const goString &s)
 
goStringoperator+= (const char *s)
 
goStringoperator+= (int i)
 
goStringoperator+= (goUInt32 i)
 
goStringoperator+= (goUInt64 i)
 
goStringoperator+= (float f)
 
goStringoperator+= (double f)
 
goString operator+ (const goString &o) const
 
goString operator+ (const char *s) const
 
char * getPtr ()
 
const char * getPtr () const
 
 operator char * ()
 
 operator const char * () const
 

Protected Attributes

goArray< char > thisString
 
char dummyChar
 

Friends

bool operator== (const goString &str, const char *s)
 
bool operator== (const goString &str, const goString &str2)
 
bool operator!= (const goString &str, const char *s)
 
bool operator!= (const goString &str, const goString &str2)
 
std::ostream & operator<< (std::ostream &o, const goString &s)
 

Detailed Description

Member Function Documentation

◆ copy()

bool goString::copy ( goString target,
goIndex_t  start,
goIndex_t  end 
) const

Copy a part of this string to another string.

Parameters
targetTarget string.
startStart index in this string.
endEnd index in this string.
Returns
True if successful, false otherwise.

◆ find()

goIndex_t goString::find ( const char *  str,
goIndex_t  start = 0 
)

Find occurrence of str.

Parameters
strString to search for.
startStart index.
Returns
Start index of str in this string. -1 on failure.

◆ getFileName()

void goString::getFileName ( goString fileNameRet) const

Get the file name portion of a string describing a file name with full path.

Parameters
fileNameRetContains the file name portion.

◆ getPathName()

void goString::getPathName ( goString pathRet) const

Get the path portion of a string describing a file name with full path.

Parameters
pathRetContains the path portion of the full file name.

◆ replace()

goIndex_t goString::replace ( const char *  str,
const char *  replacement 
)
Todo:
Inefficient. Rework when there's need and time.
Parameters
str
replacement
Returns

The documentation for this class was generated from the following files: