1 #ifndef BASE_STRING_CLASS
2 #define BASE_STRING_CLASS
46 virtual char get(
int index)
const = 0;
49 virtual void put(
int position,
char to_put) = 0;
53 int start_second,
int count,
bool case_sensitive)
const = 0;
74 virtual void zap(
int start,
int end) = 0;
Defines the base class for all string processing objects in hoople.
virtual void insert(int position, const base_string &to_insert)=0
Copies "to_insert" into "this" at the "position".
virtual const char * observe() const =0
observes the underlying pointer to the zero-terminated string.
virtual base_string & upgrade(const char *s)=0
Sets the contents of this string to "s".
virtual char get(int index) const =0
a constant peek at the string's internals at the specified index.
virtual base_string & operator=(const base_string &to_copy)
sets this string's contents equal to the contents of "to_copy".
virtual void put(int position, char to_put)=0
stores the character "to_put" at index "position" in the string.
virtual bool sub_string(base_string &target, int start, int end) const =0
Gets the segment of "this" between the indices "start" and "end".
virtual void zap(int start, int end)=0
Deletes the characters between "start" and "end" inclusively.
virtual char * access()=0
provides access to the actual string held.
virtual int length() const =0
Returns the current length of the string.
virtual bool sub_compare(const base_string &to_compare, int start_first, int start_second, int count, bool case_sensitive) const =0
Compares "this" string with "to_compare".
virtual base_string & concatenate_char(char c)=0
concatenater for single characters.
virtual base_string & concatenate_string(const base_string &s)=0
Modifies "this" by concatenating "s" onto it.
virtual base_string & assign(const base_string &s)=0
Sets the contents of this string to "s".
A base for objects that can be alphabetically (lexicographically) ordered.
The guards collection helps in testing preconditions and reporting errors.