Bsoft object

class Bstring

Source:

include/Bstring.h

Description:

Bsoft linkable string class.

Features:

The variables are a public pointer to the next string and a private
pointer to a character string.
The string data are allocated internally.

Code:

class Bstring {
public:
Bstring* next;
private:
char* data;
public:
Bstring() { data = NULL; next = NULL; }
Bstring(const Bstring& s);
Bstring(const Bstring& s, long start, long len);
Bstring(const char* c);
Bstring(const char* c, long start, long len);
Bstring(const int size, const char c);
Bstring(const long size, const char c);
Bstring(const unsigned long size, const char c);
Bstring(int i, const char* format);
Bstring(unsigned int i, const char* format);
Bstring(long i, const char* format);
Bstring(unsigned long i, const char* format);
Bstring(double d, const char* format);
~Bstring() { delete[] data; data = NULL; }
Bstring& operator=(const Bstring& s);
Bstring& operator=(const char* c);
Bstring& operator+=(const Bstring& s);
Bstring operator+(const Bstring& s);
Bstring& operator+=(const char c);
Bstring operator+(const char c);
bool operator==(const Bstring& s);
bool operator!=(const Bstring& s);
bool operator>(const Bstring& s);
bool operator<(const Bstring& s);
bool operator>=(const Bstring& s);
bool operator<=(const Bstring& s);
Bstring operator<<(int n);
Bstring operator>>(int n);
char& operator[](long i);
const char* c_str() { return (const char*)data; }
bool empty() { return data == NULL; }
long length() const;
long count(const char c);
long compare(const Bstring& s);
long compare_value(const Bstring& s);
void fill(const char c);
void copy(char* c);
void copy(char* c, int n);
Bstring lower();
Bstring upper();
Bstring substr(long start, long len);
Bstring no_space();
Bstring left(long len);
Bstring right(long len);
Bstring pre(char c);
Bstring post(char c);
Bstring pre_rev(char c);
Bstring post_rev(char c);
Bstring within(char c1, char c2);
Bstring replace(char cold, char cnew);
Bstring remove(const char c);
Bstring swap(const long i, const long j);
Bstring erase(const long i);
Bstring truncate(const long n);
Bstring base();
Bstring extension();
Bstring canonical(int n);
int integer();
double real();
long index(const char c) { return index(c, 0); }
long index(const char c, long start);
long find(const Bstring& s) { return find(s, 0); }
long find(const Bstring& s, long start);
long rfind(const Bstring& s) { return rfind(s, 0); }
long rfind(const Bstring& s, long start);
bool contains(const Bstring& s);
Bstring insert(long pos, const Bstring& s);
Bstring* split();
Bstring* split(const Bstring& delim);
int* split_into_ints(const Bstring& delim, unsigned long *n);
float* split_into_floats(const Bstring& delim, unsigned long *n);
friend Bstring operator+(const char* c, const Bstring& s);
};

Other objects included:

class Bstring


Generated by bdoc.pl on Wed May 9 11:41:56 2012


Back to the Bsoft home