Site hosted by Angelfire.com: Build your free website today!

MyString Class Reference

#include <MyString.h>

List of all members.

Public Member Functions

 MyString ()
 standard constructor used to make a MyString
 MyString (char *string)
 constructor for MyString which take an initial string of characters and puts it into the character array
 MyString (MyString &original)
 constructor which makes a copy of another MyString
void Append (char toAppend)
void Append (char *string)
 procedure which appends a character array onto the end of this MyString instance
void Append (MyString &toAppend)
 procedure which appends a MyString to the end of this MyString instance
void Add (MyString toAdd, int index)
void Empty ()
 empties the current array and puts an empty string in its place
void Copy (MyString &toCopy)
 Makes this instance a copy of MyString toCopy.
void Copy (char *toCopy)
 Makes this instance a copy of the character array toCopy.
void AllLowCase ()
 Makes all capital letters lowercase.
void AllCaps ()
 Capitalizes all lower case letters.
void Delete (int n, int len)
 deletes a substring of len size begining at the n spot
void Delete (int n)
 deletes the nth character in the string
int Length ()
 which returns the current length of the character array which is MyString
bool Equals (MyString &check)
 Returns whether this instance holds the same array of characters as MyString check.
bool Equals (char *check)
 Returns whether the array of characters in this instance is the same as the array of characters check.
char CharAt (int index)
 returns the character at the index space of the array. Null character returned for invalid indexes.
bool Contains (char toFind)
 returns if the specified character is in the array
int FindChar (char toFind)
 returns the index of the first instance of the specified character in the array. -1 indicates substring was not found
int FindChar (char toFind, int startIndex)
 returns the index of the first instance of the specified character in the array after startIndex. -1 indicates substring was not found
int FindLChar (char toFind)
 returns the index of the last instance of the desired character in the array. -1 indicates substring was not found
int FindLChar (char toFind, int endIndex)
 returns the index of the last instance of the desired character in the array before endIndex
int Occurrences (char toFind)
 returns how many times the desired character occurs in the character array (this is case sensitive for letters)
int FindSubstring (char *substr)
 Returns the index of the first letter of the first occurrence of the given substring in the character array. -1 indicates substring was not found.
int FindSubstring (MyString substr)
 Returns the index of the first letter of the first occurrence of the given substring in the character array. -1 indicates substring was not found.
char * Substring (int startIndex, int endIndex)
char * RealString ()
 returns a copy of the character string that this instance has
bool DeleteChar (char toDelete, int deletion_code)
bool DeleteChar (char toDelete)
 deletes all instances of the desired character in the array, then returns whether anything was deleted
void operator+= (char toAppend)
 The symbol += is overwritten as a quick way to append a character to this instance.
void operator+= (char *toAppend)
 The symbol += is overwritten as a quick way to append a character array to this instance.
void operator+= (MyString &toAppend)
 The symbol += is overwritten as a quick way to append another MyString to this instance.
void operator= (char *toCopy)
 The symbol = is overwritten to imply that this instance is to be set as a copy of the following character array.
void operator= (MyString &toCopy)
 The symbol = is overwritten to imply that this instance is to be set as a copy of the following MyString.
bool operator== (MyString &check)
 The symbol == is overwritten to be a quick way to call the Equals function with a MyString.
bool operator== (char *check)
 The symbol == is overwritten to be a quick way to call the Equals function with a character array.
bool operator!= (MyString &check)
 The symbol != is overwritten to be a quick way to call the Equals function with a MyString and get the opposite value of the boolean.
bool operator!= (char *check)
 The symbol != is overwritten to be a quick way to call the Equals function with a character array and get the opposite value of the boolean.
char operator[] (int index)
 returns the character at the index space of the array
bool operator< (MyString &check)
 The symbol < is overwritten to be a quick way to work as a less than function with a MyString.
bool operator> (MyString &check)
 The symbol > is overwritten to be a quick way to work as a greater than function with a MyString.
void Display ()
 Puts out the character array in this instance to the screen.
void ToFile (FILE *toWrite)
 Puts the character array held in this instance out to the file sent in.
void GetNew ()
 Gets a new character array from the keyboard.
void FromFile (FILE *toRead)
 Gets a new character array from the file sent in.
char * Split (int cutind)
void Swap (MyString toSwap)
void FromFile (FILE *toRead, char end)

Private Member Functions

void Erase ()
 clears the current array

Private Attributes

int length
char * text


Constructor & Destructor Documentation

MyString::MyString  ) 
 

standard constructor used to make a MyString

MyString::MyString char *  string  ) 
 

constructor for MyString which take an initial string of characters and puts it into the character array

MyString::MyString MyString original  ) 
 

constructor which makes a copy of another MyString


Member Function Documentation

void MyString::Add MyString  toAdd,
int  index
 

void MyString::AllCaps  ) 
 

Capitalizes all lower case letters.

void MyString::AllLowCase  ) 
 

Makes all capital letters lowercase.

void MyString::Append MyString toAppend  ) 
 

procedure which appends a MyString to the end of this MyString instance

void MyString::Append char *  string  ) 
 

