7 * IoTString wraps the underlying char string.
8 * @author Brian Demsky <bdemsky@uci.edu>
18 * Builds an IoTString object around the char array. This
19 * constructor makes a copy, so the caller is free to modify the char array.
23 IoTString(Array<char> *_array) : array(new Array<char>(_array)) {}
27 * Internal method to grab a reference to our char array. Caller
31 Array<char> *internalBytes() { return array; }
34 * Returns a copy of the underlying char string.
37 Array<char> *getBytes() { return new Array<char>(array); }
40 * Returns the length in chars of the IoTString.
43 bool equals(IoTString *str) {
44 uint strlength = str->array->length();
45 uint thislength = array->length();
46 if (strlength != thislength)
49 int result = memcmp(str->array->internalArray(), array->internalArray(), strlength);
53 int length() { return array->length(); }
54 friend IoTString *IoTString_shallow(Array<char> *_array);
57 IoTString *IoTString_shallow(Array<char> *_array) {
58 IoTString *str = new IoTString();