AuxPort 0.2
Modules for Audio Software Development
|
Abstraction over C-Style Strings for ease of use. More...
#include <AuxString.h>
Public Member Functions | |
String () | |
Creates an empty String object. | |
String (char character) | |
Initializes a String object with a character. | |
String (const uint32 &string) | |
Initializes a String object with a integer. | |
String (char *string) | |
Initializes a String object with a C-Style String. | |
String (const char *string) | |
Initializes a String object with a constant C-Style String. | |
String (const String &string) | |
Intializes a String with another const String Object. | |
String (String &string) | |
Intializes a String with a String Object. | |
String (const std::string &string) | |
Intializes a String with a std::string Object. | |
String (std::string &string) | |
Intializes a String with a std::string Object. | |
~String () | |
Default Destructor. Safely Deallocates memory before destroying the String object. | |
size_t | length () const |
Returns Length of String. | |
bool | Empty () const |
Checks whether the String is Empty or not. | |
char * | getCString () const |
Casts the String object to a C-Style String and returns it. | |
char | getFirstCharacter () const |
Returns the first character in the string. | |
void | operator= (const String &c) |
Overloaded the Assignment Operator. | |
void | operator= (const char *c) |
Overloaded the Assignment Operator. | |
void | operator= (const std::string &c) |
Overloaded the Assignment Operator. | |
String | operator+ (const char *c) |
Overloaded + operator for String Concatenation with a const C-Style String. | |
String | operator+ (const String &c) |
Overloaded + operator for String Concatenation with a const C-Style String. | |
String | operator+ (const std::string &c) |
Overloaded + operator for String Concatenation with a const C-Style String. | |
String * | operator+= (const char &c) |
Overloaded the += Operator. | |
String * | operator+= (const char *c) |
Overloaded the += Operator. | |
String * | operator+= (const std::string &c) |
Overloaded the += Operator. | |
String * | operator+= (const String &c) |
Overloaded the += Operator. | |
void | replaceCharacter (const char characterToReplace, const char replacementCharacter) |
Searches for all instance of a character in a String and replaces it with the character provided. | |
void | pushBack (const char c) |
Concatenates a character to the end of String. | |
void | pushBack (const char *c) |
Concatenates a C-Style String to the end of String. | |
void | pushBack (const String &c) |
Concatenates a String object to the end of String. | |
void | pushBack (const std::string &c) |
Concatenates an std::String to the end of String. | |
String | substring (const uint32 &start=0, const uint32 &end=1) const |
Returns the Substring in a String. | |
void | Log () override |
Overrides the Logging Module to Handle String Object Logging. | |
int32 | toInt32 () override |
Casts the String into a signed 32-bit Integer (Only handles Numerical Strings) | |
uint32 | toUInt32 () override |
Casts the String into a unsigned 32-bit Integer (Only handles Numerical Strings) | |
std::string | toStdString () override |
Casts the String object to std::string. | |
double | toDouble () override |
Casts the String into a double (Only handles Numerical Strings) | |
Static Public Member Functions | |
static String | subtract (String &string1, String &string2) |
Allows you to substract two AuxPort::Strings and get the resulted "Difference" as an AuxPort::String;. | |
static std::string | subtract (std::string string1, std::string string2) |
Allows you to substract two std::strings and get the resulted "Difference" as a std::string;. | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const String &c) |
Overloaded << operator to allow console printing of String object using ostream | |
std::ostream & | operator<< (std::ostream &out, String *c) |
Overloaded >> operator to allow console printing of String object using ostream. | |
Additional Inherited Members | |
![]() | |
void | setColour (const ColourType &colourType) |
This function allows you to set text colour for the text to be printed onto the console. | |
Abstraction over C-Style Strings for ease of use.
Example :
Definition at line 54 of file AuxString.h.
AuxPort::String::String | ( | ) |
Creates an empty String object.
Definition at line 56 of file AuxString.cpp.
AuxPort::String::String | ( | char | character | ) |
Initializes a String object with a character.
Definition at line 62 of file AuxString.cpp.
AuxPort::String::String | ( | const uint32 & | string | ) |
Initializes a String object with a integer.
Definition at line 85 of file AuxString.cpp.
AuxPort::String::String | ( | char * | string | ) |
Initializes a String object with a C-Style String.
Definition at line 102 of file AuxString.cpp.
AuxPort::String::String | ( | const char * | string | ) |
Initializes a String object with a constant C-Style String.
Definition at line 111 of file AuxString.cpp.
AuxPort::String::String | ( | const String & | string | ) |
Intializes a String with another const String Object.
Definition at line 120 of file AuxString.cpp.
AuxPort::String::String | ( | String & | string | ) |
Intializes a String with a String Object.
Definition at line 129 of file AuxString.cpp.
AuxPort::String::String | ( | const std::string & | string | ) |
Intializes a String with a std::string Object.
Definition at line 138 of file AuxString.cpp.
AuxPort::String::String | ( | std::string & | string | ) |
Intializes a String with a std::string Object.
Definition at line 147 of file AuxString.cpp.
AuxPort::String::~String | ( | ) |
Default Destructor. Safely Deallocates memory before destroying the String object.
Definition at line 156 of file AuxString.cpp.
bool AuxPort::String::Empty | ( | ) | const |
Checks whether the String is Empty or not.
Definition at line 170 of file AuxString.cpp.
char * AuxPort::String::getCString | ( | ) | const |
Casts the String object to a C-Style String and returns it.
Definition at line 45 of file AuxString.cpp.
char AuxPort::String::getFirstCharacter | ( | ) | const |
Returns the first character in the string.
Definition at line 50 of file AuxString.cpp.
size_t AuxPort::String::length | ( | ) | const |
Returns Length of String.
Definition at line 165 of file AuxString.cpp.
|
overridevirtual |
Overrides the Logging Module to Handle String Object Logging.
Reimplemented from AuxPort::ILog.
Definition at line 310 of file AuxString.cpp.
String AuxPort::String::operator+ | ( | const char * | c | ) |
Overloaded + operator for String Concatenation with a const C-Style String.
Definition at line 337 of file AuxString.cpp.
String AuxPort::String::operator+ | ( | const std::string & | c | ) |
Overloaded + operator for String Concatenation with a const C-Style String.
Definition at line 354 of file AuxString.cpp.
Overloaded + operator for String Concatenation with a const C-Style String.
Definition at line 346 of file AuxString.cpp.
String * AuxPort::String::operator+= | ( | const char & | c | ) |
Overloaded the += Operator.
You can add a character to the end of the string.
Definition at line 362 of file AuxString.cpp.
String * AuxPort::String::operator+= | ( | const char * | c | ) |
Overloaded the += Operator.
You can concatenate a C-Style String to the end of the string.
Definition at line 368 of file AuxString.cpp.
String * AuxPort::String::operator+= | ( | const std::string & | c | ) |
Overloaded the += Operator.
You can concatenate a std::string to the end of the string.
Definition at line 374 of file AuxString.cpp.
Overloaded the += Operator.
You can concatenate a AuxPort::String to the end of the string.
Definition at line 380 of file AuxString.cpp.
void AuxPort::String::operator= | ( | const char * | c | ) |
Overloaded the Assignment Operator.
You can assign/initialize a String like:
Definition at line 195 of file AuxString.cpp.
void AuxPort::String::operator= | ( | const std::string & | c | ) |
Overloaded the Assignment Operator.
You can assign/initialize a String like:
Definition at line 200 of file AuxString.cpp.
void AuxPort::String::operator= | ( | const String & | c | ) |
Overloaded the Assignment Operator.
You can assign/initialize a String like:
Definition at line 175 of file AuxString.cpp.
void AuxPort::String::pushBack | ( | const char * | c | ) |
Concatenates a C-Style String to the end of String.
Definition at line 246 of file AuxString.cpp.
void AuxPort::String::pushBack | ( | const char | c | ) |
Concatenates a character to the end of String.
Definition at line 230 of file AuxString.cpp.
void AuxPort::String::pushBack | ( | const std::string & | c | ) |
Concatenates an std::String to the end of String.
Definition at line 289 of file AuxString.cpp.
void AuxPort::String::pushBack | ( | const String & | c | ) |
Concatenates a String object to the end of String.
Definition at line 267 of file AuxString.cpp.
void AuxPort::String::replaceCharacter | ( | const char | characterToReplace, |
const char | replacementCharacter ) |
Searches for all instance of a character in a String and replaces it with the character provided.
Definition at line 221 of file AuxString.cpp.
String AuxPort::String::substring | ( | const uint32 & | start = 0, |
const uint32 & | end = 1 ) const |
Returns the Substring in a String.
Definition at line 392 of file AuxString.cpp.
|
static |
Allows you to substract two std::strings and get the resulted "Difference" as a std::string;.
Definition at line 317 of file AuxString.cpp.
Allows you to substract two AuxPort::Strings and get the resulted "Difference" as an AuxPort::String;.
Definition at line 332 of file AuxString.cpp.
|
overridevirtual |
Casts the String into a double (Only handles Numerical Strings)
Implements AuxPort::ICasters.
Definition at line 532 of file AuxString.cpp.
|
overridevirtual |
Casts the String into a signed 32-bit Integer (Only handles Numerical Strings)
Example :
This can be cast into an signed 32 bit Integer.
Implements AuxPort::ICasters.
Definition at line 487 of file AuxString.cpp.
|
overridevirtual |
Casts the String object to std::string.
Implements AuxPort::ICasters.
Definition at line 386 of file AuxString.cpp.
|
overridevirtual |
Casts the String into a unsigned 32-bit Integer (Only handles Numerical Strings)
Example :
This can be cast into an signed Unsigned 32-bit Integer.
Implements AuxPort::ICasters.
Definition at line 515 of file AuxString.cpp.
|
friend |
Overloaded << operator to allow console printing of String object using ostream
Definition at line 205 of file AuxString.cpp.
|
friend |
Overloaded >> operator to allow console printing of String object using ostream.
Definition at line 213 of file AuxString.cpp.