#include <TwoByteString.h>
Inheritance diagram for Core::TwoByteString:
Public Member Functions | |
TwoByteString (int size) | |
virtual | ~TwoByteString (void) |
virtual String * | className (void) const |
Answer receiver class name. | |
virtual Character * | at (int index) const |
virtual void | put (int index, Character *object) |
virtual int | byteSize (void) |
virtual void | putRawValue (int index, unsigned short value) |
virtual void | changeSize (long newSize) |
virtual bool | isEqual (StringImpl *object) |
virtual bool | isEqualToBytes (unsigned char *string) |
virtual bool | isEqualToShorts (unsigned short *object) |
virtual TwoByteString * | asTwoByteString (void) |
virtual bool | isTwoByteString (void) const |
Protected Attributes | |
unsigned short * | content |
These are really poor in functionality so use String instead.
Definition at line 40 of file TwoByteString.h.
|
Definition at line 32 of file TwoByteString.cc. References content, and Core::StringImpl::tally. 00033 { 00034 content = (unsigned short *) GC_malloc(size * sizeof(unsigned short)); 00035 tally = size; 00036 }
|
|
Definition at line 38 of file TwoByteString.cc. References content. 00039 { 00040 GC_free(content); 00041 }
|
|
Reimplemented from Core::StringImpl. Definition at line 106 of file TwoByteString.cc. 00107 { 00108 return this; 00109 }
|
|
Reimplemented from Core::StringImpl. Definition at line 50 of file TwoByteString.cc. References content, and Core::Character::value(). 00051 { 00052 return Character::value(content[index]); 00053 }
|
|
Reimplemented from Core::StringImpl. Definition at line 60 of file TwoByteString.cc. 00061 {
00062 return 2;
00063 }
|
|
Reimplemented from Core::StringImpl. Definition at line 95 of file TwoByteString.cc. References content, Core::StringImpl::size(), and Core::StringImpl::tally. 00096 { 00097 unsigned short *oldContent = content; 00098 00099 content = (unsigned short *) GC_malloc(newSize * sizeof(unsigned short)); 00100 bzero(content, newSize); 00101 memcpy(content, oldContent, size() * sizeof(unsigned short)); 00102 tally = newSize; 00103 }
|
|
Answer receiver class name. Because there isn't any standard way to obtain class name this method comes to place. Every class should rewrite this method but many didn't (yet). Reimplemented from Core::Object. Definition at line 44 of file TwoByteString.cc. 00045 { 00046 return new String("TwoByteString"); 00047 }
|
|
Reimplemented from Core::StringImpl. Definition at line 71 of file TwoByteString.cc. References Core::StringImpl::isEqualToShorts(). 00072 { 00073 return string->isEqualToShorts(this->content); 00074 }
|
|
Reimplemented from Core::StringImpl. Definition at line 76 of file TwoByteString.cc. References Core::StringImpl::tally. 00077 { 00078 for (int i = 0; i < tally; i++) { 00079 if (this->content[i] != string[i]) 00080 return false; 00081 } 00082 return true; 00083 }
|
|
Reimplemented from Core::StringImpl. Definition at line 85 of file TwoByteString.cc. References Core::StringImpl::tally. 00086 { 00087 for (int i = 0; i < tally; i++) { 00088 if (this->content[i] != string[i]) 00089 return false; 00090 } 00091 return true; 00092 }
|
|
Reimplemented from Core::StringImpl. Definition at line 112 of file TwoByteString.cc. 00113 { 00114 return true; 00115 }
|
|
Reimplemented from Core::StringImpl. Definition at line 55 of file TwoByteString.cc. References Core::Character::asInteger(), and content. Referenced by Core::StringImpl::asTwoByteString().
|
|
Definition at line 65 of file TwoByteString.cc. References content. Referenced by Core::ByteString::asTwoByteString(). 00066 { 00067 content[index] = value; 00068 }
|
|
Definition at line 43 of file TwoByteString.h. Referenced by at(), changeSize(), put(), putRawValue(), TwoByteString(), and ~TwoByteString(). |