BFLibCPP 0.1
CPP Library
Loading...
Searching...
No Matches
BF::String Class Reference

#include <string.hpp>

Inheritance diagram for BF::String:
Collaboration diagram for BF::String:

Public Member Functions

virtual ~String ()
 
 String ()
 
 String (const char *str)
 
 String (char *str)
 
 String (const String &str)
 
 String (long int nullstr)
 
 String (int nullstr)
 
const char * cString () const
 
char * cStringCopy () const
 
int compareString (const String &s) const
 
size_t length () const
 
int copy (String &s) const
 
int readFromFile (const char *file)
 
int addChar (char c)
 
int remChar ()
 
int addCharAtIndex (char c, size_t index)
 
int remCharAtIndex (size_t index)
 
int clear ()
 
 operator const char * () const
 
bool operator== (const String &s)
 
bool operator< (const String &s)
 
bool operator> (const String &s)
 
bool operator!= (const String &s)
 
Stringoperator= (const String &str)
 
const char operator[] (size_t index)
 

Static Public Member Functions

static StringcreateWithFormat (const char *format,...)
 
static int toi (const String &s)
 similar to std::atoi
 

Friends

std::ostream & operator<< (std::ostream &out, const String &s)
 

Additional Inherited Members

- Protected Member Functions inherited from BF::Array< char, size_t >
char * address () const
 
 Array ()
 
 Array (char *array, size_t size)
 
 Array (std::initializer_list< char > list)
 
virtual ~Array ()
 
void removeAll ()
 
void set (char *array, size_t size)
 
void set (std::initializer_list< char > list)
 
void setAllocationCallback (char *(*cb)(size_t size))
 
void setDeallocationCallback (void(*cb)(char *value))
 
virtual bool contains (char object)
 
char objectAtIndex (size_t index) const
 
size_t indexForObject (char object) const
 
virtual size_t count () const
 Returns _count.
 
virtual void print ()
 
void setComparator (int(*callback)(char a, char b))
 
void setReleaseCallback (void(*callback)(char obj))
 
void copyFromArray (const Array< char > *arr)
 
int add (char obj)
 
int insertObjectAtIndex (char obj, size_t index)
 
int removeObjectAtIndex (size_t index)
 
char operator[] (size_t index) const
 
void operator= (const std::initializer_list< char > &list)
 
Array< char > & operator= (const Array< char > &arr)
 
- Protected Member Functions inherited from BF::Object
 Object ()
 
 Object (Object &obj)
 
virtual ~Object ()
 
- Static Protected Member Functions inherited from BF::Array< char, size_t >
static int comparisonDefault (char a, char b)
 
- Static Protected Member Functions inherited from BF::Object
static void retain (Object *obj)
 
static void release (Object *obj)
 
static int retainCount (Object *obj)
 
static int retainCount (Object &obj)
 

Constructor & Destructor Documentation

◆ ~String()

String::~String ( )
virtual

◆ String() [1/6]

String::String ( )

◆ String() [2/6]

String::String ( const char * str)

◆ String() [3/6]

String::String ( char * str)
Here is the call graph for this function:

◆ String() [4/6]

String::String ( const String & str)

◆ String() [5/6]

String::String ( long int nullstr)

◆ String() [6/6]

String::String ( int nullstr)
Here is the call graph for this function:

Member Function Documentation

◆ addChar()

int String::addChar ( char c)

Adds char c to the end of the string

similar to std::string::push_back

Here is the call graph for this function:

◆ addCharAtIndex()

int String::addCharAtIndex ( char c,
size_t index )

adds a character at index

Here is the call graph for this function:

◆ clear()

int String::clear ( )

makes empty string

Here is the call graph for this function:

◆ compareString()

int String::compareString ( const String & s) const

Struns strcmp() on this and s

Here is the call graph for this function:

◆ copy()

int String::copy ( String & s) const

Creates a deep copy of object and outputs to s

s will have its own string to worry about

Here is the call graph for this function:

◆ createWithFormat()

String * String::createWithFormat ( const char * format,
... )
static

caller must release

Here is the call graph for this function:

◆ cString()

const char * String::cString ( ) const
Here is the call graph for this function:

◆ cStringCopy()

char * String::cStringCopy ( ) const
Here is the call graph for this function:

◆ length()

size_t String::length ( ) const

Returns length of string

Here is the call graph for this function:

◆ operator const char *()

String::operator const char * ( ) const

◆ operator!=()

bool String::operator!= ( const String & s)
Here is the call graph for this function:

◆ operator<()

bool String::operator< ( const String & s)
Here is the call graph for this function:

◆ operator=()

String & String::operator= ( const String & str)
Here is the call graph for this function:

◆ operator==()

bool String::operator== ( const String & s)
Here is the call graph for this function:

◆ operator>()

bool String::operator> ( const String & s)
Here is the call graph for this function:

◆ operator[]()

const char String::operator[] ( size_t index)
Here is the call graph for this function:

◆ readFromFile()

int String::readFromFile ( const char * file)

loads file content into string

Here is the call graph for this function:

◆ remChar()

int String::remChar ( )

removes char at the end of the string

similar to std::string::pop_back

Here is the call graph for this function:

◆ remCharAtIndex()

int String::remCharAtIndex ( size_t index)

removes a character at index

Here is the call graph for this function:

◆ toi()

int String::toi ( const String & s)
static

similar to std::atoi

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const String & s )
friend

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