unsigned int Length(void)
Return the length of the current string.
void NewLength(unsigned int newsize)
Change the length of the string buffer to the specified
newsize + 1, truncating if neccessary.
The additional character is automatically allocated on the end
to account for NULL termination.
long NewBuffer(const char *newbuffer)
Replace the entire buffer with newbuffer.
Returns non-zero if successful.
void CopyFromString(EW_String *otherstring)
Copy the data from otherstring to this string.
void CopyToBuffer(char *outbuffer)
Copy the string buffer into outbuffer.
The outbuffer must already be allocated large enough to hold the data,
including the terminating NULL character.
char *Buffer(void)
Return the pointer to the actual string buffer.
This is potentially dangerous, but useful for quick comparisons.
The pointer can be invalid after any other member operations
and the application should never alter the contents
directly through the pointer.
Whenever possible, Buffer(long) or Compare(char *)
could be used instead.
long Buffer(long position)
Return the single character at the specified
position in the string buffer.
long Compare(char *otherbuffer)
Equivalent to strcmp( Buffer(), otherbuffer ).
Note that strcmp() returns zero if the two buffers are the same.
long InsertBuffer(long position,char *insertion)
long InsertChar(long position,long c)
Insert a buffer insertion
or single character c
at the specified position
in the string buffer.
long DeleteRange(long position,long number)
long DeleteChar(long position)
Delete (a) character(s) starting at the specified position.
DeleteRange() is a superset of the DeleteChar()
functionality and allows a specified number
of characters to be deleted.
If character sizes other than multiples of eight are permitted,
the buffers may pad each character to fill the bytes.
This is undecided.