procedure which appends a character array onto the end of this MyString instance

void MyString::Append char  toAppend  ) 
 

char MyString::CharAt int  index  ) 
 

returns the character at the index space of the array. Null character returned for invalid indexes.

bool MyString::Contains char  toFind  ) 
 

returns if the specified character is in the array

void MyString::Copy char *  toCopy  ) 
 

Makes this instance a copy of the character array toCopy.

void MyString::Copy MyString toCopy  ) 
 

Makes this instance a copy of MyString toCopy.

void MyString::Delete int  n  ) 
 

deletes the nth character in the string

void MyString::Delete int  n,
int  len
 

deletes a substring of len size begining at the n spot

bool MyString::DeleteChar char  toDelete  ) 
 

deletes all instances of the desired character in the array, then returns whether anything was deleted

bool MyString::DeleteChar char  toDelete,
int  deletion_code
 

Function which deletes the desired character according to the following specifications: deletion_code = 0: Deletes the first instance of that character in the array. deletion_code = 1: Deletes the last instance of the character in the array. deletion_code = 2: Deletes all instances of the character in the array. then returns whether anything was deleted.

void MyString::Display  ) 
 

Puts out the character array in this instance to the screen.

void MyString::Empty  ) 
 

empties the current array and puts an empty string in its place

bool MyString::Equals char *  check  ) 
 

Returns whether the array of characters in this instance is the same as the array of characters check.

bool MyString::Equals MyString check  ) 
 

Returns whether this instance holds the same array of characters as MyString check.

void MyString::Erase  )  [private]
 

clears the current array

int MyString::FindChar char  toFind,
int  startIndex
 

returns the index of the first instance of the specified character in the array after startIndex. -1 indicates substring was not found

int MyString::FindChar char  toFind  ) 
 

returns the index of the first instance of the specified character in the array. -1 indicates substring was not found

int MyString::FindLChar char  toFind,
int  endIndex
 

returns the index of the last instance of the desired character in the array before endIndex

int MyString::FindLChar char  toFind  ) 
 

returns the index of the last instance of the desired character in the array. -1 indicates substring was not found

int MyString::FindSubstring MyString  substr  ) 
 

Returns the index of the first letter of the first occurrence of the given substring in the character array. -1 indicates substring was not found.

int MyString::FindSubstring char *  substr  ) 
 

Returns the index of the first letter of the first occurrence of the given substring in the character array. -1 indicates substring was not found.

void MyString::FromFile FILE *  toRead,
char  end
 

void MyString::FromFile FILE *  toRead  ) 
 

Gets a new character array from the file sent in.

void MyString::GetNew  ) 
 

Gets a new character array from the keyboard.

int MyString::Length  ) 
 

which returns the current length of the character array which is MyString

int MyString::Occurrences char  toFind  ) 
 

returns how many times the desired character occurs in the character array (this is case sensitive for letters)

bool MyString::operator!= char *  check  ) 
 

The symbol != is overwritten to be a quick way to call the Equals function with a character array and get the opposite value of the boolean.

bool MyString::operator!= MyString check  ) 
 

The symbol != is overwritten to be a quick way to call the Equals function with a MyString and get the opposite value of the boolean.

void MyString::operator+= MyString toAppend  ) 
 

The symbol += is overwritten as a quick way to append another MyString to this instance.

void MyString::operator+= char *  toAppend  ) 
 

The symbol += is overwritten as a quick way to append a character array to this instance.

void MyString::operator+= char  toAppend  ) 
 

The symbol += is overwritten as a quick way to append a character to this instance.

bool MyString::operator< MyString check  ) 
 

The symbol < is overwritten to be a quick way to work as a less than function with a MyString.

void MyString::operator= MyString toCopy  ) 
 

The symbol = is overwritten to imply that this instance is to be set as a copy of the following MyString.

void MyString::operator= char *  toCopy  ) 
 

The symbol = is overwritten to imply that this instance is to be set as a copy of the following character array.

bool MyString::operator== char *  check  ) 
 

The symbol == is overwritten to be a quick way to call the Equals function with a character array.

bool MyString::operator== MyString check  ) 
 

The symbol == is overwritten to be a quick way to call the Equals function with a MyString.

bool MyString::operator> MyString check  ) 
 

The symbol > is overwritten to be a quick way to work as a greater than function with a MyString.

char MyString::operator[] int  index  ) 
 

returns the character at the index space of the array

char * MyString::RealString  ) 
 

returns a copy of the character string that this instance has

char * MyString::Split int  cutind  ) 
 

char * MyString::Substring int  startIndex,
int  endIndex
 

returns a character array of the substring of the array from startIndex to endIndex inclusive (because of overloaded operators, this can also be used like a MyString)

void MyString::Swap MyString  toSwap  ) 
 

void MyString::ToFile FILE *  toWrite  ) 
 

Puts the character array held in this instance out to the file sent in.


Member Data Documentation

int MyString::length [private]
 

char* MyString::text [private]
 


The documentation for this class was generated from the following file:
Generated on Sat Apr 15 17:33:30 2006 for 560 by  doxygen 1.4.6-NO