#include #include "bstring.h" /* char * str; // pointer to a dynamic array of chars int size; // how big is the string? // allocation will be size+1 to allow storage as c-string */ // friend functions in this section BString operator+(const BString& x, const BString& y) { } bool operator<(const BString& x, const BString& y) { } bool operator>(const BString& x, const BString& y) { } bool operator<=(const BString& x, const BString& y) { } bool operator>=(const BString& x, const BString& y) { } bool operator==(const BString& x, const BString& y) { } bool operator!=(const BString& x, const BString& y) { } ostream& operator<< (ostream& os, const BString& x) { /* for (int i = 0; i < x.size; i++) os << x.str[i]; */ os << x.str; return os; } istream& operator>> (istream& is, BString& x) { } // member functions are below BString::BString() { size = 0; str = new char[1]; // allocation is size + 1 str[0] = '\0'; } BString::BString(const char* s) // conversion from c-string to BString object { size = strlen(s); str = new char[size+1]; strcpy(str, s); // can now use strcpy (because internal storage allows) /* for (int i = 0; i < size; i++) str[i] = s[i]; */ } BString::BString(int x) { } BString::~BString() { } BString::BString(const BString& s) { } BString& BString::operator=(const BString& s) { } BString& BString::operator+=(const BString& s) { } int BString::getSize() const { } int BString::length() const { } BString BString::substring(int index, int len) const { }