#include <MyString.h>
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 |
|
|
standard constructor used to make a MyString
|
|
|
constructor for MyString which take an initial string of characters and puts it into the character array
|
|
|
constructor which makes a copy of another MyString
|
|
||||||||||||
|
|
|
|
Capitalizes all lower case letters.
|
|
|
Makes all capital letters lowercase.
|
|
|
procedure which appends a MyString to the end of this MyString instance
|
|
|
procedure which appends a character array onto the end of this MyString instance
|
|
|
|
|
|
returns the character at the index space of the array. Null character returned for invalid indexes.
|
|
|
returns if the specified character is in the array
|
|
|
Makes this instance a copy of the character array toCopy.
|
|
|
Makes this instance a copy of MyString toCopy.
|
|
|
deletes the nth character in the string
|
|
||||||||||||
|
deletes a substring of len size begining at the n spot
|
|
|
deletes all instances of the desired character in the array, then returns whether anything was deleted
|
|
||||||||||||
|
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. |
|
|
Puts out the character array in this instance to the screen.
|
|
|
empties the current array and puts an empty string in its place
|
|
|
Returns whether the array of characters in this instance is the same as the array of characters check.
|
|
|
Returns whether this instance holds the same array of characters as MyString check.
|
|
|
clears the current array
|
|
||||||||||||
|
returns the index of the first instance of the specified character in the array after startIndex. -1 indicates substring was not found
|
|
|
returns the index of the first instance of the specified character in the array. -1 indicates substring was not found
|
|
||||||||||||
|
returns the index of the last instance of the desired character in the array before endIndex
|
|
|
returns the index of the last instance of the desired character in the array. -1 indicates substring was not found
|
|
|
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.
|
|
|
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.
|
|
||||||||||||
|
|
|
|
Gets a new character array from the file sent in.
|
|
|
Gets a new character array from the keyboard.
|
|
|
which returns the current length of the character array which is MyString
|
|
|
returns how many times the desired character occurs in the character array (this is case sensitive for letters)
|
|
|
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.
|
|
|
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.
|
|
|
The symbol += is overwritten as a quick way to append another MyString to this instance.
|
|
|
The symbol += is overwritten as a quick way to append a character array to this instance.
|
|
|
The symbol += is overwritten as a quick way to append a character to this instance.
|
|
|
The symbol < is overwritten to be a quick way to work as a less than function with a MyString.
|
|
|
The symbol = is overwritten to imply that this instance is to be set as a copy of the following MyString.
|
|
|
The symbol = is overwritten to imply that this instance is to be set as a copy of the following character array.
|
|
|
The symbol == is overwritten to be a quick way to call the Equals function with a character array.
|
|
|
The symbol == is overwritten to be a quick way to call the Equals function with a MyString.
|
|
|
The symbol > is overwritten to be a quick way to work as a greater than function with a MyString.
|
|
|
returns the character at the index space of the array
|
|
|
returns a copy of the character string that this instance has
|
|
|
|
|
||||||||||||
|
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) |
|
|
|
|
|
Puts the character array held in this instance out to the file sent in.
|
|
|
|
|
|
|
1.4.6-NO