--- a/String.st Tue Aug 22 15:49:36 2000 +0200
+++ b/String.st Tue Aug 22 15:57:33 2000 +0200
@@ -540,46 +540,6 @@
super basicAt:index put:aCharacter asciiValue.
^ aCharacter
-!
-
-basicSize
- "return the number of characters in myself.
- Redefined here to exclude the 0-byte at the end."
-
-%{ /* NOCONTEXT */
- REGISTER OBJ slf, cls;
-
- slf = self;
-
- cls = __qClass(slf);
- if (cls == String) {
- RETURN ( __MKSMALLINT(__stringSize(slf)) );
- }
- RETURN ( __MKSMALLINT(__stringSize(slf)
- - __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars))));
-%}.
- ^ super basicSize - 1
-
-!
-
-size
- "return the number of characters in myself.
- Reimplemented here to avoid the additional size->basicSize send
- (which we can do here, since size is obviously not redefined in a subclass).
- This method is the same as basicSize."
-
-%{ /* NOCONTEXT */
- REGISTER OBJ cls, slf;
-
- slf = self;
- cls = __qClass(slf);
- if (cls == String) {
- RETURN ( __MKSMALLINT(__stringSize(slf)) );
- }
- RETURN ( __MKSMALLINT(__stringSize(slf)
- - __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars))));
-%}.
- ^ self basicSize
! !
!String methodsFor:'binary storage'!
@@ -2681,6 +2641,26 @@
!String methodsFor:'queries'!
+basicSize
+ "return the number of characters in myself.
+ Redefined here to exclude the 0-byte at the end."
+
+%{ /* NOCONTEXT */
+ REGISTER OBJ slf, cls;
+
+ slf = self;
+
+ cls = __qClass(slf);
+ if (cls == String) {
+ RETURN ( __MKSMALLINT(__stringSize(slf)) );
+ }
+ RETURN ( __MKSMALLINT(__stringSize(slf)
+ - __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars))));
+%}.
+ ^ super basicSize - 1
+
+!
+
bitsPerCharacter
"return the number of bits each character has.
Here, 8 is returned (storing single byte characters)."
@@ -2713,6 +2693,26 @@
'hello' knownAsSymbol
'fooBarBaz' knownAsSymbol
"
+!
+
+size
+ "return the number of characters in myself.
+ Reimplemented here to avoid the additional size->basicSize send
+ (which we can do here, since size is obviously not redefined in a subclass).
+ This method is the same as basicSize."
+
+%{ /* NOCONTEXT */
+ REGISTER OBJ cls, slf;
+
+ slf = self;
+ cls = __qClass(slf);
+ if (cls == String) {
+ RETURN ( __MKSMALLINT(__stringSize(slf)) );
+ }
+ RETURN ( __MKSMALLINT(__stringSize(slf)
+ - __OBJS2BYTES__(__intVal(__ClassInstPtr(cls)->c_ninstvars))));
+%}.
+ ^ self basicSize
! !
!String methodsFor:'regular expression matching'!
@@ -3093,5 +3093,5 @@
!String class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.153 2000-08-22 13:49:32 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/String.st,v 1.154 2000-08-22 13:57:30 cg Exp $'
! !